Mar 11

Automount partition using UUID in Ubuntu

March 11, 2008 – 6:38 pm

Updated on: 31 July, 2008 at 3:57 PM IST

Here 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 this command

sudo mkdir /media/dld


Here dld is the directory on which I want to mount sda6 partition

Step 2 (Find out UUID of the desired partition sda6)
use this command to find out UUID

blkid

or

ls /dev/disk/by-uuid

Step 3 (Open fstab file inside /etc directory)
use this command to open fstab file

sudo gedit /etc/fstab



Step 3 (Edit you fstab file to include the partition sda6 to mount on dld)
include this line (assuming the partition is NTFS)

# dld
UUID=C21477C91477BECB /media/dld ntfs defaults,force,umask=007,gid=46 0 1

So the same for other partitions


Enjoyed this post? Subscribe to Full Feeds or by Email and receive free daily updates on this Blog.

  1. 6 Responses to “Automount partition using UUID in Ubuntu”

  2. Gravatar
    1

    thank you very much!
    it was so helpful!!!

    By Laura on Mon 24th Mar, 2008

  3. Gravatar
    2

    Thanks alot. :D

    By Orbixx on Thu 24th Apr, 2008

  4. Gravatar
    3

    Thanks for the useful iformation. I changed ntfs to ntfs-3g and it worked well. :)

    By Math. on Tue 27th May, 2008

  5. Gravatar
    4

    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

  6. Gravatar
    5

    @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

  1. 1 Trackback(s)

  2. May 15, 2008: Automount partition using UUID in Ubuntu 7.10 (Gutsy) « A Bittersweet Life | blog

Post a Comment

March 2008
M T W T F S S
« Feb   Apr »
 12
3456789
10111213141516
17181920212223
24252627282930
31