LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-16-2006, 07:33 AM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Rep: Reputation: 56
How to format FAT32 on pendrive


Hi folks,

I have a pendrive with 2 partitions, sda1 and sda2 respectively.

I ran
# mkdosfs -F 32 /dev/sda1
# mkdosfs -F 32 /dev/sda2

They went through without complaint.

On running
# fdisk -l /dev/sda
Code:
Disk /dev/sda: 1007 MB, 1007419392 bytes
31 heads, 62 sectors/track, 1023 cylinders
Units = cylinders of 1922 * 512 = 984064 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         814      782223   83  Linux
/dev/sda2             815        1023      200849   83  Linux
They were still on Linux FS.

Tried FAT16 with the same result.

I must run "fdisk /dev/sda" to get FAT16 FS on them. Please advise what is the trick behind and how to format them as FAT32.

TIA

B.R.
satimis
 
Old 03-16-2006, 08:13 AM   #2
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 48
There's two steps to formatting: First you create the right type of partition, then you format the partition.

You can't format a Linux partition with FAT. You need to delete both partitions & create new FAT partition(s) with fdisk, cfdisk, or other partitioner. THEN run mkdosfs on them.
 
Old 03-16-2006, 08:42 AM   #3
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi oneandoneis2,

Tks for your advice.

Quote:
There's two steps to formatting: First you create the right type of partition, then you format the partition.
Partitions were created first but without FS. Because I tried running mkdosfs to create FAT32 on the partitons.

Quote:
You can't format a Linux partition with FAT.
How can I create FAT32 on the partitions of the pendrive? "fdisk" only has hidden FAT32.

B.R.
satimis
 
Old 03-16-2006, 09:21 AM   #4
overlord73
Member
 
Registered: Apr 2004
Location: ..where no life dwells..
Posts: 541

Rep: Reputation: 30
hello satimis,
in fdisk (fdisk /dev/sda), the command l gives you a list of available filesystems.
try type "b"
 
Old 03-16-2006, 09:39 AM   #5
krasl
Member
 
Registered: Nov 2005
Distribution: Fedora 4
Posts: 40

Rep: Reputation: 15
Here are the steps. I just did this with a removable USB drive.
NOTE: This will wipe out any existing data on the removable drive!

1. fdisk /dev/sda
2. press 'p' to print the partitions (make sure you're looking at the right drive!)
3. press 'd' to delete a partition
4. if prompted, press '1' to select first partition.
5. press 'd' again and the other partition will be immediately deleted.
6. press 'n' to add a new partition
7. press 'p' to select "primary"
8. enter partition number '1'
9. select the bounds for the partition (it would be easiest to just hit 'enter' on each option.)
10. after creating the partition, press 't' to change the partition's type.
11. enter type number 0c
optionally, type 'p' to view the partition table and ensure that the type is FAT32
12. write the changes to the disk; type 'w'
13. fdisk will quit after saving changes.
14. run mkfs -t vfat /dev/sda1
This creates the file system.
15. create a directory where you want to mount the drive
16. mount the drive: mount -t vfat /dev/sda1 /[your directory name here]
Be sure to umount the drive before removing it to avoid losing data!

Krasl

Last edited by krasl; 03-16-2006 at 09:41 AM.
 
Old 03-16-2006, 07:42 PM   #6
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi krasl,

Tks for your detail advice.

Quote:
11. enter type number 0c
optionally, type 'p' to view the partition table and ensure that the type is FAT32
Command (m for help): p
Code:
Disk /dev/sda: 1007 MB, 1007419392 bytes
31 heads, 62 sectors/track, 1023 cylinders
Units = cylinders of 1922 * 512 = 984064 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         814      782223    c  W95 FAT32 (LBA)
/dev/sda2             815        1023      200849    c  W95 FAT32 (LBA)
Quote:
14. run mkfs -t vfat /dev/sda1
This creates the file system.
After running;
mkfs -t vfat /dev/sda1
mkfs -t vfat /dev/sda2

# fdisk -l /dev/sda
Code:
Disk /dev/sda: 1007 MB, 1007419392 bytes
31 heads, 62 sectors/track, 1023 cylinders
Units = cylinders of 1922 * 512 = 984064 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         814      782223    c  W95 FAT32 (LBA)
/dev/sda2             815        1023      200849    c  W95 FAT32 (LBA)
It looks the same as above, still "W95 FAT32"

I have been running to the same situation before. I can't get FAT32 FS. It frustrated me.

B.R.
satimis
 
Old 03-16-2006, 07:48 PM   #7
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi overlord73,

Tks for your advice.

Quote:
in fdisk (fdisk /dev/sda), the command l gives you a list of available filesystems.
try type "b"
On the list, "b" is "Win95 FAT32" not for Linux. I can't find FAT32 there.

B.R.
satimis
 
Old 03-16-2006, 07:53 PM   #8
krasl
Member
 
Registered: Nov 2005
Distribution: Fedora 4
Posts: 40

Rep: Reputation: 15
Question

Quote:
Originally Posted by satimis
Hi krasl,

Tks for your detail advice.


Command (m for help): p
Code:
Disk /dev/sda: 1007 MB, 1007419392 bytes
31 heads, 62 sectors/track, 1023 cylinders
Units = cylinders of 1922 * 512 = 984064 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         814      782223    c  W95 FAT32 (LBA)
/dev/sda2             815        1023      200849    c  W95 FAT32 (LBA)

After running;
mkfs -t vfat /dev/sda1
mkfs -t vfat /dev/sda2

# fdisk -l /dev/sda
Code:
Disk /dev/sda: 1007 MB, 1007419392 bytes
31 heads, 62 sectors/track, 1023 cylinders
Units = cylinders of 1922 * 512 = 984064 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         814      782223    c  W95 FAT32 (LBA)
/dev/sda2             815        1023      200849    c  W95 FAT32 (LBA)
It looks the same as above, still "W95 FAT32"

I have been running to the same situation before. I can't get FAT32 FS. It frustrated me.

B.R.
satimis


Sorry, but I'm not clear on what you're trying to do.
Yes, it says W95 FAT32, but either Linux or Windows can mount/read/write this partition.
To mount in Linux, all you have to do is mount -t vfat /dev/sda1 /[mountpoint]
Or connect to a Windows (98SE or later) system and it should mount also.

Yes, after running mkfs it SHOULD still look the same. It is simply formatting the partition (creating the filesystem on an "empty" partition). So within fdisk, you should see exactly the same thing before and after you run mkfs.

What exactly are you wanting to do here? There is no such thing as a native Linux FAT32 partition, to my knowledge, because FAT32 is a M$ technology. (You gurus out there correct me if I'm wrong about this!) But Linux reads/writes the FAT32 filesystem just fine.

Krasl

Last edited by krasl; 03-16-2006 at 07:55 PM.
 
Old 03-16-2006, 08:23 PM   #9
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi krasl,

Tks for your advice.

Quote:
What exactly are you wanting to do here?
I have DSL 2.2b installed on a pendrive which was formated on FAT16 ZIP geometry. It can be booted on USB-ZIP option (BIOS) and failed on USB-HDD. I also tried format the pendrive FAT16 without zip geometry. It still failed to boot on USB-HDD.

USB-HDD supports FAT32 therefore I tried to make another test with the pendrive formatted as FAT32.

That is the story.

B.R.
satimis
 
  


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
How to format to FAT32, and how to mount my FAT32 partition. bonniehandi Linux - Newbie 16 03-05-2006 07:54 PM
Converting a pendrive to FAT32 TMH Linux - Hardware 7 03-04-2005 09:24 AM
Syntax for FAT32 format please? jhecht Linux - Software 3 08-17-2004 09:47 AM
FORMAT the FAT32 partitions??? Pakiman Linux - General 5 09-16-2003 06:12 PM
Does mke2fs format in FAT32 format? blueleft Linux - General 2 08-09-2003 08:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:53 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
Open Source Consulting | Domain Registration