November 24, 2010

Fomat USB Pen drive in Linux

Hi everyone,
Lot of my friends asked me that how to format pendrive in Linux.
There are many methods to format pendrive.

Solution1: 
1) Open command prompt and enter into root or su mode.
   $ sudo -su ( In Ubuntu )
   $ su - ( In RedHat )
2) Identify to which device file the pendrive is mounted
    # dmesg | tail
3) Mostly it will be sda or sdb or sdc with some number.
4) Unmount the device file on which the pendrive mounted
   # umount /dev/sdb
   Note: Please change the sdb with your above identified device file
5) Now, we can format the pendrive
   # mkfs.vfat -n 'Label' -I /dev/sdb
   Note: vfat indicates FAT32 filesystem, ext3 indicates EXT3 filesystem.
   Please change the Label with your own Label.

Solution2: 
1) Open command prompt and enter into root or su mode
   $ sudo -su ( In Ubuntu )
   $ su - ( In RedHat )
2) Identify to which device file the pendrive is mounted
   # df
3) Mostly it will be sda or sdb or sdc with some number.
4) Unmount the device file on which the pendrive mounted
   # umount /dev/sdb
   Note: Please change the sdb with your above identified device file
5) Now, we can format the pendrive
   # /sbin/mkdosfs -F32 -I /dev/sdb 

Solution3:
We can format the pendrive using GUI tool also.

1) Open command prompt and enter into root or su mode
   $ sudo -su ( In Ubuntu )
   $ su - ( In RedHat )
2) Install GParted software
   # apt-get install gparted ( Ubuntu )
   For Redhat, Please download the GParted RPM from http://packages.sw.be/gparted/
   Then install the RPM Package
   # rpm -ivh gparted-version.rpm
   Note: Please change the version with your downloaded file version
3) Open the GParted tool
4) Select the drive
5) Choose Partition menu -> Format to -> any file system ( ex: fat32 )
   Note: Many filesystem options are available in Format to submenu.


Note: Please send your feedback and comments to me.

No comments:

Featured Post

Java Introdcution

Please send your review and feedback to psrdotcom@gmail.com