Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I need a way to mount a usb drive without using fstab.

I Cannot use fstab because the drive is not connected to my computer at boot. This causes an issue during any one off reboots because start up hang waiting for this device until a keyboard intervention to skip it.

I cannot use my current script with just does mount /dev/sde1 /media/Backup because sometimes it changes to sdf.

Consider this a server install. I can't use tools at the user or GUI level.

I suppose the sum of my question is how to manually mount a USB drive from the commandline considering the reliability of the /dev/sd value isn't consistent.

share|improve this question

3 Answers 3

You should get the UUID of the drive (e.g $ blkid /dev/sde1), then mount with /dev/disk/by-uuid/ instead of the normal method (e.g $ mount /dev/disk/by-uuid/[UUID] /media/drive). The UUID is intrinsic to the disk, so it should work regardless of the device used to mount it.

share|improve this answer
    
Similarly, you could use /dev/disk/by-label, but that can create ambiguity (i.e two drives with the same name). –  astex Oct 30 '12 at 23:51
    
Thank you, this worked for me too. I just wonder how Ubuntu automatically does it for you and removes the empty folders under /media/myusername when the drive isn't mounted. –  Sridhar-Sarnobat Jun 13 '13 at 18:26
  1. Connect your usb disk
  2. sudo blkid
  3. Add a line to the .gnomerc script with mount -U [drive's UUID] [any other option you might want]

I never did this so there might be some changes to make it actually work.

share|improve this answer
1  
The gnomerc script will not be run if no instance of X is run as may be the case here. –  astex Oct 31 '12 at 13:38

This is what I use:

PySDM is a PyGTK-based Storage Device Manager that allows full customization of hard disk mount points without the need to edit fstab manually. It also allows the creation of udev rules for dynamic configuration of storage devices.

Search for it in the Software Centre... nice and easy GUI...

Once installed search for STORAGE DEVICE MANAGER in your apps list...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.