LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (http://www.linuxquestions.org/questions/fedora-35/)
-   -   hot plugging and mounting a USB memory disk (http://www.linuxquestions.org/questions/fedora-35/hot-plugging-and-mounting-a-usb-memory-disk-227670/)

Alf829 09-07-2004 09:14 AM

hot plugging and mounting a USB memory disk
 
Hi all,

I'm running Fedora Core 2 Test 1 with kernel 2.6.4 and am wondering how to mount my USB disk after I hot-plug it in and without having to reboot.

Currently, everytime I plug something into my USB port (disk or mouse), I have to reboot linux in order for it to recognise that there is a device on the USB port. This negates the point of USB devices and I would like to be able to hot-plug a device in and have Linux detect and mount it. Is that possible?

Regards,
Alf

rjlee 09-07-2004 09:56 AM

You can look at the Kernel automounter daemon, but I think it needs some setup to get it working. SuSE 9.1 certainly supports automounting out of the box (version 8.something didn't; at least, it didn't work for me).

You can also mount something manually by running the command
Code:

mount /mnt/usbdisk
(substitute the correct mount-point for your setup). You can do this as a regular user by adding the user option to the /etc/fstab file on the line containing /mnt/usbdisk. If you add the sync option to the same line, then you can also unplug the device without unmounting it without the risk of losing data (so long as the write light is off), at the cost of a slightly less efficient way of accessing the disk.

Hope that helps,

— Robert J. Lee

Alf829 09-07-2004 10:49 AM

Hi rjlee,

Thanks very much for the info. However, FC2 does not recognise that a device is even plugged in to the USB port, so mounting it doesn't work (comes back with an error saying no such mount point)

I'll take a look at the automount though.

Oh, if I put the /mnt/usbdisk line in the /etc/fstab file, does that mean that FC2 will load up the required files during bootup so that I can mount the disk whenever I plug it in? Or would that not do anything ie still require a reboot to recognise a usb device is plugged in?

Regards,
Alf

rjlee 09-07-2004 03:52 PM

You may not have USB hotplugging support compiled into the kernel.

Alf829 09-08-2004 09:26 AM

Quote:

Originally posted by rjlee
You may not have USB hotplugging support compiled into the kernel.
hmm, where would that be located in the kernel configuration tree? I haven't seen any option about USB hotplugging when I built my kernel 2.6.4

globeTrotter 09-09-2004 05:43 PM

Hi

this is how i mount my usb memory stick
root#mkdir /mnt/usbmem

then as user

user$mount -t vfat umask=0000 /dev/sda1 /mnt/usbmem

to unmount

user$umount /mnt/usbmem

or add the following in the /etc/fstab file

/dev/hda1 /mnt/usbmem vfat noauto,user 0 0

right click the desktop, click 'create new' -> hard disk ->device tab
from the drop down box pick
/dev/sda1 (/mnt/usbmem)
this will put an access icon on your desktop, just like a cd or floppy. plug in the usb memory stick and double click the icon to mount it.

regards
GT

rjlee 09-09-2004 06:34 PM

Quote:

Originally posted by Alf829
hmm, where would that be located in the kernel configuration tree? I haven't seen any option about USB hotplugging when I built my kernel 2.6.4
Sorry; I've just checked. I think you actually need Support for Hotpluggable Devices under General Setup.

BIACS 09-22-2004 11:09 AM

I can´t say about the 2.6.4 kernel but I´ve been able to get the following to work on the FC2 2.6.5 and 2.6.8 kernels, they both had UHCI and EHCI modules enabled out of the box. Install submount (http://submount.sourceforge.net/). There are two installations within the download, subfs-0.9 and submountd-0.9. Both are very easy to install. If you already have created the mount points where you want the USB to go then skip this next step, otherwise
Open a terminal window -> type su - and enter root password when prompted
-> typemkdir /mnt/USB or wherever you want and any name you want
-> type vim /etc/fstab hit i while in the fstab to enter Insert mode
-> go to the bottom and enter the following line, change the name of the mount point to match yours

/dev/sda1 /mnt/USB subfs fs=vfat,umask=000 0 0

Hit Esc and then type :wq this will write the changes to the fstab. Reboot the computer. When you log back in, insert your USB drive and open the /mnt/USB (or appropriate dir), you should see the contents and have rw capabilities also.

This will make the USB device ¨hot swappable¨, the only time I´ve run into a problem is when I remove it from one USB port, plug it in to another, and try to put it back in the original port. I´ve had to do an fuser /mnt/USB and kill the process number. After that it was fine.

magnetoza 10-06-2004 05:24 AM

can't get it 2 work help plz???
 
i have followed the instructions
but i get tuned that ..mount: fs type subfs not supported by kernel
but i have the lastest fc2 kernel..???
how can i find out if i have these 2 mods install or not UHCI and EHCI..i have tried 2 locate them..
can any1 help me out plz

Quote:

Originally posted by BIACS
I can´t say about the 2.6.4 kernel but I´ve been able to get the following to work on the FC2 2.6.5 and 2.6.8 kernels, they both had UHCI and EHCI modules enabled out of the box. Install submount (http://submount.sourceforge.net/). There are two installations within the download, subfs-0.9 and submountd-0.9. Both are very easy to install. If you already have created the mount points where you want the USB to go then skip this next step, otherwise
Open a terminal window -> type su - and enter root password when prompted
-> typemkdir /mnt/USB or wherever you want and any name you want
-> type vim /etc/fstab hit i while in the fstab to enter Insert mode
-> go to the bottom and enter the following line, change the name of the mount point to match yours

/dev/sda1 /mnt/USB subfs fs=vfat,umask=000 0 0

Hit Esc and then type :wq this will write the changes to the fstab. Reboot the computer. When you log back in, insert your USB drive and open the /mnt/USB (or appropriate dir), you should see the contents and have rw capabilities also.

This will make the USB device ¨hot swappable¨, the only time I´ve run into a problem is when I remove it from one USB port, plug it in to another, and try to put it back in the original port. I´ve had to do an fuser /mnt/USB and kill the process number. After that it was fine.


BIACS 10-07-2004 11:21 AM

If you are receiving a message ... fs type subfs is not supported, then it sounds as if you need to re-install the submount package (from the sourceforge link)


All times are GMT -5. The time now is 05:04 AM.