-   Linux - Newbie (
-   -   Is it possible to make a system only mount specific uuid's? (

EStyles 02-23-2013 08:45 PM

Is it possible to make a system only mount specific uuid's?
I'm not sure if this is the best section to post this question but I am wondering if it is possible to make my system mount only specific uuid's. For instance if I were to make a list of the uuid's of my devices and store it somewhere on my system could I make it so that my system would only mount the devices with those uuid's and ignore any other devices? Let me know if I need to attempt to explain better.

jlinkels 02-23-2013 08:53 PM

Your /etc/fstab would look like this:

# /etc/fstab: static file system information.
# <file system> <mount point>  <type>  <options>      <dump>  <pass>
proc            /proc          proc    defaults        0      0
# /dev/sda3      /              ext3    errors=remount-ro 0      1
UUID=bf8c8574-0f87-4e5f-b6dc-5556717422a8      /              ext3    errors=remount-ro 0      1
# /dev/sda6      /home          ext3    defaults        0      2
UUID=3e3e8e5b-55d5-4ad6-9b83-1d65e1daeeee      /home          ext3    defaults        0      2
# /dev/sda7      /usr            ext3    defaults        0      2
UUID=4489365e-ca85-47eb-879d-c887a9490e16      /usr            ext3    defaults        0      2
# /dev/sda8      /var            ext3    defaults        0      2
UUID=4285d595-b920-4100-a449-30a7b0a5c812      /var            ext3    defaults        0      2
# /dev/sda9      /movies        ext3    defaults        0      2
UUID=64fb12d8-1ace-44d2-be6d-6bb331f2ec82      /movies        ext3    defaults        0      2
# /dev/sda5      none            swap    sw              0      0
UUID=39949c15-6db9-4a7a-afca-912165f30fe4      none            swap    sw              0      0

Note the comment '#' before /dev/sdaN

Obviously your partitions, mount points and UUIDs are different. You obtain the UUIDs with the blkid command.


EStyles 02-25-2013 03:33 PM

Thanks for the reply. Seems to be working for me. :-)

Shadow_7 02-25-2013 05:34 PM

You can add noauto to have them NOT auto mount on boot. Probably safer than having a commented / missing entry in /etc/fstab. Unless you add user or group, only root should have the option to mount them. But root has the option to do that even if they are not in the /etc/fstab.

The blkid plus UUID route is definitely the way to go. My desktop flip flops the dev names on my drives because I have an older machine with a mixture if IDE (pata) and SATA drives. And if you boot with a usb stick plugged in, it gets a different /dev/ name than if you plug it in after booting.

All times are GMT -5. The time now is 07:02 AM.