Superblocks probing

Superblocks probing — filesystems and raids superblocks probing.

Functions

Description

The library API has been originally designed for superblocks probing only. This is reason why some *deprecated* superblock specific functions don't use '_superblocks_' namespace in the function name. Please, don't use these functions in new code.

The 'superblocks' probers support NAME=value (tags) interface only. The superblocks probing is enabled by default (and controlled by blkid_probe_enable_superblocks()).

Currently supported tags:

TYPE : filesystem type

SEC_TYPE : secondary filesystem type

LABEL : filesystem label

LABEL_RAW : raw label from FS superblock

UUID : filesystem UUID (lower case)

UUID_SUB : subvolume uuid (e.g. btrfs)

LOGUUID : external log UUID (e.g. xfs)

UUID_RAW : raw UUID from FS superblock

EXT_JOURNAL : external journal UUID

USAGE : usage string: "raid", "filesystem", ...

VERSION : filesystem version

MOUNT : cluster mount name (?) -- ocfs only

SBMAGIC : super block magic string

SBMAGIC_OFFSET : offset of SBMAGIC

FSSIZE : size of filesystem [not-implemented yet]

SYSTEM_ID : ISO9660 system identifier

PUBLISHER_ID : ISO9660 publisher identifier

APPLICATION_ID : ISO9660 application identifier

BOOT_SYSTEM_ID : ISO9660 boot system identifier

BLOCK_SIZE : block size

Functions

blkid_probe_enable_superblocks ()

int
blkid_probe_enable_superblocks (blkid_probe pr,
                                int enable);

Enables/disables the superblocks probing for non-binary interface.

Parameters

pr

probe

 

enable

TRUE/FALSE

 

Returns

0 on success, or -1 in case of error.


blkid_known_fstype ()

int
blkid_known_fstype (const char *fstype);

Parameters

fstype

filesystem name

 

Returns

1 for known filesystems, or 0 for unknown filesystem.


blkid_superblocks_get_name ()

int
blkid_superblocks_get_name (size_t idx,
                            const char **name,
                            int *usage);

Parameters

idx

number >= 0

 

name

returns name of supported filesystem/raid (optional)

 

usage

returns BLKID_USAGE_* flags, (optional)

 

Returns

-1 if idx is out of range, or 0 on success.


blkid_probe_filter_superblocks_type ()

int
blkid_probe_filter_superblocks_type (blkid_probe pr,
                                     int flag,
                                     char *names[]);

BLKID_FLTR_NOTIN - probe for all items which are NOT IN names ;

BLKID_FLTR_ONLYIN - probe for items which are IN names

Parameters

pr

prober

 

flag

filter BLKID_FLTR_{NOTIN,ONLYIN} flag

 

names

NULL terminated array of probing function names (e.g. "vfat").

 

Returns

0 on success, or -1 in case of error.


blkid_probe_filter_superblocks_usage ()

int
blkid_probe_filter_superblocks_usage (blkid_probe pr,
                                      int flag,
                                      int usage);

BLKID_FLTR_NOTIN - probe for all items which are NOT IN usage ;

BLKID_FLTR_ONLYIN - probe for items which are IN usage

Parameters

pr

prober

 

flag

filter BLKID_FLTR_{NOTIN,ONLYIN} flag

 

usage

BLKID_USAGE_* flags

 

Returns

0 on success, or -1 in case of error.


blkid_probe_invert_superblocks_filter ()

int
blkid_probe_invert_superblocks_filter (blkid_probe pr);

Inverts superblocks probing filter

Parameters

pr

prober

 

Returns

0 on success, or -1 in case of error.


blkid_probe_reset_superblocks_filter ()

int
blkid_probe_reset_superblocks_filter (blkid_probe pr);

Resets superblocks probing filter

Parameters

pr

prober

 

Returns

0 on success, or -1 in case of error.


blkid_probe_set_superblocks_flags ()

int
blkid_probe_set_superblocks_flags (blkid_probe pr,
                                   int flags);

Sets probing flags to the superblocks prober. This function is optional, the default are BLKID_SUBLKS_DEFAULTS flags.

Parameters

pr

prober

 

flags

BLKID_SUBLKS_* flags

 

Returns

0 on success, or -1 in case of error.


blkid_probe_reset_filter ()

int
blkid_probe_reset_filter (blkid_probe pr);

blkid_probe_reset_filter is deprecated and should not be used in newly-written code.

Use blkid_probe_reset_superblocks_filter().

Parameters

pr

prober

 

Returns

0 on success, or -1 in case of error.


blkid_probe_filter_types ()

int
blkid_probe_filter_types (blkid_probe pr,
                          int flag,
                          char *names[]);

blkid_probe_filter_types is deprecated and should not be used in newly-written code.

Use blkid_probe_filter_superblocks_type().

Parameters

pr

prober

 

flag

filter BLKID_FLTR_{NOTIN,ONLYIN} flag

 

names

NULL terminated array of probing function names (e.g. "vfat").

 

Returns

0 on success, or -1 in case of error.


blkid_probe_filter_usage ()

int
blkid_probe_filter_usage (blkid_probe pr,
                          int flag,
                          int usage);

blkid_probe_filter_usage is deprecated and should not be used in newly-written code.

Use blkid_probe_filter_superblocks_usage().

Parameters

pr

prober

 

flag

filter BLKID_FLTR_{NOTIN,ONLYIN} flag

 

usage

BLKID_USAGE_* flags

 

Returns

0 on success, or -1 in case of error.


blkid_probe_invert_filter ()

int
blkid_probe_invert_filter (blkid_probe pr);

blkid_probe_invert_filter is deprecated and should not be used in newly-written code.

Use blkid_probe_invert_superblocks_filter().

Parameters

pr

prober

 

Returns

0 on success, or -1 in case of error.


blkid_probe_set_request ()

int
blkid_probe_set_request (blkid_probe pr,
                         int flags);

blkid_probe_set_request is deprecated and should not be used in newly-written code.

Use blkid_probe_set_superblocks_flags().

Parameters

pr

probe

 

flags

BLKID_PROBREQ_* (deprecated) or BLKID_SUBLKS_* flags

 

Returns

0 on success, or -1 in case of error.