how do you format a usb stick in ubuntu server

14,120

Solution 1

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)

Solution 2

If you can connect to the server via ssh and become root on the server (i.e. if you have the permissions required to format partitions), 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:
14,120

Related videos on Youtube

Admin
Author by

Admin

Updated on September 17, 2022

Comments

  • Admin
    Admin over 1 year

    How do you format a usb stick through the terminal?

  • JanC
    JanC over 13 years
    fdisk doesn't do any formatting, it's a partitioning tool.
  • russjr08
    russjr08 over 13 years
    Hmm... I assumed it did. Well I guess the mkfs command does though