Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How do you format a usb stick through the terminal?

share|improve this question
add comment

3 Answers

You can use the fdisk command.

You can also use the mkfs command

Here is a link on using the fdisk command in Ubuntu

Using mkfs in Ubuntu (here)

share|improve this answer
1  
fdisk doesn't do any formatting, it's a partitioning tool. –  JanC Oct 26 '10 at 1:00
    
Hmm... I assumed it did. Well I guess the mkfs command does though –  russjr08 Oct 27 '10 at 22:44
add comment

If you can connect to the server via ssh and become root on the server, then you can use the Ubuntu standard Disk Utility over ssh to manage disks just like you would on your desktop/laptop computer. Just start up the disk utility on your local computer and go to File -> Connect to Server, and type in the ssh name of your server.

I like using the Disk Utility because it won't let you do silly data-destroying things like formatting mounted filesystems, or resizing partitions without first resizing the underlying filesystem.

I don't know if the packages required for this are installed in Ubuntu Server by default, and I don't remember what they are. If anyone does know, please edit or comment.

share|improve this answer
add comment

with:

cat /proc/partitions

you can see all detected partitions by the kernel, to format the "right" one

with:

mkfs.vfat /dev/

will format with fat32 file system

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.