bugGNU GRUB - Bugs: bug #55656, grub fails to read LVM LV with...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #55656: grub fails to read LVM LV with qemu sata drive on some LVM layouts

Submitted by:  Chris Bainbridge <bain>
Submitted on:  Wed 06 Feb 2019 05:52:36 PM UTC  
 
Category:  Filesystem Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  None Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Open Release: 
Release:  2.02 Reproducibility:  Every Time
Planned Release:  None

Wed 06 Feb 2019 05:57:07 PM UTC, comment #1: 

Errors look like drive corruption (but switching to virtio shows drive is ok):

grub> ls (lvm/VolGroup00-os1)/
error: unknown filesystem.
grub> ls (lvm/VolGroup00-var1)/
tmp/ lib/ run lock error: not a correct XFS inode.
adm/ error: not a correct XFS inode.
error: not a correct XFS inode.
error: not a correct XFS inode.

Chris Bainbridge <bain>
Wed 06 Feb 2019 05:52:36 PM UTC, original submission:  

Run attached "go" script. This creates a VM with:

qemu-img create -q -f qcow2 -o preallocation=metadata ${vm}.qcow2 80G

virt-install --name test --ram 2048 --disk path=test.qcow2,bus=sata \
  --vcpus 1 --os-type linux --os-variant centos7.0 \
  --location http://mirror.bytemark.co.uk/centos/7.6.1810/os/x86_64 \
  --extra-args "ks=file:/test.ks console=ttyS0" \
  --console pty,target_type=serial --initrd-inject test.ks --graphics none \
  --check disk_size=off

After kickstart install, anaconda will reboot, and then grub will fail to load the kernel from LVM LV. The issue appears to be the "bus=sata" which causes virt-install to run qemu like:

qemu-system-x86_64 -enable-kvm -cpu host -m 2G -nographic \
  -device ahci,id=sata0,bus=pci.0,addr=0x5 \
  -drive file=~/test.qcow2,format=qcow2,if=none,id=drive-sata0-0-0 \
  -device ide-hd,bus=sata0.0,drive=drive-sata0-0-0,id=sata0-0-0,bootindex=1

Manually running qemu with "... -hda test.qcow2" (instead of the above) works ok (sda appears as SCSI drive).
Using "virt-install --disk path=test.qcow2,bus=virtio" also works ok (vda appears as virtio drive).

This seems to be sensitive to the particular LVM layout - not creating the extra 2 logical volumes works ok. Maybe the changes in LVM layout causes grub to attempt reading bytes beyond some limit, which fails.

The easy workaround appears to be to remove "virt-install ... bus=sata" argument (and use default SCSI) or use "bus=virtio".

Chris Bainbridge <bain>

 

Attached Files
file #46192:  test.ks added by bain (2KiB - application/x-java-keystore)
file #46193:  go added by bain (496B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bain (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-02-06 bain Attached File- => Added test.ks, #46192
        Attached File- => Added go, #46193

    Back to the top


    Powered by Savane 3.5