USB flashdrive automount problem
Hi all,
I have done a lot googling and found some ways to automount my lovely USB flashdrive. However, I found that it does not work as I thought. And I have no idea on locating the problem. Anyone can help? Thanks. Here is my /etc/fstab: /dev/hda3 swap swap defaults 0 0 /dev/hda2 / reiserfs defaults 1 1 /dev/hda1 /mnt/hda1 vfat defaults,umask=000,iocharset=utf8 0 2 /dev/hdb1 /mnt/hdb1 vfat defaults,umask=000,iocharset=utf8 0 2 /dev/cdrom /mnt/cdrom iso9660 noauto,users,ro 0 0 /dev/fd0 /mnt/floppy auto noauto,users 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 proc /proc proc defaults 0 0 /dev/sda1 /mnt/usb vfat defaults,users,rw 0 0 P.S. my flashdrive will be located in /dev/sda1 everytime I plug it into a USB port. |
mine is mounted as follows,
/dev/sda1 /mnt/flash vfat users 0 0 and it works fine. |
At the time when 'mount -a' is run, hotplug has still not been run so you can't automount at that point in time. I'd put a line to mount it in
/etc/rc.d/rc.local instead. |
I faced another problem now. If I do not unmount it explicitly, it leaves the mount point in the filesystem unless using umount.
Is there anyway to fix it so that my USB flashdrive can be plugged in and removed at any time I want without issuing any commands. Thanks. |
Quote:
|
The device has to flushed before removal. mount and eject both do this.
|
I use autofs to mount and umount automatically my USB camera (which is seen as USB mass
storage), that works fine. |
Do you mean that you are able to just unplug it without any umount/eject command?
|
Quote:
Thanks. |
Quote:
then when I no longer use it, I cd to my home directory then it is automatically umounted I wait one second before disconnect it, tough to make sure |
Good to know this.
|
If you use the default kernel, autofs is already compiled (as module) so you just :
installpkg autofs then copy /usr/doc/autofs-xx.xx.xx/samples/auto* in your /etc, edit /etc/auto.misc to suit your needs and start /etc/rc.d/rc.autofs I use a konqueror link as icon in KDE so I just click on it to mount it and show the photos, when I close the konqueror window, the usb camera is umounted (I checked that with mount command without argument the first time) |
if you use the flash drive alot, you could just make bash scripts that mount and unmount, and stick them on your desktop... assuming your using a window manager with desktop icons... but you get the idea.
|
Quote:
I rename the file to rc.autofs and chmod its permission with +x flag. tried to start it. No luck. Error message: tsun@sKex:/etc$ /etc/rc.d/rc.autofs /etc/rc.d/rc.autofs: Unknown system, please port and contact autofs@linux.kernel.org One more thing, I issued 'mount' to mount my usb flashdrive and found usbfs in the screen with command 'mount'. Anything deal with that? (Usbfs, the name looks cool :rolleyes: ) tsun@sKex:~$ mount /dev/hda2 on / type reiserfs (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) /dev/hda1 on /mnt/hda1 type vfat (rw,umask=000,iocharset=utf8) /dev/hdb1 on /mnt/hdb1 type vfat (rw,umask=000,iocharset=utf8) devpts on /dev/pts type devpts (rw,gid=5,mode=620) usbfs on /proc/bus/usb type usbfs (rw) /dev/sda1 on /mnt/usb type vfat (rw,umask=000) Thanks. |
When you do :
lsmod Do you see autofs module loaded ? Also could you post your /etc/auto.misc file content ? |
Quote:
tsun@sKex:/etc/rc.d$ lsmod Module Size Used by cisco_ipsec 393868 1 snd_pcm_oss 61220 0 snd_mixer_oss 21120 3 snd_pcm_oss snd_via82xx 25632 4 snd_ac97_codec 76512 1 snd_via82xx snd_pcm 99716 4 snd_pcm_oss,snd_via82xx,snd_ac97_codec snd_page_alloc 9220 2 snd_via82xx,snd_pcm snd_mpu401_uart 7936 1 snd_via82xx snd_rawmidi 23456 1 snd_mpu401_uart nvidia 3463100 8 Quote:
Here you are: tsun@sKex:/etc/rc.d$ cat ../auto.misc # $Id: auto.misc,v 1.2 1997/10/06 21:52:04 hpa Exp $ # This is an automounter map and it has the following format # key [ -mount-options-separated-by-comma ] location # Details may be found in the autofs(5) manpage #kernel -ro ftp.kernel.org:/pub/linux #boot -fstype=ext2 :/dev/hda1 usb -fstype=vfat :/dev/sda1 #cd -fstype=iso9660,ro :/dev/hdc #floppy -fstype=auto :/dev/fd0 tsun@sKex:/etc/rc.d$ cat ../auto.master # $Id: auto.master,v 1.2 1997/10/06 21:52:03 hpa Exp $ # Sample auto.master file # Format of this file: # mountpoint map options # For details of the format look at autofs(8). /mnt /etc/auto.misc |
Have you the autofs module ?
/sbin/modprobe -l | grep autofs If yes, it is weird as /etc/rc.d/rc.autofs should load it, anyway try modprobe autofs Or maybe as built-in, in both case autofs should appear in cat /proc/filesystems |
USB automount
Does anyone know how Linspire (formerly Lindows) set up their automount? I'm not quite enough of a geek to figure it out. There setup is pretty nice though I plug my pen drive in and it auto mounts and an icon is created for it just like the cdrom. A green arrow is put on top of the icon to indicate it is mounted. When I'm done with it I right click hit unmount the green arrow goes away. Then I can unplug it at which point the icon goes away.
I also like the way that they have the cdrom set up. It automounts like most distros but if I close all windows related to the cd then it auto umounts. If anyone has any insight into this it is appreciated |
Quote:
but how to do the umount automatically ?????????? let's find out............. |
there's an rc.autofs for slackware
I found it earlier today.. http://mariner.cs.ucdavis.edu/slackw...ware/rc.autofs google ffs |
Re: USB automount
Quote:
I've experienced it....... But I don't have it on my slackware............. I'll find it out, and I'll post once I get to those machines... |
Quote:
Jim |
mtools
Hey guys...
I'm actually trying to figure out a similar problem... i've put up a thread about this already... http://www.linuxquestions.org/questi...hreadid=285696 You do not need to actually mount our unmount the USB key to access files on it... If you guys have mtools installed... just simply add the following line to your /etc/mtools.conf: drive u: file="/dev/sdb1" exclusive mformat_only (sdb or sda - depending on your system) make sure the permissions on /dev/sdb1 is set to 777 then in Konqueror type in the address ' floppy:/u ' and then you're in your USB Flash.... Do a man mtools to find out more Simple! However, my problem is that when i unplug the usb key, my /dev/sdb1 dissappears. (which is ok) But when i plug in my usb key, the device /dev/sdb1 is recreated with the permissions 700 ! (only root) Does anyone know a solution on how I can get my permissions to automatically be set to 777 when I plug in my USB Key? Thanks Zubin Parihar |
Heres my howto
Hey guys...
Here is my howto on how to access your USB Flash Device without mounting and unmounting it! http://www.linuxquestions.org/questi...hreadid=285916 Hope it helps anyone! Zubin Parihar |
All times are GMT -5. The time now is 08:49 AM. |