Linux - HardwareThis 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.
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.
I was messing around with some stuff today, working on restoring the mbr on a usb stick for BartPE. I got the one usb device to work doing dd if=pe2usb.bin of=/dev/sdb bs=512 count=1, so I was working on another one and decided to clear the mbr to test another utility.
I used dd if=/dev/null of=/dev/sdb bs=512 count=1
Now, I cannot write anything to the device, cannot use dd to write bit by bit or anything. Doing a fdisk -l says the logical and physical geometry's are off.
dmesg is stating some bad sectors.
If I try a format in windows, it states Invalid media or Track 0 bad - disk unusable.
I'm not too concerned about getting it to work (if that's even possible, which I don't think it is), just wondering if this caused the issue or if it happened to crap out when I was working on it.
I.e. do not use the /dev/null device as input file, use /dev/zero instead. That device actually outputs data (zeroes) whereas /dev/null does not.
I don't know if it is the use of /dev/null as input which screwed your USB stick, but after reading your post I am not going to risk any of mine to verify this....
Although I find it quite strange that no further 'dd' command will write to that disk.
Did you try to use that USB stick on another computer and write to it there? Or reboot your computer and then try again?
Alternatively, try this command to re-initialize the USB stick (assuming that your distro has the sfdisk program on board):
Try to partition your USB stick with:
fdisk /dev/sdb
It will bring you to the menu, type 'm' for help.
You could try:
then 'n' - add new partition
then 'a' - add boot flag
then 'w' or 'x' (I don't remember) to write it back to
the device.
If you are successful then create file system on newly created partition
mke2fs /dev/sdb1
It is possible that you damaged the flash memory. BTW using bs=512 wipes out the bootloader and the partition table. To zero out the bootloader just use bs=446.
Try to partition your USB stick with:
fdisk /dev/sdb
It will bring you to the menu, type 'm' for help.
You could try:
then 'n' - add new partition
then 'a' - add boot flag
then 'w' or 'x' (I don't remember) to write it back to
the device.
If you are successful then create file system on newly created partition
mke2fs /dev/sdb1
Good luck.
I've tried repartioning it a few times, and it hasn't worked. Which is what has lead me to believe it no longer works.
Quote:
Originally Posted by michaelk
It is possible that you damaged the flash memory
That is what I was thinking, but I am wondering how that would actually damage the memory.
I'm not too concerned with fixing it, and I think it is beyond repair. I am just wondering how/why it quit working.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.