[SOLVED] bash take known uuid and feed to fsarchiver as /dev/sdwhateveritisnow
OK, I figured it out!
smallpond you were sooo close. You should use: ls -l /dev/disk/by-uuid/
which gives the example result:
lrwxrwxrwx 1 root root 10 May 29 17:13 5e02d4ae-5476-471c-bec1-529801e35941 -> ../../sdb2
lrwxrwxrwx 1 root root 10 May 29 17:13 9da321dc-f08c-456a-b6f4-66b559893994 -> ../../sda1
lrwxrwxrwx 1 root root 10 May 29 17:13 BB75-CADC -> ../../sdb3
lrwxrwxrwx 1 root root 10 May 29 17:13 c508ff5e-fe52-447a-a66c-92e8f63db180 -> ../../sdb1
But that's still not what I'm looking for. While it connects the UUID to the /dev/sd?# I'd have pipe together a bunch of cuts to get the result I want. Also notice that /dev/sdb3 isn't the same length as the other UUIDs. That means even more has to be done to get the result I need.
That's when I went back to blkid where I got my UUIDs in the first place. I RTFM for blkid and found: blkid -U <UUID> (BTW, that option is a capital U). So, lets say for example that I know my destination UUID is 9da321dc-f08c-456a-b6f4-66b559893994, but I don't know what the current /dev/sd?# is for it.
blkid -U 9da321dc-f08c-456a-b6f4-66b559893994
gives me the example result:
/dev/sda1
And that is exactly what I'm looking for!
|