UUID anomaly

Florian Diesch diesch at spamfence.net
Fri Jul 9 22:28:32 UTC 2010


Nils Kassube <kassube at gmx.net> writes:

> 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.

I'm not sure if that reflects a UUID change by e.g. tune2fs in real time
as that may not fire an udev event (I didn't check this).

I'm using
  sudo  blkid -p
if I want to be sure the value is not from the cache.


   Florian
-- 
<http://www.florian-diesch.de/linux/asciipinguine.html>




More information about the ubuntu-users mailing list