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.
Using dd won't help; it will just try to write zeros over the bad blocks. A bad block on a flash chip is not a good sign; it normally means that part of the chip has become damaged (which could be caused by exposure to radiation or a manufacturing defect like a faulty seal on the chip letting a speck of dust in). It shouldn't be possible to corrupt the filesystem just by the camera acting strange; it's more likely that the filesystem corruption confused the camera.
Unless I'm wrong (which is possible), this looks to me like a manufacturing defect. If it's under warranty, I'd try and take it back.
You could run fsck.vfat on the file system to mark the bad blocks after formatting. Repartitioning with -c as you have done should also do the trick. You will lose the storage space with the bad blocks but whatever space is left should be okay.
You can't do a low-level format of a flash chip in the same way as a magnetic hard disk; there aren't any magnetic domains that can be recreated to try and work around the problem. Instead, each storage bit consists of a small electronic circuit built into the semiconductor; you may be able to do something in a clean-room using scanning tunneling microscopes, laser trimming and possibly plasma deposition through carefully-constructed masks but it would be much cheaper just to buy a new one.
you can try the DiskDump command like you have posted.
It will write down zero's to /dev/sda and is compareable to a low-level format.
this might help if your filesystem is damaged, but if you have a hardware-problem it wouldn't be fixed with DD.
You will have to remake the partition table. If fdisk or cfdisk gives you problems. You will have to do "dd if=/dev/zero of=/dev/sda bs=512 count=1". Then run fdisk or cfdisk again. You can format with the option to scan for badblocks.
Unfortunately, flash mediums has limited writes, so this problem will occur over time the more you write to it. FAT writes multiple times to create a file or directory. The only solid state medium that has unlimited writes and that does not erase its data when power is removed is FRAM. I wish FRAM has high storage capacity because it can be written to it unlimited times, it is almost as fast as DRAM, and it is low power (about 1/100th of an amp).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.