Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-27-2004, 04:19 PM
|
#1
|
Member
Registered: Mar 2003
Location: Boston Area
Distribution: Ubuntu (Edgy)
Posts: 247
Rep:
|
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?
|
|
|
12-27-2004, 04:25 PM
|
#2
|
LQ Guru
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296
Rep: 
|
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.
|
|
|
12-27-2004, 04:26 PM
|
#3
|
Member
Registered: Mar 2003
Location: Boston Area
Distribution: Ubuntu (Edgy)
Posts: 247
Original Poster
Rep:
|
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...
|
|
|
12-27-2004, 04:39 PM
|
#5
|
Member
Registered: Mar 2003
Location: Boston Area
Distribution: Ubuntu (Edgy)
Posts: 247
Original Poster
Rep:
|
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.
|
|
|
12-27-2004, 04:47 PM
|
#6
|
Senior Member
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721
Rep:
|
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.
|
|
|
12-27-2004, 04:51 PM
|
#7
|
Member
Registered: Apr 2004
Distribution: Dapper
Posts: 167
Rep:
|
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.
|
|
|
12-27-2004, 05:31 PM
|
#8
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
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.
|
|
|
12-27-2004, 07:53 PM
|
#9
|
Member
Registered: Feb 2004
Location: 33.31N -111.97W
Distribution: SuSE
Posts: 919
Rep:
|
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.
|
|
|
12-27-2004, 09:10 PM
|
#10
|
Member
Registered: Mar 2003
Location: Boston Area
Distribution: Ubuntu (Edgy)
Posts: 247
Original Poster
Rep:
|
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)
|
|
|
12-27-2004, 09:59 PM
|
#11
|
LQ Newbie
Registered: Mar 2004
Location: australia.
Distribution: slackware
Posts: 17
Rep: 
|
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)
|
|
|
12-27-2004, 10:18 PM
|
#12
|
Member
Registered: Mar 2003
Location: CA
Distribution: Manjaro
Posts: 146
Rep:
|
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.
|
|
|
12-27-2004, 11:34 PM
|
#13
|
LQ Newbie
Registered: Mar 2004
Location: australia.
Distribution: slackware
Posts: 17
Rep: 
|
but why do i need umask=0222 and not just umaks=222, the 0 doesnt make anything rwx.
|
|
|
12-28-2004, 03:38 PM
|
#14
|
Senior Member
Registered: Sep 2003
Location: Indiana
Distribution: Slackware 15.0
Posts: 1,273
Rep:
|
the first digit has just started becoming more common in recent years. it has to do with suid, sgid and sticky bits.
|
|
|
12-29-2004, 08:54 PM
|
#15
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
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.
|
|
|
All times are GMT -5. The time now is 06:59 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|