[PLUG] Identifying Device UUID

Daniel Pittman daniel at rimspace.net
Sat Oct 30 01:29:22 UTC 2010


Rich Shepard <rshepard at appl-ecosys.com> writes:

> I've searched with Google but despite headings that imply how to find the
> UUID of a specific device, the page contents do not really tell me how to do
> this.

You had it *almost* right, too.

>    In /etc/fstab the entry for my external backup disk is
> UUID=436bc83a-1d2b-4c58-b3a9-5dbe8efc4112  /media/hd0  ext3  defaults 0 0
>
> The past couple of mornings I see a mail message that the dirvish backup
> could not unmount the drive. When I tried from the command line this morning
> the attempt failed because the UUID did not match what the kernel saw.
> Turning off the drive, and back on about a hour later allowed me to umount
> the drive.
>
> How do I determine the UUID for devices such as this external drive? I've
> tried 'vol_id', but 'vol_id -u /media/hd0' responds that it's an unknown or
> unique media type and I see the same response if I use --uuid as the option
> to vol_id.

/media/hd0 is the *mount* point for the filesystem, not the device.  Tools
like blkid and vol_id need to look at the raw disk itself.

That means you want: blkid /dev/sda1  # or whatever raw device it is at.

[...]

Rich Shepard <rshepard at appl-ecosys.com> writes:
> On Fri, 29 Oct 2010, Gerald Turner wrote:
>
>> Could the problem be that you've changed your external drive to vfat?
>
> Not unless it was the rainy weather. It's ext3.

Also, you would still get identifying information out of it. :)

>> I just tried a USB stick formatted with vfat, at first 'blkid' didn't
>> report any information for it (maybe blkid is using a cache, or maybe it's
>> ignoring vfat partitions), but then ran 'blkid -p /dev/sdg1' ("low-level
>> probe") and it reported the UUID and other attributes just fine and
>> mysteriously, subsequently running just 'blkid' now reports the data.
>
> Huh! I did not know this tool existed. It's here, too, on Slackware.
> Running just 'bklid' with no dev specified found all partitions and returned
> the UUID and filesystem type.

O_o  How odd.  I didn't know blkid did any caching. :)

        Daniel
-- 
✣ Daniel Pittman            ✉ daniel at rimspace.net            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons



More information about the PLUG mailing list