stupid permissions! *need your help*
ive been running smooth since i sarted using linux except for one thing, i have absolutely no way to enter my hdb1 storage drive unless i am in root, i understand that theres lots of permissions in linux to keep people from ruining thier pc but i really dislike having to log back in to view the contents of my hard drive, so if someone could tell me how i could view my second hard drive in my username please tell me, im an awful person at googling and i wouldnt come here unless i had no way of finding an answer ~_~ im using slackware 10.1, thanks
|
what is your drive filesystem?
|
NTFS on hdb1, ext2 on my linux drive, a while back i had windows, my 80 gig hard drive was all just a big dump bin of files
|
edit /etc/fstab and add "umask=022" to the option (4th column) for that partition, separated by a comma. If you only have "defaults" there, remove it and replace it with "umask=022" instead of adding it.
As example, here is my line about a FAT32 partition (I dont use NTFS here) : /dev/hda7 /mnt/win_d vfat umask=022 1 2 |
2 things.
First be warned that writing to NTFS, as you could corrupt that partition totally and blow away your windows install. 2nd is, you can map the NTFS partition to a particular user or group which is a little nicer. Code:
edit /etc/fstab The umask gives a the linuxgroup read/write access to that partition also. Also mapping to particular user works for fat32 partitions. |
thnks, and i dont really have windows installation, and i dont really want to ever use it again, it was just a formatted storage drive i used, all i really want is to read it, thnks tho ^_^
*edit* yeah, niether worked, the umask did absolutley nothing, and apparently ive forgotten what # is the gid, i was sure it was root, but it still wont let me connect.... so i dont know |
grrr, now even with these settings, it still wont let my user access it x_x please help.....
|
can you show us the line you added exactly? This should work so I believe there is something wrong about your line.
|
/dev/hdb1 /storage ntfs uid=1001,gid=100,umask=222 1 2
worked, then didnt work, i checked and double checked and double doublechecked the uid gid.... i dunno anymore... |
Try to make your uid 1001 the owner of the /storage directory.
Also, you shoot yourself in the foot with umask=222 instead of 022. Those mean the bits that are OFF in the permissions. So the 222 mask means you get 555, or r-xr-xr-x, but you want rwx for the owner, 755 for the bits, so set 022 for the umask. Also, you could add "user" to the mount options, allowing yourself, not root, to mount that area if you don't want it all the time. Then also add noauto so it gets mounted only on demand. Good luck, mlp |
I'm a newbie myself, but I know a very small amount about access permissions (ie, what it says in the Suse manual).
These are the things I would try: Quote:
This is an example of the contents from my /etc/fstab file: Code:
/dev/hdb1 /backup/hdb1 vfat user,noauto 0 0 Having "user" specified in the fourth column means that any user can mount it, not just root. However this only means that users can mount it. It doesn't mean that they can access it (I think that's what you were trying to resolve with "umask=222" and stuff, but I don't really understand that yet!) The second thing I would try is this: Mount the hard disk Type the following: Code:
cd / Code:
linux:/ # ls -l storage The part we are concerned about is the second line of the output from the command (that is, the line which has the single full stop at the end): "drwxr-xr-x 2 root root 48 2005-07-26 18:43 ." The "drwxr-xr-x" shows the access permissions, this is how to read them: "d" signifies it is a directory ("-" is a file, "l" is a link, etc) Then there is a bunch of characters, rwxr-xr-x The first rwx means the owner can read files from the directory, write to files in the directory (including creating new files/directories) and execute the directory (executing a directory means opening it) The second and third sets of "r-x" therefore signify that members of the group owning the file, and all other users, can only read files inside the directory, and look at what is in the directory. They cannot modify files or add files to the directory. The access permissions can be changed using the following command (called from the root (/) directory): Code:
chmod u+rwx,g+rwx,o+rwx storage If you type "ls -l storage" again, you will see that the changes are reflected in the directory listing: Code:
linux:/ # ls -l storage Code:
chmod o-w storage Possible problems with this could be: 1) I don't know whether the access permissions will be inheritable within the directory: If you create a new file, for example, I don't know what access permissions it will have. This could be what the whole "umask=022" stuff was about, but like I said, I don't understand that! 2) I don't know if this will work with NTFS filesystems. I think it should but I think you need the Linux ACL (Access Control Lists) on the filesystem, and I don't know much about filesystems so I couldn't tell you. Well I think that's all I have to say on the issue! Probably nothing you didn't already know, but hey. I don't know if any of this will work on your distro or anything, but it may be useful to someone. Oh, This is my first post on a Forum, so if I'm talking Jack will someone please beat it out of me?! Cheers. |
the drive is mounted read only. i cant change permissions, even in root, if i could have made
it that easy i would have =P.i tried about a hundred times. its how the device is mounted. but when i mount it rw it doesnt even mount, maybe because the entire drive is ntfs... |
Let's try again, give us a bit more info. Please send us some output of:
id <nameyouruserwithuid1001> your current /etc/fstab after the disk is mounted, the output of mount and a few lines of ls -l /storage It's true that you cannot *change* permission in a readonly filesystem. The idea is still that the mount options make it so that the files appear with the right permissions and, more importantly, owner from the beginning. Then, you could recompile your kernel with NTFS write support, but it's still marked as dangerous. If all you need is to read the files that you already have on the disk, it's going to work this way. mlp |
I appear to have the same exact problem as this person. I too have no permission, even as root, to change the permissions of the drive. I have an sata drive that somehow got partitioned into 3 parts that show up under the /windows mount as C, D and E. Here are the answers to the questions you asked the last guy for my situation:
Quote:
uid=1000(phish420) gid=100(users) groups=100(users),16(dialout),33(video) Quote:
/dev/hdc1 swap swap pri=42 0 0 devpts /dev/pts devpts mode=0620,gid=5 0 0 proc /proc proc defaults 0 0 usbfs /proc/bus/usb usbfs noauto 0 0 sysfs /sys sysfs noauto 0 0 /dev/dvdrecorder /media/dvdrecorder subfs fs=cdfss,ro,procuid,nosuid,nodev,exec,iocharset=utf8 0 0 /dev/fd0 /media/floppy subfs fs=floppyfss,procuid,nodev,nosuid,sync 0 0 /dev/sda4 /windows/c ntfs umask=022 0 0 /dev/sda5 /windows/d ntfs umask=022 0 0 /dev/sda6 /windows/e ntfs umask=022 0 0 Quote:
/dev/hdc2 on / type reiserfs (rw,acl,user_xattr) proc on /proc type proc (rw) tmpfs on /dev/shm type tmpfs (rw) devpts on /dev/pts type devpts (rw,mode=0620,gid=5) /dev/hda on /media/dvdrecorder type subfs (ro,nosuid,nodev,fs=cdfss,procuid,iocharset=utf8) /dev/fd0 on /media/floppy type subfs (rw,nosuid,nodev,sync,fs=floppyfss,procuid) /dev/sda4 on /windows/c type ntfs (rw,umask=022) /dev/sda5 on /windows/d type ntfs (rw,umask=022) /dev/sda6 on /windows/e type ntfs (rw,umask=022) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) /dev/sdc1 on /media/usb-0200387914:0:0:1p1 type subfs (rw,noexec,nosuid,nodev,sync,procuid,iocharset=utf8) Quote:
linux:/ # ls -l /storage /bin/ls: /storage: No such file or directory linux:/ # ls -l /windows total 21 drwxrwxrwx 5 root root 120 2005-08-23 21:58 . drwxr-xr-x 23 root root 536 2005-08-24 01:02 .. dr-xr-xr-x 1 root root 12288 2005-08-23 19:03 c dr-xr-xr-x 1 root root 4096 2005-08-23 19:03 d dr-xr-xr-x 1 root root 4096 2005-08-23 19:03 e Quote:
Also, here is the output of me trying to change the permissions as suggested above: linux:/windows # chmod u+rwx,g+rwx,o+rwx c chmod: changing permissions of `c': Read-only file system Oh, and I am running Suse 9.2 on a 64bit athlon. The drive, as I said is sata and does not have any windows install that I am concerened about - only video files for the most part. |
Again, in a read-only file system, you cannot change anything after it's mounted -- your chmod MUST fail. That's why we make the mount options so that the files ownerships appear right from the get-go. You will be able to read the files, but not be able to change anything, including permissions.
I looked it up on one of "my" machines that has a similar setup; /dev/hda1 is a NTFS winxp partition, the linux installation lives on hdb. I mount hda1 as /winxp. The designated owner (Peter) is uid=199,gid=100. Here is the line in /etc/fstab: /dev/hda1 /winxp ntfs uid=199,gid=100,ro 0 0 This mounts the partition and all files in there appear to be owned by peter: Code:
# ls -l /winxp/ In your case, change the lines to /dev/sda4 /windows/c ntfs uid=1000,gid=100,ro 0 0 /dev/sda5 /windows/d ntfs uid=1000,gid=100,ro 0 0 /dev/sda6 /windows/e ntfs uid=1000,gid=100,ro 0 0 The "ro" is just to be specific. With the kernel, I have never used SuSE and there may be specific instructions where to find what, but there are plenty of step-by-step guides, e.g. http://www.linuxdocs.org/HOWTOs/Kernel-HOWTO.html Still I would not mess with the ntfs partition if the above is good enough. Hope it helps, mlp |
All times are GMT -5. The time now is 03:01 AM. |