Troubleshoot USB not getting detected after getting corrupted during formatting on Fedora 33
by Rohan Kumar from LinuxQuestions.org on (#5BW23)
Hi guys,
Yesterday, I got my USB drive corrupted by cancelling format process from KDE partition manager. Since then, I'm not able to access my USB drive. I'm not able to understand what I have messed up with file partition tables. I'm really want to restore this USB to a usable state. I'm okay with losing data. When I attach USB it doesn't get detected like usual and doesn't mount automatically. When I try to mount it like this, I get this warning:
Code:~ : $ sudo mount /dev/sdb /media/usb-drive/
mount: /media/usb-drive: WARNING: source write-protected, mounted read-only.When I open it in Gparted it shows unallocated but when I create new partition table; Gparted freezes
When I try to format it using `mkfs` it hangs forever:
Code:~ : $ sudo mkfs.vfat -v -F 32 /dev/sdb
mkfs.fat 4.1 (2017-01-24)
/dev/sdb has 64 heads and 32 sectors per track,
hidden sectors 0x0000;
logical sector size is 512,
using 0xf8 media descriptor, with 60437492 sectors;
drive number 0x80;
filesystem has 2 32-bit FATs and 32 sectors per cluster.
FAT size is 14752 sectors, and provides 1887748 clusters.
There are 32 reserved sectors.
Volume ID is 2517e272, no volume label.Here are some details:
sudo fdisk -l
Code:Disk /dev/sdb: 28.82 GiB, 30943995904 bytes, 60437492 sectors
Disk model: DataTraveler 2.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 byteslsusb
Code:~ : $ lsusb
Bus 002 Device 002: ID 0bda:0316 Realtek Semiconductor Corp. Card Reader
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 04f2:b5ab Chicony Electronics Co., Ltd Integrated Camera
Bus 001 Device 002: ID 8087:0a2b Intel Corp. Bluetooth wireless interface
Bus 001 Device 006: ID 0951:1665 Kingston Technology Digital DataTraveler SE9
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hubdemsg (after inserting USB)
Code:[ 4187.922108] usb 1-1: new high-speed USB device number 7 using xhci_hcd
[ 4188.052065] usb 1-1: New USB device found, idVendor=0951, idProduct=1665, bcdDevice= 1.00
[ 4188.052069] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4188.052072] usb 1-1: Product: DataTraveler 2.0
[ 4188.052075] usb 1-1: Manufacturer: Kingston
[ 4188.052077] usb 1-1: SerialNumber: 60A44C413C7AF3B066305F47
[ 4188.053887] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 4188.057442] scsi host1: usb-storage 1-1:1.0
[ 4189.093100] scsi 1:0:0:0: Direct-Access Kingston DataTraveler 2.0 1.00 PQ: 0 ANSI: 4
[ 4189.093635] sd 1:0:0:0: Attached scsi generic sg1 type 0
[ 4189.095162] sd 1:0:0:0: [sdb] 60437492 512-byte logical blocks: (30.9 GB/28.8 GiB)
[ 4189.095387] sd 1:0:0:0: [sdb] Write Protect is off
[ 4189.095390] sd 1:0:0:0: [sdb] Mode Sense: 45 00 00 00
[ 4189.095591] sd 1:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 4189.167568] sd 1:0:0:0: [sdb] Attached SCSI removable diskWhen I try to repair this USB using fsck it throws me this error:
Code:~ : $ sudo fsck /dev/sdb
fsck from util-linux 2.36
e2fsck 1.45.6 (20-Mar-2020)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block 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 dosfsck:
Code:~ : $ sudo dosfsck -a /dev/sdb
fsck.fat 4.1 (2017-01-24)
Logical sector size is zero.Could anyone please tell me what's wrong with my USB drive? I think it's corrupted but can it be restored somehow. I just bought it a month ago and now it's unusable right now. Any help would be appreciated.


Yesterday, I got my USB drive corrupted by cancelling format process from KDE partition manager. Since then, I'm not able to access my USB drive. I'm not able to understand what I have messed up with file partition tables. I'm really want to restore this USB to a usable state. I'm okay with losing data. When I attach USB it doesn't get detected like usual and doesn't mount automatically. When I try to mount it like this, I get this warning:
Code:~ : $ sudo mount /dev/sdb /media/usb-drive/
mount: /media/usb-drive: WARNING: source write-protected, mounted read-only.When I open it in Gparted it shows unallocated but when I create new partition table; Gparted freezes
When I try to format it using `mkfs` it hangs forever:
Code:~ : $ sudo mkfs.vfat -v -F 32 /dev/sdb
mkfs.fat 4.1 (2017-01-24)
/dev/sdb has 64 heads and 32 sectors per track,
hidden sectors 0x0000;
logical sector size is 512,
using 0xf8 media descriptor, with 60437492 sectors;
drive number 0x80;
filesystem has 2 32-bit FATs and 32 sectors per cluster.
FAT size is 14752 sectors, and provides 1887748 clusters.
There are 32 reserved sectors.
Volume ID is 2517e272, no volume label.Here are some details:
sudo fdisk -l
Code:Disk /dev/sdb: 28.82 GiB, 30943995904 bytes, 60437492 sectors
Disk model: DataTraveler 2.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 byteslsusb
Code:~ : $ lsusb
Bus 002 Device 002: ID 0bda:0316 Realtek Semiconductor Corp. Card Reader
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 04f2:b5ab Chicony Electronics Co., Ltd Integrated Camera
Bus 001 Device 002: ID 8087:0a2b Intel Corp. Bluetooth wireless interface
Bus 001 Device 006: ID 0951:1665 Kingston Technology Digital DataTraveler SE9
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hubdemsg (after inserting USB)
Code:[ 4187.922108] usb 1-1: new high-speed USB device number 7 using xhci_hcd
[ 4188.052065] usb 1-1: New USB device found, idVendor=0951, idProduct=1665, bcdDevice= 1.00
[ 4188.052069] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4188.052072] usb 1-1: Product: DataTraveler 2.0
[ 4188.052075] usb 1-1: Manufacturer: Kingston
[ 4188.052077] usb 1-1: SerialNumber: 60A44C413C7AF3B066305F47
[ 4188.053887] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 4188.057442] scsi host1: usb-storage 1-1:1.0
[ 4189.093100] scsi 1:0:0:0: Direct-Access Kingston DataTraveler 2.0 1.00 PQ: 0 ANSI: 4
[ 4189.093635] sd 1:0:0:0: Attached scsi generic sg1 type 0
[ 4189.095162] sd 1:0:0:0: [sdb] 60437492 512-byte logical blocks: (30.9 GB/28.8 GiB)
[ 4189.095387] sd 1:0:0:0: [sdb] Write Protect is off
[ 4189.095390] sd 1:0:0:0: [sdb] Mode Sense: 45 00 00 00
[ 4189.095591] sd 1:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 4189.167568] sd 1:0:0:0: [sdb] Attached SCSI removable diskWhen I try to repair this USB using fsck it throws me this error:
Code:~ : $ sudo fsck /dev/sdb
fsck from util-linux 2.36
e2fsck 1.45.6 (20-Mar-2020)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block 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 dosfsck:
Code:~ : $ sudo dosfsck -a /dev/sdb
fsck.fat 4.1 (2017-01-24)
Logical sector size is zero.Could anyone please tell me what's wrong with my USB drive? I think it's corrupted but can it be restored somehow. I just bought it a month ago and now it's unusable right now. Any help would be appreciated.