Re: Error mounting LVM volume as root (SOLVED)

2020-10-12 Thread David
On Mon, 12 Oct 2020 at 12:36, Marc Shapiro  wrote:

> I had not thought that there was any real difference between the two
> formats, and this may well be the only instance where there is, but I'm
> going to use the '/dev/mapper/vgname-lvname' format in all locations
> from here on out.

I notice that 'man 8 lvm' on buster says:
"""
Links or nodes in /dev/mapper are intended only for internal use and
the precise format and escaping might change between releases and
distributions. Other software and scripts should use the
/dev/VolumeGroupName/LogicalVolumeName format to reduce the chance of
needing amendment when the software is updated.
"""



Re: Error mounting LVM volume as root (SOLVED)

2020-10-11 Thread Stefan Monnier
>     '/dev/vgname/lvname' instead of '/dev/mapper/vgname-lvname'.

Indeed, I have found that `/dev//` doesn't work as argument to
`root=` on the kernel command line, whereas `/dev/mapper/-`
works fine.

Maybe it merits a bug report.  Maybe it'll be hard/inconvenient to make
the kernel accept the `/dev//` form, but if so scripts like
`upgrade-grub` could come to the rescue and either warn about the
problem or do the rewrite themselves.


Stefan



Re: Error mounting LVM volume as root (SOLVED)

2020-10-11 Thread Marc Shapiro



On 10/11/20 2:04 PM, Marc Shapiro wrote:

On 10/11/20 6:34 AM, Stefan Monnier wrote:

That did it.  I am assuming that the system was just in the process of
changing from the initrc to the actual running system?  But how do I 
get the
boot sequence to activate the LVs automatically each time before 
attempting

to mount the / filesystem?

AFAIK you don't need to do anything special for that.
>From what I can tell, the initramfs (tries to) activate the swap and
root LVs, and then the rest of the boot activates them all.

If that doesn't work for you, you're going to have to dig deeper,


 Stefan


The swap LV seems to be getting activated, but not the root LV, so it 
keeps trying to mount an LV that is not yet activated and eventually 
it times out and drops me into a shell.  From there, I can manually 
activate all LVs and exit the shell and the boot process continues 
successfully.


Marc


After more Googling, I found the following page:


https://serverfault.com/questions/199185/logical-volumes-are-inactive-at-boot-time


The last answer on the page suggests a mismatch in the way the LV is 
named in:


    /usr/share/initramfs-tools/scripts/local-top/lvm2

and

    fstab,

namely

    '/dev/vgname/lvname' instead of '/dev/mapper/vgname-lvname'.


Both of those files used '/dev/mapper/vgname-lvname', but /etc/lilo.conf 
was using '/dev/vgname/lvname'.  I changed /etc/lilo.conf to use the 
same format as the other two, re-ran lilo, rebooted, and it worked.  I 
then did the same thing for my Stretch partitions, and the system booted 
into Stretch with the LV mounted on / with no issues.


I had not thought that there was any real difference between the two 
formats, and this may well be the only instance where there is, but I'm 
going to use the '/dev/mapper/vgname-lvname' format in all locations 
from here on out.



Marc