LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
Search this Thread
Old 09-07-2004, 08:14 AM   #1
Alf829
Member
 
Registered: Jul 2003
Distribution: Fedora Core 2 & 5
Posts: 110

Rep: Reputation: 15
Question 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
 
Old 09-07-2004, 08:56 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 67
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
 
Old 09-07-2004, 09:49 AM   #3
Alf829
Member
 
Registered: Jul 2003
Distribution: Fedora Core 2 & 5
Posts: 110

Original Poster
Rep: Reputation: 15
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
 
Old 09-07-2004, 02:52 PM   #4
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 67
You may not have USB hotplugging support compiled into the kernel.
 
Old 09-08-2004, 08:26 AM   #5
Alf829
Member
 
Registered: Jul 2003
Distribution: Fedora Core 2 & 5
Posts: 110

Original Poster
Rep: Reputation: 15
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
 
Old 09-09-2004, 04:43 PM   #6
globeTrotter
Member
 
Registered: Feb 2004
Location: Townsville, Queensland, Oz
Distribution: Red Hat 9
Posts: 107

Rep: Reputation: 15
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
 
Old 09-09-2004, 05:34 PM   #7
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 67
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.
 
Old 09-22-2004, 10:09 AM   #8
BIACS
Member
 
Registered: Apr 2004
Location: Arlington, TX
Distribution: Fedora Core 4 64bit
Posts: 95

Rep: Reputation: 15
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.

Last edited by BIACS; 09-22-2004 at 10:13 AM.
 
Old 10-06-2004, 04:24 AM   #9
magnetoza
LQ Newbie
 
Registered: Oct 2004
Location: Cape Town
Distribution: Fedora Core 2
Posts: 2

Rep: Reputation: 0
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.

Last edited by magnetoza; 10-06-2004 at 04:32 AM.
 
Old 10-07-2004, 10:21 AM   #10
BIACS
Member
 
Registered: Apr 2004
Location: Arlington, TX
Distribution: Fedora Core 4 64bit
Posts: 95

Rep: Reputation: 15
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)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
usb controller dies mounting external usb hard disk komasoftware Linux - Hardware 4 11-30-2005 01:18 PM
Using USB memory disk in solaris. UltraSoul Solaris / OpenSolaris 1 06-20-2005 12:07 PM
hot/cold plugging a Belkin F5D7010 wufo Linux - Laptop and Netbook 1 12-29-2004 06:14 AM
Hot-plugging a SCSI Tapedrive ganninu Linux - Hardware 1 05-03-2004 11:05 AM
mounting disk-on-chip flash memory SirRobbin Linux - Hardware 0 08-20-2003 08:07 AM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration