#611 Issue closed: Saving LVM layout on VBOX oracle linux VM fails

Labels: support / question

ibnabbas opened issue at 2015-07-06 12:58:

Saving LVM layout on VBOX oracle linux VM fails. Below is the error as shown in rear.log

2015-07-06 15:21:47 Including layout/save/GNU/Linux/21_raid_layout.sh
2015-07-06 15:21:47 Including layout/save/GNU/Linux/22_lvm_layout.sh
2015-07-06 15:21:47 Saving LVM layout.
  stdin: fdopen failed: Invalid argument
  stdin: fclose failed: Invalid argument
  stdin: fdopen failed: Invalid argument
  stdin: fdopen failed: Invalid argument
  stdin: fclose failed: Invalid argument
  stdin: fdopen failed: Invalid argument
  stdin: fdopen failed: Invalid argument
  stdin: fclose failed: Invalid argument
  stdin: fdopen failed: Invalid argument
2015-07-06 15:21:47 Including layout/save/GNU/Linux/23_filesystem_layout.sh
2015-07-06 15:21:47 Begin saving filesystem layout
2015-07-06 15:21:47 Saving filesystem layout (using the findmnt command).

My rear version is rear-1.17.0-1.el6.noarch

lsb_release -a
LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: OracleServer
Description:    Oracle Linux Server release 6.4
Release:        6.4
Codename:       n/a

Recovery was failing and the disklayout.conf did not have any directives to create LVs on the new disk.

gdha commented at 2015-07-06 13:25:

could you run rear -vD savelayout and check the rear.log around the location where the errors happened. We should know which command was executing.

ibnabbas commented at 2015-07-06 13:39:

This is from the debug I ran some time back:

++ echo '2015-07-06 17:25:46 Saving LVM layout.'
2015-07-06 17:25:46 Saving LVM layout.
++ lvm pvdisplay -c
++ read line
  stdin: fdopen failed: Invalid argument
  stdin: fclose failed: Invalid argument
  stdin: fdopen failed: Invalid argument

When I run the above command manually it works fine for me:

lvm pvdisplay -c
  /dev/sdb:vg_oracle:125829120:-1:8:8:-1:4096:15359:0:15359:6VAxOe-m7NM-w8eS-5NDH-FaqS-dqoF-RLsc4z
  /dev/sdc:vg_oracle:125829120:-1:8:8:-1:4096:15359:0:15359:dB2cEo-fcmh-rfa8-a6mV-gpHQ-Kvqr-9IGiPB
  /dev/sdd:vg_oracle:122880000:-1:8:8:-1:4096:14999:10358:4641:YHT3Wx-VCsw-vfNR-W9Rs-K4ZH-Zvf2-yA8yg4
  /dev/sda2:vg_system:61888512:-1:8:8:-1:4096:7554:0:7554:HJRHnt-YQLC-pK5Z-Er7F-GU41-CNNW-H5M9TU

ibnabbas commented at 2015-07-06 13:46:

Interestingly, when I run just the savelayout, there is no error

[root layout]# rear -vD savelayout
Relax-and-Recover 1.17.0 / Git
Using log file: /var/log/rear/rear-dev.log
Creating disk layout
Excluding Volume Group vg_oracle
Excluding component fs:/u01/product
Excluding component fs:/u01/admin
[root layout]#

++ echo '2015-07-06 17:41:57 Saving LVM layout.'
2015-07-06 17:41:57 Saving LVM layout.
++ lvm pvdisplay -c
++ read line
+++ echo /dev/sdb:vg_oracle:125829120:-1:8:8:-1:4096:15359:0:15359:6VAxOe-m7NM-w
8eS-5NDH-FaqS-dqoF-RLsc4z
+++ cut -d : -f 1
++ pdev=/dev/sdb
++ '[' dev/sdb = /dev/sdb ']'

I can see directives for PV and VG creation in the disktodo.conf. Previously there were no LVM related indicators in this file.

[root layout]# more /var/lib/rear/layout/disktodo.conf |grep todo
todo /dev/sda disk
todo /dev/sda1 part
todo /dev/sda2 part
todo pv:/dev/sda2 lvmdev
todo /dev/vg_system lvmgrp
todo /dev/mapper/vg_system-lv_root lvmvol
todo /dev/mapper/vg_system-lv_swap lvmvol
todo fs:/ fs
todo fs:/boot fs
todo swap:/dev/mapper/vg_system-lv_swap swap

gdha commented at 2015-07-09 07:16:

Could be that you need to update lvm2 product - see https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/6.5_Technical_Notes/lvm2.html

ibnabbas commented at 2015-07-12 12:48:

Thanks for pointing out the bug in lvm. Looks like it only affects nohup commands. So switched to screen for workaround.


[Export of Github issue for rear/rear.]