LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 12-27-2004, 04:19 PM   #1
DiZASTiX
Member
 
Registered: Mar 2003
Location: Boston Area
Distribution: Ubuntu (Edgy)
Posts: 247

Rep: Reputation: 30
I can't access my windows drive as a user, only as root...fstab problems?


Hey, I have my windows drive and my linux drive. (they are on 2 different physical drives, windows on a 80gb Western Digital and Linux on a 20gb Western Digital) I have it so my windows drive (/dev/hda1) is mounted automatically to /win. I can access /win (read-only) while root, but when I try cd /win as a user, I get:

-bash: cd: /win: Permission denied

Someone else here had to same problem, I found this thread:

http://www.linuxquestions.org/questi...hreadid=251646

After reading it and making changes to my /etc/fstab, this is what I have now (in my fstab):

Code:
/dev/hda1        /win             ntfs        ro,user,uid=1000,gid=100      1   0
(1000 is my uid and users gid is 100 and it is ntfs)

But still, I get the same error when trying to access it as a user. Is it necessary for me to run a command or reboot the computer after making changes to /etc/fstab? Or is there something wrong in my options?
 
Old 12-27-2004, 04:25 PM   #2
Peacedog
Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,292

Rep: Reputation: 167Reputation: 167
Try a reboot, if it still isn't working follow the thread you posted. What are the permissions on /win, how about ownership?
good luck.
 
Old 12-27-2004, 04:26 PM   #3
DiZASTiX
Member
 
Registered: Mar 2003
Location: Boston Area
Distribution: Ubuntu (Edgy)
Posts: 247

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by Peacedog
Try a reboot, if it still isn't working follow the thread you posted. What are the permissions on /win, how about ownership?
good luck.
I will try a reboot, the permissions are set to:

dr-x------

root is the owner and group...
 
Old 12-27-2004, 04:36 PM   #4
Peacedog
Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,292

Rep: Reputation: 167Reputation: 167
Here is an excellent guide on permissions.

http://www.linuxquestions.org/questi...ticle&artid=20

good luck.
 
Old 12-27-2004, 04:39 PM   #5
DiZASTiX
Member
 
Registered: Mar 2003
Location: Boston Area
Distribution: Ubuntu (Edgy)
Posts: 247

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by Peacedog
Here is an excellent guide on permissions.

http://www.linuxquestions.org/questi...ticle&artid=20

good luck.
yeah, I know how permissions work and I have tried (as root) chmod 777 win/ and it says it does, but it doesn't

Last edited by DiZASTiX; 12-27-2004 at 05:51 PM.
 
Old 12-27-2004, 04:47 PM   #6
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 52
i've got this in my fstab for a ntfs-part. :

/dev/hda6 /win-e ntfs ro,users,umask=022 1 0

users can read and cd / ls onto that.

edit: you must chmod that dir, when the partition is not mounted..

egag

Last edited by egag; 12-27-2004 at 04:49 PM.
 
Old 12-27-2004, 04:51 PM   #7
Chrax
Member
 
Registered: Apr 2004
Distribution: Dapper
Posts: 167

Rep: Reputation: 31
You cannot set permissions on a fat/ntfs drive anywhere except in fstab, as they don't support permissions on individual files, so however you mount the drive is propagated to all files.

Edit: directed toward OP, not egag.
 
Old 12-27-2004, 05:31 PM   #8
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
For the NTFS file system, you can use the 'fmask' and 'dmask' options, which work like umask, but fmask controls access for files, while dmask controls access for directories.
Another tip is that you can use your user name in the fstab entry for the uid and gid options, instead of having to look up the corresponding integer values.
 
Old 12-27-2004, 07:53 PM   #9
Xian
Member
 
Registered: Feb 2004
Location: 33.31N -111.97W
Distribution: SuSE
Posts: 918

Rep: Reputation: 31
Quote:
Originally posted by egag
i've got this in my fstab for a ntfs-part. :
/dev/hda6 /win-e ntfs ro,users,umask=022 1 0
users can read and cd / ls onto that.
you must chmod that dir, when the partition is not mounted..
Thanks, egag. That worked perfectly.
 
Old 12-27-2004, 09:10 PM   #10
DiZASTiX
Member
 
Registered: Mar 2003
Location: Boston Area
Distribution: Ubuntu (Edgy)
Posts: 247

Original Poster
Rep: Reputation: 30
Well, I rebooted with the fstab in my first post and it now works. I didn't have to use the "umask" option, but out of curiosity, what does that do? (The umask option)
 
Old 12-27-2004, 09:59 PM   #11
minibootsy
LQ Newbie
 
Registered: Mar 2004
Location: australia.
Distribution: slackware
Posts: 17

Rep: Reputation: Disabled
i had the same problem untill last night, i set umask=0222 so no one can write to the ntfs partitions. i had umask=222 but that gave me funny permisions. can someone elaborate on what the 0 does? (newb)
 
Old 12-27-2004, 10:18 PM   #12
gnu noob
Member
 
Registered: Mar 2003
Location: CO
Distribution: Slackware 14
Posts: 138

Rep: Reputation: 15
umask=0 gives you read write and execute permissions it's basically the same as a chmod 7. As far as the difference between umask and chmod, it seems like chmod gives permissions and and umask takes them away.

Last edited by gnu noob; 12-27-2004 at 10:19 PM.
 
Old 12-27-2004, 11:34 PM   #13
minibootsy
LQ Newbie
 
Registered: Mar 2004
Location: australia.
Distribution: slackware
Posts: 17

Rep: Reputation: Disabled
but why do i need umask=0222 and not just umaks=222, the 0 doesnt make anything rwx.
 
Old 12-28-2004, 03:38 PM   #14
ringwraith
Senior Member
 
Registered: Sep 2003
Location: Indiana
Distribution: Slackware-current
Posts: 1,244

Rep: Reputation: 47
the first digit has just started becoming more common in recent years. it has to do with suid, sgid and sticky bits.
 
Old 12-29-2004, 08:54 PM   #15
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
The umask setting is used by the shell to determine what the default permissions should be for newly created files. A one bit will mask out that permission (from 666 for non-executable files), So you would set a bit to 0 to allow access.
Technically, the permission bits that end up in a newly created file are formed by ANDing the ones in the 'open' system call with the complement of the process's file mode creation mask (umask).

For native linux/unix file-systems, the umask is used during the creation of a file. For vfat and ntfs, the umask setting in the /etc/fstab entry sets the permissions for files and directories in the mounted partition.

So the UMASK is used differently depending on the file-system, or where you used it (shell or fstab).

When you think about it, using a file-creation mask for a read-only filesystem like NTFS sounds like an oxymoron. To avoid this confusion, I'd recommend using 'dmask' and 'fmask' instead for NTFS fstab options.
 
  


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
9.2 Pro--only root user can access my sata drive Yoblad Suse/Novell 1 11-28-2004 05:16 AM
External Hard Drive --No Access as USER only ROOT (10.1) 1kyle Mandriva 1 10-31-2004 09:09 AM
non-root user cannot access Windows partition curmudgeon42 Linux - General 3 08-13-2004 04:33 PM
cant access my windows drive in my user account Polyfaux Linux - General 5 02-21-2004 07:08 AM
FSTAB entry for normal user to access windows partition rmanocha Linux - Software 4 01-29-2004 04:33 PM


All times are GMT -5. The time now is 09:38 AM.

Main Menu
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