The virtual private LVM devices do not contain any blkid relevant data
and it does not make any sense to scan for superblocks or partitions
on the devices, because we can interpret data from the devices in bad
way.
Unfortunately, for LVM has "private" very special meaning. The private
LVM devices are accessible and readable (according to LVM guys it's
feature, because debugging etc.).
The problem is pretty visible with LVM thin provisioning where a virtual
pool device contains segments from the top-level thin devices.
Mountable top-level LVM-thin device:
# blkid -o udev -p /dev/mapper/vg-thin1
ID_FS_UUID=57ed6490-903b-416c-91d2-6d06804ec60c
ID_FS_TYPE=ext4
Virtual private LVM-pool device (contains data from all thin devices):
# blkid -o udev -p /dev/mapper/vg-pool0
ID_FS_UUID=57ed6490-903b-416c-91d2-6d06804ec60c
ID_FS_TYPE=ext4
... this is incorrect, vg-pool0 is unmountable.
LVM uses special UUID suffixes for private devices. All devices with
uuid in format "LVM-<uuid>-<type>" are private.
This patch modifies libblkid to not scan such devices. The high-level
API ignores such devices at all now.
The low-level API allows to assign the device to blkid_prober, but all
scan functions always return nothing and library does not read
anything from the device. The another functionality (get parental
device, topology, sector sizes, etc.) still works as expected. The
change affects only probing code.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1101345
Signed-off-by: Karel Zak <kzak@redhat.com>
Sometimes we use "behaviour" and "behavior" in the same text, let's
use "behavior" only everywhere.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1011068
Signed-off-by: Karel Zak <kzak@redhat.com>
It seems that gtk-docs stuff is confused when we use version.xml
(package version) and xml/version.xml (library version functions).
Signed-off-by: Karel Zak <kzak@redhat.com>
Detect squashfs version <= 3 as squashfs3 and version >= 4 as squashfs.
squashfs kernel module version 4.0 (kernel 2.6.29) is not backward
compatible to open squashfs created with previous versions.
Also fixed version number parsing, see
$ mkdir test
$ mksquashfs test test.sqsh
$ blkid -p test.sqsh
- test.sqsh: VERSION="1024.0" TYPE="squashfs" USAGE="filesystem"
+ test.sqsh: VERSION="4.0" TYPE="squashfs" USAGE="filesystem"
This patch comes from openSUSE / SLE. Original author was probably
Miklos Szeredi.
Internal SUSE references: bnc#666893, sr226509
CC: Stanislav Brabec <sbrabec@suse.cz>
CC: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Correct space between sentences to two space characters
(or begin each sentence on a new line).
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
The partitions prober does two step:
1) probe the assigned device for partition table
2) probe whole-disk device for partition table if the assigned device is a
partition (this generates PART_ENTRY_* results for blkid -p -o udev))
The step 2) is optional and the return code from this probing should
not override success (rc=0) from the step 1) -- except situations when
the step 2) ends with I/O error or when the step 1) found nothing, but
2) was successful.
Signed-off-by: Karel Zak <kzak@redhat.com>
* PART_ENTRY_* stuff is optional and should not overwrite
previous probing result in partitions_probe()
* missing minix parental partition is not error
* blkid_probe_is_vfat() usage has to be more robust
Signed-off-by: Karel Zak <kzak@redhat.com>
* 'common_debug' of https://github.com/ooprala/util-linux:
clean up redundant macros and defines
libfdisk: use include/debug.h
libblkid: use include/debug.h
libmount: further debug.h integration
libcommon: don't mention lib versions in debug macros
libcommon: define more debugging macros
libmount: use macros from include/debug.h
libcommon: add common debugging routines
With the previous patch the scanning functions were
modified to return a differentiated return code.
To correctly abort scanning when an I/O error occurs
we need to differentiate between 'error' (= -1) and
'not found' (= 1) in the probe functions.
This patch updates all superblock scanning functions
to the new calling convention.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
Whenever we fail to read from a device it's pointless to
continue with probing; we should be failing immediately.
Otherwise the system will continue logging I/O errors.
This patch updates the probe functions to return the
negative error number on error and BLKID_PROBE_NONE
if not found.
[kzak@redhat.com: - fix s/return errno/return -errno/]
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
The _DEPENDENCIES has to be used for dependencies on another in-tree
files, but _LIBADD is to specify additional libs (including external
libs).
Reported-by: oleid <notifications@github.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
wipefs(8) has to also erase PMBR, not GPR header only, otherwise the
device could be still interpreted as a device with a partition table.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1054186
Signed-off-by: Karel Zak <kzak@redhat.com>
* Linux kernel cares about the first superblock only
* backup superblock are FS specific stuff and there is no reason to
care about it in generic tools
* the problem with broken btrfs utils has been already fixed (it was
possible to use the utils on filesystem with erased primary
superblok without any warning message).
Signed-off-by: Karel Zak <kzak@redhat.com>
* read also backup superblock
* check which superblock is newer
* set minimal device size to 1MiB
Reported-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Currently when trying to identify extN file system we're playing games
with searching for kernel modules and parsing /proc/filesystem. All of
this just because ext4 module can be used to mount ext3 and ext2 file
systems on recent kernel and also because of ext4dev.
However all of this is not necessary. Ext4 module which does support
mounting ext2 and ext3 file system is able to recognize and mount ext2
and ext3 type so there is no need to disguise it and ext4dev should only
be ever used for testing and not as fallback when other modules are
missing (use -t instead).
This also introduces a bug when in situation that we only have ext4
modules with ext2/ext3 support which is not loaded and we try to mount
ext2 file system we will mount it incorrectly as ext4. This will not
happen if the ext4 module is already loaded.
With this patch we remove all the unnecessary checks and return the real
type of the file system which is on the device. This fixes the issue.
However on the kernel which was not compiled with EXT4_USE_FOR_EXT23
support one would have to provide file system type (-t) to be able to
mount the file system with ext4 driver.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
* v1: hdr->version = 1, magic string = SWAPSPACE2
* v0: no versio in header, magic string = SWAP-SPACE
The mistake has been introduced in the old udev volume_id
binary where the version was set according to magic string.
Reported-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
If a bad check sum is detected and BLKID_SUBLKS_BADCSUM is enabled
than SBBADCSUM=1 is added to the probing result.
Signed-off-by: Karel Zak <kzak@redhat.com>
[kzak@redhat.com: - move BLKID_SUBLKS_BADCSUM login to
blkid_probe_verify_csum()]
Signed-off-by: Gabriel de Perthuis <g2p.code@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
* consolidate "incorrect checksum" debug messages
* verify all on one place
Based on patch from Gabriel de Perthuis <g2p.code@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
The log UUID is usually the same as filesystem UUID, it is bad idea to
have two devices with the same UUID in the system. It seems batter to
use only LOGUUID= for xfs external log.
# mkfs.xfs -l logdev=/dev/sdb1 /dev/sdb2
# blkid -p -o udev /dev/sdb1 | grep FS
ID_FS_LOGUUID=4063d453-5c01-46ce-b92f-9523d64aecc7
ID_FS_TYPE=xfs_external_log
ID_FS_USAGE=other
# blkid -p -o udev /dev/sdb2 | grep FS
ID_FS_UUID=4063d453-5c01-46ce-b92f-9523d64aecc7
ID_FS_TYPE=xfs
ID_FS_USAGE=filesystem
The filesystem (sdb2) uses UUID= and log (sdb1) uses LOGUUID=.
Signed-off-by: Karel Zak <kzak@redhat.com>