Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux? |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-02-2021, 03:38 PM
|
#1
|
LQ Newbie
Registered: Dec 2020
Distribution: Slackware64 14.2
Posts: 28
Rep:
|
Restore crashed USB flash drive
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 disk
Code:
[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 rom
Code:
[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 found
Is 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!
|
|
|
01-02-2021, 04:47 PM
|
#2
|
LQ Guru
Registered: Oct 2004
Distribution: Arch
Posts: 5,415
|
If you are double sure that /dev/sdb is the usb device.
Code:
dd if=/dev/zero of=/dev/sdb bs=1M count=10
Does that cause the device to show up with fdisk -l? If so use fdisk to put at least 1 partition on it, format that partition/s.
|
|
1 members found this post helpful.
|
01-02-2021, 04:50 PM
|
#3
|
Senior Member
Registered: Aug 2016
Posts: 3,345
|
You can try wiping the corrupted partition table area with
Code:
dd if=/dev/zero of=/dev/sdb bs=1M count=1
then use fdisk or parted to recreate the partition table.
Make certain the output of dd above is pointing to the correct device before you execute it.
If dd can't write to it that way then the device is likely no longer usable. If still good this should allow you to recover it.
|
|
1 members found this post helpful.
|
01-02-2021, 05:59 PM
|
#4
|
LQ Newbie
Registered: Dec 2020
Distribution: Slackware64 14.2
Posts: 28
Original Poster
Rep:
|
Code:
[downloads]# dd if=/dev/zero of=/dev/sdb bs=1M count=10
dd: failed to open '/dev/sdb': No medium found
Unfortunately dd gives the same error as fdisk...
|
|
|
01-02-2021, 07:40 PM
|
#5
|
Senior Member
Registered: Aug 2016
Posts: 3,345
|
Just a thought. Have you rebooted since you torched the USB? If not then with the device unplugged please reboot and log back in. Then plug in the USB device again and give us the tail of dmesg again so we can see if the system even sees it. lsusb should see it as well but lsblk possibly not.
Don't do anything else with it initially but if dmesg shows a device name such as sdb like you posted before, then try the dd command again as you just did. Make certain the "of=/dev/sdX" part of the dd command shows the device you just identified. It may work in which case you are in luck. If not then the device is history and can be thrown.
|
|
|
01-03-2021, 11:00 AM
|
#6
|
LQ Newbie
Registered: Dec 2020
Distribution: Slackware64 14.2
Posts: 28
Original Poster
Rep:
|
Nothing changed...
Code:
[a]# dmesg|tail
[ 88.864953] Bluetooth: RFCOMM ver 1.11
[ 813.488012] usb 3-1.2: new high-speed USB device number 7 using ehci-pci
[ 813.573642] usb 3-1.2: New USB device found, idVendor=ffff, idProduct=1201
[ 813.573650] usb 3-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 813.662077] usb-storage 3-1.2:1.0: USB Mass Storage device detected
[ 813.662248] scsi host8: usb-storage 3-1.2:1.0
[ 813.662468] usbcore: registered new interface driver usb-storage
[ 813.669093] usbcore: registered new interface driver uas
[ 814.665231] scsi 8:0:0:0: Direct-Access NAND USB2DISK 0.00 PQ: 0 ANSI: 4
[ 814.668402] sd 8:0:0:0: [sdb] Attached SCSI removable disk
[a]# 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 005: ID 1bcf:2895 Sunplus Innovation Technology Inc.
Bus 003 Device 004: ID 413c:8197 Dell Computer Corp.
Bus 003 Device 006: ID 0b97:7772 O2 Micro, Inc. OZ776 CCID Smartcard Reader
Bus 003 Device 003: ID 0b97:7761 O2 Micro, Inc. Oz776 1.1 Hub
Bus 003 Device 007: ID ffff:1201
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 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[a]# 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
sr0 11:0 1 1024M 0 rom
[a]# dd if=/dev/zero of=/dev/sdb bs=1M count=10
dd: failed to open '/dev/sdb': No medium found
[a]#
|
|
|
01-03-2021, 12:27 PM
|
#7
|
LQ Guru
Registered: Oct 2004
Distribution: Arch
Posts: 5,415
|
/dev/sdb, that is it.
Code:
[ 814.665231] scsi 8:0:0:0: Direct-Access NAND USB2DISK 0.00 PQ: 0 ANSI: 4
[ 814.668402] sd 8:0:0:0: [sdb] Attached SCSI removable disk
https://linux.die.net/man/1/ms-sys
What happens when you stick it into a windows machine?
|
|
|
01-03-2021, 12:36 PM
|
#8
|
LQ Newbie
Registered: Dec 2020
Distribution: Slackware64 14.2
Posts: 28
Original Poster
Rep:
|
Quote:
Originally Posted by teckk
|
That's a good question! I am wondering too and I would have tried it already if I would have a windows machine. First time I get close to one is Friday. I will check if I can reformat it or fix with diskpart!
|
|
|
01-03-2021, 01:57 PM
|
#9
|
LQ Veteran
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,843
|
|
|
|
01-03-2021, 02:25 PM
|
#10
|
LQ Newbie
Registered: Dec 2020
Distribution: Slackware64 14.2
Posts: 28
Original Poster
Rep:
|
Quote:
Originally Posted by colorpurple21859
|
yeah
Code:
[a]# dmesg|tail
[ 6549.930411] ERROR @wl_notify_scan_status : eth1 Scan_results error (-22)
[10694.419837] usb 3-2: new high-speed USB device number 2 using xhci_hcd
[10694.584138] usb 3-2: New USB device found, idVendor=ffff, idProduct=1201
[10694.584144] usb 3-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[10694.606567] usb-storage 3-2:1.0: USB Mass Storage device detected
[10694.606673] scsi host8: usb-storage 3-2:1.0
[10694.606830] usbcore: registered new interface driver usb-storage
[10694.613839] usbcore: registered new interface driver uas
[10695.609384] scsi 8:0:0:0: Direct-Access NAND USB2DISK 0.00 PQ: 0 ANSI: 4
[10695.610417] sd 8:0:0:0: [sdb] Attached SCSI removable disk
[a]# parted /dev/sdb
Error: Error opening /dev/sdb: No medium found
Retry/Cancel? r
Error: Error opening /dev/sdb: No medium found
Retry/Cancel? c
[a]#
|
|
|
04-02-2022, 05:20 PM
|
#11
|
Member
Registered: May 2004
Distribution: Slackware / GoboLinux / LFS / VoidLinux
Posts: 145
Rep:
|
I have a similar problem.
It happens with an INTENSO USB Disc that is fairly large, 32GB.
When I plug it in I get this output:
[3833577.842542] usb 1-5: USB disconnect, device number 7
[3834877.780984] usb 1-5: new high-speed USB device number 8 using ehci-pci
[3834877.911339] usb 1-5: New USB device found, idVendor=ffff, idProduct=1201, bcdDevice= 0.00
[3834877.911353] usb 1-5: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[3834877.912548] usb-storage 1-5:1.0: USB Mass Storage device detected
[3834877.912920] scsi host7: usb-storage 1-5:1.0
[3834878.923763] scsi 7:0:0:0: Direct-Access NAND USB2DISK 0.00 PQ: 0 ANSI: 4
[3834878.925481] sd 7:0:0:0: [sdd] Media removed, stopped polling
[3834878.927219] sd 7:0:0:0: [sdd] Attached SCSI removable disk
Using "fdisk -l", unfortunately, I do not see anything else. It does not seem to be fully recognized.
I have other small USB sticks with 32GB which seem to work fine, although USB transfer is very slow
to these. These USB sticks do not work on windows either; I just tested it and it is saying "Installing
USB Mass Driver" or something like that, but afterwards it is not recognized.
I think something is missing but I have not figured out why or how. I am reporting this in the event
others come with a similar issue. This was a fresh purchase; never used that USB stick particularly.
Normally USB sticks purchased all work fine for me on Linux.
|
|
|
04-03-2022, 12:45 AM
|
#12
|
LQ Addict
Registered: Dec 2013
Posts: 19,872
|
The last 2 lines of your dmesg output look interesting, somewhat contradictory. Faulty contact?
Anyhow, plaease use this method to provide the dmesg output.
|
|
|
04-07-2022, 08:10 AM
|
#13
|
Senior Member
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 22 MATE, Peppermint OS-Devuan, EndeavourOS, antiX
Posts: 4,359
|
aiszisz,
It sounds like your USB drive may be faulty.
Try installing dcfldd, zero the drive and then verify that it has been zeroed.
Then compare the two files with the comparison command (cmp).
dcfldd:
http://dcfldd.sourceforge.net/
Code:
sudo apt install dcfldd
Insert the USB drive and zero it:
This can take quite a while, depending on the size of the drive. Be patient!
Code:
sudo su
# dcfldd if=/dev/zero of=/dev/sdc bs=1M
Then remove and reinsert the USB drive.
Code:
# cmp /dev/zero /dev/sdc
My first output for a 8GB drive was:
7680 blocks (7680Mb) written.dcfldd:: No space left on device.
The cmp will hopefully fail at the point where it has reached the end of the drive.
If it fails before then, the drive isn't usable any more.
My second output was:
Code:
/dev/zero /dev/sdc differ: byte 1011713, line 1
which indicated a faulty drive.
|
|
|
04-07-2022, 08:52 AM
|
#14
|
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,317
|
My guess is this is one of many fake USB drives. It claimed to be 30G but is not in reality. It hasn't shown any sign of working since the initial write I don't think you did anything wrong. Return it for refund or throw it out.
|
|
|
All times are GMT -5. The time now is 11:06 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|