I have a usb thumb drive that I want to reuse.
How can I format it?
There are lots of different ways to do this.
You don't necessarily need to ‘format’ (i.e. make a filesystem — you can't format USB sticks in the corrects sense of the word) the stick if you just want to delete all files.
Assuming the stick is mounted under
You will not be asked to confirm! This won't touch hidden files (recycling bin folders from Windows or Mac, etc).
If you want a pristine filesystem, make sure the filesystem is unmounted first:
This will make a FAT filesystem. If you need an NTFS filesystem, there's always
Fire up the KDE Partition Manager (if you don't have it, the Debian/Ubuntu package name is a slightly non-standard
Use the Gnome Disk Utility (Palimpsest). It's quite trivial to use: just select your USB drive from the left. If it has a partition already, click the ‘Format’ button. Otherwise, there's a ‘Format Drive’ button which'll do everything for you.
Ask Ubuntu has this exact question already answered: How to format USB or external drive in 11.10? — note how this just walks you through using the Palimpsest Disk Utility.
My own favourite GUI tool for this job is GParted. It does everything you need (except, sadly, LVM and encryption) and it's user friendly to boot.
To (re)create a filesystem, use one of the mkfs family of tools. Choose the one based on what filesystem you want; the most common ones are:
You'll need to find out the name of the device that the drive is plugged into. Under Linux, removable drives usually have names like
On many systems, these tools live in
To create a new filesystem, run the
Remember to put the right partition number. If you're running Linux and you have a single hard drive and no other connected external drive, the device is usually
Make very very sure that you pick the right device name, as this will erase all data with no hope of recovery.
Note that while this will erase the data with no possibility of recovery by ordinary software means, it may leave traces behind that can be recovered with some electronic work. See Is it enough to only wipe a flash drive once?. The only paranoia-compliant way of erasing data on a flash drive is to have encrypted it in the first place, and destroy all copies of the key.
Have a look at the