You are not logged in.

#1 2020-10-28 22:19:45

user9921
Member
Registered: 2020-10-28
Posts: 1

USB harddrive detached - lost data way back

Hello,

I have been browsing for other topcs on similar problems but not really found any answers.

I am running a RAID 1 on a USB dock with 2 SATA harddrives, which are fairly new. The computer they were attached to was turned on since february 2020.

What happend then is that during some tumbling by my dog, the USB cable got detached and I promptly rebooted the computer.

But after turning it on, lo and behond I discovered that I only have files saved since June on the computer!

I have written thousands of files of many gb to that drive since then.

I looked at https://wiki.archlinux.org/index.php/File_recovery and did ext4magic /dev/sdC1 -f .  -Lx   The list was over 80mb and had many file names but none of the disappeared files.

How is this possible? I know there is a write cache on USB devices, but surley the cache buffer cannot hold the gigabytes I have transferred onto the drive since then.

I might accept the loss of data but I’m very interested to know how it could happend.

I looked at lost+found but found it empty after doing an e2fsck.

Journalctl -b -2 tells me:

jun 27 00:05:57 ior kernel: Linux version 5.6.14-arch1-1 (linux@archlinux) (gcc version 10.1.0 (GCC)) #1 SMP PREEMPT Wed, 20 May 2020 20:43:19 +0000
jun 27 00:05:57 ior kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=3326d488-b816-4931-bf78-07256c1f119d rw quiet
kt 27 16:56:00 ior kernel: usb 2-6: USB disconnect, device number 3
......
okt 27 16:56:02 ior php-fpm[705266]: pool www[705266]: PHP Warning:  touch(): Unable to create file /media/backup/nextcloud/nextcloud.log because Input/output error in /usr/share/webapps/nextcloud/lib/private/Log/File.php on line 65
...
okt 27 16:56:03 ior kernel: EXT4-fs error (device sdc1): __ext4_find_entry:1536: inode #133562898: comm php-fpm: reading directory lblock 0
okt 27 16:56:03 ior kernel: EXT4-fs error (device sdc1): __ext4_find_entry:1536: inode #133562898: comm php-fpm: reading directory lblock 0
okt 27 16:56:03 ior kernel: EXT4-fs error (device sdc1): __ext4_find_entry:1536: inode #133562898: comm php-fpm: reading directory lblock 0
okt 27 16:56:03 ior kernel: EXT4-fs error (device sdc1): __ext4_find_entry:1536: inode #133562898: comm php-fpm: reading directory lblock 0
okt 27 16:56:03 ior kernel: EXT4-fs error (device sdc1): __ext4_find_entry:1536: inode #133562898: comm php-fpm: reading directory lblock 0
okt 27 16:56:03 ior kernel: EXT4-fs error (device sdc1): __ext4_find_entry:1536: inode #133562898: comm php-fpm: reading directory lblock 0
okt 27 16:56:03 ior kernel: EXT4-fs error (device sdc1): __ext4_find_entry:1536: inode #133562898: comm php-fpm: reading directory lblock 0
okt 27 16:56:03 ior kernel: EXT4-fs error (device sdc1): __ext4_find_entry:1536: inode #133562898: comm php-fpm: reading directory lblock 0
okt 27 16:56:03 ior kernel: EXT4-fs error (device sdc1): __ext4_find_entry:1536: inode #133562898: comm php-fpm: reading directory lblock 0
...
rebooting the computer

e2fsck seems normal:

Pass 1: Kontrollerar inoder, block och storlekar
inod 105119759:s utsträckningsträd (på nivå 1) kunde vara smalare.  Optimera? ja

... many similar rows...

inod 119799811:s utsträckningsträd (på nivå 2) kunde vara smalare.  Optimera? ja

Pass 1E: Optimerar utsträckningsträd
Pass 2: Kontrollerar katalogstruktur
Pass 3: Kontrollerar katalogförbindelser
Pass 4: Kontrollerar referensräknare
Pass 5: Kontrollerar gruppsammanfattningsinformation

2019: ***** FILSYSTEMET MODIFIERADES *****
2019: 659820/244195328 filer (2.9% ej sammanhängande), 663122010/976754176 block

dmesg |grep sdc:

[   12.137596] sd 7:0:0:0: [sdc] Read Capacity(10) failed: Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[   12.137600] sd 7:0:0:0: [sdc] Sense Key : Unit Attention [current] 
[   12.137602] sd 7:0:0:0: [sdc] Add. Sense: Not ready to ready change, medium may have changed
[   12.137606] sd 7:0:0:0: [sdc] 0 512-byte logical blocks: (0 B/0 B)
[   12.137607] sd 7:0:0:0: [sdc] 0-byte physical blocks
[   13.252879] sd 7:0:0:0: [sdc] Test WP failed, assume Write Enabled
[   13.706370] sd 7:0:0:0: [sdc] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[   13.728921] sd 7:0:0:0: [sdc] Very big device. Trying to use READ CAPACITY(16).
[   13.729296] sd 7:0:0:0: [sdc] 7814037152 512-byte logical blocks: (4.00 TB/3.64 TiB)
[   13.731310] sd 7:0:0:0: [sdc] Attached SCSI disk
[   25.213375] NFSD: Using nfsdcld client tracking operations.
[  140.483213]  sdc: sdc1
[  140.708955]  sdc: sdc1
[  187.350448] EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts: (null)
[ 7272.611177] EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts: (null)

Last edited by user9921 (2020-10-28 22:33:36)

Offline

#2 2021-07-07 12:52:53

Tabs
Member
Registered: 2015-02-01
Posts: 11

Re: USB harddrive detached - lost data way back

Hello,

a bit of digging to say that I face a very similar issue. Also having an Nexcloud instance and the problem also being related to php-fm (same logs). Did you manage to solve the issue ?

Offline

Board footer

Powered by FluxBB