Howto recover non-mounting USB memory drive?
by nachtan from LinuxQuestions.org on (#5P3EY)
How do I recover a non-mounting ext2 USB drive? Im using Ubuntu 5.11.0-27-generic
The ext2 file system was working fine before the device crash. It was damaged when the machine it was on lost power while it was being written to (rsync).
Ideally, I like to recover the data on it, but if thats not possible, Im happy to re-partition it, even to its original filesystem if need be.
Another USB memory does work in this port, so the USB port is OK.
ls /media/<my_name> shows no device, though its plugged in.
Nor does the Ubuntu Files GUI.
I do get an audible click when I insert or remove the device.
lsusb shows it as:
Bus 002 Device 021: ID 0951:1666 Kingston Technology DataTraveler 100 G3/G4/SE9 G2
lsblk shows it as:
sdb 8:16 1 57.6G 0 disk (but no sdb1)
sudo parted -l gives this:
Error: /dev/sdb: unrecognised disk label
Model: Kingston DataTraveler 3.0 (scsi)
Disk /dev/sdb: 61.9GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:
sudo gparted & shows:
GParted 1.0.0
configuration --enable-libparted-dmraid --enable-online-resize
libparted 3.3
Input/output error during read on /dev/sdb
sudo e2fsck -b 98304 /dev/sdb shows:
e2fsck 1.45.5 (07-Jan-2020)
e2fsck: Input/output error while trying to open /dev/sdb
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 <device>
or
e2fsck -b 32768 <device>
Using the advice found in the e2fsck man page, I ran
sudo mke2fs -n /dev/sdb. It showed:
mke2fs 1.45.5 (07-Jan-2020)
Creating filesystem with 15104000 4k blocks and 3776512 inodes
Filesystem UUID: 9a6d67b6-240e-4273-83eb-30a44d18de9a
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424
cat /proc/partitions gives:
major minor #blocks name:
... ... ... ...
8 16 60416000 sdb
Here are a few of the last lines from dmesg.
[14230.556171] blk_update_request: I/O error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[14230.556173] Buffer I/O error on dev sdb, logical block 0, async page read
[14230.556412] sd 1:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=0s
[14230.556414] sd 1:0:0:0: [sdb] tag#0 Sense Key : Not Ready [current]
[14230.556416] sd 1:0:0:0: [sdb] tag#0 Add. Sense: Medium not present
[14230.556417] sd 1:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 18 00 00 08 00
[14230.556418] blk_update_request: I/O error, dev sdb, sector 24 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[14230.556420] Buffer I/O error on dev sdb, logical block 3, async page read
[14230.556975] sdb: unable to read partition table
Ideas?
The ext2 file system was working fine before the device crash. It was damaged when the machine it was on lost power while it was being written to (rsync).
Ideally, I like to recover the data on it, but if thats not possible, Im happy to re-partition it, even to its original filesystem if need be.
Another USB memory does work in this port, so the USB port is OK.
ls /media/<my_name> shows no device, though its plugged in.
Nor does the Ubuntu Files GUI.
I do get an audible click when I insert or remove the device.
lsusb shows it as:
Bus 002 Device 021: ID 0951:1666 Kingston Technology DataTraveler 100 G3/G4/SE9 G2
lsblk shows it as:
sdb 8:16 1 57.6G 0 disk (but no sdb1)
sudo parted -l gives this:
Error: /dev/sdb: unrecognised disk label
Model: Kingston DataTraveler 3.0 (scsi)
Disk /dev/sdb: 61.9GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:
sudo gparted & shows:
GParted 1.0.0
configuration --enable-libparted-dmraid --enable-online-resize
libparted 3.3
Input/output error during read on /dev/sdb
sudo e2fsck -b 98304 /dev/sdb shows:
e2fsck 1.45.5 (07-Jan-2020)
e2fsck: Input/output error while trying to open /dev/sdb
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 <device>
or
e2fsck -b 32768 <device>
Using the advice found in the e2fsck man page, I ran
sudo mke2fs -n /dev/sdb. It showed:
mke2fs 1.45.5 (07-Jan-2020)
Creating filesystem with 15104000 4k blocks and 3776512 inodes
Filesystem UUID: 9a6d67b6-240e-4273-83eb-30a44d18de9a
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424
cat /proc/partitions gives:
major minor #blocks name:
... ... ... ...
8 16 60416000 sdb
Here are a few of the last lines from dmesg.
[14230.556171] blk_update_request: I/O error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[14230.556173] Buffer I/O error on dev sdb, logical block 0, async page read
[14230.556412] sd 1:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=0s
[14230.556414] sd 1:0:0:0: [sdb] tag#0 Sense Key : Not Ready [current]
[14230.556416] sd 1:0:0:0: [sdb] tag#0 Add. Sense: Medium not present
[14230.556417] sd 1:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 18 00 00 08 00
[14230.556418] blk_update_request: I/O error, dev sdb, sector 24 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[14230.556420] Buffer I/O error on dev sdb, logical block 3, async page read
[14230.556975] sdb: unable to read partition table
Ideas?