UUID anomaly

Rashkae ubuntu at tigershaunt.com
Sat Jul 10 02:21:39 UTC 2010


Nils Kassube wrote:
> Markus Schönhaber wrote:
>>> Nils Kassube wrote:
>>>> I suppose you used "blkid" and not "sudo blkid". Calling blkid
>>>> without sudo doesn't necessarily tell you the current state but
>>>> the one from the cache file /etc/blkid.tab which was written when
>>>> blkid was last used with sudo.
>> That's interesting, indeed.
>> I've never fallen into this trap since I wasn't aware that blkid uses
>> a cache file. Therefore, for me, running blkid was associated with
>> "must access raw device" and in turn "needs root privileges".
> 
> The behaviour of blkid changed about a year ago and I remember a 
> discussion about it (I think on this list). Previously there was no 
> output for unprivileged users. But after the change, the output came 
> from the cache file. Nowadays I avoid the blkid command and use
> 
> ls -l /dev/disk/by-*/
> 
> instead. I'm quite confident that the output of this command is real and 
> not from a cache file.
> 
> 
> Nils
> 

But it might not be up to date if you don't run the command to refresh 
udev devices.  (sorry, forget what it is.)  If I remember correctly, 
udev calls blkid to create those in the first place.  (readers should be 
aware that the If in that sentence is pretty big.)




More information about the ubuntu-users mailing list