cannot change ownership or permissions

Asked by dirkalberteverts

i have usb harddrives and they are owned by me.Only i have read and write permissions.Whatever i do,it seems that even i cannot change anything.Chmod and chown don't work.gksudo nautilus doesn't work.I want others to have read only permissions on these drives.So if you can help me.thx

benny@benny-desktop:/media$ ls -l
totaal 220
lrwxrwxrwx 1 root root 6 2009-05-04 16:03 cdrom -> cdrom0
drwxr-xr-x 2 root root 4096 2009-05-04 16:03 cdrom0
drwxr-xr-x 2 root root 4096 2009-05-04 16:03 cdrom1
drwx------ 449 benny root 49152 1970-01-01 01:00 disk
drwx------ 3 benny root 32768 1970-01-01 01:00 Elements
lrwxrwxrwx 1 root root 7 2009-05-04 16:03 floppy -> floppy0
drwxr-xr-x 2 root root 4096 2009-05-04 16:03 floppy0
drwx------ 76 benny root 131072 1970-01-01 01:00 PACKARD

Question information

Language:
English Edit question
Status:
Solved
For:
Elbuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Steven Danna
Solved:
Last query:
Last reply:
Revision history for this message
Steven Danna (ssd7) said :
#1

Are these drives using ntfs as their file system?

Revision history for this message
dirkalberteverts (dirkalberteverts) said :
#2

no,they are fat 32

Revision history for this message
Steven Danna (ssd7) said :
#3

Fat32 doesn't understand the concepts of unix permissions, so whatever permissions are set when the drive is mounted are the permissions until you unmount it and remount it with different permissions. Also, individual files on that drive cannot have different permissions.

You can set custom options for this drive in your /etc/fstab file. This file is used by the mount program at boot to mount drive. It is also consulted by gnome-mount which is the program that is mounting your drives when they are connected after boot. A very good and detailed explanation of fstab is here:

http://ubuntuforums.org/showthread.php?t=283131

This file is I hope this helps!

Revision history for this message
dirkalberteverts (dirkalberteverts) said :
#4

thx for this answer.Iam going to try this.It's going to take a while because i have not much experience with linux.I keep you posted.

Revision history for this message
Steven Danna (ssd7) said :
#5

Feel free to post any questions or problems you run into when setting it up. Good luck!

Revision history for this message
dirkalberteverts (dirkalberteverts) said :
#6

wen i look into the mtab my drives are mounted,do i have to change my fstab or is there another way.
benny@benny-desktop:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'vol_id --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=aa4b215b-5920-45fa-997d-87b4dd6114af / ext3 relatime,errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=f02fb23d-c472-4947-9e24-db4b12d5730a none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0

benny@benny-desktop:~$ cat /etc/mtab
/dev/sda1 / ext3 rw,relatime,errors=remount-ro 0 0
tmpfs /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0
varrun /var/run tmpfs rw,nosuid,mode=0755 0 0
varlock /var/lock tmpfs rw,noexec,nosuid,nodev,mode=1777 0 0
udev /dev tmpfs rw,mode=0755 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0
fusectl /sys/fs/fuse/connections fusectl rw 0 0
lrm /lib/modules/2.6.28-11-generic/volatile tmpfs rw,mode=755 0 0
securityfs /sys/kernel/security securityfs rw 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0
gvfs-fuse-daemon /home/benny/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,user=benny 0 0
/dev/sdg1 /media/disk vfat rw,nosuid,nodev,uhelper=hal,shortname=mixed,uid=1000,utf8,umask=077,flush 0 0
/dev/sdb1 /media/PACKARD\040BEL vfat rw,nosuid,nodev,uhelper=hal,shortname=mixed,uid=1000,utf8,umask=077,flush 0 0
/dev/sdh1 /media/Elements vfat rw,nosuid,nodev,uhelper=hal,shortname=mixed,uid=1000,utf8,umask=077,flush 0 0
benny@benny-desktop:~$

Revision history for this message
Best Steven Danna (ssd7) said :
#7

/etc/mtab contains a list of the currently mounted filesystem. As you can see, both of your USB drives have been mounted with umask=077. As is described in the link, this option is what is causing the filesystem to be readible only by you. The only way to change this is to remount the drive with a different umask and the best way I know of to make that umask permanent is to edit the /etc/fstab file.

The above link I gave gives pretty comprehensive which I know can be a bit intimidating. Here is a brief summary that may work for you:

1) Run the following command:

ls /dev/disk/by-uuid -alh

This will list all your disks and show the UUID. what you shoudl see is a directory listing that has a funny string of numbers followed by an arrow pointing at something like ../../sdh1. The funny string of numbers is the UUID, Since you are dealing with a USB device, we want to list the drive by it's uuid in fstab.

2) Copy and paste the UUID that points to ../../sdh1 to a text file. This will be the UUID related to the usb drive named "Elements"

3) Run the command: gksudo gedit /etc/fstab
4) Enter your password when prompted.
5) Enter your password when prompted.
6) Add the following line to the end of the file:

UUID=fab05680-eb08-4420-959a-ff915cdfcb44 /media/Elements vfat user,uid=1000,gid=1000,utf8,umask=022,flush 0 0

(Just in case it gets formated incorrectly, that should all be one line)

NOW, after the UUID= you will want to substitute the UUID you copied in step 2.

7) Run the command

sudo umount /media/Elements

8) Make sure that /media/Elements exists by running: ls -al /media/
9) If it doesn't exist: sudo mkdir /media/Elements
10) Run the command: sudo mount /media/Elements
12) Check if the filesystem has the permissions you want: ls -l /media
13) Run the command: sudo umount /media/Elements
14) Unplug the USB drive and Plug it back in to ensure that it mounts automatically when you plug it in. Also ensure that it still has the permissions you want.

You will then have to repeate similar procedures for your other drives. I wrote these directions somewhat quickly so post any errors you get back here.

Revision history for this message
dirkalberteverts (dirkalberteverts) said :
#8

thanks Steven,it really worked out.

Revision history for this message
dirkalberteverts (dirkalberteverts) said :
#9

Thanks Steven Danna, that solved my question.