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 09-05-2008, 02:53 PM   #1
ufmale
Member
 
Registered: Feb 2007
Posts: 385

Rep: Reputation: 30
format FAT32 in linux


I have an drive with enclosure that I want to be able to
read/write in both linux and windows.

Can we create partition and format this drive with FAT32?
Is this the format usuall used by the USB external drive?
what command I should use to do that?
 
Old 09-05-2008, 03:21 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
Yes, you can format a disk using the FAT32 filesystem in linux.

Your distro may have a disk partitioning program that can make it easy as well.

First use fdisk if the drive needs to be partitioned. Let's suppose that it uses /dev/sdc1.
sudo mkfs.vfat -i VOLUME_ID /dev/sdc1
will make the filesystem. The volume_id is optional, but I would recommend it. That way you can use "LABEL=<VOLUME_ID>" as the device in /etc/fstab. When you insert an external drive, it may get a different device node. Using "LABEL=" or "UUID=" to identify the drive will keep you from having to rewrite your /etc/fstab file if that is the case.

Please see the "man mkfs.vfat" man page for more options.

I guess there are different types of FAT and depending on the size of the device, FAT16 or FAT32 might be selected, by you don't need to worry about it. Just let the program select what will work.

The only difference I can think of is that Windows XP may refuse to format a partition above a certain size. So, suppose you purchase a very large external drive that uses the fat32 filesystem. You won't be able to format some external drives in Windows but you can in Linux. But Windows can use the drive. That is the only difference I know of.

You will want to use the drive for storage and not to run off of. The FAT filesystem doesn't store the ownership, permissions or ACLs that Linux uses, and the permissions and ownership are created enmass for the entire files system when you mount (using fmask= and dmask= in /etc/fstab or the mount command). KDE will allow you to change this as well, by changing properties in the popup dialog. ( I don't use gnome, but it probably is the same )

Last edited by jschiwal; 09-05-2008 at 03:28 PM.
 
Old 09-05-2008, 03:25 PM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Don't forget to use the -F32 option of mkdosfs (or mkfs.vfat which on many system is a link to mkdosfs) if you really want a FAT32 filesystem, otherwise it will be formatted as FAT16.
 
Old 09-05-2008, 04:33 PM   #4
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Fat16 is limited by design to 2gb max size. So, anything bigger will be formated as fat32 (or will not be formated at all.

Note that fat32 has an annoying file size limit, which might or might not suit you: ~4gb. If you need bigger files, or simply, a better fs overall, use ntfs. The ntfs3g drivers can be used in linux to access it in full r/w mode.
 
Old 09-06-2008, 04:28 AM   #5
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285
Quote:
Originally Posted by i92guboj View Post
Note that fat32 has an annoying file size limit, which might or might not suit you: ~4gb. If you need bigger files, or simply, a better fs overall, use ntfs. The ntfs3g drivers can be used in linux to access it in full r/w mode.
Yes, but is it safe ? I would instead recommend using ext2 or ext3 and the Window$ drivers for it.

Last edited by H_TeXMeX_H; 09-06-2008 at 04:29 AM.
 
Old 09-06-2008, 05:04 AM   #6
Techmeology
LQ Newbie
 
Registered: Aug 2006
Distribution: Arch
Posts: 16

Rep: Reputation: 0
I agree with H_TeXMeX_H. Windows drivers, and ext2 or ext3 is probably the best option. There are a few good drivers:
http://www.fs-driver.org/
and
http://www.ext2fsd.com/
 
Old 09-06-2008, 11:50 AM   #7
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
I agree. I've been using ext2fsd for long time without any problem. Moreover, one of the most annoying things about FAT is that it does not store permissions, and every file ends up with 777.
 
Old 09-06-2008, 12:25 PM   #8
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by H_TeXMeX_H View Post
Yes, but is it safe ? I would instead recommend using ext2 or ext3 and the Window$ drivers for it.
From my experience, yes. The kernel ntfs driver is not, and has very lacky support for writing. The ntfs3g driver is stable, it's also actively developed and frequently updated. And works very well.

I can't comment on the ext2/3 stuff for windows though. If it's stable it will be a better option because it will integrate better with the linux user/group/permissions schemes.
 
Old 09-06-2008, 12:29 PM   #9
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 115Reputation: 115
There is no reason at all to use FAT for anything these days, except in the case where the drive might be plugged into an old Win95/98/ME machine.

FAT is well past its "sell by" date. It was fine in the days when 360K floppies were the normal means of storing information, but it is grossly inadequate today. It wastes a lot of space, it is insecure, it is not tolerant of faults.

Given that Linux can read/write NTFS (a very robust file system) and Windows can read/write ext2/3 (another very robust filesystem) there is no good reason to use FAT for anything.
 
Old 09-06-2008, 01:18 PM   #10
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285
Also, if you want to use NTFS, ntfs3g has been obsoleted by ntfsmount:
http://www.linux-ntfs.org/doku.php?id=ntfsmount
 
Old 09-06-2008, 06:28 PM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,839

Rep: Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822
I made that mistake too about ntfsmount and -3g; read the discussion that ensued here.
 
Old 09-06-2008, 06:44 PM   #12
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by H_TeXMeX_H View Post
Also, if you want to use NTFS, ntfs3g has been obsoleted by ntfsmount:
http://www.linux-ntfs.org/doku.php?id=ntfsmount
Let the user decide. Ntfs-3g is not obsoleted. As I said above, it's very actively maintained and it always worked without any major glitch.

It's been not even a month since the last release. Odd for an "obsoleted" project, I'd say.

EDIT: In my humble opinion, it's the maintainer of the project the one to say if it's obsoleted/unmaintained, and not anyone else. I could start a web site tomorrow declaring both projects obsoleted, in favor of mine, that doesn't make it real, though.

Last edited by i92guboj; 09-06-2008 at 06:47 PM.
 
  


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 FAT32 > 32Gb in Linux for share with XP akafitz Linux - Newbie 1 07-06-2006 06:42 PM
How to format to FAT32, and how to mount my FAT32 partition. bonniehandi Linux - Newbie 16 03-05-2006 08:54 PM
How do I format 250 GB with FAT32 in Linux? Raveolution Linux - Hardware 1 10-05-2005 10:30 AM
use linux to format a FAT32 Hard Disk ? qwijibow Linux - Newbie 4 08-29-2003 09:38 PM
How to format my linux drive back to fat32 Underworld135 Linux - Newbie 5 10-19-2001 10:42 AM


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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration