I can't access my windows drive as a user, only as root...fstab problems?
SlackwareThis 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.
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.
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:
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?
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.
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.
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.
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..
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)
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)
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.