• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

blkid

balanga

Daemon

Thanks: 62
Messages: 1,999

#1
I recently came across a program called blkid on Linux. There is no such command on FreeBSD. I tried pkg install blkid but failed to find it.

If it does exist how do I install it?
 

junovitch@

Daemon
Developer

Thanks: 608
Messages: 1,773

#3
cd /usr/ports; grep -R blkid *
Code:
...
sysutils/e2fsprogs/pkg-plist:man/man8/blkid.8.gz
sysutils/e2fsprogs/pkg-plist:sbin/blkid
It would seem that blkid is including the pkg-plist file of sysutils/e2fsprogs. Looking at that port, it uses the library you installed automatically. So you don't need to install that package you installed as it will be used automatically. Just pkg install e2fsprogs should be enough.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,998
Messages: 26,762

#4
You can always tell what a particular package installed: pkg info -l e2fsprogs-libblkid
 

balanga

Daemon

Thanks: 62
Messages: 1,999

#5
Thanks for the help, I now have blkid installed, but unfortunately it doesn't show any devices. What command in FreeBSD will show all attached devices?
 

usdmatt

Daemon

Thanks: 440
Messages: 1,252

#7
We may be able to provide more help, or possible alternative commands if we knew what you were actually trying to do.
 

balanga

Daemon

Thanks: 62
Messages: 1,999

#8
According to the man page for blkid:

The blkid program is the command-line interface to working with the
libblkid(3) library. It can determine the type of content (e.g.
filesystem or swap) that a block device holds, and also the
attributes (tokens, NAME=value pairs) from the content metadata (e.g.
LABEL or UUID fields).
This is the information I am trying to get. I can't get the version I have installed on FreeBSD to work properly. Try blkid on a Linux system to see what info it returns.
 

junovitch@

Daemon
Developer

Thanks: 608
Messages: 1,773

#9
See if gpart list is what you are looking for as it also shows the label, UUID, and file system type. If you need different forms of parsable output, try out each of the following and see what works:
sysctl kern.geom.confxml
sysctl kern.geom.confdot
sysctl kern.geom.conftxt
 

balanga

Daemon

Thanks: 62
Messages: 1,999

#10
I guess gpart list is a huge superset of blkid's capabilities as I've just discovered.

The trouble (for me) is understanding exactly what it shows. I'll just have to persevere with some of the options.
 

balanga

Daemon

Thanks: 62
Messages: 1,999

#11
I have just noticed that the list option for gpart is not described in the FreeBSD man pages.

Can someone confirm this?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,998
Messages: 26,762

#12
balanga said:
I have just noticed that the list option for gpart is not described in the FreeBSD man pages.

Can someone confirm this?
Indeed. It seems to be missing. At least on my 10.0-STABLE (r267684).
 

kpa

Beastie's Twin

Thanks: 1,678
Messages: 6,084

#13
It's mentioned in the geom(8) manual page, every GEOM class and the matching command line utility is supposed to have a list subcommand. It should be mentioned in the gpart(8) manual page too though.
 

vince66

Well-Known Member

Thanks: 10
Messages: 287

#14
Hello guys,

in this post junovitch@ wrote that the command gpart list can be used to retrieve the same information given by the Linux "blkid" command.

In particular he suggests different and usefull forms of output like:
sysctl kern.geom.conftxt

Effectively it is true.

Because I'm only interested in some of the fields shown by the sysctl kern.geom.conftxt can you help me to understand how can I extract them from the output of this command, that is show them on the monitor or again store them in a text file ?

Thanks in advance.
 
Last edited by a moderator:

Beastie

Daemon

Thanks: 423
Messages: 2,091

#15
Because I'm only interested in some of the fields shown by the "sysctl kern.geom.conftxt", can you help me to understand how can I extract them from the output of this command, that is show them on the monitor or again store them in a text file ?
grep(1), awk(1), sed(1), any combination of these, etc. There are plenty of examples in the EXAMPLE sections of these manual pages and online.
Your question is really vague.
 
Top