Restore crashed USB flash drive
by aiszisz from LinuxQuestions.org on (#5CB02)
Hi folks!
It's funny and awkward at the same time, while I tried to solve an issue with a windows iso I caused another one :)))
I followed a howto and gave this command as root:
ms-sys -7 /dev/sdb1
It should have write mbr to the usb device, and according the output the process was successful but the result was strange.
It created 4 partitions two of them was about 100GB one was some TB but the whole USB device is 30GB. I thought it's not OK so I erased the partition table created a new one and run mkfs:
mkfs.ntfs /dev/sdb1
It started to format the partition (so creating the new table should be ok).
Then I realized I forgot the -f option for fast formatting and I did something stupid. I aborted the process! Now my flash drive is broken.
After I plug the USB device:
Code:[dev]# dmesg|tail
[ 9963.269811] usb 1-2: Device not responding to setup address.
[ 9963.470784] usb 1-2: Device not responding to setup address.
[ 9963.671737] usb 1-2: device not accepting address 24, error -71
[ 9979.966929] usb 1-2: new high-speed USB device number 26 using xhci_hcd
[ 9980.131252] usb 1-2: New USB device found, idVendor=ffff, idProduct=1201
[ 9980.131261] usb 1-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 9980.131804] usb-storage 1-2:1.0: USB Mass Storage device detected
[ 9980.132501] scsi host32: usb-storage 1-2:1.0
[ 9981.133472] scsi 32:0:0:0: Direct-Access NAND USB2DISK 0.00 PQ: 0 ANSI: 4
[ 9981.135336] sd 32:0:0:0: [sdb] Attached SCSI removable diskCode:[dev]# lsusb
Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 006: ID 1bcf:2895 Sunplus Innovation Technology Inc.
Bus 003 Device 005: ID 413c:8197 Dell Computer Corp.
Bus 003 Device 007: ID 0b97:7772 O2 Micro, Inc. OZ776 CCID Smartcard Reader
Bus 003 Device 004: ID 0b97:7761 O2 Micro, Inc. Oz776 1.1 Hub
Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 026: ID ffff:1201
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub(my device is the bold line)
But neither lsblk nor fdisk can't see my drive
Code:[dev]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 298.1G 0 disk
|-sda1 8:1 0 1K 0 part
|-sda2 8:2 0 46.6G 0 part
|-sda5 8:5 0 3.7G 0 part [SWAP]
|-sda6 8:6 0 46.6G 0 part /
`-sda7 8:7 0 201.2G 0 part /run/media/a/5bca266b-1574-463c-ba56-6d9ed4bc9c0e
sr0 11:0 1 1024M 0 romCode:[dev]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
fdisk: cannot open /dev/sdb: No medium foundIs there any way to restore my flash drive? I found no threads with solution in any forum. The device is not a fake device it used to work before. I tried on all my USB port and even another linux machine with the same result. Ports are OK the drive is broken for sure. There is no (important) data on the device I just want it to work again.
Thanks a lot!


It's funny and awkward at the same time, while I tried to solve an issue with a windows iso I caused another one :)))
I followed a howto and gave this command as root:
ms-sys -7 /dev/sdb1
It should have write mbr to the usb device, and according the output the process was successful but the result was strange.
It created 4 partitions two of them was about 100GB one was some TB but the whole USB device is 30GB. I thought it's not OK so I erased the partition table created a new one and run mkfs:
mkfs.ntfs /dev/sdb1
It started to format the partition (so creating the new table should be ok).
Then I realized I forgot the -f option for fast formatting and I did something stupid. I aborted the process! Now my flash drive is broken.
After I plug the USB device:
Code:[dev]# dmesg|tail
[ 9963.269811] usb 1-2: Device not responding to setup address.
[ 9963.470784] usb 1-2: Device not responding to setup address.
[ 9963.671737] usb 1-2: device not accepting address 24, error -71
[ 9979.966929] usb 1-2: new high-speed USB device number 26 using xhci_hcd
[ 9980.131252] usb 1-2: New USB device found, idVendor=ffff, idProduct=1201
[ 9980.131261] usb 1-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 9980.131804] usb-storage 1-2:1.0: USB Mass Storage device detected
[ 9980.132501] scsi host32: usb-storage 1-2:1.0
[ 9981.133472] scsi 32:0:0:0: Direct-Access NAND USB2DISK 0.00 PQ: 0 ANSI: 4
[ 9981.135336] sd 32:0:0:0: [sdb] Attached SCSI removable diskCode:[dev]# lsusb
Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 006: ID 1bcf:2895 Sunplus Innovation Technology Inc.
Bus 003 Device 005: ID 413c:8197 Dell Computer Corp.
Bus 003 Device 007: ID 0b97:7772 O2 Micro, Inc. OZ776 CCID Smartcard Reader
Bus 003 Device 004: ID 0b97:7761 O2 Micro, Inc. Oz776 1.1 Hub
Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 026: ID ffff:1201
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub(my device is the bold line)
But neither lsblk nor fdisk can't see my drive
Code:[dev]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 298.1G 0 disk
|-sda1 8:1 0 1K 0 part
|-sda2 8:2 0 46.6G 0 part
|-sda5 8:5 0 3.7G 0 part [SWAP]
|-sda6 8:6 0 46.6G 0 part /
`-sda7 8:7 0 201.2G 0 part /run/media/a/5bca266b-1574-463c-ba56-6d9ed4bc9c0e
sr0 11:0 1 1024M 0 romCode:[dev]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
fdisk: cannot open /dev/sdb: No medium foundIs there any way to restore my flash drive? I found no threads with solution in any forum. The device is not a fake device it used to work before. I tried on all my USB port and even another linux machine with the same result. Ports are OK the drive is broken for sure. There is no (important) data on the device I just want it to work again.
Thanks a lot!