LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 01-20-2009, 03:28 AM   #1
chrischristian
Member
 
Registered: Jan 2009
Posts: 45

Rep: Reputation: 16
How to format pendrive in FAT32 format


Does any one know how to format pendrive in FAT 32 format in Debian, I tried Gparted but it have ext3, ext2 and swap format only .
 
Old 01-20-2009, 03:31 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Use (c)fdisk to create the partitions and then mkfs to format them.
 
Old 01-20-2009, 04:07 AM   #3
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
After running fdisk or cfdisk to create a partition as suggested by Nylex, you can use the mkfs.vfat command. Be careful to specify -F32 on the command line, otherwise you will end up with a FAT12 or a FAT16 filesytem. Here is an excerpt from man mkfs.vfat explaining this issue:
Code:
-F FAT-size
    Specifies the type of file allocation tables used (12, 16 or 32 bit). 
    If nothing is specified, mkdosfs will automatically select between
    12 and 16 bit, whatever fits better for the file system size.
    32 bit FAT (FAT32 format) must (still) be selected explicitly
    if you want it.
 
Old 01-20-2009, 04:49 AM   #4
chrischristian
Member
 
Registered: Jan 2009
Posts: 45

Original Poster
Rep: Reputation: 16
Is not there graphic based more safe way to do this ?, one have to be very careful of will format wrong drive .
 
Old 01-20-2009, 04:54 AM   #5
SqdnGuns
Member
 
Registered: Aug 2005
Location: Fountain Valley, CA / Thailand
Distribution: Slackware64 14.0
Posts: 981

Rep: Reputation: 88
Quote:
Originally Posted by chrischristian View Post
Is not there graphic based more safe way to do this ?, one have to be very careful of will format wrong drive .
Attention to detail, don't FEAR the CLI, it's your best friend.
 
Old 01-20-2009, 05:48 AM   #6
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
Quote:
Originally Posted by chrischristian View Post
Is not there graphic based more safe way to do this ?, one have to be very careful of will format wrong drive .
If your main concern is about partitioning you can always use gparted to partition the pen drive. Then go to the command line to run the mkfs.vfat command only.

About fdisk usage, don't be afraid. Just read a good tutorial about partitioning using fdisk (plenty of them online, but you can start from the official Partition HOWTO) then first check the list of drives using
Code:
# fdisk -l

Disk /dev/hdc: 122.9 GB, 122942324736 bytes
255 heads, 63 sectors/track, 14946 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdc1   *           1          26      208813+  83  Linux
/dev/hdc2              27         392     2939895   83  Linux
/dev/hdc4             393       14946   116905005    f  W95 Ext'd (LBA)
/dev/hdc5             393        1667    10241406   83  Linux
/dev/hdc6            1668        1928     2096451   82  Linux swap / Solaris
/dev/hdc7            1929        2183     2048256   83  Linux
/dev/hdc8            2184        2221      305203+  83  Linux
/dev/hdc9            2222       14946   102213531   83  Linux

Disk /dev/sda: 2055 MB, 2055208960 bytes
255 heads, 63 sectors/track, 249 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         250     2007008+   6  FAT16
This is an example of a list on my current machine with a 2Gb pen drive inserted. You can easily locate the name of the device looking at its size (highlighted in red in the example above). Then simply run the command
Code:
fdisk name_of_the_device
then type the relevant interactive commands to create a partition on that device. In my example above the command would have been fdisk /dev/sda. Most likely on your system /dev/sda is the main disk, so you will have the pen drive as /dev/sdb OR /dev/sdc and so on. If you double check the fdisk command line before pressing enter, you can safely proceed being sure the other drives rest untouched.
 
Old 01-20-2009, 07:13 AM   #7
chrischristian
Member
 
Registered: Jan 2009
Posts: 45

Original Poster
Rep: Reputation: 16
formating it to FAT32 gives "FAT32 is not supported by your system" when reinserted. So can I use ex2 will it work on any windos sys ? Why I always have one "lost+found" folder on pendrive ? it is of 1025MB (1GB) but it always show 49MB used ???
 
Old 01-20-2009, 07:32 AM   #8
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,758

Rep: Reputation: Disabled
1. gparted should be able to format it in fat32 (=vfat)

2. or use the parted magic cd

3. qtparted is another gui option

ext2 is more efficient on pendrives...esp if they are 'large'
and you want to put 'large' files in them

#man mkfs.ext2
 
Old 01-20-2009, 07:32 AM   #9
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,758

Rep: Reputation: Disabled
1. gparted should be able to format it in fat32 (=vfat)

2. or use the parted magic cd

3. qtparted is another gui option

ext2 is more efficient on pendrives...esp if they are 'large'
and you want to put 'large' files in them

#man mkfs.ext2
 
Old 01-20-2009, 08:04 AM   #10
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
Quote:
Originally Posted by chrischristian View Post
formating it to FAT32 gives "FAT32 is not supported by your system" when reinserted.
Which exact command line did you issued to format the pen drive to fat32? Also to be more helpful, let us see the output of fdisk -l with the pen drive inserted.
Quote:
So can I use ex2 will it work on any windos sys ? Why I always have one "lost+found" folder on pendrive ? it is of 1025MB (1GB) but it always show 49MB used ???
ext2 filesystem can be managed by windows if you have a ext2/ext3 tool installed. One of the most reliable is Ext2IFS and it has full plug-n-play functionality.

The lost+found directory is always created on a ext2/ext3 filesystem. It is the place where chunks of corrupted files are stored in order to rescue them. Regarding the used space, it is normal that the filesystem reserves some space for its functionality. The used space increases when the filesystem uses journaling: this is the default for ext3 formatting but can be explicitly set for ext2 as well.
 
Old 01-20-2009, 08:47 AM   #11
chrischristian
Member
 
Registered: Jan 2009
Posts: 45

Original Poster
Rep: Reputation: 16
O.K. that satisfies me , as far as FAT32 is concerned I'm not going to use it as Debian does'nt support it. Thanks for replies.
 
Old 01-20-2009, 08:56 AM   #12
jmite
Member
 
Registered: Jun 2008
Distribution: Ubuntu
Posts: 266

Rep: Reputation: 36
Just out of curiosity, where did we get the notion that Debian doesn't support Fat32? I used gparted to format my pendrive to Fat32, and it's readable in windows, mac, debian, ubuntu, gentoo...etc.
 
Old 01-20-2009, 09:01 AM   #13
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid
Posts: 4,734
Blog Entries: 12

Rep: Reputation: 457Reputation: 457Reputation: 457Reputation: 457Reputation: 457
FAT32 works just fine with any Linux.

There are actually many ways of formatting a USB flash drive in Linu

The quick 'n' easy way:

First establish what your stick is. It'll probably be sda1 - but check anyway by looking at the results of the following command (you need to be root to do this):

# fdisk -l

Assuming it is sda1, you'll need to unmount the flash disk, so:

# umount /dev/sda1

Once done, enter the following command to format the flash device to FAT32

# mkdosfs -F 32 -I /dev/sda1

Needless to say, you'll lose everything on the disk so be sure that sda1 really is the flash disk in question! Best switch off any external drives first, just to be sure!

USB Flash Memory HOWTO
http://tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
format in FAT32 varunkant Linux - Newbie 5 06-13-2008 03:08 PM
Trying to format fat32 royeo Linux - Newbie 3 09-03-2006 04:33 AM
How to format FAT32 on pendrive satimis Linux - Software 8 03-16-2006 09:23 PM
How to format to FAT32, and how to mount my FAT32 partition. bonniehandi Linux - Newbie 16 03-05-2006 08:54 PM
Does mke2fs format in FAT32 format? blueleft Linux - General 2 08-09-2003 09:03 AM


All times are GMT -5. The time now is 12:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration