Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I run a LVM setup on a raid1 created by mdadm. md2 is based on sda6 (major:minor 8:6) and sdb6 (8:22). md2 is partition 9:2. The VG on top of md2 has 4 LVs, var, home, usr, tmp.

First the problem: While booting it seems as if the device mapper takes the wrong partition for the mapping! Immediately after boot the information is like

~# dmsetup table
systemlvm-home: 0 4194304 linear 8:22 384
systemlvm-home: 4194304 16777216 linear 8:22 69206400
systemlvm-home: 20971520 8388608 linear 8:22 119538048
systemlvm-home: 29360128 6291456 linear 8:22 243270016
systemlvm-tmp: 0 2097152 linear 8:22 41943424
systemlvm-usr: 0 10485760 linear 8:22 20971904
systemlvm-var: 0 10485760 linear 8:22 10486144
systemlvm-var: 10485760 6291456 linear 8:22 4194688
systemlvm-var: 16777216 4194304 linear 8:22 44040576
systemlvm-var: 20971520 10485760 linear 8:22 31457664
systemlvm-var: 31457280 20971520 linear 8:22 48234880
systemlvm-var: 52428800 33554432 linear 8:22 85983616
systemlvm-var: 85983232 115343360 linear 8:22 127926656

~# cat /proc/mdstat
Personalities : [raid1]
md2 : active (auto-read-only) raid1 sda6[0]
      151798080 blocks [2/1] [U_]

md0 : active raid1 sda1[0] sdb1[1]
      96256 blocks [2/2] [UU]

md1 : active raid1 sda2[0] sdb2[1]
      2931776 blocks [2/2] [UU]

I have to manually "lvchange -an" all LVs, add /dev/sdb6 back to the raid and reactivate the LVs, then all is fine. But it prevents me from automounting the partitions and obviously leads to a bunch of other problems.

If everything works fine, the information is like

~$ cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 sdb6[1] sda6[0]
      151798080 blocks [2/2] [UU]
...


~# dmsetup table
systemlvm-home: 0 4194304 linear 9:2 384
systemlvm-home: 4194304 16777216 linear 9:2 69206400
systemlvm-home: 20971520 8388608 linear 9:2 119538048
systemlvm-home: 29360128 6291456 linear 9:2 243270016
systemlvm-tmp: 0 2097152 linear 9:2 41943424
systemlvm-usr: 0 10485760 linear 9:2 20971904
systemlvm-var: 0 10485760 linear 9:2 10486144
systemlvm-var: 10485760 6291456 linear 9:2 4194688
systemlvm-var: 16777216 4194304 linear 9:2 44040576
systemlvm-var: 20971520 10485760 linear 9:2 31457664
systemlvm-var: 31457280 20971520 linear 9:2 48234880
systemlvm-var: 52428800 33554432 linear 9:2 85983616
systemlvm-var: 85983232 115343360 linear 9:2 127926656

I think that LVM for some reason just "takes" /dev/sdb6 which is then missing in the raid. I tried almost all options in the lvm.conf but none seems to work.

Below is some more information, like config files. Does anyone have any idea about what is going on here and how to prevent that?

If you need any additional information, please let me know

Thanks in advance! Dominik

The information (off a "repaired" system):

~# cat /etc/debian_version
5.0.4


~# uname -a
Linux kermit 2.6.26-2-686 #1 SMP Wed Feb 10 08:59:21 UTC 2010 i686 GNU/Linux


~# lvm version
  LVM version:     2.02.39 (2008-06-27)
  Library version: 1.02.27 (2008-06-25)
  Driver version:  4.13.0


~# cat /etc/mdadm/mdadm.conf
DEVICE partitions
ARRAY /dev/md1 level=raid1 num-devices=2 metadata=00.90 UUID=11e9dc6c:1da99f3f:b3088ca6:c6fe60e9
ARRAY /dev/md0 level=raid1 num-devices=2 metadata=00.90 UUID=92ed1e4b:897361d3:070682b3:3baa4fa1
ARRAY /dev/md2 level=raid1 num-devices=2 metadata=00.90 UUID=601d4642:39dc80d7:96e8bbac:649924ba


~# mount
/dev/md1 on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/md0 on /boot type ext3 (rw)
/dev/mapper/systemlvm-usr on /usr type reiserfs (rw)
/dev/mapper/systemlvm-tmp on /tmp type reiserfs (rw)
/dev/mapper/systemlvm-home on /home type reiserfs (rw)
/dev/mapper/systemlvm-var on /var type reiserfs (rw)


~# grep -v ^$ /etc/lvm/lvm.conf | grep -v "#"
devices {
    dir = "/dev"
    scan = [ "/dev" ]
    preferred_names = [ ]
    filter = [ "a|/dev/md.*|", "r/.*/" ]
    cache_dir = "/etc/lvm/cache"
    cache_file_prefix = ""
    write_cache_state = 1
    sysfs_scan = 1   
    md_component_detection = 1
    ignore_suspended_devices = 0
}
log {
    verbose = 0
    syslog = 1
    overwrite = 0
    level = 0
    indent = 1
    command_names = 0
    prefix = "  "
}
backup {
    backup = 1
    backup_dir = "/etc/lvm/backup"
    archive = 1
    archive_dir = "/etc/lvm/archive"
    retain_min = 10
    retain_days = 30
}
shell {
    history_size = 100
}
global {
    umask = 077
    test = 0
    units = "h"
    activation = 1
    proc = "/proc"
    locking_type = 1
    fallback_to_clustered_locking = 1
    fallback_to_local_locking = 1
    locking_dir = "/lib/init/rw"
}
activation {
    missing_stripe_filler = "/dev/ioerror"
    reserved_stack = 256
    reserved_memory = 8192
    process_priority = -18
    mirror_region_size = 512
    readahead = "auto"
    mirror_log_fault_policy = "allocate"
    mirror_device_fault_policy = "remove"
}


:~# vgscan -vvv
        Processing: vgscan -vvv
        O_DIRECT will be used
      Setting global/locking_type to 1
      File-based locking selected.
      Setting global/locking_dir to /lib/init/rw
      Locking /lib/init/rw/P_global WB
    Wiping cache of LVM-capable devices
        /dev/block/1:0: Added to device cache
        /dev/block/1:1: Added to device cache
        /dev/block/1:10: Added to device cache
        /dev/block/1:11: Added to device cache
        /dev/block/1:12: Added to device cache
        /dev/block/1:13: Added to device cache
        /dev/block/1:14: Added to device cache
        /dev/block/1:15: Added to device cache
        /dev/block/1:2: Added to device cache
        /dev/block/1:3: Added to device cache
        /dev/block/1:4: Added to device cache
        /dev/block/1:5: Added to device cache
        /dev/block/1:6: Added to device cache
        /dev/block/1:7: Added to device cache
        /dev/block/1:8: Added to device cache
        /dev/block/1:9: Added to device cache
        /dev/block/253:0: Added to device cache
        /dev/block/253:1: Added to device cache
        /dev/block/253:2: Added to device cache
        /dev/block/253:3: Added to device cache
        /dev/block/8:0: Added to device cache
        /dev/block/8:1: Added to device cache
        /dev/block/8:16: Added to device cache
        /dev/block/8:17: Added to device cache
        /dev/block/8:18: Added to device cache
        /dev/block/8:19: Added to device cache
        /dev/block/8:2: Added to device cache
        /dev/block/8:21: Added to device cache
        /dev/block/8:22: Added to device cache
        /dev/block/8:3: Added to device cache
        /dev/block/8:5: Added to device cache
        /dev/block/8:6: Added to device cache
        /dev/block/9:0: Already in device cache
        /dev/block/9:1: Already in device cache
        /dev/block/9:2: Already in device cache
        /dev/bsg/0:0:0:0: Not a block device
        /dev/bsg/1:0:0:0: Not a block device
        /dev/bus/usb/001/001: Not a block device
        [... many more "not a block device"]
        /dev/core: Not a block device
        /dev/cpu_dma_latency: Not a block device
        /dev/disk/by-id/ata-SAMSUNG_HD160JJ_S08HJ10L507895: Aliased to /dev/block/8:16 in device cache
        /dev/disk/by-id/ata-SAMSUNG_HD160JJ_S08HJ10L507895-part1: Aliased to /dev/block/8:17 in device cache
        /dev/disk/by-id/ata-SAMSUNG_HD160JJ_S08HJ10L507895-part2: Aliased to /dev/block/8:18 in device cache
        /dev/disk/by-id/ata-SAMSUNG_HD160JJ_S08HJ10L507895-part3: Aliased to /dev/block/8:19 in device cache
        /dev/disk/by-id/ata-SAMSUNG_HD160JJ_S08HJ10L507895-part5: Aliased to /dev/block/8:21 in device cache
        /dev/disk/by-id/ata-SAMSUNG_HD160JJ_S08HJ10L507895-part6: Aliased to /dev/block/8:22 in device cache
        /dev/disk/by-id/ata-SAMSUNG_HD160JJ_S08HJ10L526800: Aliased to /dev/block/8:0 in device cache
        /dev/disk/by-id/ata-SAMSUNG_HD160JJ_S08HJ10L526800-part1: Aliased to /dev/block/8:1 in device cache
        /dev/disk/by-id/ata-SAMSUNG_HD160JJ_S08HJ10L526800-part2: Aliased to /dev/block/8:2 in device cache
        /dev/disk/by-id/ata-SAMSUNG_HD160JJ_S08HJ10L526800-part3: Aliased to /dev/block/8:3 in device cache
        /dev/disk/by-id/ata-SAMSUNG_HD160JJ_S08HJ10L526800-part5: Aliased to /dev/block/8:5 in device cache
        /dev/disk/by-id/ata-SAMSUNG_HD160JJ_S08HJ10L526800-part6: Aliased to /dev/block/8:6 in device cache
        /dev/disk/by-id/dm-name-systemlvm-home: Aliased to /dev/block/253:2 in device cache
        /dev/disk/by-id/dm-name-systemlvm-tmp: Aliased to /dev/block/253:3 in device cache
        /dev/disk/by-id/dm-name-systemlvm-usr: Aliased to /dev/block/253:1 in device cache
        /dev/disk/by-id/dm-name-systemlvm-var: Aliased to /dev/block/253:0 in device cache
        /dev/disk/by-id/dm-uuid-LVM-rL8Oq2dA7oeRYeu1orJA7Ufnb1kjOyvr25N7CRZpUMzR18NfS6zeSeAVnVT98LuU: Aliased to /dev/block/253:0 in device cache
        /dev/disk/by-id/dm-uuid-LVM-rL8Oq2dA7oeRYeu1orJA7Ufnb1kjOyvr3TpFXtLjYGEwn79IdXsSCZPl8AxmqbmQ: Aliased to /dev/block/253:1 in device cache
        /dev/disk/by-id/dm-uuid-LVM-rL8Oq2dA7oeRYeu1orJA7Ufnb1kjOyvrc5MJ4KolevMjt85PPBrQuRTkXbx6NvTi: Aliased to /dev/block/253:3 in device cache
        /dev/disk/by-id/dm-uuid-LVM-rL8Oq2dA7oeRYeu1orJA7Ufnb1kjOyvrYXrfdg5OSYDVkNeiQeQksgCI849Z2hx8: Aliased to /dev/block/253:2 in device cache
        /dev/disk/by-id/md-uuid-11e9dc6c:1da99f3f:b3088ca6:c6fe60e9: Already in device cache
        /dev/disk/by-id/md-uuid-601d4642:39dc80d7:96e8bbac:649924ba: Already in device cache
        /dev/disk/by-id/md-uuid-92ed1e4b:897361d3:070682b3:3baa4fa1: Already in device cache
        /dev/disk/by-id/scsi-SATA_SAMSUNG_HD160JJS08HJ10L507895: Aliased to /dev/block/8:16 in device cache
        /dev/disk/by-id/scsi-SATA_SAMSUNG_HD160JJS08HJ10L507895-part1: Aliased to /dev/block/8:17 in device cache
        /dev/disk/by-id/scsi-SATA_SAMSUNG_HD160JJS08HJ10L507895-part2: Aliased to /dev/block/8:18 in device cache
        /dev/disk/by-id/scsi-SATA_SAMSUNG_HD160JJS08HJ10L507895-part3: Aliased to /dev/block/8:19 in device cache
        /dev/disk/by-id/scsi-SATA_SAMSUNG_HD160JJS08HJ10L507895-part5: Aliased to /dev/block/8:21 in device cache
        /dev/disk/by-id/scsi-SATA_SAMSUNG_HD160JJS08HJ10L507895-part6: Aliased to /dev/block/8:22 in device cache
        /dev/disk/by-id/scsi-SATA_SAMSUNG_HD160JJS08HJ10L526800: Aliased to /dev/block/8:0 in device cache
        /dev/disk/by-id/scsi-SATA_SAMSUNG_HD160JJS08HJ10L526800-part1: Aliased to /dev/block/8:1 in device cache
        /dev/disk/by-id/scsi-SATA_SAMSUNG_HD160JJS08HJ10L526800-part2: Aliased to /dev/block/8:2 in device cache
        /dev/disk/by-id/scsi-SATA_SAMSUNG_HD160JJS08HJ10L526800-part3: Aliased to /dev/block/8:3 in device cache
        /dev/disk/by-id/scsi-SATA_SAMSUNG_HD160JJS08HJ10L526800-part5: Aliased to /dev/block/8:5 in device cache
        /dev/disk/by-id/scsi-SATA_SAMSUNG_HD160JJS08HJ10L526800-part6: Aliased to /dev/block/8:6 in device cache
        /dev/disk/by-path/pci-0000:00:0f.0-scsi-0:0:0:0: Aliased to /dev/block/8:0 in device cache
        /dev/disk/by-path/pci-0000:00:0f.0-scsi-0:0:0:0-part1: Aliased to /dev/block/8:1 in device cache
        /dev/disk/by-path/pci-0000:00:0f.0-scsi-0:0:0:0-part2: Aliased to /dev/block/8:2 in device cache
        /dev/disk/by-path/pci-0000:00:0f.0-scsi-0:0:0:0-part3: Aliased to /dev/block/8:3 in device cache
        /dev/disk/by-path/pci-0000:00:0f.0-scsi-0:0:0:0-part5: Aliased to /dev/block/8:5 in device cache
        /dev/disk/by-path/pci-0000:00:0f.0-scsi-0:0:0:0-part6: Aliased to /dev/block/8:6 in device cache
        /dev/disk/by-path/pci-0000:00:0f.0-scsi-1:0:0:0: Aliased to /dev/block/8:16 in device cache
        /dev/disk/by-path/pci-0000:00:0f.0-scsi-1:0:0:0-part1: Aliased to /dev/block/8:17 in device cache
        /dev/disk/by-path/pci-0000:00:0f.0-scsi-1:0:0:0-part2: Aliased to /dev/block/8:18 in device cache
        /dev/disk/by-path/pci-0000:00:0f.0-scsi-1:0:0:0-part3: Aliased to /dev/block/8:19 in device cache
        /dev/disk/by-path/pci-0000:00:0f.0-scsi-1:0:0:0-part5: Aliased to /dev/block/8:21 in device cache
        /dev/disk/by-path/pci-0000:00:0f.0-scsi-1:0:0:0-part6: Aliased to /dev/block/8:22 in device cache
        /dev/disk/by-uuid/13c1262b-e06f-40ce-b088-ce410640a6dc: Aliased to /dev/block/253:3 in device cache
        /dev/disk/by-uuid/379f57b0-2e03-414c-808a-f76160617336: Aliased to /dev/block/253:2 in device cache
        /dev/disk/by-uuid/4fb2d6d3-bd51-48d3-95ee-8e404faf243d: Already in device cache
        /dev/disk/by-uuid/5c6728ec-82c1-49c0-93c5-f6dbd5c0d659: Aliased to /dev/block/8:5 in device cache
        /dev/disk/by-uuid/a13cdfcd-2191-4185-a727-ffefaf7a382e: Aliased to /dev/block/253:1 in device cache
        /dev/disk/by-uuid/e0d5893d-ff88-412f-b753-9e3e9af3242d: Aliased to /dev/block/8:21 in device cache
        /dev/disk/by-uuid/e79c9da6-8533-4e55-93ec-208876671edc: Aliased to /dev/block/253:0 in device cache
        /dev/disk/by-uuid/f3f176f5-12f7-4af8-952a-c6ac43a6e332: Already in device cache
        /dev/dm-0: Aliased to /dev/block/253:0 in device cache (preferred name)
        /dev/dm-1: Aliased to /dev/block/253:1 in device cache (preferred name)
        /dev/dm-2: Aliased to /dev/block/253:2 in device cache (preferred name)
        /dev/dm-3: Aliased to /dev/block/253:3 in device cache (preferred name)
        /dev/fd: Symbolic link to directory
        /dev/full: Not a block device
        /dev/hpet: Not a block device
        /dev/initctl: Not a block device
        /dev/input/by-path/platform-i8042-serio-0-event-kbd: Not a block device
        /dev/input/event0: Not a block device
        /dev/input/mice: Not a block device
        /dev/kmem: Not a block device
        /dev/kmsg: Not a block device
        /dev/log: Not a block device
        /dev/loop/0: Added to device cache
        /dev/MAKEDEV: Not a block device
        /dev/mapper/control: Not a block device
        /dev/mapper/systemlvm-home: Aliased to /dev/dm-2 in device cache
        /dev/mapper/systemlvm-tmp: Aliased to /dev/dm-3 in device cache
        /dev/mapper/systemlvm-usr: Aliased to /dev/dm-1 in device cache
        /dev/mapper/systemlvm-var: Aliased to /dev/dm-0 in device cache
        /dev/md0: Already in device cache
        /dev/md1: Already in device cache
        /dev/md2: Already in device cache
        /dev/mem: Not a block device
        /dev/net/tun: Not a block device
        /dev/network_latency: Not a block device
        /dev/network_throughput: Not a block device
        /dev/null: Not a block device
        /dev/port: Not a block device
        /dev/ppp: Not a block device
        /dev/psaux: Not a block device
        /dev/ptmx: Not a block device
        /dev/pts/0: Not a block device
        /dev/ram0: Aliased to /dev/block/1:0 in device cache (preferred name)
        /dev/ram1: Aliased to /dev/block/1:1 in device cache (preferred name)
        /dev/ram10: Aliased to /dev/block/1:10 in device cache (preferred name)
        /dev/ram11: Aliased to /dev/block/1:11 in device cache (preferred name)
        /dev/ram12: Aliased to /dev/block/1:12 in device cache (preferred name)
        /dev/ram13: Aliased to /dev/block/1:13 in device cache (preferred name)
        /dev/ram14: Aliased to /dev/block/1:14 in device cache (preferred name)
        /dev/ram15: Aliased to /dev/block/1:15 in device cache (preferred name)
        /dev/ram2: Aliased to /dev/block/1:2 in device cache (preferred name)
        /dev/ram3: Aliased to /dev/block/1:3 in device cache (preferred name)
        /dev/ram4: Aliased to /dev/block/1:4 in device cache (preferred name)
        /dev/ram5: Aliased to /dev/block/1:5 in device cache (preferred name)
        /dev/ram6: Aliased to /dev/block/1:6 in device cache (preferred name)
        /dev/ram7: Aliased to /dev/block/1:7 in device cache (preferred name)
        /dev/ram8: Aliased to /dev/block/1:8 in device cache (preferred name)
        /dev/ram9: Aliased to /dev/block/1:9 in device cache (preferred name)
        /dev/random: Not a block device
        /dev/root: Already in device cache
        /dev/rtc: Not a block device
        /dev/rtc0: Not a block device
        /dev/sda: Aliased to /dev/block/8:0 in device cache (preferred name)
        /dev/sda1: Aliased to /dev/block/8:1 in device cache (preferred name)
        /dev/sda2: Aliased to /dev/block/8:2 in device cache (preferred name)
        /dev/sda3: Aliased to /dev/block/8:3 in device cache (preferred name)
        /dev/sda5: Aliased to /dev/block/8:5 in device cache (preferred name)
        /dev/sda6: Aliased to /dev/block/8:6 in device cache (preferred name)
        /dev/sdb: Aliased to /dev/block/8:16 in device cache (preferred name)
        /dev/sdb1: Aliased to /dev/block/8:17 in device cache (preferred name)
        /dev/sdb2: Aliased to /dev/block/8:18 in device cache (preferred name)
        /dev/sdb3: Aliased to /dev/block/8:19 in device cache (preferred name)
        /dev/sdb5: Aliased to /dev/block/8:21 in device cache (preferred name)
        /dev/sdb6: Aliased to /dev/block/8:22 in device cache (preferred name)
        /dev/shm/network/ifstate: Not a block device
        /dev/snapshot: Not a block device
      /dev/sndstat: stat failed: Datei oder Verzeichnis nicht gefunden
        /dev/stderr: Not a block device
        /dev/stdin: Not a block device
        /dev/stdout: Not a block device
        /dev/systemlvm/home: Aliased to /dev/dm-2 in device cache
        /dev/systemlvm/tmp: Aliased to /dev/dm-3 in device cache
        /dev/systemlvm/usr: Aliased to /dev/dm-1 in device cache
        /dev/systemlvm/var: Aliased to /dev/dm-0 in device cache
        /dev/tty: Not a block device
        /dev/tty0: Not a block device
        [... many more "not a block device"]
        /dev/vcsa6: Not a block device
        /dev/xconsole: Not a block device
        /dev/zero: Not a block device
    Wiping internal VG cache
        lvmcache: initialised VG #orphans_lvm1
        lvmcache: initialised VG #orphans_pool
        lvmcache: initialised VG #orphans_lvm2
  Reading all physical volumes.  This may take a while...
    Finding all volume groups
        /dev/ram0: Skipping (regex)
        /dev/loop/0: Skipping (sysfs)
        /dev/sda: Skipping (regex)
        Opened /dev/md0 RO
      /dev/md0: size is 192512 sectors
        Closed /dev/md0
      /dev/md0: size is 192512 sectors
        Opened /dev/md0 RW O_DIRECT
        /dev/md0: block size is 1024 bytes
        Closed /dev/md0
        Using /dev/md0
        Opened /dev/md0 RW O_DIRECT
        /dev/md0: block size is 1024 bytes
      /dev/md0: No label detected
        Closed /dev/md0
        /dev/dm-0: Skipping (regex)
        /dev/ram1: Skipping (regex)
        /dev/sda1: Skipping (regex)
        Opened /dev/md1 RO
      /dev/md1: size is 5863552 sectors
        Closed /dev/md1
      /dev/md1: size is 5863552 sectors
        Opened /dev/md1 RW O_DIRECT
        /dev/md1: block size is 4096 bytes
        Closed /dev/md1
        Using /dev/md1
        Opened /dev/md1 RW O_DIRECT
        /dev/md1: block size is 4096 bytes
      /dev/md1: No label detected
        Closed /dev/md1
        /dev/dm-1: Skipping (regex)
        /dev/ram2: Skipping (regex)
        /dev/sda2: Skipping (regex)
        Opened /dev/md2 RO
      /dev/md2: size is 303596160 sectors
        Closed /dev/md2
      /dev/md2: size is 303596160 sectors
        Opened /dev/md2 RW O_DIRECT
        /dev/md2: block size is 4096 bytes
        Closed /dev/md2
        Using /dev/md2
        Opened /dev/md2 RW O_DIRECT
        /dev/md2: block size is 4096 bytes
      /dev/md2: lvm2 label detected
        lvmcache: /dev/md2: now in VG #orphans_lvm2 (#orphans_lvm2)
        /dev/md2: Found metadata at 39936 size 2632 (in area at 2048 size 194560) for systemlvm (rL8Oq2-dA7o-eRYe-u1or-JA7U-fnb1-kjOyvr)
        lvmcache: /dev/md2: now in VG systemlvm with 1 mdas
        lvmcache: /dev/md2: setting systemlvm VGID to rL8Oq2dA7oeRYeu1orJA7Ufnb1kjOyvr
        lvmcache: /dev/md2: VG systemlvm: Set creation host to rescue.
        Closed /dev/md2
        /dev/dm-2: Skipping (regex)
        /dev/ram3: Skipping (regex)
        /dev/sda3: Skipping (regex)
        /dev/dm-3: Skipping (regex)
        /dev/ram4: Skipping (regex)
        /dev/ram5: Skipping (regex)
        /dev/sda5: Skipping (regex)
        /dev/ram6: Skipping (regex)
        /dev/sda6: Skipping (regex)
        /dev/ram7: Skipping (regex)
        /dev/ram8: Skipping (regex)
        /dev/ram9: Skipping (regex)
        /dev/ram10: Skipping (regex)
        /dev/ram11: Skipping (regex)
        /dev/ram12: Skipping (regex)
        /dev/ram13: Skipping (regex)
        /dev/ram14: Skipping (regex)
        /dev/ram15: Skipping (regex)
        /dev/sdb: Skipping (regex)
        /dev/sdb1: Skipping (regex)
        /dev/sdb2: Skipping (regex)
        /dev/sdb3: Skipping (regex)
        /dev/sdb5: Skipping (regex)
        /dev/sdb6: Skipping (regex)
      Locking /lib/init/rw/V_systemlvm RB
    Finding volume group "systemlvm"
        Opened /dev/md2 RW O_DIRECT
        /dev/md2: block size is 4096 bytes
      /dev/md2: lvm2 label detected
        lvmcache: /dev/md2: now in VG #orphans_lvm2 (#orphans_lvm2) with 1 mdas
        /dev/md2: Found metadata at 39936 size 2632 (in area at 2048 size 194560) for systemlvm (rL8Oq2-dA7o-eRYe-u1or-JA7U-fnb1-kjOyvr)
        lvmcache: /dev/md2: now in VG systemlvm with 1 mdas
        lvmcache: /dev/md2: setting systemlvm VGID to rL8Oq2dA7oeRYeu1orJA7Ufnb1kjOyvr
        lvmcache: /dev/md2: VG systemlvm: Set creation host to rescue.
        Using cached label for /dev/md2
        Read systemlvm metadata (19) from /dev/md2 at 39936 size 2632
        /dev/md2 0:      0     16: home(0:0)
        /dev/md2 1:     16     24: var(40:0)
        /dev/md2 2:     40     40: var(0:0)
        /dev/md2 3:     80     40: usr(0:0)
        /dev/md2 4:    120     40: var(80:0)
        /dev/md2 5:    160      8: tmp(0:0)
        /dev/md2 6:    168     16: var(64:0)
        /dev/md2 7:    184     80: var(120:0)
        /dev/md2 8:    264     64: home(16:0)
        /dev/md2 9:    328    128: var(200:0)
        /dev/md2 10:    456     32: home(80:0)
        /dev/md2 11:    488    440: var(328:0)
        /dev/md2 12:    928     24: home(112:0)
        /dev/md2 13:    952    206: NULL(0:0)
  Found volume group "systemlvm" using metadata type lvm2
        Read volume group systemlvm from /etc/lvm/backup/systemlvm
      Unlocking /lib/init/rw/V_systemlvm
        Closed /dev/md2
      Unlocking /lib/init/rw/P_global


~# vgdisplay
  --- Volume group ---
  VG Name               systemlvm
  System ID            
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  19
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                4
  Open LV               4
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               144,75 GB
  PE Size               128,00 MB
  Total PE              1158
  Alloc PE / Size       952 / 119,00 GB
  Free  PE / Size       206 / 25,75 GB
  VG UUID               rL8Oq2-dA7o-eRYe-u1or-JA7U-fnb1-kjOyvr


~# pvdisplay
  --- Physical volume ---
  PV Name               /dev/md2
  VG Name               systemlvm
  PV Size               144,77 GB / not usable 16,31 MB
  Allocatable           yes
  PE Size (KByte)       131072
  Total PE              1158
  Free PE               206
  Allocated PE          952
  PV UUID               ZSAzP5-iBvr-L7jy-wB8T-AiWz-0g3m-HLK66Y


:~# lvdisplay
  --- Logical volume ---
  LV Name                /dev/systemlvm/home
  VG Name                systemlvm
  LV UUID                YXrfdg-5OSY-DVkN-eiQe-Qksg-CI84-9Z2hx8
  LV Write Access        read/write
  LV Status              available
  # open                 2
  LV Size                17,00 GB
  Current LE             136
  Segments               4
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2

  --- Logical volume ---
  LV Name                /dev/systemlvm/var
  VG Name                systemlvm
  LV UUID                25N7CR-ZpUM-zR18-NfS6-zeSe-AVnV-T98LuU
  LV Write Access        read/write
  LV Status              available
  # open                 2
  LV Size                96,00 GB
  Current LE             768
  Segments               7
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

  --- Logical volume ---
  LV Name                /dev/systemlvm/usr
  VG Name                systemlvm
  LV UUID                3TpFXt-LjYG-Ewn7-9IdX-sSCZ-Pl8A-xmqbmQ
  LV Write Access        read/write
  LV Status              available
  # open                 2
  LV Size                5,00 GB
  Current LE             40
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1

  --- Logical volume ---
  LV Name                /dev/systemlvm/tmp
  VG Name                systemlvm
  LV UUID                c5MJ4K-olev-Mjt8-5PPB-rQuR-TkXb-x6NvTi
  LV Write Access        read/write
  LV Status              available
  # open                 2
  LV Size                1,00 GB
  Current LE             8
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:3
share|improve this question

5 Answers 5

Check out /etc/lvm/lvm.conf - you'll need to edit it and adjust the filter config.

Basically, LVM scans all the block devices in your system and is finding /dev/sdX before /dev/mdX.

If you edit lvm.conf and add something like

filter =  [ "a/md/", "r/.*/" ]

it will only scan /dev/mdX devices.

share|improve this answer
    
That doesn't work: kermit:~# grep filter /etc/lvm/lvm.conf | grep -v \# filter = [ "a|/dev/md.*|", "r/.*/" ] –  DaDaDom Feb 22 '10 at 9:51
    
What does vgscan -vv look like? –  James Feb 22 '10 at 12:45
    
I put it into an answer, otherwise it's unreadable. –  DaDaDom Feb 23 '10 at 15:50
    
It looks OK to me. What's not working? –  James Feb 23 '10 at 16:30
    
Looks OK to me, too. But on boot I get the problem that not md2 is used as the lvm device but sdb6, see my original question. That's why I am so stuck, everything looks fine configuration-wise, it just isn't working! –  DaDaDom Feb 23 '10 at 17:45
:~# vgscan -vv
      Setting global/locking_type to 1
      File-based locking selected.
      Setting global/locking_dir to /lib/init/rw
      Locking /lib/init/rw/P_global WB
    Wiping cache of LVM-capable devices
      /dev/sndstat: stat failed: Datei oder Verzeichnis nicht gefunden
    Wiping internal VG cache
  Reading all physical volumes.  This may take a while...
    Finding all volume groups
      /dev/md0: size is 192512 sectors
      /dev/md0: size is 192512 sectors
      /dev/md0: No label detected
      /dev/md1: size is 5863552 sectors
      /dev/md1: size is 5863552 sectors
      /dev/md1: No label detected
      /dev/md2: size is 303596160 sectors
      /dev/md2: size is 303596160 sectors
      /dev/md2: lvm2 label detected
      Locking /lib/init/rw/V_systemlvm RB
    Finding volume group "systemlvm"
      /dev/md2: lvm2 label detected
  Found volume group "systemlvm" using metadata type lvm2
      Unlocking /lib/init/rw/V_systemlvm
      Unlocking /lib/init/rw/P_global
share|improve this answer

It seems as if LVM volumes are assembled before MD devices. Can you check the order in which they start in /etc/rc?.d/ (assuming the startup scripts are there)?

share|improve this answer
    
Hm, that may be a problem, but I will investigate further as soon as I have a little bit more time. kermit:/etc# l -la rc?.d/S*lvm* rcS.d/S26lvm2 -> ../init.d/lvm2 rc6.d/S50lvm2 -> ../init.d/lvm2 rc0.d/S50lvm2 -> ../init.d/lvm2 kermit:/etc# l -la rc?.d/S*md* rcS.d/S25mdadm-raid -> ../init.d/mdadm-raid rc6.d/S60mdadm-raid -> ../init.d/mdadm-raid rc0.d/S60mdadm-raid -> ../init.d/mdadm-raid rc5.d/S25mdadm -> ../init.d/mdadm rc4.d/S25mdadm -> ../init.d/mdadm rc3.d/S25mdadm -> ../init.d/mdadm rc2.d/S25mdadm -> ../init.d/mdadm –  DaDaDom Mar 28 '10 at 2:47

Hmm that filter should work. Try

md_component_detection = 1

or

preferred_names = [ "^/dev/md" ]

in the devices section of lvm.conf.

Also posting the formatted output of lvm dumpconfig may help.

share|improve this answer
    
I already tried those options as well as I can see from my log I created when trying to repair that stuff. But now I almost completely reinstalled the system so I can't completely reproduce the problem anymore. –  DaDaDom Sep 8 '10 at 11:48
up vote 0 down vote accepted

The problem disappeared after an update. As I cannot reproduce this problem anymore, I have to "close" this topic. If anyone runs into this as well, don't bother to ask me as I have some logs and docs about this, though I don't have the exact way of how it was solved.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.