kanotix.com

General Support - usb mount

anotheruser - 25.07.2006, 12:27 Uhr
Titel: usb mount
Hello

How i can mount usb devices as user?

(using 2.6.17.3-slh64-smp-1)
devil - 25.07.2006, 13:24 Uhr
Titel: usb mount
are they in fstab or do you pop them in and out?


greetz
devil
anotheruser - 26.07.2006, 00:49 Uhr
Titel: RE: usb mount
They are not in fstab, since they are 3 devices.
testdriver - 26.07.2006, 04:38 Uhr
Titel:
One way could be this:

2. Open a terminal and become root ( I hope you knowhow)

3. plugin the devices

4. In the terminal type
Code:
dmesg | grep sd*


5. look for lines that either include sda, sdb and sdc or sda1 sda2 sda3. The only thing important is to know if the devices are called sda1, sda2 etc or sda, sdb etc.

Incase they are called sda, sdb and sdc (which is most likely) you should think of a name that you want to give those devices to link to for instance usb-hdd1 usb-hdd2 etc or what ever you think is handy. I will use the usb-hdd name here.

Oke you know the devices and you have choosen a name for the link now we want to automate the proces.

7. Still as root type for all devices
Code:
mkdir /media/"yourchoosenname"
So for example
Code:
mkdir /media/usb-hdd1 && mkdir /media/usb-hdd2 && mkdir /media/usb-hdd3


8. check if they are set by typing
Code:
ls /media


9. Now open /etc/fstab in nano for example or another editor you prefure but make sure you open it as root

Incase of nano:

10: nano -w /etc/fstab (you should see the fstab file now. Dont edit any line all you need to do is add 3 lines
Code:

/dev/sda      /media/usb-hdd1   vfat user,noauto     0       0
/dev/sdb      /media/usb-hdd2   vfat user,noauto     0       0
/dev/sdc      /media/usb-hdd3   vfat user,noauto     0       0


Close nano by pushing Ctrl+O to save the file and Ctrl+X to close.
Exit root and the terminal and thats it.


Note1. the usb-hdd* name is an example like i sad before you should pick a name that make sence to yourself.

Note2. I asumed the filesystem on the devices are fat incase its not you should replace vfat for the correct type, iso9660 incase of cd/dvd ot ntfs incase of ntfs drives, but I guess you can figure that out easely.

Note3: Incase you want to automount the devices at boot all you need to do is replace noauto for auto.
testdriver - 26.07.2006, 04:47 Uhr
Titel:
Ow when you replug them everytime sine it are 3 devices you could plug them 3 times, check the dmesg to see what device name they get (the sda part) and do the same thing as desciped earlier only now with the name it gets when plugged. If the name is the same every time you only need one line in fstab pointing to the device and to the linkpoint in /media.

If you are in hury you could do a mount (as root) directly in the terminal by typing
Code:
 mount /dev/$name you got from dmesg" -t "filetype" /media/"mountpoint"

Remember no matter what You use you allways need to make a mountpoint link.
So for example again:
Code:
 mount /dev/sda1 -t vfat /media/usb-hdd


Goodluck
t-bone - 26.07.2006, 07:40 Uhr
Titel:
This is what I did:

[imdeemvp@localhost imdeemvp]$ cd /mnt/ <-as user cd yourself to the mnt folder and become root to create directory
[imdeemvp@localhost mnt]$ su
Password:
[root@localhost mnt]# mkdir usbflash <- this created a directory in the mnt folder

[root@localhost mnt]# ls /mnt/ <-this command listed all my directories the mnt folder
cdrom cdrom1 floppy usbflash

[root@localhost mnt]# mount /dev/sda1 /mnt/usbflash <-this is the command to mount flash card reader

[root@localhost mnt]# ls usbflash

Hope it works for you...it did for my USB key that did not mount automatically, although my USB hard drive does every time.

Do not forget to unmount it before unplugging it!

umount -f /mnt/sda1

Have fun! Sehr glücklich
anotheruser - 26.07.2006, 08:05 Uhr
Titel:
Thank you for your help.
This is what i have been doing till i got bored.
I was sure this was due to some security bug, since i could mount usb devices in konqueror as root but not as user.
After playing with a lot of groups, kde works properly if you add the user to plugdev. Sehr glücklich
t-bone - 26.07.2006, 18:23 Uhr
Titel:
Great to know! Sehr glücklich
Alle Zeiten sind GMT + 1 Stunde
PNphpBB2 © 2003-2007