blkid

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?
 
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.
 
You can always tell what a particular package installed: pkg info -l e2fsprogs-libblkid
 
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?
 
We may be able to provide more help, or possible alternative commands if we knew what you were actually trying to do.
 
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.
 
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
 
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.
 
I have just noticed that the list option for gpart is not described in the FreeBSD man pages.

Can someone confirm this?
 
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).
 
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.
 
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:
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.
 
Back
Top