LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 06-24-2007, 01:19 AM   #1
krimsonking
LQ Newbie
 
Registered: Jun 2007
Location: Melbourne, Australia
Distribution: openSUSE, Ubuntu
Posts: 12

Rep: Reputation: 0
Question directory permission issues


Hi all,

I am having trouble changing permission on a directory which is actually and entire drive that I mount automatically at startup. I created the fstab entry to be read/write and user accessible, but this does not happen. When I try to change the permissions or the ownership as root, I get an access denied error. This seems strange to me as I thought root should be able to do whatever it wanted. I have tried this both through terminal and by logging into x as root, but with the same result each time. The only thing I can think of is it must be something to do with how I am mounting the drive, the fstab entry looks like this: /dev/sdb1 /home/user/data vfat rw,auto,user,sync 0 0.

Any help with this would be appreciated, thanks in advance,

KrimsonKing

Last edited by krimsonking; 06-24-2007 at 01:22 AM.
 
Old 06-24-2007, 02:22 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,004
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
The problem here is vfat. It has no knowledge of Linux
ownerships and permissions; what you want to do is to add
a umask=0000 entry to the rw,auto,user,sync bit ...



Cheers,
Tink
 
Old 06-24-2007, 05:02 AM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
Given the device and filesystem on the drive, I'll guess that this is a removable drive usb or firewire drive. If that is the case, you may want to use the "noauto" option instead. Also, for fat32 mass storage drives, it is best not to have execute permissions on files. But you need the "x" bit set for directories to be able to enter them. To do this you need to use the "fmask" and "dmask" options instead of "umask".

Another problem is that if you were to add another usb drive, the next time you boot up the same partition might be assigned to another device. So, instead of using a device entry in fstab, use either "LABEL=alabel" or "UUID=fs_uuid".

I'll do it myself right now to walk you through the process:
I just inserted a USB Cruzer mini pendrive into the laptop. Let's see what the FS_UUID number is:
Code:
> udevinfo -q env -n /dev/sda1
ID_VENDOR=SanDisk
ID_MODEL=Cruzer_Mini
ID_REVISION=0.1
ID_SERIAL=SanDisk_Cruzer_Mini_SNDK41A4B41C47300502
ID_TYPE=disk
ID_BUS=usb
ID_PATH=pci-0000:00:02.2-usb-0:3:1.0-scsi-0:0:0:0
ID_FS_USAGE=filesystem
ID_FS_TYPE=vfat
ID_FS_VERSION=FAT16
ID_FS_UUID=3B69-1AFD
ID_FS_LABEL=
ID_FS_LABEL_SAFE=
Cheating a little, I automounted it and borrowed some of the options used in mounting it:

Code:
UUID=3B69-1AFD /mnt/cr256 vfat rw,nosuid,nodev,noatime,noauto,flush,user,uid=jschiwal,utf8,shortname=lower,fmask=177,dmask=077
I added the uid=, and user option to allow me to mount it as a regular user. The fsmask and dmask options I chose will give the mounted partition r/w permissions for user "jschiwal" but if another user "gest" were to mount it, he wouldn't be able to enter the directory without using sudo ( or another computer).

Also, reinserting two pendrives, the device used was /dev/sdd1 instead. Entering "mount /mnt/cr256" mounted it anyway.
 
Old 06-24-2007, 06:21 AM   #4
krimsonking
LQ Newbie
 
Registered: Jun 2007
Location: Melbourne, Australia
Distribution: openSUSE, Ubuntu
Posts: 12

Original Poster
Rep: Reputation: 0
Thumbs up All working, sweet

Hi, thanks to both tinkster and jschiwal for your help, adding the umask=0000 entry to fstab has worked great. Sorry jschiwal, I should have specified that I was using an internal SATA disk, the reason for the fat32 filesystem is that the disk in question gets shared with my Windows system, and as I'm still a noob on linux I like to keep my options open

Thanks again to you both

KrimsonKing
 
Old 06-24-2007, 07:04 AM   #5
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
In that case, I made the wrong assumption.

An even easier way, in openSUSE, would be to use the YaST2 partitioner. It will update /etc/fstab for you as well.
 
  


Reply

Tags
mount, permissions, root


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
Directory Permission riganta Linux - Newbie 6 05-24-2007 06:20 AM
directory permission leprkhn Linux - Newbie 6 05-02-2007 08:30 PM
directory permission Drunkalot Linux - General 1 07-05-2005 02:05 AM
Directory permission problem elderain Linux - Newbie 6 05-24-2004 12:25 PM
Permission for directory absolut Linux - Newbie 2 01-19-2004 05:38 AM


All times are GMT -5. The time now is 01:00 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration