LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Only root access to automounted USB drive (https://www.linuxquestions.org/questions/linux-software-2/only-root-access-to-automounted-usb-drive-342811/)

denis1314 07-13-2005 10:37 AM

Only root access to automounted USB drive
 
Hi All,

I use a SUSE 9.3 distribution that has hotplug installed. When I plug an external Hard Disk, I have only ready only user access and read write access as root.

changing the parameters in the file /etc/sysconfig/hotplug does not help:

HOTPLUG_DO_MOUNT="manual"
HOTPLUG_MOUNT_TYPE="fstab"
HOTPLUG_USE_SUBFS="no"

even if there are the correct param in the fstab file:

/dev/sdg1 /media/usbdisk subfs rw,noauto,users,sync,fs=ext3 0 0
/dev/sdg2 /media/usbdisk_1 subfs rw,noauto,users,sync,fs=reiserfs 0 0

BUT if the filesystem on the USB disk is FAT32 I get a rw access to this !!
reading the /etc/mtab show that the submountd does not seem to take into account my fstab

suggestions ??

Many thanks

Denis Dupont
Geneva

Lleb_KCir 07-13-2005 11:09 AM

when you figure that out, please let me know. i have the same issue with debian on the 2.6.11 kernel. i have rw permissions in my /etc/fstab, but it does not matter only root has those permissions and it still gives me plenty of error msg, but does what i tell it to do.

user can not to squat other then read my USBstick.

phil.d.g 07-13-2005 11:20 AM

remove the 's' from 'users' in both lines

denis1314 07-13-2005 12:02 PM

Only root access to automounted USB drive
 
submountd tends to replace mountd I suppose for the main Linux distributors. see submount.sourceforge.net/ to check that I correctly understood this. That means changing interpretation of fstab file (noauto,umask .... not processed anymore)
The new option procuid does not help

the option user and users are different but not usefull with this new interpretation of fstab.

the thread will stay open !

thanks

Denis

phil.d.g 07-13-2005 12:17 PM

I weren't threatening to close your thread!

I know the two options are different, I'm not exactly sure how 'users' work but I know 'user' will make all the files owned by the user that mounts the device aswell as allowing a normal user to mount/umount that device

Oh, and do you know for sure that the option 'rw' does have an affect if others like 'users' don't? I don't have much knowledge about mountd and submountd to be able to be able to help much further, sorry

Lleb_KCir 07-13-2005 12:44 PM

here is my line in /etc/fstab and it does not alow users to mount and once root mounts users can only read not write to my USB stick

Code:

/dev/sda1      /mnt/USBdrive  auto    user,rw,noauto  0      0
do i goof on that line?

Lleb_KCir 07-13-2005 12:45 PM

also once you make a change to fstab, do you have to reboot for it to take effect or is there an other way around that like restarting some service?

denis1314 07-13-2005 03:03 PM

I changed my fstab and saw the results on mtab after having unplugged and replugged the USB disk.
It seems that the kernel ( chkconfig --list | grep mount shows nothing) calls submountd which is an executable located in /sbin.

hope to discuss later
Thanks
Denis

Lleb_KCir 07-16-2005 03:40 PM

well could not get auto mounter to work, but i was successful at getting user to mount/umount my USB stick so i am happy enough for now.

taylor_venable 07-16-2005 04:04 PM

You should never have to reboot for changed settings in fstab to take effect, unless they apply to a drive that can't be unmounted. A drive can only be (safely) unmounted when it is not being used [see fuser(1)]. That said, when you plug in your USB stick, the hotplugger sees a new device, which registers as something like usb-mass-storage. If necessary, appropriate kernel modules are loaded, and the automounter daemon (tipped off by the hotplugger that something is going on) checks the kernel-assigned drive designation against fstab to find out how it should be mounted. I think that's more or less how it works. But fstab changes will take effect on the next mount, regardless.

denis1314 07-19-2005 02:06 AM

I've found a solution for me:
Formatting the external disk with FAT32 makes it writable with automount. In other words, if I connect a CFcard or an external hard disk formatted ext3 I have a user read only access and a read/write root access, but without changing anything else, when I reformat my CFCARD or HD with FAT, I get a user read/write access. So I keep the FAT32 filesystem on my external HD.

Hope it will be usefull for you also

Denis

bglnelissen 07-19-2005 09:01 AM

Quote:

Originally posted by Lleb_KCir
also once you make a change to fstab, do you have to reboot for it to take effect or is there an other way around that like restarting some service?
Code:

# umount -a
for unmounting everything. (it will not unmount the disks that are in use)

Code:

# mount -a
for mounting the whole fstab file in /etc/fstab.

so for the fstab file to take effect just type:
Code:

# umount -a;mount -a
greetings.

bas


(i have the same problem (thread) but changing filesystem ain't an option. so i am still looking for the RIGHT answer.)


All times are GMT -5. The time now is 01:03 AM.