# Formatting a usb pen in fat32 using mkdosfs



## NucleusKore (Dec 27, 2008)

After unmounting the pendrive, and using fdisk to set the partition as W95 FAT32, I used the following command

sudo mkdosfs -F 32 /dev/sdb1

Now everything was successful, but when I try to paste files as user I cannot because the owner of the filesystem is root (I had to be root to fdisk and mkdosfs). 

So how do I solve this problem?


----------



## Naveen.S (Dec 27, 2008)

Re-Mount stick and set umask value to zero. Let say, /media/sdb1 is mount point ( folder ). In case it doesn't exist, create it.

```
sudo umount /dev/sdb1
sudo mount -vfat /dev/sdb1 /media/sdb1 -o defaults,umask=0
```
Regular user will have full privileges.


----------



## NucleusKore (Dec 28, 2008)

Thank you for your reply, will await other replies too. This is a manual method. I am ok with it, but not if I teach newcomers.

Please have a look at this thread also
*ubuntuforums.org/showthread.php?t=1022712


----------



## Naveen.S (Dec 28, 2008)

Easiest but a risky way is, press Alt+F2 and type this

```
gksu nautilus
```
It will open _Nautilus_ with root privileges. You will have full access to every file/folder. Risky, because you will root user and it not good to have root privileges in GUI.


----------



## vinayasurya (Dec 30, 2008)

I usually use mkfs.vfat to format usb on linux. Is this different from the method discussed here ?


----------



## NucleusKore (Dec 30, 2008)

Maybe the same?

*linux.about.com/od/embedded/l/blcmdl8_mkfsvfa.htm


----------



## blondie (Dec 30, 2008)

Try adding the user to group haldaemon, since the mounting and things are controlled by hal.


----------



## Naveen.S (Dec 30, 2008)

vinayasurya said:
			
		

> I usually use mkfs.vfat to format usb on linux. Is this different from the method discussed here ?


_mkfs.vfat_ and _mkdosfs -F 32 _do the same job. Both commands format partition in FAT32 filesystem in similar way.


----------

