Formatting usb pen in Linux

Q. How do I format USB pen in Linux?

Advertisement

A. You can use standard mke2fs command to format usb pen in Linux. mke2fs is used to create an ext2/ext3 filesystem (usually in a disk partition or other USB devices). device is the special file corresponding to the device (e.g /dev/hdXX). blocks-count is the number of blocks on the device. If omitted, mke2fs automagically figures the file system size. If called as mkfs.ext3 a journal is created as if the รขโ‚ฌโ€œj option was specified.

Step # 1: Verify or find out your usb partition name

Type the following command to find out USB pen partition name:

# fdisk -l

Step # 2: Format parition

Once identified the partition name type the following command to format the usb pen in Linux (caution you must select correct usb partition name, otherwise you will loss all the data on hard disk):

# mkfs.ext3 /dev/sda1

To format as VFAT/FAT32 file system type the command:

# mkfs.vfat /dev/sda1

๐Ÿฅบ 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.

12 comments… add one
  • Mohammad Etemaddar Apr 26, 2014 @ 17:00

    Cyberciti, You are great!

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.