You are not logged in.

#1 2013-05-31 15:33:36

hydrosIII
Member
Registered: 2013-04-04
Posts: 127

blkid not working

Ok this is a minor issue, but im unable to get any output out of blkid, it's not serious because i can use lsblk -f to view the partitions, but i find it weird. I cannot confirm that it doesn't work all the time, but it seems to stop working ramdomly after reboots.

I'm running blkid as root, and i was actualling using it, maybe an upgrade broke it. I'm not sure. When i use blkid in a terminal emulator the terminal emulator just freezes, i cannot even kill the process using ctrl c, i have to close the terminal. I have tried reinstalling the package. I have checked the pacman.log and saw that the util-linux package was not upgrade recently.

Im afraid of downgrading this package since is a package of the base group, just to solve this little problem.
Any ideas?, Im using Arch linux 64 bit and kernel 3.7.9.2.

Thank you.

Offline

#2 2013-05-31 22:33:44

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: blkid not working

Does it happen if you run, say, blkid -h just to display the help? Why happens when you run it as a normal user? (Why are you running it as root?)

Have you ruled out filesystem/disk problems?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#3 2013-05-31 22:47:39

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: blkid not working

@cfr, does blkid give you output if you don't run it as root?  For the past while I have had to "chmod +s $(which blkid)" in order to get it to give me anything when running it as my own user.

Offline

#4 2013-05-31 22:51:19

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: blkid not working

┌─[Centurion ~]
└─╼ pacman -Q util-linux
util-linux 2.23.1-1

Works here and it must be run with elevated privileges.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2013-05-31 22:51:19

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: blkid not working

WonderWoofy wrote:

@cfr, does blkid give you output if you don't run it as root?  For the past while I have had to "chmod +s $(which blkid)" in order to get it to give me anything when running it as my own user.

Yes. It gives me the output it always has - well, given my current partitioning etc. I double-checked before I asked just to make sure I wasn't misremembering and I get 14 lines of output: 3 for physical disk partitions; one for the physical volume which I have lvm on; and the rest for my logical volumes. This includes mount point, label, uuid and type.

EDIT: According to the manual page, it is giving me "cached unverified information" and I would be better advised to use lsblk --fs. Actually, it goes on to say that lsblk is the better choice for use by users and scripts and that blkid is really designed to be used by system services and to test the library.

Last edited by cfr (2013-05-31 22:55:30)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#6 2013-05-31 22:52:43

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: blkid not working

What are the permissions of /usr/bin/blkid on your system cfr?

Edit: It may not be /usr/bin... I just did the /usr move, so now everything on my system is in /usr/bin.
But this is what I have:

%  pacman -Q util-linux 
util-linux 2.23.1-2

I have set the sticky bit on it, so I have this:

% ls -l /usr/bin/blkid
-rwsr-sr-x 1 root root 68784 May 30 05:55 /usr/bin/blkid*

Last edited by WonderWoofy (2013-05-31 22:55:14)

Offline

#7 2013-05-31 22:56:47

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: blkid not working

$ pacman -Q util-linux
util-linux 2.23.1-1

$ l /sbin/blkid 
-rwxr-xr-x 1 root root 68K Mai  28 13:28 /sbin/blkid*

Are you using testing, WonderWoofy? My system was updated within the last couple of hours and I've not been alerted to any further updates since.

Last edited by cfr (2013-05-31 22:58:32)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#8 2013-05-31 23:03:43

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: blkid not working

Yes I am using testing.  Actually, I have btrfs, so I have a subvol that is testing, and another that is the normal repo.  Then I use bedup for deduplication.  It is quite nice.

That is very odd that your system gives you output without modification of permissions and without root permissions.  I wonder why that would be...

Offline

#9 2013-05-31 23:05:14

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: blkid not working

WonderWoofy wrote:

Yes I am using testing.  Actually, I have btrfs, so I have a subvol that is testing, and another that is the normal repo.  Then I use bedup for deduplication.  It is quite nice.

That is very odd that your system gives you output without modification of permissions and without root permissions.  I wonder why that would be...

That is what the manual page says it will do... so I might ask why it does not do the same for everyone else!

EDIT: Did you see my earlier EDIT? Your post may have crossed...

Last edited by cfr (2013-05-31 23:06:07)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#10 2013-05-31 23:12:39

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: blkid not working

No I didn't see that.  Thanks for pointing it out.  I think it is apparent that lsblk is the better choice for user info, and blkid serves a different purpose.  But I am just really curious as to why it would behave differently on your system than it would for mine (and apparently jasonwryan's).  So apparently, I have no cached information?  Hmmm...

Anyway, we have derailed the OP's thread here.  I think we should get back to the topic at hand.

Offline

#11 2013-05-31 23:19:15

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: blkid not working

I just booted my [testing] box and, after completing the /usr/ move and rebooting, can report the same behaviour with the newer util-linux:

┌─[Shiv ~ ]
└─╼ pacman -Q util-linux                                                                                                                                                        
util-linux 2.23.1-2

┌─[Shiv ~ ]
└─╼ ls -l /usr/bin/blkid                                                                                                                                                        
-rwxr-xr-x 1 root root 68K May 31 00:55 /usr/bin/blkid

OP: please confirm your version and permissions...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#12 2013-06-01 00:40:21

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: blkid not working

jasonwryan wrote:

I just booted my [testing] box and, after completing the /usr/ move and rebooting, can report the same behaviour with the newer util-linux...

But didn't you say above that you got the same behaviour with the stable version of util-linux? That is, I read "with elevated privileges" as "as root" but perhaps I misunderstood?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#13 2013-06-01 01:11:55

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: blkid not working

cfr wrote:
jasonwryan wrote:

I just booted my [testing] box and, after completing the /usr/ move and rebooting, can report the same behaviour with the newer util-linux...

But didn't you say above that you got the same behaviour with the stable version of util-linux? That is, I read "with elevated privileges" as "as root" but perhaps I misunderstood?

That's correct: both versions work as expected when run with elevated privileges (sudo).


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#14 2013-06-01 02:23:14

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: blkid not working

jasonwryan wrote:
cfr wrote:
jasonwryan wrote:

I just booted my [testing] box and, after completing the /usr/ move and rebooting, can report the same behaviour with the newer util-linux...

But didn't you say above that you got the same behaviour with the stable version of util-linux? That is, I read "with elevated privileges" as "as root" but perhaps I misunderstood?

That's correct: both versions work as expected when run with elevated privileges (sudo).

But do you not get anything if you do not use sudo with the stable version of the package? I get the full listing of partitions which I describe (and I have not touched the permissions of blkid as WonderWoofy has).


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#15 2013-06-01 02:58:54

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: blkid not working

That. Is. Odd.

When I tested on both machines earlier today, issuing `blkid` just returned the prompt. Now (after having logged out and back in), I get the full list. I'm stumped...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#16 2013-06-01 03:58:12

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: blkid not working

Okay do this.  On a fresh boot, run "blkid".  You'll get nothing.  Then run it with "sudo" or otherwise as root and watch as you get information back.  Then try running it again as a normal user, and on my machine I get information back (I un-stickied the binary).  I think this is what cfr's comment about cached data is all about.

Offline

#17 2013-06-01 05:01:51

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: blkid not working

Yes, I missed the edit; the caching makes sense...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#18 2013-06-01 20:57:52

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: blkid not working

So maybe in my case something automatically runs this so that I always get cached information? (I've never gotten nothing.) In fact, I know exactly why I always get cached information. I have a cron job that is essentially running this once an hour except when I have a backup which is less than 24 hours old. But mostly I don't have such a backup and, even when I do I probably have older cached data.

Note this isn't why I have the cron job - it is just a side effect. I guess according to the manual page, I ought to be using lsblk really instead... (even in the script).

Anyway, none of this explains why running blkid causes things to go entirely haywire in the OP's case...


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#19 2013-06-02 05:09:36

hydrosIII
Member
Registered: 2013-04-04
Posts: 127

Re: blkid not working

Hi , i dind's expect this much colaboration, in fact i've read al your messages and i barely understand some of them smile (Im really a noob here). Ok, today  i booted into my machine and everything was working fine, I ran blkid and got no problem both under sudo or normal user. So in order to see wath was wrong i tried to plug and replug usb ticks to see if something changed. The thing is that blkid is running great until i mount/umount a disk, I launched gparted closed it and then tried with blkid under sudo. Blkid stopped responding again.
I'm not sure but i think is not related exclusevely to gparted. Maybe is a mounting problem. Can anyone try to replicate this behaviour?

And the weird behaviour continues, im totally able to run blkid as a normal user without any privileges, i thought because of the caching described in the Above posts. So my theory was that when using sudo, blkid tries to recover the actual information from the disks and not only the cache and that's why it fails.But then i just unplug my usb stick and the change is reported by "blkid -o device" without sudo command, WTF? trying to run it directly as root instead of sudo has the same results. However running blkid -h works.
I'm confused, can anyone replicate this?, I'm not using testing repos, just the stable ones.

Thanks, i hope the info is useful

Offline

#20 2013-06-02 05:13:11

hydrosIII
Member
Registered: 2013-04-04
Posts: 127

Re: blkid not working

Maybe the previous post was a little confusing. Resuming. Blkid is running good until i run and close gparted. Then the only way of making blkid work is with the provileges of a normal user, not root, nor sudo !!.

Offline

#21 2013-06-02 05:17:50

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: blkid not working

┌─[Centurion ~]
└─╼ blkid
┌─[Centurion ~]
└─╼ echo $?
0
┌─[Centurion ~]
└─╼ sudo gparted
[sudo] password for jason: 
======================
libparted : 3.1
======================
┌─[Centurion ~]
└─╼ blkid
/dev/sdb1: UUID=blahblahblah 
/dev/sdb2: UUID=etc...

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#22 2013-06-02 13:14:46

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: blkid not working

Yeah, this behaviour doesn't happen for me either... I installed gparted, ran it, closed it, and then called blkid again, and no trouble...

Offline

#23 2013-06-02 17:54:51

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: blkid not working

I checked running sudo blkid, then mounting a USB stick, rerunning sudo blkid, unmounting the stick and finally running sudo blkid again and blkid gave the expected output every time without problem.

Are you trying with the same USB stick or different ones? Are you unmounting the stick before removing it? If so, does it unmount OK?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#24 2013-06-03 22:53:36

hydrosIII
Member
Registered: 2013-04-04
Posts: 127

Re: blkid not working

Just confirming, i tried to do the test with other usb device, and discovered that the problem is just happening with gparted and is not particular no any usb stick, the sticks justmount and ummount ok, both from the file manager and the terminal. When i run and close gparted blkid stops responding with user root, also gparted sometimes takes a insanely amount of time to display the partition layout. So i think that gparted is messing up something. Curiously running sudo parted -l is not giving any problems. The thing is when blkid just hangs, i'm not able to use it under sudo until i reboot.

Thanks

Offline

#25 2013-06-16 03:43:48

hydrosIII
Member
Registered: 2013-04-04
Posts: 127

Re: blkid not working

Hi ,i have tried downgrading gparted, to different versions but nthing of these works as the blkid issue keeps repeating, is this a bug?, should i report this to the gparted maintainers, or arch bugs???, is something wrong on my machine???

Last edited by hydrosIII (2013-06-16 03:43:59)

Offline

Board footer

Powered by FluxBB