Bug#378143: broken(?) snapshot prevents vgchange -a y, prevents boot

Ian Jackson ian at davenant.greenend.org.uk
Thu Jul 13 16:55:16 UTC 2006


Package: lvm2
Version: 2.01.04-5

I am submitting two bug reports about this one experience; please do
not confuse them.  This report is about the fact that the system was
too fragile and prevented my machine from booting when a boot should
have been possible.

It seems like a broken LVM snapshot was the cause of the problem.
Either the snapshot should not have been broken, or if it had been
dropped because it was too full, then it shouldn't have prevented the
vg activation.

Ian.


Transcript:
-----------

I had to reboot my machine.  During shutdown, this happened:

The system is going down for reboot NOW!
INIT: Sending processes the TERM signal
...
Unmounting remote and non-toplevel virtual filesystems...done.
Deconfiguring network interfaces...done.
Deactivating swap...done.
Unmounting local filesystems...umount: /var: device is busy
umount: /dev/mapper/vg--main-lv--usr busy - remounted read-only
umount: /: device is busy
done.
mount: / is busy
Shutting down LVM Volume Groups...
  Can't deactivate volume group "vg-main" with 2 open logical volume(s)
Rebooting... Restarting system.

I don't know why /var and /usr were busy.

Before the reboot, lv-usr had an snapshot which may or may not have
become full.  The snapshot was created, I think, some time ago, and I
can't find any record of it having been dropped or removed.

After the first reboot, e2fsck demanded a reboot after fiddling with
my non-LVM'd /.

After the second reboot, this happened:

Setting up LVM Volume Groups...
  Reading all physical volumes.  This may take a while...
  Found volume group "vg-main" using metadata type lvm2
  Can't expand LV: Snapshot support missing from kernel?
  8 logical volume(s) in volume group "vg-main" now active
Checking all file systems...
fsck 1.37 (21-Mar-2005)
Failed to open the device '/dev/mapper/vg--main-lv--usr': No such file or directory

 [ various messages about fscks of other volumes elided ]

fsck failed.  Please repair manually.

CONTROL-D will exit from this shell and continue system startup.

Give root password for maintenance
(or type Control-D to continue):
root@(none):~# mount
/dev/sdb1 on / type ext2 (rw)
proc on /proc type proc (rw,paranoid)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
root@(none):~# ls /dev/mapper/vg--main-lv*
/dev/mapper/vg--main-lv--log   /dev/mapper/vg--main-lv--u2
/dev/mapper/vg--main-lv--news  /dev/mapper/vg--main-lv--u3
/dev/mapper/vg--main-lv--swap  /dev/mapper/vg--main-lv--var
/dev/mapper/vg--main-lv--u     /dev/mapper/vg--main-lv--volt
root@(none):~# vgchange -a y
  Can't expand LV: Snapshot support missing from kernel?
  8 logical volume(s) in volume group "vg-main" now active
root@(none):~# vgchange -a y /dev/mapper/vg--main-lv--usr
  Invalid volume group name: mapper/vg--main-lv--usr
root@(none):~# lvchange -a y /dev/mapper/vg--main-lv--usr
  Volume group "mapper" not found
root@(none):~# lvchange -a y /dev/vg-main/lv-usr
  Can't expand LV: Snapshot support missing from kernel?
root@(none):~# vgdisplay
  --- Volume group ---
  VG Name               vg-main
  System ID             chiark1090621977
  Format                lvm2
  Metadata Areas        5
  Metadata Sequence No  191
  VG Access             read/write
  VG Status             resizable
  MAX LV                256
  Cur LV                10
  Open LV               0
  Max PV                256
  Cur PV                5
  Act PV                5
  VG Size               187.65 GB
  PE Size               4.00 MB
  Total PE              48039
  Alloc PE / Size       17025 / 66.50 GB
  Free  PE / Size       31014 / 121.15 GB
  VG UUID               GgVUxo-Oj7N-PwQi-cNJq-OsHQ-kRNa-TI2HYf

root@(none):~# vgdisplay -v
    Finding all volume groups
    Finding volume group "vg-main"
  --- Volume group ---
  VG Name               vg-main
  System ID             chiark1090621977
  Format                lvm2
  Metadata Areas        5
  Metadata Sequence No  191
  VG Access             read/write
  VG Status             resizable
  MAX LV                256
  Cur LV                10
  Open LV               0
  Max PV                256
  Cur PV                5
  Act PV                5
  VG Size               187.65 GB
  PE Size               4.00 MB
  Total PE              48039
  Alloc PE / Size       17025 / 66.50 GB
  Free  PE / Size       31014 / 121.15 GB
  VG UUID               GgVUxo-Oj7N-PwQi-cNJq-OsHQ-kRNa-TI2HYf

  --- Logical volume ---
  LV Name                /dev/vg-main/lv-var
  VG Name                vg-main
  LV UUID                000000-0000-0000-0000-0000-0000-000000
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                3.00 GB
  Current LE             768
  Segments               2
  Allocation             normal
  Read ahead sectors     1024
  Block device           254:0

  --- Logical volume ---
  LV Name                /dev/vg-main/lv-u2
  VG Name                vg-main
  LV UUID                000000-0000-0000-0000-0000-0000-000001
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                7.95 GB
  Current LE             2036
  Segments               4
  Allocation             normal
  Read ahead sectors     1024
  Block device           254:1

  --- Logical volume ---
  LV Name                /dev/vg-main/lv-swap
  VG Name                vg-main
  LV UUID                000000-0000-0000-0000-0000-0000-000002
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                1.00 GB
  Current LE             256
  Segments               1
  Allocation             contiguous
  Read ahead sectors     16
  Block device           254:2

  --- Logical volume ---
  LV Name                /dev/vg-main/lv-u
  VG Name                vg-main
  LV UUID                000000-0000-0000-0000-0000-0000-000003
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                5.88 GB
  Current LE             1506
  Segments               1
  Allocation             normal
  Read ahead sectors     1024
  Block device           254:3

  --- Logical volume ---
  LV Name                /dev/vg-main/lv-usr
  VG Name                vg-main
  LV UUID                000000-0000-0000-0000-0000-0000-000004
  LV Write Access        read/write
  LV snapshot status     source of
  device-mapper ioctl cmd 12 failed: No such device or address
  device-mapper ioctl cmd 12 failed: No such device or address
                         /dev/vg-main/chiark-backup [INACTIVE]
  LV Status              NOT available
  LV Size                2.27 GB
  Current LE             581
  Segments               1
  Allocation             normal
  Read ahead sectors     1024

  --- Logical volume ---
  LV Name                /dev/vg-main/lv-volt
  VG Name                vg-main
  LV UUID                000000-0000-0000-0000-0000-0000-000005
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                29.49 GB
  Current LE             7549
  Segments               6
  Allocation             normal
  Read ahead sectors     1024
  Block device           254:4

  --- Logical volume ---
  LV Name                /dev/vg-main/lv-log
  VG Name                vg-main
  LV UUID                000000-0000-0000-0000-0000-0000-000006
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                4.92 GB
  Current LE             1259
  Segments               1
  Allocation             normal
  Read ahead sectors     1024
  Block device           254:5

  --- Logical volume ---
  LV Name                /dev/vg-main/lv-u3
  VG Name                vg-main
  LV UUID                000000-0000-0000-0000-0000-0000-000007
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                3.91 GB
  Current LE             1000
  Segments               1
  Allocation             normal
  Read ahead sectors     1024
  Block device           254:6

  --- Logical volume ---
  LV Name                /dev/vg-main/lv-news
  VG Name                vg-main
  LV UUID                000000-0000-0000-0000-0000-0000-000008
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                5.59 GB
  Current LE             1431
  Segments               2
  Allocation             normal
  Read ahead sectors     1024
  Block device           254:7

  --- Logical volume ---
  LV Name                /dev/vg-main/chiark-backup
  VG Name                vg-main
  LV UUID                1rwSbR-73Wz-Cul1-Exjf-raA0-vy4m-QGm8o9
  LV Write Access        read/write
  device-mapper ioctl cmd 12 failed: No such device or address
  device-mapper ioctl cmd 12 failed: No such device or address
  LV snapshot status     INACTIVE destination for /dev/vg-main/lv-usr
  LV Status              NOT available
  LV Size                2.27 GB
  Current LE             581 
  Segments               3
  Snapshot chunk size    8.00 KB
  Allocated to snapshot  100.00%
  Allocation             inherit
  Read ahead sectors     0

  --- Physical volumes ---
  PV Name               /dev/sda2
  PV UUID               3zbY3o-brwM-ctB4-QNV3-RQ3K-YC3V-cjkapA
  PV Status             allocatable
  Total PE / Free PE    4326 / 0

  PV Name               /dev/sdc1
  PV UUID               4JEgFW-nB6H-B59f-Wecn-Vnq7-SJpE-Seu2qv
  PV Status             allocatable
  Total PE / Free PE    1429 / 0

  PV Name               /dev/sdc2
  PV UUID               wXEBZz-JEh7-rSUL-zDUR-Pktw-mPJO-G716I4
  PV Status             allocatable
  Total PE / Free PE    833 / 0

  PV Name               /dev/sdc3
  PV UUID               YuuRB9-doSq-7X67-CGXl-2z05-Br8G-x0jjOb
  PV Status             allocatable
  Total PE / Free PE    6484 / 0

  PV Name               /dev/sdb2
  PV UUID               4quhV2-NTz5-1PVJ-GurZ-13Rg-WxbK-C1pq9y
  PV Status             allocatable
  Total PE / Free PE    34967 / 31014

root@(none):~# lvremove /dev/vg-main/chiark-backup
  Logical volume "chiark-backup" successfully removed
root@(none):~# lvchange -a y /dev/vg-main/lv-usr
root@(none):~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sdb1               139986     81616     51143  62% /
tmpfs                   518008         0    518008   0% /dev/shm
root@(none):~# mount -o remount,ro /
root@(none):~# reboot

And then all was well.




More information about the pkg-lvm-maintainers mailing list