Results 1 to 4 of 4

Thread: [TIP] Adding a new partition in fstab with UUID

  1. #1
    Join Date
    Apr 2007
    Location
    http://longbeach.ca.u$
    Beans
    257
    Distro
    Ubuntu 12.04 Precise Pangolin

    [TIP] Adding a new partition in fstab with UUID

    I search the Ubuntu forums first for any Ubuntu questions. So, I believe this TIP should be here.

    If you want to add a new partition in /etc/fstab under file system you no longer have /dev/xxx but an UUID (Unique unit ID). To find out the UUID of your partition just use the following command:
    Code:
    $ sudo vol_id -u device

    Thanks to this Source
    :: La repuesta de la vida, el universo y todo es 42.
    :: Do you really think anyone cares about your computer specs?

  2. #2
    Join Date
    Sep 2006
    Beans
    66

    Re: [TIP] Adding a new partition in fstab with UUID

    Thanks, this was just what I needed!

  3. #3
    Join Date
    May 2009
    Location
    Jakarta, Indonesia
    Beans
    41
    Distro
    Kubuntu 10.10 Maverick Meerkat

    Re: [TIP] Adding a new partition in fstab with UUID

    Quote Originally Posted by Ateo View Post
    I search the Ubuntu forums first for any Ubuntu questions. So, I believe this TIP should be here.

    If you want to add a new partition in /etc/fstab under file system you no longer have /dev/xxx but an UUID (Unique unit ID). To find out the UUID of your partition just use the following command:
    Code:
    $ sudo vol_id -u device

    Thanks to this Source
    I wouldn't replace /dev/xxx with a UUID, since it screws things up.

    Take a look at this post.
    http://ubuntuforums.org/showthread.php?p=7326352
    you were once a newbie too.

  4. #4
    Join Date
    Feb 2008
    Location
    In a bucket, in Dublin
    Beans
    458
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [TIP] Adding a new partition in fstab with UUID

    My UUID is shockingly short compared to the others in fstab: 847CFB207CFB0BA4 - do I have to do anything with this to make it look standard?
    UPDATE!: Don't worry, this strange number still works, even though its way different from the others in "fstab". For those wondering here's a copy of my fstab, the reason I'm posting mine is because I wanted to see an fstab example myself to see what it all looked like after placing a UUID in:
    Code:
    # /etc/fstab: static file system information.
    #
    # Use 'vol_id --uuid' to print the universally unique identifier for a
    # device; this may be used with UUID= as a more robust way to name devices
    # that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc            /proc           proc    defaults        0       0
    
    # / was on /dev/sda5 during installation
    UUID=23fcd069-72ab-4f36-823e-2c74374efd4b /               ext4    relatime,errors=remount-ro 0       1
    
    # swap was on /dev/sda2 during installation
    UUID=ecffc2c3-e7be-4145-b6f1-28c3a725acfc none            swap    sw              0       0
    
    # DVD drive
    /dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec,utf8 0       0
    
    # NTFS partition
    UUID=847CFB207CFB0BA4	/media/JOHN-DATA	ntfs-3g		user,fmask=0111,dmask=0000   0   0
    Finally, want to see if it works without a restart, type:

    Step 1.
    Code:
    sudo umount /dev/sdXX
    This will unmount the drive you want to now mount using UUID.

    Step 2.
    Code:
    sudo mount -a
    This will mount everything thats found in fstab, thats not mounted, including your drive that now has a UUID as its identifier instead of /dev/sdXX. If the drive mounts then WELL DONE!
    Last edited by jward3010; July 7th, 2009 at 03:25 PM. Reason: I tested and realised it worked, also added important info for others

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •