e2fsprogs/lib
Karel Zak 4db2f59a71 Add device-mapper support to the blkid library
On systems where is multi-path storage device is problem with duplicated
filesystems. The solution is select "the best" device. This is possible
by device-mapper library.

Short quotation from RH bugzilla:

With my patch, all dm devices remains in libblkid cache.

Only the top level dm devices are given high priority
and more appropriate node names (i.e. /dev/mapper/*) are used.

For example, if we have linear mapped dm device "ov1" over
dm device "disk1p3" which is multipath mapped to /dev/sdd3 and /dev/sdh3:
  # dmsetup.static ls --tree
  ov1 (253:5) <-- /dev/mapper/ov1 or /dev/dm-5
   `-disk1p3 (253:4) <-- /dev/mapper/disk1p3 or /dev/dm-4
      `-disk1 (253:0)
         |- (8:112) <-- /dev/sdh
         `- (8:48) <-- /dev/sdd

Original version of blkid will show:
  # ./orig/blkid -t LABEL=mpdisk1p3 -l
  /dev/sdd3: LABEL="mpdisk1p3" ... TYPE="ext3"

With my patch, blkid will show:
  # ./deptree/blkid -t LABEL=mpdisk1p3 -l
  /dev/mapper/ov1: LABEL="mpdisk1p3" ... TYPE="ext3"

In blkid cache, all devices are listed:

  # ./orig/blkid -t LABEL=mpdisk1p3
  /dev/sdd3: LABEL="mpdisk1p3" ... TYPE="ext3"
  /dev/sdh3: LABEL="mpdisk1p3" ... TYPE="ext3"
  /dev/dm-4: LABEL="mpdisk1p3" ... TYPE="ext3"
  /dev/dm-5: LABEL="mpdisk1p3" ... TYPE="ext3"

  # ./deptree/blkid -t LABEL=mpdisk1p3
  /dev/mapper/ov1: LABEL="mpdisk1p3" ... TYPE="ext3"
  /dev/sdd3: LABEL="mpdisk1p3" ... TYPE="ext3"
  /dev/sdh3: LABEL="mpdisk1p3" ... TYPE="ext3"
  /dev/dm-4: LABEL="mpdisk1p3" ... TYPE="ext3"

For more details see discussion on:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=156324

Addresses Red Hat Bug: #156324

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-03-08 14:17:28 -05:00
..
blkid Add device-mapper support to the blkid library 2006-03-08 14:17:28 -05:00
e2p Address parallel build problem in the library Makefiles 2005-12-10 22:23:01 -05:00
et Address parallel build problem in the library Makefiles 2005-12-10 22:23:01 -05:00
ext2fs Address parallel build problem in the library Makefiles 2005-12-10 22:23:01 -05:00
ss Address parallel build problem in the library Makefiles 2005-12-10 22:23:01 -05:00
uuid Set FD_CLOEXEC on the /dev/random file descriptor used by libuuid 2006-01-06 18:10:02 -05:00
ChangeLog Avoid needlessly recompilation of library objection files 2005-12-29 22:45:29 -05:00
Makefile.bsd-lib Avoid needlessly recompilation of library objection files 2005-12-29 22:45:29 -05:00
Makefile.checker Avoid needlessly recompilation of library objection files 2005-12-29 22:45:29 -05:00
Makefile.darwin-lib Avoid needlessly recompilation of library objection files 2005-12-29 22:45:29 -05:00
Makefile.elf-lib Avoid needlessly recompilation of library objection files 2005-12-29 22:45:29 -05:00
Makefile.library Avoid needlessly recompilation of library objection files 2005-12-29 22:45:29 -05:00
Makefile.profile Avoid needlessly recompilation of library objection files 2005-12-29 22:45:29 -05:00
Makefile.solaris-lib Avoid needlessly recompilation of library objection files 2005-12-29 22:45:29 -05:00
fpopen.c fpopen.c: 1999-06-18 01:13:31 +00:00