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.


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.

  • 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
  • Very interesting and nice answer. I was in a similar problem as the threadstarter, only that my problem was different (an automounter tried to automatically mount my DVD, but this caused a problem elsewhere leading to an infinite loop; until I removed the entry from the fstab file, but then I had this problem of not knowing how to mount it). – shevy May 17 '20 at 1:16
  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.

  • 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...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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