When I finally had time to set up a small server with RPi4, I wanted to plug in my old disk with a lot of memories. I often connected it to my laptop(s) without problems. What I did on the RPi4 may be a story for another time, but what you need to know is that I am running Gentoo on the RPi4. I had to edit some sections on the Raspberry_Pi wiki page as systemd was not fully documented in the wiki page at the time I did my installation.

So, what happened? I attached the disk (WD 15EADS External) and it seemed everything was in check. journalctl showed a nice log entry

Jan 28 07:40:49 operae kernel: usb 1-1.2: new high-speed USB device number 5 using xhci_hcd
Jan 28 07:40:49 operae kernel: usb 1-1.2: New USB device found, idVendor=1058, idProduct=1003, bcdDevice= 1.75
Jan 28 07:40:49 operae kernel: usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jan 28 07:40:49 operae kernel: usb 1-1.2: Product: External HDD
Jan 28 07:40:49 operae kernel: usb 1-1.2: Manufacturer: Western Digital
Jan 28 07:40:49 operae kernel: usb 1-1.2: SerialNumber: xxxxxx
Jan 28 07:40:49 operae kernel: usb-storage 1-1.2:1.0: USB Mass Storage device detected
Jan 28 07:40:49 operae kernel: scsi host0: usb-storage 1-1.2:1.0
Jan 28 07:40:50 operae kernel: scsi 0:0:0:0: Direct-Access     WD       15EADS External  1.75 PQ: 0 ANSI: 4
Jan 28 07:40:50 operae kernel: sd 0:0:0:0: [sda] 2930277168 512-byte logical blocks: (1.50 TB/1.36 TiB)
Jan 28 07:40:50 operae kernel: sd 0:0:0:0: [sda] Write Protect is off
Jan 28 07:40:50 operae kernel: sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
Jan 28 07:40:50 operae kernel: sd 0:0:0:0: [sda] No Caching mode page found
Jan 28 07:40:50 operae kernel: sd 0:0:0:0: [sda] Assuming drive cache: write through
Jan 28 07:40:50 operae kernel:  sda: sda1
Jan 28 07:40:50 operae kernel: sd 0:0:0:0: [sda] Attached SCSI disk

Good right? Right? Wrong!

access_partition_right_correct

Sadly, whenever I tried to mount it, it will find some problems and mount it in RO.

Jan 28 07:43:08 operae kernel: ntfs: (device sda1): load_system_files(): Volume is dirty.  Mounting read-only.  Run chkdsk and mount in Windows.

and

Jan 28 10:00:58 operae kernel: Buffer I/O error on dev sda1, logical block 6291462, lost sync page write
Jan 28 10:00:58 operae kernel: Buffer I/O error on dev sda1, logical block 6291463, lost sync page write
Jan 28 10:00:58 operae kernel: Buffer I/O error on dev sda1, logical block 1465137558, lost sync page write
Jan 28 10:00:58 operae kernel: Buffer I/O error on dev sda1, logical block 1465137559, lost sync page write
Jan 28 10:00:58 operae kernel: ntfs: (device sda1): ntfs_sync_mft_mirror(): I/O error while writing mft mirror record 0x3!
Jan 28 10:00:58 operae kernel: ntfs: (device sda1): ntfs_sync_mft_mirror(): Failed to synchronize $MFTMirr (error code 5).  Volume will be left marked dirty on umount.  Run ntfsfix on the partition after umounting to correct t>
Jan 28 10:00:58 operae kernel: ntfs: (device sda1): write_mft_record_nolock(): I/O error while writing mft record 0x3!  Marking base inode as bad.  You should unmount the volume and run chkdsk.
Jan 28 10:00:58 operae kernel: ntfs: (device sda1): __ntfs_write_inode(): Failed (error 5):  Run chkdsk.

Being very naive (and ignorant of disks errors), I believed what I read in dmseg. So I took the only windows machine in the house and plugged in the disk. Run the command and ... the partition disappeared!

you_cant_if_you_dont

After the wtf moment, I tried to connect it to my laptop, again. I could see the device, but there was, indeed, no partition.

My first reaction was to try to recover it on Windows. In the end, it is a NTFS partition, Windows created the problem in the first place ... so, let's fix it in Windows. I cannot believe that the constellation of freeware in Windows is polluted with tenths of software that makes you see the files on the partition, but ask you to pay 160 euros to buy the full version to actually recover it.

Demotivated, I went to to look for a software I remembered from years ago. testdisk from Christophe Grenier. Do visit his website https://www.cgsecurity.org/wiki/Main_Page There is even an extremely detailed step-to-step guide on how to use the software.

Now I recovered the partition and I can use my disk without problems. I even added the entry in fstab to mount it at the boot

/dev/sda1           /archive    ntfs3           rw,nosuid,nodev,relatime,force,uid=1000,gid=1000,iocharset=utf8,uhelper=udisks20 0

Happy ending, for once.

Next Post Previous Post