Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

My /etc/fstab contains this:

# / was on /dev/sda1 during installation
UUID=77d8da74-a690-481a-86d5-9beab5a8e842 /               ext4    errors=remount-ro 0       1

There are several other disks on this system, and not all disks are being mounted to the correct location (For example, /dev/sda1 and /dev/sdb1 are sometimes reversed).

How can I see the UUIDs for all disks on my system? Can I see the UUID for the third disk on this system?

share|improve this question
add comment

4 Answers

up vote 18 down vote accepted

In /dev/disk/by-uuid there are symlinks mapping each drive's UUID to its entry in /dev (e.g. /dev/sda1)

share|improve this answer
    
It's not readable when LVM partitions. –  Grzegorz Wierzowiecki Sep 18 '11 at 21:22
add comment

There's a tool called blkid (use it as root or with sudo),

# blkid /dev/sda1
/dev/sda1: LABEL="/" UUID="ee7cf0a0-1922-401b-a1ae-6ec9261484c0" SEC_TYPE="ext2" TYPE="ext3"

you can check this link for more info

share|improve this answer
    
I like blkid, especially when LVM2. –  Grzegorz Wierzowiecki Sep 18 '11 at 21:23
    
Just a minor comment: looks like being a member of group disk is sufficient to run blkid; no need for full superuser privileges. –  arielf Dec 14 '13 at 23:19
add comment

This works for me:

ls -la /dev/disk/by-uuid

If you want to check what type the partition is, use:

df -Th

and it will show you if you have ext3 or ext2. Today it helped me because there was a formatted ext2 partition and I thought it was ext3, which was causing the mount to fail.

share|improve this answer
    
You could always try mount -t auto /dev/sda1 /media/sda1. –  ott-- Dec 28 '12 at 21:16
add comment

To see the uuid of a hard disk partition I just boot the system up with a Linux CD and goto my computer mount, click on, the partition I want to see. The uuid number of the Linux partition will be displayed.

You can also see disk uuid by running Linux Disk utility after the Linux CD boot up.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.