LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Inserting a USB Flash Drive (http://www.linuxquestions.org/questions/linux-newbie-8/inserting-a-usb-flash-drive-884622/)

the_gripmaster 06-05-2011 05:52 AM

Inserting a USB Flash Drive
 
What command is executed when you plug in a USB Flash drive manually in the PC's USB port?

I am pluggin in the device and it is automatically getting mounted in /media/ed7a753f-df88-4984-b65a-5d3a8cc2714a. After I unmount the device using umount /media/ed7a753f-df88-4984-b65a-5d3a8cc2714a, how do I remount it from the terminal so that the weird directory gets created automatically and the Flash Drive gets mounted there?

Another question, where does the system get this ed7a753f-df88-4984-b65a-5d3a8cc2714a. Is it some kind of identification of the disk?

jschiwal 06-05-2011 06:03 AM

The 'ed7a753f-df88-4984-b65a-5d3a8cc2714a' value is from the UUID of the filesystem on the device. On some filesystems you could create a Label for the filesystem and it might be used instead.

If the device node is still present, you could use a simple mount command to mount the device. This may not be the case if you ejected the device.

If your distro has the ivman package installed, you can use `halmount <device>' to automount filesystems via HAL. Here are some examples from the manpage:
Code:

EXAMPLES
      halmount
              list all mountable devices known to hal

      halmount /dev/hdc
              mount device hdc on default mount point (/media/volumelabel)

      halmount /dev/hdc cdrom
              mount device hdc on /media/cdrom

      halmount -u "Holiday Pictures"
              umount device that has the label "Holiday Pictures"

On most distros automounting removable devices is handled by the desktop environment, and PolicyKit is used behind the scenes to provide permission to do this. On KDE 4 for example, there is a device notifier applet. It can be configured to automount certain devices and ignore others. You wouldn't need to mount the device from the console. I still use halmount however. It is very convenient for mounting and looking up device names.

the_gripmaster 06-05-2011 06:43 AM

Quote:

Originally Posted by jschiwal (Post 4376775)
If your distro has the ivman package installed, you can use `halmount <device>' to automount filesystems via HAL.

I am using Fedora 15 and could not find ivman package for my distro. Found an alternative package though to get the job done, it's called halevt

Thanks.

David the H. 06-05-2011 07:10 AM

ivman is a dead project. halevt is the working replacement. They have slightly different config syntax, but the functionality is the same.

I don't know what will happen to it when hal is fully deprecated and all its functions are merged into udev though.

For manual mounting of removable drives, pmount/pumount is the usual tool.

jschiwal 06-05-2011 07:23 AM

I didn't realize that ivman was obsolete. My distro has ivman and not halevt.

David the H. 06-05-2011 07:58 AM

Well, ivman hasn't had an update in 4 years now, and halevt appears to have been started in response. I was forced to switch over when it stopped working properly on my system, and Debian eventually removed it from its repositories. I guess a few distros just haven't noticed the changeover yet. ;)

jefro 06-05-2011 04:52 PM

This /media/ed7a753f-df88-4984-b65a-5d3a8cc2714a
would make me think the name of the usb is that.


All times are GMT -5. The time now is 11:47 PM.