You are not logged in.

#1 2015-01-29 09:03:51

elukas
Member
From: Avignon, France
Registered: 2012-03-14
Posts: 18
Website

[SOLVED] Fail to mount LVM on start up

Hello,

I have just added a SSD to my HTPC, changing drives order (not eactly on purpose).
Currently, the configuration is SSD (/, /swap and /home with LVM) + 3x1To in RAID5 (/var and /mnt/data with LVM).
Since, the LVM partitions over the raid array cannot be mounted on start up. I fall in rescue mode (type root password and correct blabla or Ctrl+D blabla).

But if I disabled and enabled the vg, everything goes fine.

I named ssd-mediacenter the VG on the SSD and raid-mediacenter the VG on the raid array. I labeled lv-[mount point] LVs and [ssd|raid]-[mount opint] the filesystem
ssd-mediacenter/lv-root is the ext4 partition labeled ssd-root

/dev/sdd2 isn't used anymore.
raid-mediacenter/lv-rootfs is my old root partition (before the SSD) still kept for config files.

[root@mediacenter ~]# pvs
  PV         VG               Fmt  Attr PSize   PFree
  /dev/md127 raid-mediacenter lvm2 a--    1,82t  20,00g
  /dev/sda2  ssd-mediacenter  lvm2 a--  476,74g 424,74g

[root@mediacenter ~]# vgs
  VG               #PV #LV #SN Attr   VSize   VFree
  raid-mediacenter   1   3   0 wz--n-   1,82t  20,00g
  ssd-mediacenter    1   3   0 wz--n- 476,74g 424,74g

[root@mediacenter ~]# lvs
  LV      VG               Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lv-data raid-mediacenter -wi-a-----  1,77t
  lv-var  raid-mediacenter -wi-a----- 15,00g
  rootfs  raid-mediacenter -wi-a----- 10,00g
  lv-home ssd-mediacenter  -wi-ao---- 30,00g
  lv-root ssd-mediacenter  -wi-ao---- 20,00g
  lv-swap ssd-mediacenter  -wc-ao----  2,00g
[root@mediacenter ~]# LANG=C lsblk
lsblk: dm-3: failed to get device path
lsblk: dm-4: failed to get device path
lsblk: dm-5: failed to get device path
lsblk: dm-3: failed to get device path
lsblk: dm-4: failed to get device path
lsblk: dm-5: failed to get device path
lsblk: dm-3: failed to get device path
lsblk: dm-4: failed to get device path
lsblk: dm-5: failed to get device path
lsblk: dm-3: failed to get device path
lsblk: dm-4: failed to get device path
lsblk: dm-5: failed to get device path
NAME                          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                             8:0    0   477G  0 disk
|-sda1                          8:1    0   200M  0 part  /boot
|-sda2                          8:2    0 476.8G  0 part
| |-ssd--mediacenter-lv--root 253:0    0    20G  0 lvm   /
| |-ssd--mediacenter-lv--swap 253:1    0     2G  0 lvm   [SWAP]
| `-ssd--mediacenter-lv--home 253:2    0    30G  0 lvm   /home
`-sda3                          8:3    0  1007K  0 part
sdb                             8:16   0 931.5G  0 disk
`-sdb1                          8:17   0   930G  0 part
  `-md127                       9:127  0   1.8T  0 raid5
sdc                             8:32   0 931.5G  0 disk
`-sdc1                          8:33   0   930G  0 part
  `-md127                       9:127  0   1.8T  0 raid5
sdd                             8:48   0 931.5G  0 disk
|-sdd1                          8:49   0   930G  0 part
| `-md127                       9:127  0   1.8T  0 raid5
`-sdd2                          8:50      1007K  0 part
[root@mediacenter ~]# vgchange -a n raid-mediacenter
  0 logical volume(s) in volume group "raid-mediacenter" now active
[root@mediacenter ~]# vgchange -a y raid-mediacenter
  3 logical volume(s) in volume group "raid-mediacenter" now active
[root@mediacenter ~]# LANG=C lsblk
NAME                             MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                                8:0    0   477G  0 disk
|-sda1                             8:1    0   200M  0 part  /boot
|-sda2                             8:2    0 476.8G  0 part
| |-ssd--mediacenter-lv--root    253:0    0    20G  0 lvm   /
| |-ssd--mediacenter-lv--swap    253:1    0     2G  0 lvm   [SWAP]
| `-ssd--mediacenter-lv--home    253:2    0    30G  0 lvm   /home
`-sda3                             8:3    0  1007K  0 part
sdb                                8:16   0 931.5G  0 disk
`-sdb1                             8:17   0   930G  0 part
  `-md127                          9:127  0   1.8T  0 raid5
    |-raid--mediacenter-rootfs   253:3    0    10G  0 lvm
    |-raid--mediacenter-lv--var  253:4    0    15G  0 lvm
    `-raid--mediacenter-lv--data 253:5    0   1.8T  0 lvm
sdc                                8:32   0 931.5G  0 disk
`-sdc1                             8:33   0   930G  0 part
  `-md127                          9:127  0   1.8T  0 raid5
    |-raid--mediacenter-rootfs   253:3    0    10G  0 lvm
    |-raid--mediacenter-lv--var  253:4    0    15G  0 lvm
    `-raid--mediacenter-lv--data 253:5    0   1.8T  0 lvm
sdd                                8:48   0 931.5G  0 disk
|-sdd1                             8:49   0   930G  0 part
| `-md127                          9:127  0   1.8T  0 raid5
|   |-raid--mediacenter-rootfs   253:3    0    10G  0 lvm
|   |-raid--mediacenter-lv--var  253:4    0    15G  0 lvm
|   `-raid--mediacenter-lv--data 253:5    0   1.8T  0 lvm
`-sdd2                             8:50   0  1007K  0 part

Last edited by elukas (2015-02-25 08:46:35)

Offline

#2 2015-01-29 10:55:10

elukas
Member
From: Avignon, France
Registered: 2012-03-14
Posts: 18
Website

Re: [SOLVED] Fail to mount LVM on start up

The issue seems to be due to an error with the raid array itself or rebuild the raid array forces rescan LVM configuration, I don't know.

In case of something like that append to someone :

[root@mediacenter ~]# history | tail -n 20
  ...
  486  vgchange -a n raid-mediacenter
  487  pvchange --help
  488  mdadm --stop /dev/md50
  489  mdadm --assemble --help
  490  mdadm --assemble --update=?
  491  mdadm --assemble /dev/md50 --name=mediacenter01 --update=name
  492  pvs
  493  vgs
  494  lvs
  495  vgchange -a y raid-mediacenter
  496  lvs
  497  mdadm -Es
  ...

after a reboot lsblck displays the right devices configuration.

Thank you for viewers who search to help.

EDIT January 30 2015:
The problem persists.

The lvm2-pvscan@9:127.service fails to load.

[root@mediacenter ~]# systemctl status lvm2-pvscan@9\:127.service -l
? lvm2-pvscan@9:127.service - LVM2 PV scan on device 9:127
   Loaded: loaded (/usr/lib/systemd/system/lvm2-pvscan@.service; static; vendorpreset: disabled)
   Active: failed (Result: signal) since ven. 2015-01-30 11:16:56 CET; 16min ago
     Docs: man:pvscan(8)
 Main PID: 167 (code=killed, signal=KILL)

janv. 30 11:16:56 mediacenter systemd[1]: lvm2-pvscan@9:127.service stop-sigterm timed out. Killing.
janv. 30 11:16:56 mediacenter systemd[1]: lvm2-pvscan@9:127.service: main process exited, code=killed, status=9/KILL
janv. 30 11:16:56 mediacenter systemd[1]: Unit lvm2-pvscan@9:127.service entered failed state.
janv. 30 11:16:56 mediacenter systemd[1]: lvm2-pvscan@9:127.service failed.
[root@mediacenter ~]# journalctl -b0
...
janv. 30 11:15:24 localhost kernel: md127: detected capacity change from 0 to 1996891357184
janv. 30 11:15:25 localhost kernel:  md127: unknown partition table
janv. 30 11:15:25 localhost kernel: EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null)
janv. 30 11:15:25 localhost systemd-udevd[59]: '/usr/bin/mdadm --incremental --export /dev/sdb1 --offroot ${DEVLINKS}' [110] terminated by signal 15 (Terminated)
janv. 30 11:15:25 localhost lvm[162]: Daemon lvmetad returned error 104
janv. 30 11:15:25 localhost lvm[162]: WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
janv. 30 11:15:25 localhost lvm[162]: Cannot proceed since lvmetad is not active.
janv. 30 11:15:25 localhost systemd[1]: lvm2-pvscan@8:2.service: control process exited, code=exited status=5
janv. 30 11:15:25 localhost systemd[1]: Unit lvm2-pvscan@8:2.service entered failed state.
janv. 30 11:15:25 localhost systemd[1]: lvm2-pvscan@8:2.service failed.
...

Last edited by elukas (2015-01-30 13:45:23)

Offline

#3 2015-01-30 11:03:31

elukas
Member
From: Avignon, France
Registered: 2012-03-14
Posts: 18
Website

Re: [SOLVED] Fail to mount LVM on start up

I have a question,
If a make a backup config for the VG raid-mediacenter, and then remove everything, reboot and restore, will I recover my partitions ?

Last edited by elukas (2015-01-30 13:47:39)

Offline

#4 2015-02-06 08:24:55

elukas
Member
From: Avignon, France
Registered: 2012-03-14
Posts: 18
Website

Re: [SOLVED] Fail to mount LVM on start up

Hi,

Is my problem could be due to the hardware (chipset) ?
My HTPC is based on LGA775 socket on top of the Asus P5N7A-VM motherboard. There is 3 red SATA slots, and 2 black.
Is it possible that the 2 black ports (handled, I think, by the additional JMicron JMB368 controller) can't be used before the system has been fully started ?

When I press F8 to get the bios selector boot device menu, only SATA devices plugged into the red slots are enabled.

If is that so, how could I embed JMicron driver into the initramfs image ?

Thanks.

Offline

#5 2015-02-25 08:46:06

elukas
Member
From: Avignon, France
Registered: 2012-03-14
Posts: 18
Website

Re: [SOLVED] Fail to mount LVM on start up

I finally solved my issue.

It seems that the problem was due to mdadm_udev hook, which causes this trouble in combination with systemd (I didn't try adding udev).

this configuration works for me : HOOKS="base systemd autodetect modconf block mdadm mdadm_udev  sd-lvm2 filesystems keyboard sd-vconsole fsck"

Offline

Board footer

Powered by FluxBB