LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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-03-2006, 10:01 PM   #1
royeo
Member
 
Registered: Jun 2006
Posts: 150

Rep: Reputation: 15
Format a partition fat32


I've been trying to find a way to format a partition fat32 with no luck. I've put out the word on 3 forums and nothing works. mkdosfs is in my /sbin but it doesn't work. I bought Partition Magic just so I could format it fat32. It works at first but over time I lost files and it finally came to Linux not being able to write to that partition. So I decided to format in Linux and try that. I've tried mkdos ... /dev/sda2 and I get the message "command not found". I've tried /sbin/mkdosfs ... /dev/sda2 and I get the message "permission denied". I'm trying to format an existing partition made in Windows. Maybe that's the problem. I don't know how to make a partition in Linux. Can anybody tell me how to make partition in Linux? Do you need to start with unallocated space?

I've heard of a program called "qparted" that will supposedly do the job in a GUI environment but I don't how to get it. It's not on my system and when I do a "yum -y install qparted" it can't find it with my current configuration. If anybody can think of something I'd sure appreciate it.

Thanks,

royeo
 
Old 09-03-2006, 10:19 PM   #2
zhangmaike
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 376

Rep: Reputation: 31
Quote:
I've tried /sbin/mkdosfs ... /dev/sda2 and I get the message "permission denied"
Permission denied means exactly what it says. Your normal user doesn't (and shouldn't) have permission to do this, hence the error. /sbin isn't included in the path of a normal user because a normal user shouldn't run those commands.

Become root, then (as root):
Code:
/sbin/mkdosfs /dev/sda2
Quote:
I'm trying to format an existing partition made in Windows. Maybe that's the problem. I don't know how to make a partition in Linux. Can anybody tell me how to make partition in Linux? Do you need to start with unallocated space?
A partion is a partition, it does not matter in which OS the partition was created.

Last edited by zhangmaike; 09-03-2006 at 10:20 PM.
 
Old 09-03-2006, 10:21 PM   #3
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 62
You can use the mkfs command. /sbin/mkfs -t vfat /dev/sda2
Note it must NOT be mounted yet. Also it might be a good idea to use /sbin/fdisk to blow the partition then create a new one. Also don't forget to set the type of partition before exiting fdisk. One more thing you must be root to use either command.

To learn a little more on mkfs and fdisk use man command.
man fdisk
man mkfs

Brian1
 
Old 09-03-2006, 10:30 PM   #4
sn68
Member
 
Registered: Oct 2005
Distribution: FC5
Posts: 338

Rep: Reputation: 30
Re : Format a FAT32 Parttion

Please check the way your FAT32 parttion is mounted, if it is moounted read only for all users including root, then logging in as root may not help.
First edit the /etc/fstab to mount the partition with rw permissions and then try and format it.
As regards Gparted, download the the relevant rpm file from the website (google gparted) and do "yum -y localinstall gparted", though even with gparted the you will have to mount the partiion with write permissions

Insert following in fstab instead of what is there for that particular partiton, substituting for hda1 & win_c as in your case.

/dev/hda1 /mnt/win_c vfat rw,defaults,umask=0222 0 0

Last edited by sn68; 09-03-2006 at 10:32 PM.
 
Old 09-03-2006, 10:35 PM   #5
zhangmaike
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 376

Rep: Reputation: 31
Quote:
Originally Posted by sandeepnatu
Please check the way your FAT32 parttion is mounted, if it is moounted read only for all users including root, then logging in as root may not help.
First edit the /etc/fstab to mount the partition with rw permissions and then try and format it.
As regards Gparted, download the the relevant rpm file from the website and do "yum -y localinstall gparted", though even with gparted the you will have to mount the partiion with write permissions

Insert following in fstab instead of what is there for that particular partiton, substituting for hda1 & win_c as in your case.

/dev/hda1 /mnt/win_c vfat rw,defaults,umask=0222 0 0
You SHOULD NOT run mkfs on a mounted partition. Formatting (creating a new filesystem with mkfs) does not involve mounting in any way. It is performed on the raw, unmounted partition device.

You do not need to mount a partion to edit the partition table (which is what qparted/gparted/fdisk does), nor do you need to edit the partition table to create a filesystem, unless the partition you intend to run mkfs on does not yet exist (according to your first post, it does).

Last edited by zhangmaike; 09-03-2006 at 11:44 PM.
 
Old 09-03-2006, 11:13 PM   #6
sn68
Member
 
Registered: Oct 2005
Distribution: FC5
Posts: 338

Rep: Reputation: 30
Fat32 partition

zhangmaike

thanks for correcting, my mistake, I was not aware of this
regards
 
Old 09-04-2006, 01:08 PM   #7
royeo
Member
 
Registered: Jun 2006
Posts: 150

Original Poster
Rep: Reputation: 15
Re: How do you format a partition fat32 (vfat)

Quote:
Originally Posted by sandeepnatu
Please check the way your FAT32 parttion is mounted, if it is moounted read only for all users including root, then logging in as root may not help.
First edit the /etc/fstab to mount the partition with rw permissions and then try and format it.
As regards Gparted, download the the relevant rpm file from the website (google gparted) and do "yum -y localinstall gparted", though even with gparted the you will have to mount the partiion with write permissions

Insert following in fstab instead of what is there for that particular partiton, substituting for hda1 & win_c as in your case.

/dev/hda1 /mnt/win_c vfat rw,defaults,umask=0222 0 0

Thank you. I was spelling gparted wrong. I had never heard of it till someone mentioned it and they spelled it with a "q". It might already be installed. Yum doesn't work too well on misspelled files.


I've already used gparted. GUIs are so nice. I can read and write to the partition in Windows.

Roy O'Neill
 
Old 09-04-2006, 01:49 PM   #8
sn68
Member
 
Registered: Oct 2005
Distribution: FC5
Posts: 338

Rep: Reputation: 30
Re: Format FAT32 partition

royeo
nice to know that some good has come out of that post
Regards
 
  


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 do you format a partition fat32 (vfat) royeo Linux - Newbie 4 09-06-2006 11:58 AM
How to format to FAT32, and how to mount my FAT32 partition. bonniehandi Linux - Newbie 16 03-05-2006 08:54 PM
Format Fat32 partition IndigoBlu Linux - General 7 12-31-2005 11:02 AM
Format ext3 partition to FAT32? Moses420ca Linux - Newbie 14 09-16-2005 01:31 PM
I need to format a fat32 partition through a redhat 9 shell rendaimedia Linux - General 1 04-27-2004 10:50 AM


All times are GMT -5. The time now is 10:38 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