Wind River Support Network

HomeDefectsLIN6-9890
Fixed

LIN6-9890 : Issue with lvm snapshots on wrl6

Created: May 14, 2015    Updated: Dec 3, 2018
Resolved Date: May 28, 2015
Found In Version: 6.0.0.18
Severity: Standard
Applicable for: Wind River Linux 6
Component/s: Userspace

Description

Whilst trying to reproduce a snapshot issue observed by a customer I hit a segfault in "vgchange".

It could be that the root cause of both the customer issue and mine is the same, though I was using RCPL 18 and they were using RCPL 17. Other differences were that the customer has the rootfs on the LV, whereas I didn't get as far as setting up a rootfs on the LV, so the LV was just mounted manually.

Steps to Reproduce

Configure an intel-x86-64 platform with standard kernel and glibc_std rootfs.
Build and deploy to target using pxeboot - tftp kernel and NFS rootfs.
The target in my tests was a Matxm with two hard disks attached.

After booting via pxe, follow these steps:

1. Create 2 partitions on sda - one for /boot and one for / (root)
2. Created 1 partition on sdb - for extending /
3. Format sda1 with ext2 ready for use as /boot
4. Create physical volumes:

root@localhost:~# pvcreate /dev/sda2
  Writing physical volume data to disk "/dev/sda2"
  Physical volume "/dev/sda2" successfully created

root@localhost:~# pvcreate /dev/sdb1
  Writing physical volume data to disk "/dev/sdb1"
  Physical volume "/dev/sdb1" successfully created

5. Create vol group:

root@localhost:~# vgcreate rootvg /dev/sda2 /dev/sdb1
  Volume group "rootvg" successfully created

6. Create logical volume:

root@localhost:~# lvcreate -L200G -n rootlv rootvg
bio: create slab <bio-2> at 2
  Logical volume "rootlv" created

7. Format & Mount

root@localhost:~# mkfs -t ext4 /dev/rootvg/rootlv
...
root@localhost:~# mount /dev/rootvg/rootlv /mnt
EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null)

8. Populate with some data, I just used a dist.tar.bz2 file
9. Create snapshot

root@localhost:/mnt# lvcreate -L10G -s -n backup /dev/rootvg/rootlv
bio: create slab <bio-3> at 3
  Logical volume "backup" created

10. Modify the LV with some new data
11. Start restore from backup

root@localhost:/mnt# lvconvert --merge -i 1 /dev/rootvg/backup 
  Can't merge over open origin volume
  Merging of snapshot backup will start next activation.

12. Reboot
13. Remount LV

root@localhost:~# vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "rootvg" using metadata type lvm2
root@localhost:~# vgchange -ay
bio: create slab <bio-2> at 2
  1 logical volume(s) in volume group "rootvg" now active
root@localhost:~# mount /dev/rootvg/rootlv /mnt
EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null)

14. Check restore progress

root@localhost:~# lvs /dev/rootvg/backup
  LV       VG     Attr     LSize  Pool Origin Data%  Move Log Copy%  Convert
  [backup] rootvg Swi-a-s- 10.00g      rootlv   0.77

at this point, and even if I don't do the "lvs" command, I see this after a few seconds:

vgchange[651]: segfault at 28 ip 000000000047ba59 sp 00007fffa3e1a7d0 error 4 in lvm[400000+d5000]

This seems to be reproducible every time.

Other Downloads


Live chat
Online