Chmod Problem Permissions for Fat32 filesystem

hawker

Honorary Master
Joined
Sep 22, 2006
Messages
11,306
Hey guys

I'm running Ubuntu 10.04 (Pre release)

I have a small problem. I have 3 HDD's. I've posted the result of "fdisk -l"

Code:
rudi@TheHawkNest:~$ sudo fdisk -l

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000090f2

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       30401   244196001   83  Linux

Disk /dev/sdb: 250.1 GB, 250058268160 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0008ac83

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1       30402   244195328    7  HPFS/NTFS

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2acc6b83

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        1824    14651248+  83  Linux
/dev/sdc2            1825        1946      979965    5  Extended
/dev/sdc3   *        1947       60801   472752787+   b  W95 FAT32
/dev/sdc5            1825        1946      979933+  82  Linux swap / Solaris
Output of my /etc/fstab

Code:
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc                                       /proc            proc  defaults           0  0  
# / was on /dev/sda1 during installation
UUID=29bb16a1-6095-46ab-8e84-b687f81d8aa5  /                ext4  errors=remount-ro  0  1  
# swap was on /dev/sda5 during installation
UUID=8bfc4bb4-2659-4a62-9025-ef63ead967e5  none             swap  sw                 0  0  
/dev/sdc3                                  /media/SeaDrive  vfat  defaults           0  0  
/dev/sdb1                                  /media/EDrive    ntfs  defaults           0  0  
/dev/sda1                                  /media/DDrive    ext4  defaults           0  0
Now as you can see, on the 3rd drive there is a FAT32 Partition that I would like to give read/write permissions to.

I have done that for the other 2 HDD's. They are mounted at:
/media/DDrive and /media/EDrive

I didn't previously have write permissions to those 2 locations but I just did a quick

Code:
sudo chmod -R 777 /media/<foldername>
to change it.

Now my problem is:
When I try execute:

Code:
sudo chmod -R 777 /media/SeaDrive
(SeaDrive being the location to where my FAT32 partition is mounted)

The command doesn't change the permissions.

What could the problem be? Any ideas?

P.S. I know of the risks of giving everyone write permissions etc etc :p so no lectures about all of that please. :)
 
Last edited:

MickZA

Executive Member
Joined
Jan 19, 2007
Messages
7,576
Exactly what permissions does ls -l /media/SeaDrive currently return?
 

hawker

Honorary Master
Joined
Sep 22, 2006
Messages
11,306
Exactly what permissions does ls -l /media/SeaDrive currently return?
Thanks for the reply MickZA currently it returns:

Code:
total 40624
-rwxr-xr-x   1 root root  7227615 2010-02-27 10:08 2ju2p_war1057.mp3
-rwxr-xr-x   1 root root   523079 2008-10-10 20:43 32146-glass-icons.tar.gz
-rwxr-xr-x   1 root root    62306 2008-10-11 10:58 71995-Mac4Lin_Emerald_v0.4.emerald
drwxr-xr-x  26 root root    16384 2010-04-08 17:04 Boot
-rwxr-xr-x   1 root root   383562 2009-07-13 17:39 bootmgr
-rwxr-xr-x   1 root root      512 2010-04-08 17:54 BOOTSECT.BAK
drwxr-xr-x   3 root root    16384 2010-02-23 19:19 Downloads
drwxr-xr-x   2 root root    16384 2009-02-07 07:41 emerald_themes
drwxr-xr-x  12 root root    16384 2010-04-07 17:57 Home
-rwxr-xr-x   1 root root    79802 2010-03-06 23:18 latex-handout.pdf
-rwxr-xr-x   1 root root    82487 2010-03-06 23:18 latex-slides.pdf
drwxr-xr-x   4 root root    16384 2010-01-25 22:15 Linux
drwxr-xr-x   4 root root    16384 2010-03-10 20:44 Mail
drwxr-xr-x 717 root root    65536 2010-04-06 12:32 Music
-rwxr-xr-x   1 root root 32608810 2008-10-10 20:43 OxygenRefit2-2.2.0.tar.bz2
drwxr-xr-x  31 root root    16384 2010-04-03 15:12 Pictures
drwxr-xr-x   2 root root    16384 2010-03-20 21:24 Recycled
-rwxr-xr-x   1 root root    23773 2010-03-25 23:52 ResectionCalculator.ods
drwxr-xr-x  20 root root    16384 2009-09-13 10:34 School
-rwxr-xr-x   1 root root    16350 2010-03-28 18:14 SimpleJoinCalculator.ods
-rwxr-xr-x   1 root root   238025 2008-10-11 10:58 underwater.emerald
drwxr-xr-x   4 root root    16384 2010-03-02 18:11 University
drwxr-xr-x  10 root root    16384 2009-04-05 11:47 Update Tools and Stuff
drwxr-xr-x   6 root root    16384 2010-03-20 21:18 Video
Does this help at all?
 

MickZA

Executive Member
Joined
Jan 19, 2007
Messages
7,576
Try cd /media/SeaDrive

&

sudo chmod -R 777 ./*

&

ls -l
 

hawker

Honorary Master
Joined
Sep 22, 2006
Messages
11,306
Try cd /media/SeaDrive

&

sudo chmod -R 777 ./*

&

ls -l
Same thing, no change:

Code:
rudi@TheHawkNest:~$ cd /media/SeaDrive
rudi@TheHawkNest:/media/SeaDrive$ sudo chmod -R 777 ./*
[sudo] password for rudi: 
rudi@TheHawkNest:/media/SeaDrive$ ls -l
total 40624
-rwxr-xr-x   1 root root  7227615 2010-02-27 10:08 2ju2p_war1057.mp3
-rwxr-xr-x   1 root root   523079 2008-10-10 20:43 32146-glass-icons.tar.gz
-rwxr-xr-x   1 root root    62306 2008-10-11 10:58 71995-Mac4Lin_Emerald_v0.4.emerald
drwxr-xr-x  26 root root    16384 2010-04-08 17:04 Boot
-rwxr-xr-x   1 root root   383562 2009-07-13 17:39 bootmgr
-rwxr-xr-x   1 root root      512 2010-04-08 17:54 BOOTSECT.BAK
drwxr-xr-x   3 root root    16384 2010-02-23 19:19 Downloads
drwxr-xr-x   2 root root    16384 2009-02-07 07:41 emerald_themes
drwxr-xr-x  12 root root    16384 2010-04-07 17:57 Home
-rwxr-xr-x   1 root root    79802 2010-03-06 23:18 latex-handout.pdf
-rwxr-xr-x   1 root root    82487 2010-03-06 23:18 latex-slides.pdf
drwxr-xr-x   4 root root    16384 2010-01-25 22:15 Linux
drwxr-xr-x   4 root root    16384 2010-03-10 20:44 Mail
drwxr-xr-x 717 root root    65536 2010-04-06 12:32 Music
-rwxr-xr-x   1 root root 32608810 2008-10-10 20:43 OxygenRefit2-2.2.0.tar.bz2
drwxr-xr-x  31 root root    16384 2010-04-03 15:12 Pictures
drwxr-xr-x   2 root root    16384 2010-03-20 21:24 Recycled
-rwxr-xr-x   1 root root    23773 2010-03-25 23:52 ResectionCalculator.ods
drwxr-xr-x  20 root root    16384 2009-09-13 10:34 School
-rwxr-xr-x   1 root root    16350 2010-03-28 18:14 SimpleJoinCalculator.ods
-rwxr-xr-x   1 root root   238025 2008-10-11 10:58 underwater.emerald
drwxr-xr-x   4 root root    16384 2010-03-02 18:11 University
drwxr-xr-x  10 root root    16384 2009-04-05 11:47 Update Tools and Stuff
drwxr-xr-x   6 root root    16384 2010-03-20 21:18 Video
What does

Code:
stat /media/SeaDrive
outut?
Result:
Code:
 File: `/media/SeaDrive'
  Size: 16384     	Blocks: 32         IO Block: 16384  directory
Device: 823h/2083d	Inode: 1           Links: 15
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 1970-01-01 02:00:00.000000000 +0200
Modify: 1970-01-01 02:00:00.000000000 +0200
Change: 2010-04-09 16:27:57.000000000 +0200
 

bleh69

Senior Member
Joined
Nov 26, 2009
Messages
539
you gotta make sure you actually mounted it as writeable (and not read only which is default for FAT fs)

can you touch /media/SeaDrive/testfile ??
 

hawker

Honorary Master
Joined
Sep 22, 2006
Messages
11,306
you gotta make sure you actually mounted it as writeable (and not read only which is default for FAT fs)

can you touch /media/SeaDrive/testfile ??
Nope

Code:
rudi@TheHawkNest:~$ touch /media/SeaDrive/latex-slides.pdf 
touch: cannot touch `/media/SeaDrive/latex-slides.pdf': Permission denied
How do I go about rectifying it?

Code:
sudo umount /dev/sdc3
sudo mount /dev/sdc3 <with write param?>
Then change the permissions?
 

koffiejunkie

Executive Member
Joined
Aug 23, 2004
Messages
9,095
It ain't gonna make any difference. You're trying to set the permissions for three different users/groups i.e. owner, group and world. FAT32 doesn't have group and world. In fact, it only has owner insofar as it's assigned via the mount process. Your owner already has rwx. What you can do is add 'user' to your mount options, and then mount it as the user who would access it.
 

bleh69

Senior Member
Joined
Nov 26, 2009
Messages
539
not sure for fat.. but ntfs : sudo mount -t ntfs-3g /dev/sda1 /media/win -o force
 

bleh69

Senior Member
Joined
Nov 26, 2009
Messages
539
lol.. my fellow worker just interjected: sudo mount -t vfat /dev/sda6 /media/FAT32 -o uid=1000,gid=1000,umask=022

set the permissions as you choose.
 

hawker

Honorary Master
Joined
Sep 22, 2006
Messages
11,306
Hey guys

I've fixed it :)

I just added this ,umask=000 after defaults in my /etc/fstab

So the line now reads:

Code:
/dev/sdc3          /media/SeaDrive  vfat  defaults,umask=000    0       0
Thanks for all your help guys!

Have a great weekend.

Regards

hawker
 

MickZA

Executive Member
Joined
Jan 19, 2007
Messages
7,576
Or sudo chown -R xxxx /media/SeaDrive - replace xxxx with your normal user name should do the trick
 

Nod

Executive Member
Joined
Jul 22, 2005
Messages
8,811
You mount to with rw permissions, i.e mount -o rw ...
 
Top