LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 07-07-2002, 04:18 AM   #1
Blow
LQ Newbie
 
Registered: Jul 2002
Distribution: redhat
Posts: 3

Rep: Reputation: 0
trouble w/user account & ntfs mount


Hi, I'm running Redhat 7.3 and I recently mounted my windows ntfs partition into linux. My problem is, only root can access it, and I want my user account (uid 500) to have read access to it as well. When I try to open the directory where I've got it mounted with my user account though it says I don't have permission to access it. To fix it I first tried changing the permissions on the mount point directory to 444, but whenever I mounted the ntfs partition the permissions on that directory would always revert to 101 for some reason. It also won't let me change the permissions for the duration of the time that the partition is mounted, so I am unable to change them back unless I unmount it and that does me no good (I think because I installed only the module for read access in ntfs. I hear write access is really bad for ntfs so I can't install that if that is the problem). Next I tried changing the permissions on /dev/hda1 (the ntfs partition), but that didn't work either. Then I ran linuxconf and tried mounting it with that; it put mount -o ro,uid=500,gid=500,umask=444 in /etc/fstab, but I've rebooted several times since and also tried mounting it myself with those options and I still don't have access to the mount point with my user account.

Otherwise ntfs read support works perfectly when I'm logged in as root. I just installed linux for the first time wednesday so I don't really know what I'm doing. Does anybody know what I need to do to get this working?
 
Old 07-07-2002, 04:33 AM   #2
linuxcool
LQ Addict
 
Registered: Jun 2001
Posts: 1,183

Rep: Reputation: 47
Try umask=333 and make sure you have the correct uid and gid numbers.
 
Old 07-07-2002, 04:48 AM   #3
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Semi on topic...

What does the 333 mean? Better yet, how do you know what to use there? When I checked the man pages, it eventually pointed me to chmod. And the section in there on umask and the "octal" crap just doesn't make any sense to me. Can you put it in sort of 'laymen's terms' for me?
 
Old 07-07-2002, 05:24 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966
masterc, try reading some books and stuff, that's what they are there for. it's pretty easy really.

Quote:
The second digit selects
permissions for the user who owns the file: read (4),
write (2), and execute (1); the third selects permissions
for other users in the file's group, with the same values;
and the fourth for other users not in the file's group,
with the same values.
so therefore a umask of 333 equates to a chmod of 444 (777-333) which is r--r--r-- in more conventional terms. umask 022 would be rwxr-xr-x (chmod 755) and so on.
 
Old 07-07-2002, 05:25 AM   #5
linuxcool
LQ Addict
 
Registered: Jun 2001
Posts: 1,183

Rep: Reputation: 47
MasterC, let's do an example. Take the three digit octal number 754. The 7 is for the permissions of the owner. The 5 and 4 are for the group and others respectively. We can convert this number easily from octal to binary so that we can figure out the permissions. Below is a table to convert one octal digit to binary:


octal binary
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111

Take the 7 in 754. It is 111 binary. Each bit of the binary number represents a permission. The sequence is rwx. So, if we look at 111, we see the first bit on the left is a one, so the owner has read permission. The middle bit is a one, so the owner has write permission. And the bit on the right is a one so the owner has execute permission.

Let's look at the 5. It's 101 binary. So, the group would have read and execute permissions, but no write permission because the middle bit is a zero.

The 4 is 100 binary. In this case, the others have only read permission and no write or execute permissions because the middle and right bits are zeroes.

To figure out what a umask number means you need to XOR ( exclusive OR ) it with 777. You can also just subtract it. You get the same results. So, 777 minus 333 is 444. Now we take the 444 and convert each digit to binary ( 100 100 100 ) and we see that the owner, group, and the others all have read permissions and no write and execute.

I hope that is clear.
 
Old 07-07-2002, 06:04 AM   #6
Blow
LQ Newbie
 
Registered: Jul 2002
Distribution: redhat
Posts: 3

Original Poster
Rep: Reputation: 0
Alright, I'm back. I don't really know much about linux since I just started on wednesday but I really don't understand this. I tried that umask=333 thing, and that caused the permissions on the mount point directory to revert to 040 when the ntfs partition was mounted, as opposed to the 101 it would revert to when I tried umask=444. I thought 040 should work because it would allow the group access to the directory but it didn't, and I'm not sure why. The file owner was the user account though, and since the owner doesn't have access with 040 maybe that's why. Anyway I decided to try a few more random umask numbers and they would always give me seemingly random file permission numbers. After a couple minutes I finally found a few that give me what I want: umask=000, 020, 002, 022, 130, 530, and 640 all cause the directory to change to 555 once the partition is mounted and allow me to get in. There's probably something going on here and I'm just not smart enough to see it, but at least I can get with my user account now. Thank you for your help.

Edit: Oh ok, I just read your description on how umask works. I'm not sure I completely understand the last part about the exclusive or but I'm sure it at least accounts for what I found. I thougth that umask took numbers just like chmod but I guess not. Thank you for all your help again.

Last edited by Blow; 07-07-2002 at 06:18 AM.
 
Old 07-07-2002, 06:17 AM   #7
linuxcool
LQ Addict
 
Registered: Jun 2001
Posts: 1,183

Rep: Reputation: 47
You're welcome.
 
Old 07-07-2002, 06:46 AM   #8
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Wow, that was a helleva explanation, thank you for the depth of the answer. I will have to print this one out and stick it in the folder of "ultimate knowledge" that I have gathered from this site. Thanks alot!
 
Old 07-07-2002, 05:08 PM   #9
linuxcool
LQ Addict
 
Registered: Jun 2001
Posts: 1,183

Rep: Reputation: 47
You're welcome MasterC.

I just noticed that I left something out. The number 754 was to be used with the chmod command. If you wanted to give the same permissions using umask, you would subtract 754 from 777 and get 023. So, it would be umask=023. Sorry about the omission.
 
Old 09-13-2002, 12:23 AM   #10
Bigun
Member
 
Registered: Aug 2002
Location: Hickville, TN
Distribution: Gentoo > current. Have used: Red Hat 7.3, 9, Gentoo 1.4
Posts: 400

Rep: Reputation: 30
Ok, I'm looking at my etc/fstab, and I found where I can put who has access to what mounts. However, there is an option called "defaults"...I am assuming you can change the default.....how?
 
Old 09-13-2002, 01:15 AM   #11
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
man mount, as seen in your other thread

Cool
 
Old 03-25-2004, 02:41 AM   #12
zubir
LQ Newbie
 
Registered: Mar 2004
Posts: 28

Rep: Reputation: 15
what da #$$#!%

I'm lost, someone help, all I want to do is be able to write to usr, etc and var
 
  


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
No access to NTFS mounts for regular user account lowpro2k3 Slackware 5 10-23-2005 05:21 PM
Unable to mount cd under user account Hotfeet Debian 24 03-29-2005 09:51 AM
Mount SMB Share from user account jeopardyracing Linux - Newbie 3 12-03-2004 05:04 PM
Trouble accessing mounted filesystem from user account. DarkXtar Slackware 6 04-29-2003 10:27 PM
NTFS mount trouble Redukt Linux - Hardware 13 02-17-2003 11:24 AM


All times are GMT -5. The time now is 04:54 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