Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

0 votes
1 answers
392 views
New ubuntu install need to clean second disk
I have installed Ubuntu on my old laptop to give him a second life. I installed Ubuntu on the 24gb SSD. But the old Windows10 partition is on the 1tb HDD. Now every time I boot the system it asks which one I want to boot from. I dont want this, and want to just delete everything from this disk (the...
I have installed Ubuntu on my old laptop to give him a second life. I installed Ubuntu on the 24gb SSD. But the old Windows10 partition is on the 1tb HDD. Now every time I boot the system it asks which one I want to boot from. I dont want this, and want to just delete everything from this disk (the Windows one ofcourse) and start with a clean disk. How do I do this?
Foxdemon (3 rep)
Oct 21, 2019, 08:12 AM • Last activity: Jul 31, 2025, 06:00 AM
0 votes
2 answers
2143 views
How to process dd-created disk image, which is corrupted (disk died during dumping)
I have a laptop with HDD which had issues with booting (windows10). I assumed that Windows just failed some way. I've booted from LinuxLiveUSB and tried to dump the disk using `dd`. DD failed on 85GB because of I/O error. I've read that it is sign of bad block, so I've used `NOERROR` flag next time....
I have a laptop with HDD which had issues with booting (windows10). I assumed that Windows just failed some way. I've booted from LinuxLiveUSB and tried to dump the disk using dd. DD failed on 85GB because of I/O error. I've read that it is sign of bad block, so I've used NOERROR flag next time. During that process dd now throws only I/O errors. I've checked disk in fdisk -l, but see only one partition (was 4 before the whole operation) with message that there was no other partition or something (sorry I can't remember correctly). For the next reboot to LiveUSB, fdisk detect no sda whatsoever. So I think, disk is dead. I still have 270GB image (closed DD because of never-ending I/O errors) of 1TB disk. I want to recover data from this image, but neither OSFMount on Windows nor losetup/kpartx can mount Windows partition from this image (OSFmount just hangs and linux tools do nothing). Is there any process to prepare the image in a way to read the data from it? Thanks.
tuxfan (1 rep)
Aug 6, 2020, 10:06 AM • Last activity: Jul 25, 2025, 08:55 PM
5 votes
1 answers
9217 views
"Non-medium error" in smartctl output
Who can explain what is meaning "Non-medium error" in this output. I think my hard disks have some problems. **Disk1** root@nshost2:/home/david # smartctl -a -d cciss,0 /dev/ciss0 smartctl 6.5 2016-05-07 r4318 [FreeBSD 10.3-RELEASE-p4 amd64] (local build) Copyright (C) 2002-16, Bruce Allen, Christia...
Who can explain what is meaning "Non-medium error" in this output. I think my hard disks have some problems. **Disk1** root@nshost2:/home/david # smartctl -a -d cciss,0 /dev/ciss0 smartctl 6.5 2016-05-07 r4318 [FreeBSD 10.3-RELEASE-p4 amd64] (local build) Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Vendor: HP Product: EH0146FARWD Revision: HPDC User Capacity: 146,815,737,856 bytes [146 GB] Logical block size: 512 bytes Rotation Rate: 15030 rpm Form Factor: 2.5 inches Logical Unit id: 0x5000cca00b7b4c54 Serial number: PLX5U32E Device type: disk Transport protocol: SAS (SPL-3) Local Time is: Mon Aug 15 16:37:17 2016 AMT SMART support is: Available - device has SMART capability. SMART support is: Enabled Temperature Warning: Enabled === START OF READ SMART DATA SECTION === SMART Health Status: OK Current Drive Temperature: 28 C Drive Trip Temperature: 65 C Manufactured in week 05 of year 2012 Specified cycle count over device lifetime: 50000 Accumulated start-stop cycles: 31 Elements in grown defect list: 0 Vendor (Seagate) cache information Blocks sent to initiator = 18233185821261824 Error counter log: Errors Corrected by Total Correction Gigabytes Total ECC rereads/ errors algorithm processed uncorrected fast | delayed rewrites corrected invocations [10^9 bytes] errors read: 0 168255 0 168255 0 21908.836 0 write: 0 5365037 0 5365037 0 46145.893 0 Non-medium error count: 691 SMART Self-test log Num Test Status segment LifeTime LBA_first_err [SK ASC ASQ] Description number (hours) # 1 Background short Completed - 7 - [- - -] # 2 Background short Completed - 3 - [- - -] Long (extended) Self Test duration: 1394 seconds [23.2 minutes] **Disk2** root@nshost2:/home/david # smartctl -a -d cciss,1 /dev/ciss0 smartctl 6.5 2016-05-07 r4318 [FreeBSD 10.3-RELEASE-p4 amd64] (local build) Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Vendor: HP Product: EH0146FARWD Revision: HPDC User Capacity: 146,815,737,856 bytes [146 GB] Logical block size: 512 bytes Rotation Rate: 15030 rpm Form Factor: 2.5 inches Logical Unit id: 0x5000cca00b7b2254 Serial number: PLX5R9BE Device type: disk Transport protocol: SAS (SPL-3) Local Time is: Mon Aug 15 16:38:56 2016 AMT SMART support is: Available - device has SMART capability. SMART support is: Enabled Temperature Warning: Enabled === START OF READ SMART DATA SECTION === SMART Health Status: OK Current Drive Temperature: 26 C Drive Trip Temperature: 65 C Manufactured in week 05 of year 2012 Specified cycle count over device lifetime: 50000 Accumulated start-stop cycles: 31 Elements in grown defect list: 0 Vendor (Seagate) cache information Blocks sent to initiator = 18232624858267648 Error counter log: Errors Corrected by Total Correction Gigabytes Total ECC rereads/ errors algorithm processed uncorrected fast | delayed rewrites corrected invocations [10^9 bytes] errors read: 0 204138 0 204138 0 21981.509 0 write: 0 3646624 0 3646624 0 46146.250 0 Non-medium error count: 693 SMART Self-test log Num Test Status segment LifeTime LBA_first_err [SK ASC ASQ] Description number (hours) # 1 Background short Completed - 7 - [- - -] # 2 Background short Completed - 3 - [- - -] Long (extended) Self Test duration: 1394 seconds [23.2 minutes] **Here is cciss output** root@nshost2:/home/david # cciss_vol_status -q /dev/ciss0 /dev/ciss0: (Smart Array P410i) RAID 1(1+0) Volume 0 status: OK.
David (369 rep)
Aug 15, 2016, 12:45 PM • Last activity: Jul 22, 2025, 07:22 AM
1 votes
1 answers
2436 views
Failing of Samsung SSD (can't access partitions, i/o errors)
My Samsung SSD 860 EVO 250GB failed out of the blue after only 14 months. It was the system drive of a Win10 PC which was only rarely used. I am reasonably certain that it is toast, but because it contains several thousand pictures which I'd really like to keep, I wanted to see if there's anything I...
My Samsung SSD 860 EVO 250GB failed out of the blue after only 14 months. It was the system drive of a Win10 PC which was only rarely used. I am reasonably certain that it is toast, but because it contains several thousand pictures which I'd really like to keep, I wanted to see if there's anything I can still do. After the PC didn't boot up any more ("No boot media present") I took it out and tried connecting it to my other PC via powered SATA/USB adapters (both an older one and a new one from Inateck with USB 3.0 ). While it does not appear under "My PC", it recognised that there is something and the disk briefly shows up in Device Manager and in Disk Management as an uninitialized disk. But trying to initialize it fails with an IO error and the disk sort of flickers in and out of existence. with the older SATA adapter I tried using different SATA cables but the results were the same. Now I tried it on my xubuntu box. Here is what I have so far and I would like to know if more can be done. - Testdisk either doesn't list the drive or hangs at "Please Wait...." for a long time - Gparted hangs - Gsmartcontrol hangs Then I tried a few commandline utilities. The disk is `sdc` USER@BOX:~$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 149,1G 0 disk └─sda1 8:1 0 149,1G 0 part / sdb 8:16 0 111,8G 0 disk └─sdb1 8:17 0 111,8G 0 part sdc 8:32 0 232,9G 0 disk USER@BOX:~$ lsscsi [0:0:0:0] disk ATA SAMSUNG HM160HC 0-10 /dev/sda [1:0:0:0] disk ATA SAMSUNG HM121HC 0-10 /dev/sdb [2:0:0:0] disk ASMedia ASM105x 0 /dev/sdc USER@BOX:~$ sudo smartctl --all /dev/sdc [sudo] password for USER: smartctl 6.6 2016-05-31 r4324 [i686-linux-5.4.0-66-generic] (local build) Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Device Model: Samsung SSD 860 EVO 250GB Serial Number: S3YJNX0M525844H LU WWN Device Id: 5 002538 e40fc29fc Firmware Version: RVT02B6Q User Capacity: 250.059.350.016 bytes [250 GB] Sector Size: 512 bytes logical/physical Rotation Rate: Solid State Device Form Factor: 2.5 inches Device is: Not in smartctl database [for details use: -P showall] ATA Version is: Unknown(0x09fc), ACS-4 T13/BSR INCITS 529 revision 5 SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s) Local Time is: Mon Mar 8 15:54:52 2021 CET SMART support is: Available - device has SMART capability. SMART support is: Enabled On a later try, smartctl hung for a long time and finished with Read SMART Data failed: Connection timed out. Then I checked `dmesg which ends on blk_update_request: I/O error, dev sdc, sector 0` [ 996.856691] blk_update_request: I/O error, dev sdc, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0 [ 996.856704] Buffer I/O error on dev sdc, logical block 0, async page read [ 1027.282503] sd 2:0:0:0: [sdc] tag#13 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD IN [ 1027.282518] sd 2:0:0:0: [sdc] tag#13 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00 [ 1027.296850] scsi host2: uas_eh_device_reset_handler start [ 1027.424850] usb 1-6: reset high-speed USB device number 4 using ehci-pci [ 1027.582666] scsi host2: uas_eh_device_reset_handler success [ 1058.000845] scsi host2: uas_eh_device_reset_handler start [ 1058.007434] sd 2:0:0:0: [sdc] tag#14 uas_zap_pending 0 uas-tag 1 inflight: CMD [ 1058.007449] sd 2:0:0:0: [sdc] tag#14 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00 [ 1058.132851] usb 1-6: reset high-speed USB device number 4 using ehci-pci [ 1058.291082] scsi host2: uas_eh_device_reset_handler success [ 1088.708928] INFO: task blkid:1363 blocked for more than 724 seconds. [ 1088.708942] Not tainted 5.4.0-66-generic #74~18.04.2-Ubuntu [ 1088.708946] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 1088.708951] blkid D 0 1363 1361 0x00000000 [ 1088.708959] Call Trace: [ 1088.708978] __schedule+0x292/0x7d0 [ 1088.708987] schedule+0x2e/0xa0 [ 1088.708994] schedule_preempt_disabled+0xd/0x10 [ 1088.709001] __mutex_lock.isra.9+0x207/0x490 [ 1088.709008] ? _cond_resched+0x17/0x40 [ 1088.709015] __mutex_lock_slowpath+0x12/0x20 [ 1088.709021] mutex_lock+0x2f/0x40 [ 1088.709027] __blkdev_get+0x70/0x4c0 [ 1088.709034] ? I_BDEV+0x10/0x10 [ 1088.709042] ? iget5_locked+0x1c/0x70 [ 1088.709047] blkdev_get+0xc6/0x110 [ 1088.709052] ? bd_acquire+0xa0/0xc0 [ 1088.709056] blkdev_open+0x7d/0x90 [ 1088.709062] do_dentry_open+0x1ca/0x3b0 [ 1088.709067] ? blkdev_get_by_dev+0x40/0x40 [ 1088.709072] vfs_open+0x25/0x30 [ 1088.709078] path_openat+0x29c/0x1290 [ 1088.709088] do_filp_open+0x6a/0xd0 [ 1088.709097] ? __alloc_fd+0x36/0x170 [ 1088.709103] do_sys_open+0x1ad/0x2c0 [ 1088.709109] sys_openat+0x1b/0x20 [ 1088.709115] do_fast_syscall_32+0x7f/0x240 [ 1088.709123] entry_SYSENTER_32+0xac/0xff [ 1088.709127] EIP: 0xb7f86bb5 [ 1088.709134] Code: 00 3d 39 67 00 00 0f 84 6f 13 00 00 3d 29 67 00 00 0f 85 86 eb ff ff c7 86 dc 00 00 00 15 00 00 00 e9 ff e9 ff ff 8d b4 26 00 00 00 3d 98 68 00 00 0f 84 b4 0b 00 00 0f 86 00 07 00 00 3d 9b [ 1088.709138] EAX: ffffffda EBX: ffffff9c ECX: 00ceb4d0 EDX: 00088000 [ 1088.709142] ESI: 00000000 EDI: e0462da8 EBP: 00cef5e0 ESP: bf875a90 [ 1088.709146] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b EFLAGS: 00000246 [ 1088.724836] scsi host2: uas_eh_device_reset_handler start [ 1088.731428] sd 2:0:0:0: [sdc] tag#15 uas_zap_pending 0 uas-tag 1 inflight: CMD [ 1088.731436] sd 2:0:0:0: [sdc] tag#15 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00 [ 1088.856846] usb 1-6: reset high-speed USB device number 4 using ehci-pci [ 1089.014814] scsi host2: uas_eh_device_reset_handler success [ 1119.440840] scsi host2: uas_eh_device_reset_handler start [ 1119.449026] sd 2:0:0:0: [sdc] tag#12 uas_zap_pending 0 uas-tag 1 inflight: CMD [ 1119.449040] sd 2:0:0:0: [sdc] tag#12 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00 [ 1119.576842] usb 1-6: reset high-speed USB device number 4 using ehci-pci [ 1119.734805] scsi host2: uas_eh_device_reset_handler success [ 1150.160844] scsi host2: uas_eh_device_reset_handler start [ 1150.167386] sd 2:0:0:0: [sdc] tag#13 uas_zap_pending 0 uas-tag 1 inflight: CMD [ 1150.167399] sd 2:0:0:0: [sdc] tag#13 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00 [ 1150.292831] usb 1-6: reset high-speed USB device number 4 using ehci-pci [ 1150.451026] scsi host2: uas_eh_device_reset_handler success [ 1180.872921] scsi host2: uas_eh_device_reset_handler start [ 1180.880479] sd 2:0:0:0: [sdc] tag#14 uas_zap_pending 0 uas-tag 1 inflight: CMD [ 1180.880507] sd 2:0:0:0: [sdc] tag#14 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00 [ 1181.004890] usb 1-6: reset high-speed USB device number 4 using ehci-pci [ 1181.162973] scsi host2: uas_eh_device_reset_handler success [ 1181.163214] sd 2:0:0:0: [sdc] tag#14 FAILED Result: hostbyte=DID_RESET driverbyte=DRIVER_OK [ 1181.163224] sd 2:0:0:0: [sdc] tag#14 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00 [ 1181.163233] blk_update_request: I/O error, dev sdc, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0 [ 1181.163245] Buffer I/O error on dev sdc, logical block 0, async page read So in summary, the disk itself is being recognised in a way for example in the BIOS and occasionally by smartctl, but attempts to access it or to even see the partitions on it time out or fail. (There should be the three partitions of a regular Win10 setup.) Can you help me?
cupholder (11 rep)
Mar 8, 2021, 04:12 PM • Last activity: Jul 16, 2025, 09:07 PM
24 votes
7 answers
53291 views
Prevent a USB external hard drive from sleeping
Does anyone know if there is an elegant way to tell an external usb drive not to spin down after a period of inactivity? I've seen cron based solutions that write a file every minute, but nothing that smells of nice unixey elegance. There must be a hdparm, or scsi command that I can issue (usb drive...
Does anyone know if there is an elegant way to tell an external usb drive not to spin down after a period of inactivity? I've seen cron based solutions that write a file every minute, but nothing that smells of nice unixey elegance. There must be a hdparm, or scsi command that I can issue (usb drives are accessed via the sd driver in OpenBSD) to the drive to tell it to not sleep. I'm afraid that this is probably a *feature* built into the controller in the enclosure, and as such not much can change it aside from ripping the drive out of it's enclosure and plopping it directly in the machine, but I figured I would ask, on the off chance. Ideally, I'm looking for an OpenBSD solution, but I know there are others out there w/the same problem so any solutions will be considered for the answer.
gabe. (12124 rep)
Dec 29, 2010, 05:50 AM • Last activity: Jul 14, 2025, 05:07 PM
-1 votes
1 answers
76 views
How do I thoroughly wipe a corrupted drive and reformat on Debian?
I bought a brand new 4TB Western Digital Blue HDD, which is connected to my NAS running Debian via usb with an external HDD enclosure. I used the following commands to setup the drive: (parted) mklabel gpt (parted) mkpart primary 0% 100% sudo mkfs.exfat -n 4tbBackup /dev/sdc It seemed to work okay o...
I bought a brand new 4TB Western Digital Blue HDD, which is connected to my NAS running Debian via usb with an external HDD enclosure. I used the following commands to setup the drive: (parted) mklabel gpt (parted) mkpart primary 0% 100% sudo mkfs.exfat -n 4tbBackup /dev/sdc It seemed to work okay on the Linux machine, but when I plugged it into my Windows PC, it showed up under Disk Management as an unallocated 2048GB partition and another unallocated partition with the rest of the disk on it. I tried switching to gdisk, and it immediately gave me this error: GPT fdisk (gdisk) version 1.0.6 Warning: Partition table header claims that the size of partition table entries is 0 bytes, but this program supports only 128-byte entries. Adjusting accordingly, but partition table may be garbage. Caution: invalid main GPT header, but valid backup; regenerating main header from backup! Warning: Invalid CRC on main header data; loaded backup partition table. Warning! Main and backup partition tables differ! Use the 'c' and 'e' options on the recovery & transformation menu to examine the two tables. Warning! Main partition table CRC mismatch! Loaded backup partition table instead of main partition table! Warning! One or more CRCs don't match. You should repair the disk! Main header: ERROR Backup header: OK Main partition table: ERROR Backup partition table: OK Partition table scan: MBR: MBR only BSD: not present APM: not present GPT: damaged Found valid MBR and corrupt GPT. Which do you want to use? (Using the GPT MAY permit recovery of GPT data.) How can I totally reset the drive so that I can clear all of this header corruption out and reformat it safely to exFAT?
GeneralTully (39 rep)
Jul 3, 2025, 05:50 AM • Last activity: Jul 4, 2025, 02:28 AM
-1 votes
1 answers
78 views
Is the following way of encrypting hard drive using file encryption safe?
Assuming that I want to encrypt/decrypt a hard drive corresponding to `/dev/sdX`, the following is the procedure I have for doing so: **Encryption:** 1. Write the hard drive's data into a file (e.g. `./tmp`), using the command `dd if=/dev/sdX of=./tmp` 2. Encrypt the `tmp` file using any secure file...
Assuming that I want to encrypt/decrypt a hard drive corresponding to /dev/sdX, the following is the procedure I have for doing so: **Encryption:** 1. Write the hard drive's data into a file (e.g. ./tmp), using the command dd if=/dev/sdX of=./tmp 2. Encrypt the tmp file using any secure file encryption algorithm 3. Write the encrypted tmp.enc into the hard drive (dd if=./tmp.enc of=/dev/sdX) **Decryption:** 1. Write the hard drive's data into a file (e.g. ./tmp), using the command dd if=/dev/sdX of=./tmp.enc 2. Decrypt the tmp.enc file 3. Write the decrypted tmp into the hard drive (dd if=./tmp of=/dev/sdX) Does the following method necessarily work?
sbh (71 rep)
Jun 28, 2025, 03:00 PM • Last activity: Jun 29, 2025, 02:57 AM
1 votes
2 answers
9114 views
How do you erase the partition TABLE of a drive?
New(ish) to Linux, not new to hardware. Got a new NAS which is to be hosted via linux. Before that I'm faffing about with the hardware, and things I will never get to do otherwise. Live distros are so lovely. I've tried around 4 so far. Anyway, I'm also playing around with the storage drives. There'...
New(ish) to Linux, not new to hardware. Got a new NAS which is to be hosted via linux. Before that I'm faffing about with the hardware, and things I will never get to do otherwise. Live distros are so lovely. I've tried around 4 so far. Anyway, I'm also playing around with the storage drives. There's a bunch of file systems and partition types to explore - swap partitions are a puzzling idea to me, but whatever. I can play around with those easy enough. However I could not find a way to actually delete the partition **TABLE**, just change it. I tried both fdisk and gparted. How do you delete the partition table?
martixy (123 rep)
May 1, 2023, 05:38 AM • Last activity: Jun 26, 2025, 11:04 PM
4 votes
3 answers
3168 views
LVM: pvcreate by uuid or non "dev/sdX" method
Is it possible to pvcreate a pv by any more unique means than the standard "/dev/sdX"? The reason is the external multiple hard drive dock and dev mapper on my system don't always assign the same "/dev/sdX" at boot. I work around this with ext4 mounts in fstab by mounting by uuid, otherwise the resu...
Is it possible to pvcreate a pv by any more unique means than the standard "/dev/sdX"? The reason is the external multiple hard drive dock and dev mapper on my system don't always assign the same "/dev/sdX" at boot. I work around this with ext4 mounts in fstab by mounting by uuid, otherwise the results could be disastrous reads/writes to the wrong disk.
user203950 (41 rep)
Dec 5, 2016, 03:51 PM • Last activity: Jun 26, 2025, 05:59 PM
1 votes
0 answers
306 views
Ubuntu 20.04 slow file transfer across disks
I'm trying to move files from an SSD to an HDD on Ubuntu 20.04, but the transfer speeds are extremely slow. After half an hour, only 1.3 GB has been copied. My research hasn't helped, most solutions I found discuss network or USB issues, which don't apply here. - SSD: 500GB, ext4, boot drive, 95% us...
I'm trying to move files from an SSD to an HDD on Ubuntu 20.04, but the transfer speeds are extremely slow. After half an hour, only 1.3 GB has been copied. My research hasn't helped, most solutions I found discuss network or USB issues, which don't apply here. - SSD: 500GB, ext4, boot drive, 95% use - HDD: 2TB, ext4, mounted on /media/disk I attempted several solutions. - Dropping the ram cache (The system is using 28.5GiB of cache out of 31.1 avaliable), but the drop does not work and hangs forever. Using this solution - Using ionice through iotop to increase priority, which helps. - Using rsync instead of cp No matter what i try, i only get at best 2.5MBps on average. Considering that 99% of the files are 3.5MB and above, i think that the transfer speed should be much faster. I have a Seagate ST2000DM008 7500rpm 2TB hdd.
Cédric Vallée (11 rep)
Dec 5, 2024, 04:28 PM • Last activity: Jun 25, 2025, 08:31 AM
0 votes
0 answers
43 views
Cannot access files to delete
I currently use freefilesync on ubuntu 24.04 to back up my data. A couple of months ago I started to get errors on the external backup disk that a quick (and ineffective) look didn't resolve so I just ignored them. Today I delved deeper. If I use Files to open one of the problem directories it gives...
I currently use freefilesync on ubuntu 24.04 to back up my data. A couple of months ago I started to get errors on the external backup disk that a quick (and ineffective) look didn't resolve so I just ignored them. Today I delved deeper. If I use Files to open one of the problem directories it gives an error "This location could not be displayed" with a file name stating: input/output error. Double Commander (my preferred file manager) opens the directory fine but shows no files. However, using ls -l in a terminal lists a number of files with reasonable file names but where the attributes, owner, group, etc should be listed there are only question marks. Unsurprisingly attempting to run chmod, chown, rm, etc just results in an imput/output error. I also tried to check the partition with GParted but it crashed, Is there an easy way top resolve this issue? I suspect the best option is to bite the bullet and reformat the external disk and backup my 2TB data from scratch. My only concern is that, despite knowing better, I have just the one external disk so would be without a backup for a short while. Any suggestions gratefully received Keith
KeithW (1 rep)
Jun 20, 2025, 08:25 PM • Last activity: Jun 21, 2025, 05:01 AM
1 votes
2 answers
3179 views
How to manually get initramfs prompt at boot
I'm trying to get an initramfs prompt at boot because I have no USB drives or anything that I can use, and I need to use `fsck` on my `/dev/sda`, but that's obviously not allowed while it's mounted. It's not bad enough that I get the prompt, but it still appears to fix a few things every once in a w...
I'm trying to get an initramfs prompt at boot because I have no USB drives or anything that I can use, and I need to use fsck on my /dev/sda, but that's obviously not allowed while it's mounted. It's not bad enough that I get the prompt, but it still appears to fix a few things every once in a while at boot. So my question boils down to:

**How can I stop or pause the boot process, on Arch Linux, to get an initramfs prompt?**
(I'm sorry if this isn't possible on Arch, I'm coming from Debian)
kel5isgod (11 rep)
Oct 15, 2020, 10:02 AM • Last activity: Jun 20, 2025, 12:04 PM
0 votes
1 answers
58 views
Why do the sync mount option kill the performance of NTFS partitions?
I have noticed that when I mount my external HDD NTFS partition with the sync option, the write performance is terrible (1MB/s max). But when I use async the system finishes the operation very quickly (yes I know it is filled in the write cache), but according to htop I can see over 100MB/s writes t...
I have noticed that when I mount my external HDD NTFS partition with the sync option, the write performance is terrible (1MB/s max). But when I use async the system finishes the operation very quickly (yes I know it is filled in the write cache), but according to htop I can see over 100MB/s writes to the external HDD. Why is this happening? Isn't sync immediately applying writes instead of caching? Why would it perform so poorly (x100 less than the max speed of the drive) I am Running Debian unstable (equivalent to 13 - trixie)
td211 (477 rep)
Jun 20, 2025, 04:21 AM • Last activity: Jun 20, 2025, 04:52 AM
4 votes
1 answers
3206 views
ioctl: invalid argument for HDIO_GET_IDENTITY
I wrote a program to get the details of hard disk drive using `HDIO_ ioctl calls`. For writing program, I'm referring [`Documentation/ioctl/hdio.txt`][1] in kernel source(2.6.32). Here is my main part of code: fd = open("/dev/sda", O_RDONLY); // validated fd. retval = ioctl(fd, HDIO_GET_IDENTITY, &d...
I wrote a program to get the details of hard disk drive using HDIO_ ioctl calls. For writing program, I'm referring Documentation/ioctl/hdio.txt in kernel source(2.6.32). Here is my main part of code: fd = open("/dev/sda", O_RDONLY); // validated fd. retval = ioctl(fd, HDIO_GET_IDENTITY, &driveid); if(retval < 0) { perror("ioctl(HDIO_GET_IDENTITY)"); exit(3); } When I run(as root) the above code, I got below error: ioctl(HDIO_GET_IDENTITY): Invalid argument What is the wrong in the program? Why I'm getting error? **Additional Info**: OS: CentOS-6.5, kernel version: 2.6.32, IA:x86_64 (running on VMware). Result of hdparm -i /dev/sda is SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 HDIO_GET_IDENTITY failed: Invalid argument
gangadhars (727 rep)
Apr 18, 2014, 06:18 AM • Last activity: Jun 19, 2025, 06:09 PM
0 votes
1 answers
2340 views
Udev rule refuses to trigger when harddrive is added
I'm on Ubuntu 20.04. I'm trying to execute an action when a specific harddrive is connected using an udev rule identifying the drive using UUID. The script will eventually do a routine where it will mount the drive and run rsync. To rule out any errors in that process I'm now just trying out a test...
I'm on Ubuntu 20.04. I'm trying to execute an action when a specific harddrive is connected using an udev rule identifying the drive using UUID. The script will eventually do a routine where it will mount the drive and run rsync. To rule out any errors in that process I'm now just trying out a test command. The harddrive is connected via SATA Hotswap and has an UUID which is confirmed to be correct. I've followed numerous guides that seem to use this exact syntax, and still absolutely nothing happens however I try. Here are the steps I've done: - Created a file called 90-backup.rules in /etc/udev/rules.d. The content is: ACTION=="add", ENV{ID_FS_UUID}=="b527aadc-9dce-4ead-8937-e53ca2cfac84", RUN+="/bin/echo 1 >> /rule.test" - Tried udevadm control --reload-rules && udevadm trigger - Tried systemctl reload udev - Running udevadm test /dev/sdX i can see that it lists the rules file: Reading rules file: /etc/udev/rules.d/90-backup.rules - Using udevadm info /dev/sdX confirm that the ID_FS_UUID environmental variable is correct and can be read. - Tried adding KERNEL=='sd?' before the ACTION argument. Since the server is currently live in use, I haven't tried rebooting it yet. And it would be good to once and for all establish what is necessary to have udev reload the rules properly without reboot, for proper debugging. Any help is appreciated. All the best, Andreas
A.H (1 rep)
Jan 31, 2022, 01:23 AM • Last activity: Jun 19, 2025, 05:00 AM
1 votes
4 answers
2773 views
Automatic Mount at Boot For Xubuntu
I'm trying to follow these instruction to mount a second hard drive: https://help.ubuntu.com/community/InstallingANewHardDrive For automatic mount at boot it says I need to enter this into the terminal: sudo nano -Bw /etc/fstab Then: Add this line to the end (for ext3 file system): /dev/sdb1 /media/...
I'm trying to follow these instruction to mount a second hard drive: https://help.ubuntu.com/community/InstallingANewHardDrive For automatic mount at boot it says I need to enter this into the terminal: sudo nano -Bw /etc/fstab Then: Add this line to the end (for ext3 file system): /dev/sdb1 /media/mynewdrive ext3 defaults 0 2 Add this line to the end (for fat32 file system): /dev/sdb1 /media/mynewdrive vfat defaults 0 2 I'm not really sure what file system I am working with. I'm also not sure what it means to add the line to the end. End of what? This is a screen shot of what happens when I type in "sudo nano -Bw /etc/fstab" Image
boy (75 rep)
Jun 9, 2016, 08:37 PM • Last activity: Jun 16, 2025, 07:05 PM
0 votes
0 answers
42 views
How to install POP OS dual boot with windows on separate drive without erasing data of other drive?
I have windows 11 on 250gb ssd and a 500gb empty hard drive. I want to install POP!os on one of the partition of this Hard drive and let the windows be on the ssd. So while partitioning space to install linux if I select D drive from my HardDisk and does further partitioning there for linux os then...
I have windows 11 on 250gb ssd and a 500gb empty hard drive. I want to install POP!os on one of the partition of this Hard drive and let the windows be on the ssd. So while partitioning space to install linux if I select D drive from my HardDisk and does further partitioning there for linux os then we will get Erase and install option. **Now does this option erase all my data from the ssd also? or only from the drive I selected.** If it does delete then what is the other safer option to not delete the ssd data? Also is this way of partitioning correct or Am I doing anything wrong?
Naseer (1 rep)
Jun 14, 2025, 01:07 PM • Last activity: Jun 14, 2025, 07:27 PM
0 votes
1 answers
8044 views
I have a second hard drive installed in my hardware which I can't access from Debian (not mounted)
I just installed Debian but I had some problem during the installation. I first installed my OS on HDD cause I wanted a dualboot with Windows (which WAS located on the SSD) but I couldn't complete it so I decided to say goodbye to Windows and install Debian it again on SSD. Now in my desktop I can s...
I just installed Debian but I had some problem during the installation. I first installed my OS on HDD cause I wanted a dualboot with Windows (which WAS located on the SSD) but I couldn't complete it so I decided to say goodbye to Windows and install Debian it again on SSD. Now in my desktop I can see both hard drives but I can't mount the HDD. I'll paste some relevant information:
$ sudo fdisk -l
Disk /dev/sdb: 89.4 GiB, 96029466624 bytes, 187557552 sectors
Disk model: KINGSTON RBU-SNS
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x34f08e2e

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sdb1  *         2048 185556991 185554944 88.5G 83 Linux
/dev/sdb2       185559038 187555839   1996802  975M  5 Extended
/dev/sdb5       185559040 187555839   1996800  975M 82 Linux swap / Solaris


Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000LM024 HN-M
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x55786839

Device     Boot      Start        End    Sectors   Size Id Type
/dev/sda1             2048 1951522815 1951520768 930.6G 83 Linux
/dev/sda2       1951524862 1953523711    1998850   976M  5 Extended
/dev/sda5       1951524864 1953523711    1998848   976M 82 Linux swap / Solaris

Partition 2 does not start on physical sector boundary.
The drive I'm trying to access is /dev/sda
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            5.8G     0  5.8G   0% /dev
tmpfs           1.2G  9.4M  1.2G   1% /run
/dev/sdb1        87G  5.4G   77G   7% /
tmpfs           5.9G   60M  5.8G   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           5.9G     0  5.9G   0% /sys/fs/cgroup
tmpfs           1.2G   20K  1.2G   1% /run/user/1000
Here's what I tried:
~$ sudo fsck.ext4 -f /dev/sda
e2fsck 1.44.5 (15-Dec-2018)
ext2fs_open2: Bad magic number in super-block
fsck.ext4: Superblock invalid, trying backup blocks...
fsck.ext4: Bad magic number in super-block while trying to open /dev/sda

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 
 or
    e2fsck -b 32768 

Found a dos partition table in /dev/sda

~$ sudo resize2fs /dev/sda 8193
resize2fs 1.44.5 (15-Dec-2018)
resize2fs: Bad magic number in super-block while trying to open /dev/sda
Couldn't find valid filesystem superblock.

~$ sudo resize2fs /dev/sda 32768
resize2fs 1.44.5 (15-Dec-2018)
resize2fs: Bad magic number in super-block while trying to open /dev/sda
Couldn't find valid filesystem superblock.
inside mount output I fount the other drive infos:
/dev/sdb1 on / type ext4 (rw,relatime,errors=remount-ro)
So I wrote:
sudo mount /dev/sda1 /
And the hard disk icon on my desktop disappeared. After a reboot everything's back as it was, I can see the icon, I can't access the driver. If I click on the Icon: **Failed to mount "999 GB Volume"** **Not authorized to perform operation** *Please help*
Sara Briccoli (1 rep)
Mar 9, 2021, 11:06 AM • Last activity: Jun 9, 2025, 10:04 PM
6 votes
2 answers
485 views
SMART test and suspend or reboot
What is the behaviour if I start a long test with smartctl (i.e., `sudo smartctl -t long /dev/...`), and then I suspend the machine or shut it down and restart it later? Will the test "suspend" too and "continue on" when the machine is started up again? What my question mainly aims at: I would like...
What is the behaviour if I start a long test with smartctl (i.e., sudo smartctl -t long /dev/...), and then I suspend the machine or shut it down and restart it later? Will the test "suspend" too and "continue on" when the machine is started up again? What my question mainly aims at: I would like to schedule regular SMART tests (e.g., with cron), but it still may happen that I suspend or shut down the machine while the test is running, and then I don't know whether the test will continue or is "not finished" and I would have to restart it again. With current, 16+ TB HDDs SMART tests easily can run more than 20 hours... The same question holds for external disks, can I detached an USB disk while a SMART test is running and will it be continued next time I connect the device?
D. Kov&#225;cs (163 rep)
Jun 8, 2025, 05:56 AM • Last activity: Jun 9, 2025, 02:21 PM
7 votes
1 answers
428 views
Recovering data from incomplete ddrescue iso
I've got a 2.5 inch 5200RPM 320G HDD to recover data from. As I've been told, a child has stepped on the laptop and broke it. They gave me the laptop and motherboard seems to be completely fine. There's no any signs of being stepped on. The HDD also seems fine at the first glance. I connected it ove...
I've got a 2.5 inch 5200RPM 320G HDD to recover data from. As I've been told, a child has stepped on the laptop and broke it. They gave me the laptop and motherboard seems to be completely fine. There's no any signs of being stepped on. The HDD also seems fine at the first glance. I connected it over a satausb cable and started a ddrescue (without specifying mapfile). It took 13 days to complete the first stage and go to trimming. At that point, ddrescue told that 99.39% of disk was rescued, but unfortunately, the disk moved and the fragile connection broke, leaving me with I/O errors and this message:
ipos:    8623 MB, non-trimmed:  837763 kB,   current rate:       0 B/s                                                                                                                                         
     opos:    8623 MB, non-scraped:    1095 MB,   average rate:    280 kB/s                                                                                                                                         
non-tried:        0 B,  bad-sector:    2449 kB,     error rate:   13824 B/s                                                                                                                                         
  rescued:  318137 MB,   bad areas:       4784,       run time: 13d  3h 34m                                                                                                                                         
pct rescued:   99.39%, read errors:     45_212, remaining time: 19d 16h 16m                                                                                                                                         
                               time since last successful read:          6s                                                                                                                                         
Trimming failed blocks... (forwards)                                                                                                                                                                                
ddrescue: /dev/sda: Unaligned read error. Is sector size correct?
For now, I've started the ddrescue again on the same outfile, but as far as I know, it will take another 13 days to scan it through. I'm aware that it's a bad idea to connect it over such cable and without mapfile, but I thought that the process will be faster. Anyways, I have a backup outfile for any experiments and I think that 99.39% is pretty much enough, so I'd like to try to mount the file and take a look at the data inside. Unfortunately, I cannot:
[root@foxserver ~]# mount -o loop sda.iso /mnt/iso
mount: /mnt/iso: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.
What I tried so far: 1. ntfsfix. It couldn't recover and told me to use chkdsk. 2. fsck. But I couldn't even run it, it just always prints the help message no matter what options I pass. I've got another 2.5 inch 320GB HDD and I could try to write this image to that disk, boot into windows installation and try to chkdsk, but I don't really want to, because I'd like to use free, libre and open source software to do my job.
Leca (117 rep)
May 25, 2025, 09:22 AM • Last activity: Jun 8, 2025, 01:25 PM
Showing page 1 of 20 total questions