LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Permissions for second hard drive (https://www.linuxquestions.org/questions/linux-newbie-8/permissions-for-second-hard-drive-225284/)

digi691 09-01-2004 10:52 AM

Permissions for second hard drive
 
Ok no matter what i change in my fstab or change permissions of the mount point of /opt2 a user cannot write but i can cruise the directory. I will post my fstab and a read out of ls -lac of opt2. I want users to have read write and execute. I have only been able to copy files as root.

/dev/hda1 / ext3 noatime 1 1
none /dev/pts devpts mode=0620 0 0
/dev/hda6 /home ext3 noatime 1 2
/dev/hdc /mnt/cdrom auto user,iocharset=iso8859-1,codepage=850,noauto,ro,exec 0$
/dev/hdd /mnt/cdrom2 auto umask=0,user,codepage=850,iocharset=iso8859-1,noauto,$
/dev/fd0 /mnt/floppy auto user,iocharset=iso8859-1,sync,codepage=850,noauto,exe$
/dev/hdb1 /opt2 ext3 rw,noatime 0 0
none /proc proc defaults 0 0
/dev/hda5 swap swap defaults 0 0

(This is the Permissions of /Opt2 which is my second hard drive)
drwxr-xr-x 4 root root 4096 Sep 1 10:21 ./
drwxr-xr-x 20 root root 4096 Sep 1 10:35 ../
drwx------ 2 root root 16384 Sep 1 00:17 lost+found/
drwxr-xr-x 66 root root 4096 Sep 1 02:18 Music/

R0UTE 09-01-2004 11:49 AM

Hi, I am having a similar problem for a second partition on my hard drive os i thought i'd stick it in the same thread.
I resized an NTFS partition (to make it smaller), I then went back into Linux and did
mkfs -t ext3 /dev/hda3
which worked fine then created a directory /mnt/stuff and tried (as root)
mount -t ext3 /dev/hda3 /mnt/stuff
This worked fine and i could browse it as root, obviously not as a normal user though
so unmounted it and tried
mount -t ext3 /dev/hda3 /mnt/stuff -o uid=r0ute
and got the good old mount error message :
mount: wrong fs type, bad option, bad superblock on /dev/hda3,
or too many mounted file systems
I know it is not the wrong fs type, the option is fine (uid=r0ute works fine as it does not have to be the uid value although i have tried this also to no avail), there is not a bad superblock as it mounts fine for root and there are not too many mounted file systems.
Anyone have any idea why i might be getting this ?
I've been trying this on and off for about a week with no luck.
Any help much appreciated!

egag 09-01-2004 12:35 PM

mabe try this instead of : /dev/hdb1 /opt2 ext3 rw,noatime 0 0
put in : /dev/hdb1 /opt2 ext3 rw,users,umask=000,noatime 0 0

egag

digi691 09-01-2004 01:08 PM

when i do that i get this error on the boot up and when i try to mount it after the system boots:

mount: wrong fs type, bad option, bad superblock on /dev/hdb1,
or too many mounted file systems

I am also running Mandrake 10.0 if that helps any.

didge

egag 09-01-2004 05:10 PM

well...i'm at a win-pc, cannot check, but what is the ''noatime'' option mean,
i mean , i don't have it in my fstab.....?

egag

digi691 09-01-2004 05:29 PM

I don't know but i noticed it in my other partitions so i put it in there.

didge

egag 09-01-2004 05:59 PM

maybe you can check '' man fstab '' or so to see what it means ??
( type '' q '' to leave the ''man '' command )
or remove the '' noatime '' option to try...

egag

digi691 09-01-2004 08:19 PM

/dev/hdb1 /opt2 ext3 rw,users 0 0

I changed it to this and still do no have access. I read man fstab and man mount. By looking at it i should only need rw, and users. I can cruise the directory but i cannot delete or save anything to opt2. Any help would be appreciated.

didge

egag 09-02-2004 05:04 AM

reading man-mount:

'defaults
Use default options: rw, suid, dev, exec, auto, nouser, and async.'

i think it should be :

/dev/hdb1 /opt2 ext3 defaults,user,exec 0 0

but i'm not sure. ( maybe just try )

egag

egag 09-02-2004 05:27 AM

well. i've been fiddling around, trying diff. settings. the above is nogood.
now i'm curious too....

egag

digi691 09-02-2004 10:23 AM

Yea i have been messing around with this all day yesterday and have not got anything to work. If anyone else might have an idea please post.

sketelsen 09-02-2004 11:23 AM

Hey folks, i think i may have a solution for you.

First of all, if it tells you the filesystem is the wrong type, then it probably is.

/dev/hdb1 /opt2 ext3 rw,users 0 0


That's your filesystem type listed, ext3. if the filesystem on the drive is actually ext2 or reiserfs, that won't work. Figure out what filesystem you're actually using, and put the right id in there. Hint: if it's a windows hard drive it's either vfat or ntfs.

Second, /opt2, i don't think, should be used as a mount point, from a filesystem standpoint. I usually mount my stuff on /mnt/hda1 or /mnt/media or /mnt/win. if, for simplicity, i want to mount something on /media instead of /mnt/media, i'll still mount it at /mnt/media, but symlink the directory to /media, like this:

ln -s /mnt/media /media

(basically, ln is link. -s means symbolic link. the first argument, /mnt/media, is where the file or directory actually is. the second argument, /media, is where you want the filesystem to pretend to be.)

/mnt is where drives belong, period.

Next, your permissions. the "right" way, for security purposes, is to create a group where you can put users you want to access this drive. for instance, on my machine, i have a windows partition. so i have a group called "win." to add the group, just type (as root)

groupadd win

Then, you can go into your /etc/group file, take note of the number that was assigned to the group (you'll need it in a minute), and next to the name of the group, after the colons, type in the list of users you want to access your drive. kind of like this:

125::win:bob,jane,carol

make sure you save the file. now, in your fstab, the drive will look like this:

/dev/hda2 /mnt/win vfat gid=125,umask=002,rw 0 0

or something to that effect. you'll change the first argument to whatever device you're trying to mount, the second argument to the mount point, the third argument to whatever fileystem type you're ACTUALLY using. gid is the group id number. the umask tells mount to mount the filesystem so that only the group has access (i think). the rw means read-write, and the 0 and the 0 are dump/pass variables. I have no idea what they do. :-)

once you fix the fstab entry, save /etc/fstab, unmount the filesystem:

umount /dev/hda1 (or whatever)

and then remount it:

mount /dev/hda1

it should have the correct permissions. now, get the hell out of root, and try to navigate to the mounted directory:

cd /mnt/win

it *should* say now that you have permission, and you can do whatever you want from there.

Good luck, and lemme know if you have any problems. :cool:

sketelsen 09-02-2004 11:36 AM

another note: what i wrote above only applies if you're using the drive as some sort of extra storage. if you want it to be a working part of your system, like you're migrating /usr or /var or something to a new hard drive to free up space, then you should keep the permissions AS THEY SHOULD BE, as they were assigned by the system. you don't want regular users running around writing files in your /usr or /var partitions.

digi691 09-02-2004 04:18 PM

Still a no go....... Anytime i added anything besides rw it will give me a wrong fs, bad block yadda yadda yadda. I can mount it as root w/ rw permissions in my fstab and thats about it. i made it look exactly like yours except for the fact that it was hdb1. I even repartioned it and reformatted it. Its always one thing or another when i switch distros...... I have been through pretty much all the distros and this one i kinda like but there is always a funky thing like this.... or wierd little quirks.

egag 09-02-2004 04:20 PM

maybe confused.... i think you need something like:
chmod <option> 777 /opt2
option should change perm. of all files and subdir's.
cannot check now, ( man chmod )

egag


All times are GMT -5. The time now is 04:16 PM.