Re: [linux-lvm] Trouble Booting Custom Kernel with QEMU: dracut-initqueue timeout waiting for /dev/sysvg/root

2023-09-11 Thread Vishal Chourasia
Sorry for the delay.

On 8/31/23 15:44, Zdenek Kabelac wrote:
> Dne 31. 08. 23 v 0:40 Vishal Chourasia napsal(a):
>> On 8/30/23 20:01, Zdenek Kabelac wrote:
>>> Dne 30. 08. 23 v 8:40 Vishal Chourasia napsal(a):
 Hi All,

>> # cat /proc/cmdline
>> BOOT_IMAGE=(hd0,gpt2)/vmlinuz-6.4.7-200.fc38.x86_64
>> root=/dev/mapper/sysvg-root ro console=tty1 console=ttyS0,115200n8
>> rd.lvm.lv=sysvg/root
>>
>> I have tried passing "root=/dev/mapper/sysvg-root rd.lvm.lv=sysvg/root"
>> with the -append option and it hasn't worked either.
>>>
>>> dracut that needs to include lvm2 code and be able to activate such LV
>>> prior switch to rootfs  (having somewhere inside  lvchange -ay
>>> vgname/lvrootname)
>> 1. How may I verify that dracut has included lvm2 code or not?
>> 2. Which file in the dracut would contain
>>     `lvchange -ay vgname/lvrootname` code?
> 
> Hi
> 
> If you are making ramdisk image from the system - dracut should
> autodetect such case and build the image with lvm2 support inside
> (unless you've instructed in dracut.conf to not doing so).
> 
> You can check if you dracut ramdisk image contains /usr/sbin/lvm
Yes. /usr/sbin/lvm is present

After unarchiving the initrd.img

$ find . -name lvm
./usr/sbin/lvm
./etc/lvm

> and also if dirs  in /usr/lib/dracut/hooks do have lvm2 scripts inside

λ ls usr/lib/dracut/hooks
cleanup  cmdline  emergency  initqueue  mount  netroot  pre-mount  pre-pivot  
pre-shutdown  pre-trigger  pre-udev  shutdown  shutdown-emergency

λ grep -r -i lvm *
cmdline/30-parse-lvm.sh:if [ -e /etc/lvm/lvm.conf ] && ! getargbool 1 
rd.lvm.conf -d -n rd_NO_LVMCONF; then
cmdline/30-parse-lvm.sh:rm -f -- /etc/lvm/lvm.conf
cmdline/30-parse-lvm.sh:LV_DEVS="$(getargs rd.lvm.vg -d rd_LVM_VG=) $(getargs 
rd.lvm.lv -d rd_LVM_LV=)"
cmdline/30-parse-lvm.sh:if ! getargbool 1 rd.lvm -d -n rd_NO_LVM \
cmdline/30-parse-lvm.sh:info "rd.lvm=0: removing LVM activation"
cmdline/30-parse-lvm.sh:rm -f -- /etc/udev/rules.d/64-lvm*.rules

This seems scripts under cmdline directory parse lvm related parameters
 present in the cmdline

Were you looking for lvm related scripts under pre-mount or mount directories?

> as well as /etc/lvm/lvm.conf.

filtering lines that do not start with '#'

$ grep -v '^[[:space:]]*#\|^$' etc/lvm/lvm.conf
config {
}
devices {
}
allocation {
}
log {
}
backup {
}
shell {
}
global {
}
activation {
}
dmeventd {
}

$ grep -v '^[[:space:]]*#\|^$' etc/lvm/lvmlocal.conf
local {
}
> 
> Not really sure how are you trying to build this yourself since the
> Fedora anaconda installer should be doing all of this for you
> automatically - so how did you got to the point you don't get this from
> your installation time ?

I have a VM booted with qemu-system-x86_64 and I am building kernel and initrd
on the host. I am looking to boot the VM with -kernel and -initrd options
> 
> Regards
> 
> Zdenek
> 

Thanks

vishal.c

___
linux-lvm mailing list
linux-lvm@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/


Re: [linux-lvm] Trouble Booting Custom Kernel with QEMU: dracut-initqueue timeout waiting for /dev/sysvg/root

2023-08-31 Thread Zdenek Kabelac

Dne 31. 08. 23 v 0:40 Vishal Chourasia napsal(a):

On 8/30/23 20:01, Zdenek Kabelac wrote:

Dne 30. 08. 23 v 8:40 Vishal Chourasia napsal(a):

Hi All,


# cat /proc/cmdline
BOOT_IMAGE=(hd0,gpt2)/vmlinuz-6.4.7-200.fc38.x86_64
root=/dev/mapper/sysvg-root ro console=tty1 console=ttyS0,115200n8
rd.lvm.lv=sysvg/root

I have tried passing "root=/dev/mapper/sysvg-root rd.lvm.lv=sysvg/root"
with the -append option and it hasn't worked either.


dracut that needs to include lvm2 code and be able to activate such LV
prior switch to rootfs  (having somewhere inside  lvchange -ay
vgname/lvrootname)

1. How may I verify that dracut has included lvm2 code or not?
2. Which file in the dracut would contain
`lvchange -ay vgname/lvrootname` code?


Hi

If you are making ramdisk image from the system - dracut should autodetect 
such case and build the image with lvm2 support inside (unless you've 
instructed in dracut.conf to not doing so).


You can check if you dracut ramdisk image contains /usr/sbin/lvm
and also if dirs  in /usr/lib/dracut/hooks do have lvm2 scripts inside as well 
as /etc/lvm/lvm.conf.


Not really sure how are you trying to build this yourself since the Fedora 
anaconda installer should be doing all of this for you automatically - so how 
did you got to the point you don't get this from your installation time ?


Regards

Zdenek

___
linux-lvm mailing list
linux-lvm@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/


Re: [linux-lvm] Trouble Booting Custom Kernel with QEMU: dracut-initqueue timeout waiting for /dev/sysvg/root

2023-08-31 Thread Vishal Chourasia
On 8/30/23 20:01, Zdenek Kabelac wrote:
> Dne 30. 08. 23 v 8:40 Vishal Chourasia napsal(a):
>> Hi All,
>>
>> I hope this email finds you well. I am currently facing an issue with
>> booting a VM using a custom-compiled kernel and would appreciate your
>> expertise on the matter.
>>
> 
> Hi
> 
> Not really sure how this relates to 'lvm2' yet - your kernel 'stuck'
> seems to be caused by the inability to switch to 'rootfs'  - which
> should be located on /dev/vda3  (according to your qemu exec line) - but
> kernel panics
> reports that device does not have recognizable filesystem.
> 
> There seems to be no lvm2 involved at all so far.
> 
> 
>> ### Problem Description
>> I have downloaded the `Fedora-Server-KVM-38-1.6.x86_64.qcow2` image and
>> successfully booted it using `qemu-system-x86_64`. However, when I try
>> to boot this VM with a custom-compiled kernel using the `-kernel` flag,
>> it fails to boot. The root filesystem is on LVM, and it seems the kernel
>> needs to activate volume groups before mounting the root filesystem.
> 
> If you believe the filesystem is really on LVM and your /dev/vda3 is
> just a PV - then your boot line is wrong - and you need to be using
> different naming -
> possibly something like:
> root=/dev/vgname/lvrootname rd.lvm.lv=vgname/lvrootname
# cat /proc/cmdline
BOOT_IMAGE=(hd0,gpt2)/vmlinuz-6.4.7-200.fc38.x86_64
root=/dev/mapper/sysvg-root ro console=tty1 console=ttyS0,115200n8
rd.lvm.lv=sysvg/root

I have tried passing "root=/dev/mapper/sysvg-root rd.lvm.lv=sysvg/root"
with the -append option and it hasn't worked either.
> 
> dracut that needs to include lvm2 code and be able to activate such LV
> prior switch to rootfs  (having somewhere inside  lvchange -ay
> vgname/lvrootname)
1. How may I verify that dracut has included lvm2 code or not?
2. Which file in the dracut would contain
   `lvchange -ay vgname/lvrootname` code?
> 
> But it's not really clear how have you moved from your /dev/vda3 to
> something on top of lvm2...
Not sure what you mean by this.
 lsblk
```
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sr0 11:01 1024M  0 rom
zram0  251:00  3.8G  0 disk [SWAP]
vda252:007G  0 disk
├─vda1 252:101M  0 part
├─vda2 252:201G  0 part /boot
└─vda3 252:306G  0 part
  └─sysvg-root 253:006G  0 lvm  /
```
From lsblk output I see sysvg-root is part of /dev/vda3 and therefore I
tried running qemu with different permutations. /dev/vda3 was one of
them but nothing has worked so far.

>> Regards
> 
> Zdenek
> 

___
linux-lvm mailing list
linux-lvm@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/


Re: [linux-lvm] Trouble Booting Custom Kernel with QEMU: dracut-initqueue timeout waiting for /dev/sysvg/root

2023-08-30 Thread Zdenek Kabelac

Dne 30. 08. 23 v 8:40 Vishal Chourasia napsal(a):

Hi All,

I hope this email finds you well. I am currently facing an issue with
booting a VM using a custom-compiled kernel and would appreciate your
expertise on the matter.



Hi

Not really sure how this relates to 'lvm2' yet - your kernel 'stuck' seems to 
be caused by the inability to switch to 'rootfs'  - which should be located on 
/dev/vda3  (according to your qemu exec line) - but kernel panics

reports that device does not have recognizable filesystem.

There seems to be no lvm2 involved at all so far.



### Problem Description
I have downloaded the `Fedora-Server-KVM-38-1.6.x86_64.qcow2` image and
successfully booted it using `qemu-system-x86_64`. However, when I try
to boot this VM with a custom-compiled kernel using the `-kernel` flag,
it fails to boot. The root filesystem is on LVM, and it seems the kernel
needs to activate volume groups before mounting the root filesystem.


If you believe the filesystem is really on LVM and your /dev/vda3 is just a PV 
- then your boot line is wrong - and you need to be using different naming -

possibly something like:
root=/dev/vgname/lvrootname rd.lvm.lv=vgname/lvrootname

dracut that needs to include lvm2 code and be able to activate such LV prior 
switch to rootfs  (having somewhere inside  lvchange -ay vgname/lvrootname)


But it's not really clear how have you moved from your /dev/vda3 to
something on top of lvm2...

Regards

Zdenek

___
linux-lvm mailing list
linux-lvm@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/