Results 1 to 4 of 4
Hi folks,
I have a HD mounted on USB enclosure. Please advise how to allow user=satimis to mount the USB enclosure (USB drive). Tks
The HD has 2 partitions, /dev/sda1 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 11-20-2006 #1Linux Guru
- Join Date
- Sep 2004
- Posts
- 1,712
How to enable user to mount USB enclosure
Hi folks,
I have a HD mounted on USB enclosure. Please advise how to allow user=satimis to mount the USB enclosure (USB drive). Tks
The HD has 2 partitions, /dev/sda1 and /dev/sda2
corresponding mount points /media/disk /media/disk-1
# ls -l / | grep media# ls -l /mediaCode:drwxr-xr-x 4 root root 4096 Oct 20 08:41 media
I need to copy directories and files from /home/satimis on the HD preserving their owner and permission.Code:total 8 drwxrwxrwx 2 satimis satimis 4096 Oct 16 16:14 disk drwxrwxrwx 2 satimis satimis 4096 Oct 16 13:33 disk-1
FS on /dev/sda1 msdos
FS on /dev/sda2 ext3
FS on gentoo ext3
Can I copy directories/files on /dev/sda1? It is running on msdos fs.
TIA
B.R.
satimis
- 11-23-2006 #2
first edit your fstab and add this line or modify the existing line for usb to look something like this
Next add yourself in the usb group. Enjoy!!!Code:/dev/sda1 /mnt/usb subfs fs=auto,rw,users 0 0
- 11-23-2006 #3Linux Guru
- Join Date
- Sep 2004
- Posts
- 1,712
Hi apoorv_khurasia,
Tks for your advice.
$ cat /etc/group | grep usbNext add yourself in the usb group.
No printout.
What shall I add on /etc/group? TIA
B.R.
satimis
- 12-01-2006 #4
I have two solutions coming to my mind right now.
1. Go ahead with the first part (the fstab one) and do check what device (sda, sda1, sdb???) is your usb. If you can mount-umount your drive without being root than all's done....
2. If you can do so as root (which I believe you should be able to do) then try this. emerge sudo (if its already emerged then go ahead) and create a group called usb (as root)
Then edit the sudo file and allow all users in the usb group to mount/umount usb drives.Code:user # \su - Password: root # groupadd usb
How to do this?
Make a script called mountusb and place it in /sbin. The contents of the script should be
Do this nowCode:#!/bin/sh mount /mnt/usb
The last command above will open a file (/etc/sudoers) if sudo is correctly installed on your system. Add this line to the end of the file:Code:root # chmod +x /sbin/mountusb root # visudo
Mine looks like this: (my machine is turing.iitd.ac.in)Code:%usb <your-machine-hostname>=/sbin/mountusb
Now add yourself to usb group:Code:%usb turing=/sbin/mountusb
Re-login as a normal user now (kill -1 -1 and then login) and try mounting usb drive. Let me know if it works/fails.Code:root # moduser -G usb <user-name>
Good Luck!!!


Reply With Quote
