2
* Copyright (C) 2009 Karel Zak <kzak@redhat.com>
4
* This file may be redistributed under the terms of the
5
* GNU Lesser General Public License.
10
#include <sys/types.h>
20
int main(int argc, char *argv[])
27
fprintf(stderr, "usage: %s <device> "
28
"-- prints superblocks details about the device\n",
29
program_invocation_short_name);
34
pr = blkid_new_probe_from_filename(devname);
36
err(EXIT_FAILURE, "%s: faild to create a new libblkid probe",
39
/* enable topology probing */
40
blkid_probe_enable_superblocks(pr, TRUE);
43
blkid_probe_set_superblocks_flags(pr,
44
BLKID_SUBLKS_LABEL | BLKID_SUBLKS_LABELRAW |
45
BLKID_SUBLKS_UUID | BLKID_SUBLKS_UUIDRAW |
46
BLKID_SUBLKS_TYPE | BLKID_SUBLKS_SECTYPE |
47
BLKID_SUBLKS_USAGE | BLKID_SUBLKS_VERSION |
50
rc = blkid_do_safeprobe(pr);
52
errx(EXIT_FAILURE, "%s: blkid_do_safeprobe() failed", devname);
54
warnx("%s: cannot gather information about superblocks", devname);
56
int i, nvals = blkid_probe_numof_values(pr);
58
for (i = 0; i < nvals; i++) {
59
const char *name, *data;
61
blkid_probe_get_value(pr, i, &name, &data, NULL);
62
printf("\t%s = %s\n", name, data);