I have ubuntu 12.04 and I need a portable solution (to work on various linux systems) and to be in my user's home directory for mounting a partition after login or after boot.

From what I searched on web I saw that using udisks is the best solution but what I did not find is how to mount the auxiliary partition to a specified mount point (directory path)

What I have so far is (by device name):

/usr/bin/udisks --mount /dev/sdbX

or (by uuid):

/usr/bin/udisks --mount /dev/disk/by-uuid/1313-F422

but there is no example on how to specify the mount point.

For me, it is mandatory to have a specific directory target (/media/AUX/ for example).

Is there a way to do this (not necessarily using udisks) ?


udisks won't mount your partitions like this. Moreover if you want persistent mount I'd suggest to edit /etc/fstab to add:

UUID=YOUR_OWN_PARTITION_UUID /media/AUX/ ext4 defaults 0 0

Note: edit /etc/fstab using sudo as it requires root privileges

Then reboot to see your drive / partition properly mounted

  • 2
    Yes, this was my first choice, but the problem is the partition is mounted by root, and I will need to change the mountpoint dir rights, and also I have to create the mount point before rebooting. I would need the mount to create the mountpoint automaticaly with my user access rights. – ungalcrys Mar 12 '14 at 11:46

Not with udisks

If this is a USB connected device (portable solution), all you have to do is change the label on the disk to match what you want. (you can use gparted or Disk Utility for this for example). A USB connected drive/partition labelled AUX will automatically be mounted at /media/AUX.

  • @ungalcrys does the above meet your criterion? If not, why? I'd love to help – Elder Geek Mar 13 '14 at 21:47
  • the portable solution refers to the script file or configuration needed to have the job done (mount the device to a specified directory) but not using the sudo and preferably changes must be in my home directory – ungalcrys Apr 24 '14 at 16:13
  • 1
    @ungalcrys When reading your original question I find the statement "For me, it is mandatory to have a specific directory target (/media/AUX/ for example)." 1) sudo is not required for the answer I provided and 2) "preferably changes must be in my home directory" wasn't in the question. If it's mandatory to have access from your home directory, make a link to /media/AUX in your home directory. I hope this helps. – Elder Geek Apr 25 '14 at 14:58
  • @ungalcrys Improve your question by specifying your criteria for an acceptable answer – Elder Geek Apr 30 '14 at 18:16

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.