You are not logged in.
Hello,
I was wondering why blkid doesn't inform you that it needs root privileges for it to run ? If I don't give it root privileges it just outputs nothing. Is it the way it is coded and that exception isn't handled properly ?
For eg - if I run pacman as a normal user it throws an error asking you to elevate the privileges --: "error: you cannot perform this operation unless you are root."
Arch makes me cry and pull my hair out but I soon realized thats a part of my learning process.
Offline
From the manpage:
for non-root users it returns
cached unverified information.
If you don't have a cache, it outputs nothing, but the cache appears to be generated at boot time, so I'm not sure why you don't have one.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
blkid can be used as a regular user, it just does something else:
Note that blkid reads information directly from devices and for non-root users it returns cached unverified information. It is better to use lsblk --fs to get a user-riendly overview of filesystems and devices.
This isn't too uncommon, wireless scanning works the same way.
EDIT: crossposted with the above. But I do not get a cache generated during boot either. The output for me is empty until I run blkid as root. Wormzy, I gather you have some service that runs this at boot up.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Alright. I just checked , when I run blkid as a normal user again, it did show me the information (I'm guessing thats cached information)
After restarting, blkid as a normal user didn't output anything. I'm guessing the cache gets erased. I've been using lsblk -o +UUID to get my UUIDs (other than the time I installed arch using beginners guide and I had root priv then so didn't realize)
Thanks guys.
Arch makes me cry and pull my hair out but I soon realized thats a part of my learning process.
Offline
Wormzy, I gather you have some service that runs this at boot up.
Apparently so! This is news to me though. I can't find any call to blkid in any of my systemd units. There are several references of blkid in the udev rules regarding RAID though, so that may be the cause (as I have an RAID 5).
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Moving to Newbie Corner...
Offline
It says nothing, because a program is supposed to say nothing if it has nothing worthwhile to say. A tool like this should neither worry about permissions nor patronize me about it. It is supposed to give me the information I want and shut up, if it does not have any. I especially don't want it to produce another line of garbage without real information, that I will have to catch manually in a script. I'd rather have it return 1 and not provide cached information, if called without a switch.
Offline