Automount partition using UUID in Ubuntu
Scribbled on Tuesday, March 11th, 2008Here is a tutorial to mount your drive partitions using UUID (even if u change the label and swap ur hard drives this thing will not change). The UUID of a particular partition changes only after format/deletion of that drive.
Step by step approcah:
Step 1 (Create a directory in media folder to mount the desired partition)
Use mkdir command to create a directory named dld.
You should be able to write on EXT3 partition now.
Here dld is the directory on which I want to mount sda8 partition

Step 2 (Find out UUID of the desired partition sda6)
Use either blkid or the other command to find out UUID of a partition, a UUID is a unique signature identification for a partition of Hard-Disk.
or

Step 3 (Open fstab file inside /etc directory)
Use Gedit text editor to open fstab file for editing.
Step 3 (Edit you fstab file to include the partition sda6 to mount on dld)
include this line (assuming the partition is NTFS)

Similarly for other partition you can edit fstab appropriately.
e.g UUID=123456789 /media/mountdirectory ext3 defaults 0 0
Here in above screenshot see that I have mounted two EXT3 partition in the last two lines. It’s that simple

No related posts.
Related posts brought to you by Yet Another Related Posts Plugin.





6 Responses to “Automount partition using UUID in Ubuntu”
thank you very much!
it was so helpful!!!
By Laura on Mon 24th Mar, 2008
Thanks alot.
By Orbixx on Thu 24th Apr, 2008
Thanks for the useful iformation. I changed ntfs to ntfs-3g and it worked well.
By Math. on Tue 27th May, 2008
I had a little ‘problem’ with this simple tutorial. If you just created the partitions the UUIDs are not yet created and mount says something like “partition does not exist”. Therefor you have to execute “sudo partprobe” first in order to generate the proper UUIDs.
thanks for the good tutorial!
By Florian Bruckner on Tue 10th Jun, 2008
@Florian Bruckner
thanks for your extremely helpful comment, i was not aware of it
have a nice day
@Math
am glad that your problem got fixed
@Orbixx
thank you too
@Laura
at your service lady :p
By T on Sat 14th Jun, 2008