Ubuntu Linux format USB pen drive

Q. How do I format a USB pen drive under Ubuntu Linux for ext3 file system?
A. You can format USB pen drive with the help of following commands:

Advertisement

[a] fdisk : Partition table manipulator for Linux

[b] mkfs.ext3 : Create an ext2/ext3 filesystem by formatting given partition name (/dev/partition)

e2label : Change the label on an ext2/ext3 filesystem

First make sure USB pen is not mounted. Click on Places > Computer > Select USB pen > Right click > Select Unmount Volume.

Let us assume that /dev/sda1 is your partition name for USB pen. To format type the following command (Open X terminal and type the command)
$ sudo mkfs.ext3 /dev/sda1
Caution: Careful while entering device/partition name; wrong name can wipe out entire hard disk!!!
Now use e2label command to change the filesystem label on the ext3 filesystem located on device /dev/sda1:
$ sudo e2label /dev/sda1 usb-pen
You can also create an MS-DOS/Windows XP file system under Linux, enter:
$ sudo mkfs.vfat /dev/sda1

Now you are ready to use USB pen.

🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

57 comments… add one
  • Tajka Jun 17, 2013 @ 3:51

    Thanx a lot….really helpful and easy :3

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.