How to reformat a USB stick in Ubuntu
I would like to know if there is any possible way for me to wipe everything on my USB stick and reformat it to its original state.
I am asking this because there are some files that I am unable to erase by simply putting them in the trash, everytime I try this the erasing files window hangs and nothing happens. I already backed up all my crucial files and now I want to just want to clean this drive and free it of the junk files I dont need. one last thing, I want to format it so that it can be used with windows and Ubuntu, I think it is the fat32, or whatever the default is on most usb sticks. thanks, |
Most usb "sticks" use fat16 actually, not fat32, but it shouldn't matter. Let's think your usb stick had the device file /dev/sda (otherwise change that):
Code:
dd if=/dev/zero of=/dev/sda To create a fat filesystem on the device you could use something like this, for example: Code:
mkfs.vfat /dev/sda |
Ok just to make sure I dont screw something up,
I clicked on the USB drive icon on the desktop and went to properties, I looked at the volume information and it says this: Mountpoint: /media/LexarMedia Filesystem: vfat judging from this does it mean that I can use the /dev/sda/ command you told me? |
That information doesn't tell you much, but
Code:
mount | grep LexarMedia When starting to do the dd thing, umount the device; don't eject it, it has to be present on the system, but umount it so that the filesystem is not in use: Code:
umount /dev/sda1 Code:
dmesg EDIT: if you go on with 'sda1' and your device was called something else, like 'sda4', it doesn't harm unless there actually is a connected device that is 'sda1'. If the device is not present, you'll simply get an error. However if you had two usb sticks for example, or had a sata harddisk, then it would possibly produce an unwanted result. If you don't have sata harddisks and you only have that one usb stick plugged in, it's very probably /dev/sda1, but if there are other USB or SATA devices connected, it might not. About these device namings: sda = primary usb or sata disk sdb = secondary usb or sata disk hda = primary ide harddisk hdb = secondary ide harddisk sda1 = first partition of the primary usb/sata disk hdb3 = third partition of the secondary ide harddisk etc....got it? |
Ok I got this error message:
Code:
chacmool@link:~$ mkdosfs /dev/sda Code:
chacmool@link:~$ -I So now what should I do? should I restart the whole process? |
OK I did it now,
thanks for the help, all I had to do to make it reformat it was this: Code:
chacmool@link:~$ mkdosfs /dev/sda -I :) :) :cool: |
mkdosfs /dev/sda1?
edit- nevermind but sda1 is the actual partition |
All times are GMT -5. The time now is 12:53 PM. |