When we don't have a graphical tool like GParted or the option to format memories as in Gnome, we can use a command that actually does the same thing as the two tools mentioned above.
The first thing we have to do is make sure we have the package installed dosfstools.
$ sudo aptitude install dosfstools
Once installed, we will check where our flash memory is located. We can use the command:
$ sudo fdisk -l
Which will return something like this:
The line that interests us is the one that says:
/dev/sdc1 * 62 7983863 3991901 b W95 FAT32
Once we know which device to format is, we use the command:
sudo mkfs.vfat -F 32 -n Mi_Memoria /dev/sdc1
With option -F32 we tell you that it will be formatted as fat32, and with the option -n We put a label or name to the device.
Simple right?
Edito: I forgot to say that to execute this operation, the device has to be unmounted.
mmm I do it in another way:
mkdosfs ("-n", "MI-PENDRIVE", "-v", "/dev/sdb1")
-n let me name or label the USB device.
-v it will indicate which device is the one to be formatted.
You have to run it without quotes and parentheses I imagine
I found on the net this link from where you can get the deb package to install, I tried it and it works very well.
https://sites.google.com/site/kubuntufacil/formatear-memorias-usb-en-kubuntu
I hope it is useful for you.
Because we are in Cuba, we do not have access to Google sites or code.google or anything like that, if you can download the soft and send it to kzkggaara@myopera.com 😀
KZKG ^ Gaara, friend, one question, how could I rename a device without formatting? You are looking at the command string and I thought about that.
Have you tried tor….?
I already sent it to you by Gmail, let me know if you do not receive it to send it by another mail.
Yep it came to me, and I answered you with a question 😉
Thanks really friend 😀
The documentation that we can have here is very good ...
Thanks for the comment CubaRed. A pleasure to have you here.
regards
Thanks for the comment and welcome to the site 😉
I'm running from Slax Linux (Live CD of course: P) and use the following command:
mkfs -T -F32 / dev / sda
/ dev = mount point
/ sda = drive or removable media
Regards!
Genie, you saved my life.
Years go by and I keep checking the post xD.
Good tuto elav.
Regards!
Hahaha thanks
Well, nothing, there is no way, neither by gparted nor in console with your option: it answers me:
mkfs.vfat: unable to open / dev / sdg1: Read-only file system
You have to have the dosfstools package installed, to be able to format in the terminal, as if you are in a Gnome environment you can use the Disks utility is very easy.
I thought it was a little more complicated, with the tutor it has become easier.
Thanks, after searching in several places, I was able to repair it with this info, I put the command sudo mkfs.vfat -F 32 -n My_Memory / dev / sdx then I opened gparted and formatted it to fat32, and now it works great, everything is dung had happened to take the pen to a printing with windous. I hope I don't make that mistake again.
Greetings, good blog.
Friend Elav and Linux users,
Thank you ! It has been 2 years since you wrote this and in each site they say something different, most do not work, are inaccurate or steps are missing. It would be nice if the correct solutions like this appear somewhere so you don't go crazy trying things that don't work. I take note of this blog. Cheers
The truth is that I did the steps that elav shows us, today, and I revived my 16GB pendrive ... thanks elav, your knowledge is very timely ... 🙂
Brother I love you. Thank you very well explained
In the command:
mkfs.vfat -F 32 -n My_Memory / dev / sdc1
need to use "-I" so that it can overwrite the usb partition.
I found another option that is also very well explained in http://wp.me/p2mNJ6-3I
How great!
This tutorial saved me in an important way !!!
Someone knows how to make a bottable usb with a linux iso image of more than 4 Gb since for Fat 32 this image is no longer possible, someone could guide me how to prepare the usb, greetings and thanks
check unetbootin or clonezilla
Hello, look, I have a USB that I cannot format, since it is with write-only permission, I already tried with gparted and nothing, I would recommend some software, the memory recognizes it, I can see what is in the memory, I can copy from memory to pc, but not from pc to memory since I get that the destination is read-only, please. If you have the knowledge, give me a hand. cheers ...
I also have the same problem, apparently some malware on another computer changed the memory to read-only and the content cannot be erased or even formatted or with linux not with windows, I followed several tutorials with console commands that supposedly solve it and nothing , nothing can be done with the memory, does anyone know how to recover the use of the usb memory with this problem?
Hello Isaac!
Sometimes that has happened to me. It has worked for me, with gparted, to use the option to "destroy" (not just delete it) the partition and then create a new partition table. Sometimes I have to remove and reconnect the memory so that I can create the new table.
I hope you serve.
The problem is that this formats in b W95 FAT32 but with my old windows XP it does not read the pendrives, I have to format them in another way with the format c W95 FAT32 (LBA)
None of these instructions helped me, I don't know where the problem is.
thanks, I always consult it
Hi. If you can help me to format the machine please
You need to unmount the usb drive with the umount command to be able to format
Hello I have a USB that the system does not recognize, I send you the information if you can help me thanks
dmesg
[83384.348839] USB 1-1: New High-Speed USB Device Number 8 Using EHCI-PCI
[83384.506219] usb 1-1: New USB device found, idVendor = 0c76, idProduct = 0005, bcdDevice = 1.00
[83384.506225] usb 1-1: New USB device strings: Mfr = 1, Product = 2, SerialNumber = 0
[83384.506228] usb 1-1: Product: USB Mass Storage
[83384.506231] usb 1-1: Manufacturer: GENERIC
[83384.506848] usb-storage 1-1: 1.0: USB Mass Storage device detected
[83384.508235] scsi host5: usb-storage 1-1: 1.0
[83385.524951] scsi 5: 0: 0: 0: Direct-Access GENERIC USB Mass Storage 1.00 PQ: 0 ANSI: 2
[83385.556757] sd 5: 0: 0: 0: Attached scsi generic sg3 type 0
[83385.561706] sd 5: 0: 0: 0: [sdc] Attached SCSI removable disk
root @ localhost: ~ # fdisk -l
Disk / dev / sda: 698.7 GiB, 750156374016 bytes, 1465149168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical / physical): 512 bytes / 4096 bytes
I / O size (minimum / optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 995F9474-C5F1-4EE9-8FD7-13EA790423DC
Device Start End Sectors Size Type
/ dev / sda1 2048 1050623 1048576 512M EFI System
/ dev / sda2 1050624 49879039 48828416 23.3G Linux filesystem
/ dev / sda3 49879040 69410815 19531776 9.3G Linux filesystem
/ dev / sda4 69410816 76107775 6696960 3.2G Linux swap
/ dev / sda5 76107776 80013311 3905536 1.9G Linux filesystem
/ dev / sda6 80013312 1465147391 1385134080 660.5G Linux filesystem
root @ localhost: ~ # fdisk -l / dev / sdc
fdisk: cannot open / dev / sdc: No medium found
root @ localhost: ~ # hdparm / dev / sdc
/ dev / sdc:
SG_IO: bad / missing sense data, sb []: f0 00 02 00 00 00 00 0b 00 00 00 00 3a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
multicount = 0 (off)
readonly = 0 (off)
readahead = 256 (on)
root @ localhost: ~ # hdparm -C / dev / sdc
/ dev / sdc:
drive state is: standby
root @ localhost: ~ # hdparm -I / dev / sdc
/ dev / sdc:
SG_IO: bad / missing sense data, sb []: f0 00 02 00 00 00 00 0b 00 00 00 00 3a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ATA device, with non-removable media
Standards:
Likely used: 1
Configuration:
logical max current
cylinder 0 0
heads 0 0
sectors / track 0 0
—
Logical / Physical Sector size: 512 bytes
device size with M = 1024 * 1024: 0 MBytes
device size with M = 1000 * 1000: 0 MBytes
cache / buffer size = unknown
capabilities:
IORDY not likely
Cannot perform double-word IO
R / W multiple sector transfer: not supported
DMA: not supported
IOP: pio0