[SOLVED] I cannot erase USB flash-drive. Previously it was prepared & used as ubuntu-22 installation disk. Please help. Thanks
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
When a pendrive has been used as an installation image, to return it to normal usage, you need to write a new partition table to it, usually an MBR*, (could be a GPT*, depending on size), then partition, & add a file system.
Now with gparted
1. Create a new partition table. MBR for a flash drive is fine
2. Create a new partition, select the desired filesystem. If also using the drive with Windows select NTFS, exFAT or FAT32.
3. Click the green check mark to apply all operations.
MBR = Master Boot Record. It organizes partitions on a drive so the system can find them.
GPT = GUID Partition Table. Basically same as for MBR but for drives > 2TB
If you created a new partition table as instructed above, did you create a partition with a filesystem (see post 17)? If not, it won't mount as there is nothing to mount. You need to create a filesystem on it.
When a pendrive has been used as an installation image, to return it to normal usage, you need to write a new partition table to it, usually an MBR, (could be a GPT, depending on size), then partition, & add a file system.
If you write a DVD image to the flash drive, it gets a ISO9660 file system signature written to it. And ISO9660 is read-only.
I have been using wipefs a lot lately to make good-but-unwriteable USB flash drives writeable again. The command line is "wipefs -a /dev/sdX". It zeroes out the file system signature and a couple of other locations, as described in the man page.
It has failed me on a couple of cheap drives. They got the hammer-and-trash treatment.
If you can still read the data from the last time you used the drive, give wipefs a try.
DavidMcCann
Mount it, note the id (e.g. /dev/sdc or whatever), unmount, ...
It doesn't mount.
The reason for telling you to mount it was to see where your computer mounts any usb stick. You don't want to dd zeros all over a hard drive! You could mount a usb stick, see where that goes, unmount it and replace with the one you are trying to repair. But if it doesn't actually mount, then it may well be dead.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.