Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problems accessing other partitions and drives
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
DAharon
Apprentice
Apprentice


Joined: 17 Jun 2004
Posts: 155

PostPosted: Tue Jun 28, 2005 11:46 pm    Post subject: Problems accessing other partitions and drives Reply with quote

Hi, I've had this install of Gentoo for a while now, but I have a problem that I just haven't been able to resolve through experimentation and searching the web and these forums. So I've resorted to posting my problem (even though it should be a no-brainer).

I have two HDs in my computer. hda contains a really old version of RedHat (hda1, ext2), swap space (hda2), and Gentoo(hda3, ReiserFS). hdb contains Windows (hdb1, ntfs) and free space (hdb2, FAT32).

For some reason I just can't get full access to hda1 and hdb2 as a non-root user.

/mnt with drives UNmounted:
Code:
drwxr-xr-x  2 root cdrom  72 Apr 12  2004 cdrom
drwxrwxrwx  2 root floppy 72 Apr 12  2004 floppy
drwxr-xrwx  2 root root   48 Nov 10  2004 hda1
drwxrwxrwx  2 root root   48 Nov 15  2004 hdb2
drwxr-xr-x  2 root root   48 Nov 15  2004 usb


/mnt with drives mounted:
Code:
drwxr-xr-x   2 root cdrom     72 Apr 12  2004 cdrom
drwxrwxrwx   2 root floppy    72 Apr 12  2004 floppy
drwxr-xr-x  20 root users   4096 Nov 10  2004 hda1
drwxr--r--  16 root root   32768 Jan  1  1970 hdb2
drwxr-xr-x   2 root root      48 Nov 15  2004 usb


As a user, I can read but not write hda1. I have no access at all to hdb2 as a user.

/etc/fstab:
Code:

/dev/hda3                    /                  reiserfs      noatime,notail    0 1
/dev/hda2                    none             swap         sw                   0 0
#/dev/cdroms/cdrom0    /mnt/cdrom    iso9660      auto,ro,users     0 0
#/dev/fd0                    /mnt/floppy    auto          auto,users         0 0
/dev/hda1                    /mnt/hda1     auto          noatime,users     0 0
/dev/hdb2                    /mnt/hdb2     vfat           defaults            0 0
#/dev/sda                    /mnt/usb       auto          auto,users        0 0


I'm not sure how much help fstab is, since I've played with it so many times.

What can I do that will give me full access to hdb2 and hda1?
Back to top
View user's profile Send private message
karnesky
Apprentice
Apprentice


Joined: 18 Mar 2004
Posts: 218

PostPosted: Tue Jun 28, 2005 11:55 pm    Post subject: Reply with quote

Quote:
Code:
drwxr-xr-x  20 root users   4096 Nov 10  2004 hda1
drwxr--r--  16 root root   32768 Jan  1  1970 hdb2
As a user, I can read but not write hda1. I have no access at all to hdb2 as a user.
Well, yeah. The permissions on hda1 aren't g+w and the permissions on hdb2 aren't a+x (to allow you to transverse) or a+w (to write).

The first thing to do is to change the option from "users" to "user,rw". (Note the lack of 's')
_________________
Donate to F/OSS
Back to top
View user's profile Send private message
smerf
l33t
l33t


Joined: 06 Nov 2004
Posts: 778
Location: Polska

PostPosted: Tue Jun 28, 2005 11:56 pm    Post subject: Re: Problems accessing other partitions and drives Reply with quote

Quote:

/etc/fstab:
Code:

/dev/hda3                    /                  reiserfs      noatime,notail    0 1
/dev/hda2                    none             swap         sw                   0 0
#/dev/cdroms/cdrom0    /mnt/cdrom    iso9660      auto,ro,users     0 0
#/dev/fd0                    /mnt/floppy    auto          auto,users         0 0
/dev/hda1                    /mnt/hda1     auto          noatime,users     0 0
/dev/hdb2                    /mnt/hdb2     vfat           defaults            0 0
#/dev/sda                    /mnt/usb       auto          auto,users        0 0


I'm not sure how much help fstab is, since I've played with it so many times.


I suggest you to read man mount carefully!!! You can set the user who will own files on partition without user/group/world fs access limiting support (like vfat), you can also set correct mode for files, and allow regular non-root users to mount it (BTW: i think it should be 'user' instead of 'users', setting auto for hd with known filesystem is pointless, use name of specific fs). and... please read manual page for mount...
_________________
Microsoft is not the answer, Microsoft is the question, the answer is no.
Back to top
View user's profile Send private message
grajagan
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jun 2005
Posts: 112
Location: RS/Brasil

PostPosted: Wed Jun 29, 2005 12:00 am    Post subject: Reply with quote

chmod 777 /dev/hda1
chmod 777 /dev/hdb2

/etc/fstab:

/dev/hda1 /mnt/hda1 auto noatime,users,uid=1000 0 0
/dev/hdb2 /mnt/hdb2 vfat users,uid=1000 0 0

it work's for me :)
Back to top
View user's profile Send private message
Jas-Nix
Tux's lil' helper
Tux's lil' helper


Joined: 05 Feb 2005
Posts: 113

PostPosted: Wed Jun 29, 2005 12:03 am    Post subject: Reply with quote

I might be WAY OFF here, I have actually never tried this myself, but maybe you can try chmod -R 776 /dev/hdb2 and /dev/hda1

You may have already tried this and if so I apologize for not having a better solution.

Jas-Nix
Back to top
View user's profile Send private message
karnesky
Apprentice
Apprentice


Joined: 18 Mar 2004
Posts: 218

PostPosted: Wed Jun 29, 2005 12:13 am    Post subject: Reply with quote

Jas-Nix wrote:
maybe you can try chmod -R 776 /dev/hdb2 and /dev/hda1
Careful with that recursive switch! There could be very good reasons why you don't want all subdirectories and files to have full permissions. Also note that hdb2 isn't owned by the users group, so a 776 alone wouldn't fix that. You could do 777 or chown/chgrp it.
_________________
Donate to F/OSS
Back to top
View user's profile Send private message
DAharon
Apprentice
Apprentice


Joined: 17 Jun 2004
Posts: 155

PostPosted: Wed Jun 29, 2005 1:25 am    Post subject: Reply with quote

Well, I have read the man page for mount, and I have played with this a lot, but I just can't seem to get it to work.

Ok, now I have
Code:
/dev/hda1    /mnt/hda1    auto    user,rw    0 0
/dev/hdb2    /mnt/hdb2    vfat    user,rw    0 0

in fstab.

With hdb2 UNmounted, I have this:
Code:
drwxrwxrwx  2 root users  48 Nov 15  2004 hdb2


With hdb2 mounted, it goes straight back to this:
Code:
drwxr--r--  16 root root   32768 Jan  1  1970 hdb2
Back to top
View user's profile Send private message
karnesky
Apprentice
Apprentice


Joined: 18 Mar 2004
Posts: 218

PostPosted: Wed Jun 29, 2005 1:32 am    Post subject: Reply with quote

If you're not auto-mounting it, why are you mounting it as root? Mount it as a regular user.

If you do mount it as root, chmod and/or chown the mount point (don't use the recursive switch though).
_________________
Donate to F/OSS
Back to top
View user's profile Send private message
wuzzerd
Guru
Guru


Joined: 05 Jan 2005
Posts: 467
Location: New Mexico

PostPosted: Wed Jun 29, 2005 1:41 am    Post subject: Reply with quote

DAharon wrote:
Well, I have read the man page for mount, and I have played with this a lot, but I just can't seem to get it to work.


Look carefully at what grajagan wrote:
Quote:
= "grajagan"
/etc/fstab:

/dev/hda1 /mnt/hda1 auto noatime,user,uid=1000 0 0


For ntfs and some others a user can only access the mount point if his uid is in the fstab. The uid is assigned for you and is in /etc/passwd. Changing the permissions before mounting has no effect, mount will change em. (see the man page).

I ran around in circles today doing this on a laptop on which I installed Ubuntu, until I read the man page. :?

Hope this helps.
Back to top
View user's profile Send private message
jmbsvicetto
Moderator
Moderator


Joined: 27 Apr 2005
Posts: 4734
Location: Angra do Heroísmo (PT)

PostPosted: Wed Jun 29, 2005 1:55 am    Post subject: Reply with quote

Hi.

The user parameter in /etc/fstab tells the system that you want your users to be able to mount and unmount the partition. The users parameter tells the system that you will allow other user than the one that mounted the partition to unmount it. Those parameters tell nothing regarding security to the system.
From my /etc/fstab
Code:
atlantis@atl64 ~ $ cat /etc/fstab
...
/dev/sda2               /home/c         ntfs            noauto,noatime,users,uid=atlantis       0 0
/dev/sdb3               /home/d         ntfs            noauto,noatime,users,uid=atlantis       0 0

and assuming that the fat32 system allows the same option as ntfs, you'll have to use the uid parameter for the /dev/hdb2.
The ext2 filesystem security is set in the usual Linux way - file permissions. You'll have to check the uid/gid used in the system. I would only change that if you don't plan to start RedHat ever again.
_________________
Jorge.

Your twisted, but hopefully friendly daemon.
AMD64 / x86 / Sparc Gentoo
Help answer || emwrap.sh
Back to top
View user's profile Send private message
Deathwing00
Bodhisattva
Bodhisattva


Joined: 13 Jun 2003
Posts: 4087
Location: Dresden, Germany

PostPosted: Wed Jun 29, 2005 6:19 am    Post subject: Reply with quote

Moved from Installing Gentoo to Other Things Gentoo.

Instead of assigning a UID in the options, which will limit the access to only _one_ user, add the option umask=0 (umask=0x0 for ntfs partitions works too, but not for fat), that will give write access to all users.

Code:

/dev/hda1                    /mnt/hda1     auto          noatime,users,umask=0     0 0
/dev/hdb2                    /mnt/hdb2     vfat          defaults,umask=0          0 0
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum