Find the answer to your Linux question:
Results 1 to 10 of 10
Recently I installed Fedora 12. When I looked into the /etc/fstab, I was supprized to see the following notation: Code: UUID=5fd64801-5018-40ea-bed4-eb91607a6ca9 / ext4 defaults 1 1 /dev/sda2 swap swap defaults ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie blnl's Avatar
    Join Date
    Jan 2009
    Location
    The Netherlands
    Posts
    170

    Question [SOLVED] What is UUID ?


    Recently I installed Fedora 12. When I looked into the /etc/fstab, I was supprized to see the following notation:
    Code:
    UUID=5fd64801-5018-40ea-bed4-eb91607a6ca9  /     ext4  defaults  1 1
    /dev/sda2                                  swap  swap  defaults  0 0
    This is completely different from the openSUSE notation that I'm familiar with:
    Code:
    /dev/disk/by-id/scsi-SATA_HDS728080PLA380_PFDB32S6R2DKHN-part1   /windows/C  ntfs-3g  users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
    /dev/disk/by-id/scsi-SATA_HDS728080PLA380_PFDB32S6R2DKHN-part2   swap        swap     defaults 0 0
    /dev/disk/by-id/scsi-SATA_HDS728080PLA380_PFDB32S6R2DKHN-part3   /           ext3     acl,user_xattr 1 1
    Will something like /dev/disk/by-id/scsi-SATA_HDS728080PLA380_PFDB32S6R2DKHN-part2 be understood by Fedora?

    If have to use UUID, how do I find UUID codes of all my partitions?
    (I don't like the mix of UUID and /dev/sda. If possible I'd prefer to have the fstab uniform and readable.)
    Fedora_20@Dell_Latitude_E7440
    Ubuntu_14.04_LTS@HP_Compaq_DC7100

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Check this Wiki page on UUID.
    You can check UUID using one of these commands :
    Code:
    ls /dev/disk/by-uuid
    ls /dev/disk/by-id  ( in OpenSUSE )
    blkid
    I don't like the mix of UUID and /dev/sda. If possible I'd prefer to have the fstab uniform and readable.
    Both OSes use separate /etc/fstab files and there is no way to make those uniform unless you use device name instead of UUID in Fedora and id in SUSE.

    Code:
    /dev/sda1   /        ext4  defaults  1 1
    /dev/sda2  swap  swap  defaults  0 0
    Note that Its not recommended to use device name in /etc/fstab file.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    The UUID is a unique identifier for a disc and/or partition. However, if you ever want to change your disc and create a new partition for the same mount point, you are SOL until you also change your /etc/fstab. Myself, I prefer to give the partition a label with the -L "labe.-name" option to mkfs when I create it. Then, when I install a new (bigger, better) disc, I can give it the same label and not have to change the contents of fstab, provided I use the LABEL="label-name" style of entry to identify the partition.

    Note as to what Casper said, it is not recommended that you use the device name in fstab since that can change magically if you install a new disc into the system.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Newbie blnl's Avatar
    Join Date
    Jan 2009
    Location
    The Netherlands
    Posts
    170
    Thanks guys, for the explanation. It is much clearer now.

    devils casper:
    I'll play with the commands you gave, and try to see if I can understand the ID's and UUID's of my HDD's. If I have more questions I'll post them in this thread. So, please stay tuned.

    Rubberman:
    Can I add a label to a disk which already has a file system, and how?
    Fedora_20@Dell_Latitude_E7440
    Ubuntu_14.04_LTS@HP_Compaq_DC7100

  6. #5
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    Quote Originally Posted by blnl View Post
    Thanks guys, for the explanation. It is much clearer now.

    devils casper:
    I'll play with the commands you gave, and try to see if I can understand the ID's and UUID's of my HDD's. If I have more questions I'll post them in this thread. So, please stay tuned.

    Rubberman:
    Can I add a label to a disk which already has a file system, and how?
    For ext2/ext3 file systems, you can use the tune2fs tool to label existing file systems.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #6
    Linux Newbie blnl's Avatar
    Join Date
    Jan 2009
    Location
    The Netherlands
    Posts
    170
    Quote Originally Posted by devils casper View Post
    Check this Wiki page on UUID.
    You can check UUID using one of these commands :
    Code:
    ls /dev/disk/by-uuid
    ls /dev/disk/by-id  ( in OpenSUSE )
    blkid
    I have a few more questions about the disk ID's/labels.

    The output of blkid on my laptop is:
    Code:
    linux-nc6000:/home/boris # blkid
    /dev/sda1: UUID="A248A12348A0F6E7" LABEL="System" TYPE="ntfs" 
    /dev/sda2: TYPE="swap" 
    /dev/sda3: LABEL="linux_root" UUID="b4f685fa-c221-4793-9eaa-5719fabc0432" TYPE="ext3" 
    /dev/sda4: LABEL="linux_home" UUID="25791ed8-a4ee-4b14-a89b-682c57537188" TYPE="ext3" 
    linux-nc6000:/home/boris #
    I notice that NTFS partition (/dev/sda1) has shorter UUID than the ext3 partitions?
    Why is that?
    If I change the UUID of the NTFS partition will Windows XP have problems with it?



    When I list the partitions by-id I notice that each partition has several different ID's.
    Is this normal?
    Will all of these work in fstab?
    Code:
    linux-nc6000:/home/boris # ls /dev/disk/by-id -l
    total 0
    lrwxrwxrwx 1 root root  9 2010-01-25 22:33 ata-ST96812A_5PJ14Q1M -> ../../sda
    lrwxrwxrwx 1 root root 10 2010-01-25 22:33 ata-ST96812A_5PJ14Q1M-part1 -> ../../sda1
    lrwxrwxrwx 1 root root 10 2010-01-25 22:33 ata-ST96812A_5PJ14Q1M-part2 -> ../../sda2
    lrwxrwxrwx 1 root root 10 2010-01-25 22:33 ata-ST96812A_5PJ14Q1M-part3 -> ../../sda3
    lrwxrwxrwx 1 root root 10 2010-01-25 22:33 ata-ST96812A_5PJ14Q1M-part4 -> ../../sda4
    lrwxrwxrwx 1 root root  9 2010-01-25 22:33 edd-int13_dev80 -> ../../sda
    lrwxrwxrwx 1 root root 10 2010-01-25 22:33 edd-int13_dev80-part1 -> ../../sda1
    lrwxrwxrwx 1 root root 10 2010-01-25 22:33 edd-int13_dev80-part2 -> ../../sda2
    lrwxrwxrwx 1 root root 10 2010-01-25 22:33 edd-int13_dev80-part3 -> ../../sda3
    lrwxrwxrwx 1 root root 10 2010-01-25 22:33 edd-int13_dev80-part4 -> ../../sda4
    lrwxrwxrwx 1 root root  9 2010-01-25 22:33 scsi-SATA_ST96812A_5PJ14Q1M -> ../../sda
    lrwxrwxrwx 1 root root 10 2010-01-25 22:33 scsi-SATA_ST96812A_5PJ14Q1M-part1 -> ../../sda1
    lrwxrwxrwx 1 root root 10 2010-01-25 22:33 scsi-SATA_ST96812A_5PJ14Q1M-part2 -> ../../sda2
    lrwxrwxrwx 1 root root 10 2010-01-25 22:33 scsi-SATA_ST96812A_5PJ14Q1M-part3 -> ../../sda3
    lrwxrwxrwx 1 root root 10 2010-01-25 22:33 scsi-SATA_ST96812A_5PJ14Q1M-part4 -> ../../sda4
    linux-nc6000:/home/boris #


    In the meantime I found that each partition can be identified by a path as well.
    Can I use these in fstab?
    Code:
    linux-nc6000:/home/boris # ls /dev/disk/by-path -l
    total 0
    lrwxrwxrwx 1 root root  9 2010-01-25 22:33 pci-0000:00:1f.1-scsi-0:0:0:0 -> ../../sda
    lrwxrwxrwx 1 root root 10 2010-01-25 22:33 pci-0000:00:1f.1-scsi-0:0:0:0-part1 -> ../../sda1
    lrwxrwxrwx 1 root root 10 2010-01-25 22:33 pci-0000:00:1f.1-scsi-0:0:0:0-part2 -> ../../sda2
    lrwxrwxrwx 1 root root 10 2010-01-25 22:33 pci-0000:00:1f.1-scsi-0:0:0:0-part3 -> ../../sda3
    lrwxrwxrwx 1 root root 10 2010-01-25 22:33 pci-0000:00:1f.1-scsi-0:0:0:0-part4 -> ../../sda4
    lrwxrwxrwx 1 root root  9 2010-01-25 22:33 pci-0000:00:1f.1-scsi-1:0:0:0 -> ../../sr0
    linux-nc6000:/home/boris # ls /dev/disk/by-id -l
    Fedora_20@Dell_Latitude_E7440
    Ubuntu_14.04_LTS@HP_Compaq_DC7100

  8. #7
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    Whatever you do, don't change the UUID. UUID stands for Universally Unique IDentifier. In the case of the drive/file system, that id is assigned by the operating system based upon a number of factors that generate an ID which can be assumed to be unique (probably). Changing it yourself has no purpose, and may well make the drive and/or file system inaccessible to you. Just leave it alone. Labels are another matter, and there are tools to set or change them that you can use. As for the shorter UUID for the NTFS partition, that as I mentioned is a matter for the OS to decide how it is generated. Don't concern yourself with that is probably the best advice I can give in that regard.

    Yes, it's possible for a drive/partition to have more than one entry in /dev/disk/by-id, but I'm not sure how it happens. On my system, my drives only show one entry per disc and partition. However, all my drivers are sata drives. Yours may either be ide drives, or you have the sata->ide translation enabled in the bios, in which case the OS may see more than one "alias" for each disc and partition. Perhaps someone else can shed more light on this subject.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  9. #8
    Linux Newbie blnl's Avatar
    Join Date
    Jan 2009
    Location
    The Netherlands
    Posts
    170
    Quote Originally Posted by Rubberman View Post
    Yes, it's possible for a drive/partition to have more than one entry in /dev/disk/by-id, but I'm not sure how it happens. On my system, my drives only show one entry per disc and partition. However, all my drivers are sata drives. Yours may either be ide drives, or you have the sata->ide translation enabled in the bios, in which case the OS may see more than one "alias" for each disc and partition. Perhaps someone else can shed more light on this subject.
    This is an IDE drive, but indeed somehow system sees it as a SATA. I assume that is the reason for /dev/sda name. I was always wandering why openSUSE sees it as SATA. However, when I boot with gparted-LIVE-CD this disk is named /dev/hda.
    Fedora_20@Dell_Latitude_E7440
    Ubuntu_14.04_LTS@HP_Compaq_DC7100

  10. #9
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    A few years ago, the system disc drivers were altered to emulate scsi (and sata) drives so that software that spoke "scsi" instructions could work without fuss, resulting in /dev/sdx instead of /dev/hdx for these. I'm not sure why gparted still uses /dev/hdx for ide drives unless they are using older drivers. Anyway, using labels on your disc partitions is a good idea, and to use them when identifying your file systems in /etc/fstab is even better, because that way it doesn't matter if your boot drive is seen as /dev/sda or /dev/hda - mount will still see the label and mount the drive properly.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  11. #10
    Linux Newbie blnl's Avatar
    Join Date
    Jan 2009
    Location
    The Netherlands
    Posts
    170
    Thanks for the explanation!

    I think that I have enough information now to organize my fstab in a more readable way.
    Fedora_20@Dell_Latitude_E7440
    Ubuntu_14.04_LTS@HP_Compaq_DC7100

Posting Permissions

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