LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-23-2013, 08:45 PM   #1
EStyles
Member
 
Registered: Jun 2012
Distribution: Kali 2.0, Arch
Posts: 39

Rep: Reputation: Disabled
Question 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.
 
Old 02-23-2013, 08:53 PM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Your /etc/fstab would look like this:
Code:
# /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.

jlinkels
 
2 members found this post helpful.
Old 02-25-2013, 03:33 PM   #3
EStyles
Member
 
Registered: Jun 2012
Distribution: Kali 2.0, Arch
Posts: 39

Original Poster
Rep: Reputation: Disabled
Thanks for the reply. Seems to be working for me. :-)
 
Old 02-25-2013, 05:34 PM   #4
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
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.
 
  


Reply

Tags
mount, restrict, uuid



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to mount by-uuid if the device won't show in /dev/disk/by-uuid untill after blkid /dev/sd* ? masmddr Linux - General 4 01-10-2011 07:38 PM
Way to make autofs mount to specific USB flash drive to specific folder? utahnix Linux - Software 2 11-24-2010 05:27 PM
command to display the device-fs-uuid-mount point htamayo Linux - Newbie 2 10-26-2010 02:44 PM
How to make a specific command(s) work for specific users or group only naren_0101bits Linux - General 3 08-28-2005 05:22 PM
How to make a specific command(s) work in a specific shell only naren_0101bits Linux - Newbie 3 08-28-2005 01:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration