[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #31771] GRUB2 with LVM snapshot of /boot
From: |
eugene |
Subject: |
[bug #31771] GRUB2 with LVM snapshot of /boot |
Date: |
Fri, 03 Dec 2010 14:14:15 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101026 SUSE/3.6.12-0.7.1 Firefox/3.6.12 |
URL:
<http://savannah.gnu.org/bugs/?31771>
Summary: GRUB2 with LVM snapshot of /boot
Project: GNU GRUB
Submitted by: eugeneus
Submitted on: Fri 03 Dec 2010 02:14:15 PM GMT
Category: Booting
Severity: Major
Priority: 5 - Normal
Item Group: Software Error
Status: None
Privacy: Public
Assigned to: None
Originator Name: Eugene Shtokolov
Originator Email: address@hidden
Open/Closed: Open
Discussion Lock: Any
Release:
Release: 1.98
Reproducibility: Every Time
Planned Release: None
_______________________________________________________
Details:
Maybe I found a bug or feature in the GRUB2.
I want to create a something like time machine. Install the system on LVM
partition, before the full system upgrade, we take a snapshot. If something
going wrong we can revert the snapshot with command:
lvconvert --merge /dev/VolGroup00/snap01.
Of course we can try to boot from LVM snapshot, after a little editing of
grub.cnf. For correct work of this mechanism, we must install the system,
including /boot, on LVM partition. This should work in theory. In practice,
after creating a snapshot the system becomes unbootable. After removing
snapshot the system becomes bootable again.
If I use a separate non LVM partition for /boot, everything works, but if the
kernel has changed, we can't restore system by merging the snapshot.
Sources of information:
https://wiki.archlinux.org/index.php/GRUB2#Installing_GRUB2_during_Arch_Linux_installation
https://wiki.archlinux.org/index.php/LVM#Important
----
Steps to reproduce:
* Boot from archlinux liveCD 2010.05
* modprobe dm-mod
* Create single large physical LVM volume and smaller size logical volume (we
need some free space on the physical volume to create a snapshot):
cfdisk /dev/sda
pvcreate /dev/sda1
pvdisplay
--- Physical volume ---
PV Name /dev/sda1
VG Name VolGroup00
PV Size 15.99 GiB / not usable 2.74 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 4094
Free PE 1534
Allocated PE 2560
PV UUID MZgGF5-XnPs-hzFM-0eWw-mEYP-6wgn-AggDO0
vgcreate VolGroup00 /dev/sda1
vgdisplay
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 7
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 15.99 GiB
PE Size 4.00 MiB
Total PE 4094
Alloc PE / Size 2560 / 10.00 GiB
Free PE / Size 1534 / 5.99 GiB
VG UUID 1TS4q4-WHAJ-YCxt-RHm0-k0Ha-spS4-O0nZzf
lvcreate -L 10G VolGroup00 -n lvolsys
lvdisplay
--- Logical volume ---
LV Name /dev/VolGroup00/lvolsys
VG Name VolGroup00
LV UUID FAfgNj-nDUW-WYyw-wwED-Fmct-it0L-NSOUDt
LV Write Access read/write
LV Status available
# open 1
LV Size 10.00 GiB
Current LE 2560
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:0
* Start the installation process: /arch/setup
* Define the mountpoints: lvolsys to /
* Continue with the installation
* Configure the system:
** set USELVM="yes" in /etc/rc.conf
** insert lvm2 in the HOOKS section in /etc/mkinitcpio.conf before
filesystems
** add dm-snapshot to the MODULES variable in /etc/mkinitcpio.conf
* Skip the Install Bootloader step and exit the installer.
* Install the bootloader:
aif -p partial-configure-network # configure the network
mount -o bind /dev /mnt/dev
chroot /mnt bash
pacman -Sy grub2
grub-install /dev/sda --no-floppy
grub-mkconfig -o /boot/grub/grub.cfg
exit
reboot
The system boots properly, but it becomes unbootable, after we make snapshot
of the lvolsys volume:
lvcreate --size 100M --snapshot --name snap01 /dev/VolGroup00/lvolsys
After reboot:
GRUB loading.
Welcome to GRUB!
error: no such disk.
Entering rescue mode...
grub rescue> ls
(hd0) (hd0,1)
If you boot from LiveCD and remove snapshot, the system becomes bootable
again.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?31771>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [bug #31771] GRUB2 with LVM snapshot of /boot,
eugene <=