Is there any other method to find all the attached devices UUID through terminal(other than using the blkidcommand ?

up vote 16 down vote accepted

Try this, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

cd /dev/disk/by-uuid

List devices by entering

ll

enter image description here

the best way I found for this is:

sudo blkid

for example the output of a specific USB in my Ubuntu is:

/dev/sda1: LABEL="16GB" UUID="25495C984912BBC3" TYPE="ntfs" 
  • Oddly this comes up empty if you've just installed formatted and mounted a new drive. – hobs Sep 17 '16 at 19:28
  • Except that the OP asked "other than using the blkid command" – James Bradbury Aug 5 '17 at 7:51

You can look in /dev/disk/by-uuid/. These files are symlinks to the /dev/... device. For example, my dmraid RAID0 disk (which makes up my root partition is /dev/dm-1 so the following gets its UUID:

$ ls -l /dev/disk/by-uuid | grep dm-1
lrwxrwxrwx 1 root root 10 Nov 21 21:07 1b66bb9e-5b02-49f1-8cf9-bc3f649d70a6 -> ../../dm-1
  • the above command doesn't display anything. – Avinash Raj Dec 5 '13 at 14:27
  • 1
    I think there is not dm-1 in our case, "ls -l /dev/disk/by-uuid" works alone but "ls -l /dev/disk/by-uuid | grep dm-1" did nothing. – Sukupa91 Dec 5 '13 at 15:09
  • 1
    Exactly. As I explained in the answer, in my case my root device is /dev/dm-1. In your case it could be /dev/sda1, or something like that. – Oli Dec 5 '13 at 15:25

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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