summaryrefslogtreecommitdiff
path: root/libblkid/src
AgeCommit message (Collapse)AuthorFilesLines
2014-01-20libblkid: detect alone PMBRKarel Zak3-2/+44
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>
2014-01-16libblkid: no more probe for btrfs backup superblockKarel Zak4-19/+2
* 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>
2014-01-15libblkid: add blkid_partlist_get_partition_by_partno()Karel Zak3-0/+39
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-01-13libblkid: (nilfs2) check also backup superblockKarel Zak1-24/+42
* 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>
2013-12-12libblkid: Identify extN file system properlyLukas Czerner1-180/+3
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>
2013-11-27libblkid: fix sgi PT parser to report system partitionsKarel Zak1-2/+1
... to be compatible with Linux kernel. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-19libblkid: fix memory leak in blkid_parse_tag_string()Karel Zak1-5/+9
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-04libblkid: fix swap-area versionKarel Zak1-3/+3
* 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>
2013-10-01libblkid: use proper type in xfs log checker [coverity scan]Karel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-26libblkid: Get rid of an unnecessary checkKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16libblkid: fix kboff usage in BSD proberKarel Zak1-2/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16libblkid: move bsd definitions to pt-bsd.hKarel Zak1-78/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: add mbr_get_partition()Karel Zak3-10/+7
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: use functions from pt-mbr.hKarel Zak3-14/+14
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16libblkid: rename sys_type to sys_indKarel Zak3-10/+10
This makes struct dos_partition more compatible with the current fdisk code. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16libblkid: move MBR definitions to include/pt-mbr.hKarel Zak5-53/+8
2013-09-16libblkid: move MBR partition types to include/Karel Zak8-142/+20
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16libblkid: move SGI disklabel definitions to include/Karel Zak1-77/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-11libblkid: export info about bad csumKarel Zak1-4/+11
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>
2013-09-11libblkid: Add bcache supportRolf Fokkens4-0/+139
From https://bugzilla.redhat.com/show_bug.cgi?id=1001120#c11 [kzak@redhat.com: - move crc64 code to lib/ by separate patch, - use BLKID_USAGE_OTHER rather than _RAID] Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-11wipefs: Also wipe superblocks with bad checksumsGabriel de Perthuis2-2/+7
[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>
2013-09-11libblkid: use separate function to verify checksumsKarel Zak6-15/+39
* 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>
2013-09-11libblkid: don't use UUID= for xfs external logKarel Zak1-1/+0
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>
2013-09-11libblkid: don't interpret regual XFS as external xfs logKarel Zak1-0/+3
$ blkid -o udev -p tests/output/blkid/images-fs/xfs.img ID_FS_AMBIVALENT=filesystem:xfs other:xfs_external_log it seems that regular XFS with internal log may be interpreted as log device. This is incorrect. This patch checks for XFS magic string to avoid this collision. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-11libblkid: diffs between errors and failed probing in via raidKarel Zak1-5/+7
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-11libblkid: diffs between errors and failed probing in silicon raidKarel Zak1-3/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-11libblkid: populate jbd LOGUUID in addition to UUIDKarel Zak1-0/+2
The LOGUUID is alias for UUID, this alias is necessary to standardize the tag name (we want to use the same tag LOGUUID= for all external logs on all filesystems). Note that for another filesystems (e.g. xfs) we have to differentiate between the journal and filesystem uuids to avoid collisions, because both devices use the same uuid. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-11libblkid: rename UUID_LOG to LOGUUIDKarel Zak2-2/+2
* the goal is to make the uuid visible and usable it as mount variable/spec, then LOGUUID= seems better than UUID_LOG= * we already have PARTUUID= * the UUID_RAW and UUID_SUB are not used by mount(8) Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-11libblkid: Detect external XFS log deviceEric Sandeen3-0/+90
Detects external XFS log devices with a minimum size of 10MB. It's possible to craft a smaller log, but that would be very unlikely; it'd require a small XFS filesystem and an intentionally small log, which would defeat the performance goal of an external log in the first place. [kzak@redhat.com: - use UUID_LOG variable name for the log uuid] Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-08-27build-sys: add CFLAGS and LDFLAGS for daemons and shared libsKarel Zak1-0/+2
This is necessary for paranoid security guys who believe that things like "-Wl,-z,relro" or "-Wl,-z,bind_now" is a way how to make the world a safer place... Signed-off-by: Karel Zak <kzak@redhat.com>
2013-06-13libblkid: support pseudo PARTUUID= for MBRKarel Zak3-1/+14
# blkid /dev/sdb1 dev/sdb1: TYPE="ext2" PARTUUID="54e743a7-01" the PARTUUID is generated from MBR Id and partition number. The same method uses Linux kernel for root=PARTUUID= on systems with MBR. Note that the patch also removes 0x prefix from PTUUID. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-06-13libblkid: split blkid_parttable_set_id()Karel Zak3-6/+12
to avoid things like strcmp(tab->type, "gpt") in generic code. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-06-13libblkid: set PTUUID for GPT and DOSKarel Zak2-14/+22
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-06-13libblkid: add functions to set PTUUIDKarel Zak2-1/+57
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-06-13libblkid: make uuid_is_empty() usable for whole libraryKarel Zak3-13/+14
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-14libblkid: add ReFS magic stringKarel Zak4-0/+29
Reported-by: "Richard W.M. Jones" <rjones@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-06libblkid: fix blkid_parse_tag_string() to ignore incomplete tagsKarel Zak1-2/+2
fstab entry: FOO= / btrfs defaults 1 1 Program received signal SIGABRT, Aborted. 0x00007f016ccd8819 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 56 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig); (gdb) bt at ../sysdeps/unix/sysv/linux/libc_fatal.c:196 Reported-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-26libblkid: check writing to a file was successfulSami Kerola2-2/+9
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-18libblkid: remove obsolete codeKarel Zak1-4/+0
... forgot in the previous commit to the swap prober. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-18libblkid: ubifs is LEKarel Zak1-1/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-18libblkid: make swap detection arch independentKarel Zak1-0/+11
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-17libblkid: use more robust code in silicon_raid checksum proberKarel Zak1-2/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-16libblkid: fix silicon raid checksum code on BEKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-15libblkid: arch independent minix detectionKarel Zak1-26/+91
It seems that on-disk MINIX FS superblock is native-endian. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=833841 Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-10libblkid: remove duplicate includesKarel Zak1-2/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-10libblkid: fix ZFS superblok offset for SBMAGICKarel Zak1-4/+8
# wipefs /dev/sdd1 offset type ---------------------------------------------------------------- 0x65000 zfs_member [raid] LABEL: zm1 UUID: 18067835215330778964 and "wipefs -o 0x65000 /dev/sdd1" seems to run in an endless loop. Reported-by: Helmut Hullen <Hullen@t-online.de> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-09libblkid: export blkid_init_debug()Karel Zak6-27/+58
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-09libblkid: support LIBBLKID_DEBUG= onlyKarel Zak1-3/+0
... the BLKID_DEBUG= is not more supported. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-09libblkid: fix DBG()Karel Zak1-4/+7
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-09libblkid: number of functions should not be declared extern [smatch scan]Sami Kerola2-10/+10
These functions are already marked extern in header file. libblkid/src/dev.c:70:19: warning: function 'blkid_dev_devname' with external linkage has definition libblkid/src/dev.c:128:26: warning: function 'blkid_dev_iterate_begin' with external linkage has definition libblkid/src/dev.c:148:12: warning: function 'blkid_dev_set_search' with external linkage has definition libblkid/src/dev.c:175:12: warning: function 'blkid_dev_next' with external linkage has definition libblkid/src/dev.c:196:13: warning: function 'blkid_dev_iterate_end' with external linkage has definition libblkid/src/tag.c:84:12: warning: function 'blkid_dev_has_tag' with external linkage has definition libblkid/src/tag.c:282:26: warning: function 'blkid_tag_iterate_begin' with external linkage has definition libblkid/src/tag.c:303:12: warning: function 'blkid_tag_next' with external linkage has definition libblkid/src/tag.c:322:13: warning: function 'blkid_tag_iterate_end' with external linkage has definition libblkid/src/tag.c:336:18: warning: function 'blkid_find_dev_with_tag' with external linkage has definition Signed-off-by: Sami Kerola <kerolasa@iki.fi>