Skip to content

Boot and root do not need to be outside LVM #70

@towo

Description

@towo

I've had a couple of installs where I needed to patch installimage by removing

installimage/functions.sh

Lines 1118 to 1139 in cc14774

# test if /boot or / is mounted outside the LVM
if [ "$LVM" = "1" ]; then
TMPCHECK=0
for ((i=1; i<=PART_COUNT; i++)); do
if [ "${PART_MOUNT[$i]}" = "/boot" ]; then
TMPCHECK=1
fi
done
if [ "$TMPCHECK" = "0" ]; then
for ((i=1; i<=PART_COUNT; i++)); do
if [ "${PART_MOUNT[$i]}" = "/" ]; then
TMPCHECK=1
fi
done
fi
if [ "$TMPCHECK" = "0" ]; then
graph_error "ERROR: /boot or / may not be a Logical Volume"
return 1
fi
fi

A totally working Debian 11 setup has this truncated lsblk output:

NAME                                           MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
nvme0n1                                        259:0    0 476.9G  0 disk
├─nvme0n1p1                                    259:1    0    50G  0 part
│ └─md0                                          9:0    0    50G  0 raid1
│   ├─$FQDN-root 253:0    0    30G  0 lvm   /
│   └─$FQDN-boot 253:1    0     1G  0 lvm   /boot

And following snippet from grub.cfg:

        module2 /vmlinuz-5.10.0-21-amd64 placeholder root=/dev/mapper/$FQDN-root ro  nomodeset consoleblank=0

(module2 as a Xen hypervisor is being loaded, but that's irrelevant to the actual functionality of Grub)

The only things that need to be ensured are having

insmod mdraid1x
insmod lvm

in grub.cfg. Debian 11 just natively supports this and doesn't require any special configuration here, that's the output from a stock update-grub.

So I would recommend just removing that snippet entirely, since if Debian can do it, I guess everything can; or, if this is supposd to be a foot penetration safety measure, at least allow disabling it with a command line flag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions