-
Notifications
You must be signed in to change notification settings - Fork 148
Description
What were you trying to do that didn't work?
[bootc] Separate /var part required for ISO based installation but forbidden for 'bootc install to-filesystem'
What is the impact of this issue to you?
impossible to create a separate logvols for directories under /var/ if /var itself is not a seprate logvol as well.
Please provide the package NVR for which the bug is seen:
Package - bootc-1.5.1-1.el9.x86_64.rpm
How reproducible is this bug?:
Steps to reproduce:
Successfully installed bootc container and ISO using instructions below:
Step 1 :
[root@test-rhel9-bootc-builder bootc-build]# cat Containerfile
FROM registry.redhat.io/rhel9/rhel-bootc:latest
RUN dnf -y install iproute rhc unzip tmux && dnf clean all
RUN systemctl mask bootc-fetch-apply-updates.timer
RUN mkdir -p /var/home
RUN useradd -d /home/admin -m -u 1001 -G wheel -p 'password' admin
RUN usermod -p 'password' root
RUN echo "test file" > /home/admin/test_file
RUN chown 1001:1001 /home/admin/test_file
RUN mkdir /foo
RUN mkdir /bar
Step 2:
RUN bootc container lint
Step 3:
podman build -t localhost/bootc .
Step 4:
[root@test-rhel9-bootc-builder bootc-build]# cat config.toml
[customizations.installer.kickstart]
contents = """
lang en_US.UTF-8
keyboard us
timezone UTC
network --device=link --bootproto=dhcp --onboot=on --activate
zerombr
clearpart --all --initlabel
part /boot --fstype ext4 --size=1024 --fsoptions='defaults,sync,nosuid'
part /boot/efi --fstype vfat --size 200 --fsoptions='defaults,sync,uid=0,gid=0,umask=0077,shortname=winnt,nosuid'
part pv.10 --size=1024 --grow
volgroup BL pv.10
logvol swap --fstype swap --name=swapLV --vgname=BL --size=4096
#logvol /var --fstype ext4 --name=var01 --vgname=BL --size=4096
logvol /var/log --fstype ext4 --name=log --vgname=BL --size=4096
logvol /var/log/audit --fstype ext4 --name=audit --vgname=BL --size=1024
logvol /var/home --fstype ext4 --name=home --vgname=BL --size=512
logvol /foo --fstype ext4 --name=root02 --vgname=BL --size=4096
part /foo/boot --fstype ext4 --size=1024 --fsoptions='defaults,sync,nosuid'
part /foo/boot/efi --fstype vfat --size 200 --fsoptions='defaults,sync,uid=0,gid=0,umask=0077,shortname=winnt,nosuid'
#logvol /foo/var --fstype ext4 --name=var02 --vgname=BL --size=4096
logvol /tmp --fstype ext4 --name=tmp --vgname=BL --size=1656
logvol /opt --fstype ext4 --name=opt --vgname=BL --size=4096
logvol /var/crash --fstype ext4 --name=crash --vgname=BL --size=1024
logvol /var/crypted --fstype ext4 --name=crypted --vgname=BL --size=512
logvol /var/reserved_space --fstype ext4 --name=reserved_space --vgname=BL --size=34096
logvol /var/lib/containers --fstype xfs --name=containers --vgname=BL --size=24096
logvol / --fstype ext4 --name=root01 --vgname=BL --fsoptions='defaults' --size=4096
logvol /ssp_disks --fstype ext4 --name=mep_storage --vgname=BL --percent=100
reboot --eject
"""
Step 5:
I have build installation ISO using command:
[root@test-rhel9-bootc-builder bootc-build]# podman run --rm -it --privileged --pull=newer --security-opt label=type:unconfined_t -v /var/lib/containers/storage:/var/lib/containers/storage -v $(pwd)/config.toml:/config.toml -v $(pwd)/output:/output registry.redhat.io/rhel9/bootc-image-builder:latest --local --type iso --config /config.toml localhost/bootc
Step 6:
When I try to install machine using build above ISO I'm getting error:
`The command 'mount --bind /mnt/sysimage/var/crash /mnt/sysroot/var/crash' exited with the code 32`
See attached screenshoot for the anaconda with the error.
Step 7:
The issue dissapears is if in config.toml I uncomment line creating separte logvol under /var
#logvol /var --fstype ext4 --name=var01 --vgname=BL --size=4096
In other words, it is impossible to create a separate logvols for directories under /var/ if /var itself is not a seprate logvol as well.
Expected results:
According documentation linked above:
"There is just one /var directory. If it is not a distinct partition, then physically the /var directory is a bind mount into /ostree/deploy/$stateroot/var and is shared across the available boot loader entries deployments."
So it suggest that using separate lvm/part for /var is not required.
Could you elaborate on this?
-
Should it be possible to have separate LVMs crated under var (especially /var/lib/containers) but not /var itself?
-
At the same time is not not possible to use separate /var mount point if I'm trying to deploy build in the same way image using option
"bootc install to-filesystem"
Error returned in such case is:
ERROR Installing to filesystem: Verifying empty rootfs: Non-empty root filesystem; found "var"
To be more precise, structure to which I woujld like to run "bootc install to-filesystem" (only relevant part is included)
├─sda3 1G 0 part /foo/boot 26d962b2-1111-4453-9614-bf3f91234567
├─sda4 200M 0 part /foo/boot/efi
├─BL-var02 4G 0 lvm /foo/var c026ae7e-1111-4842-9f90-0f5fc3456789
├─BL-root02 5G 0 lvm /foo
Command used:
podman run --rm --privileged -v /dev:/dev -v /var/lib/containers:/var/lib/containers -v /foo:/target -v /run/user/0/containers/auth.json:/etc/ostree/auth.json --pid=host --security-opt label=type:unconfined_t localhost/bootc bootc install to-filesystem --karg=root=UUID=52d280c9-1234-49cc-9a38-4818a1234567 --root-mount-spec=UUID=52d280c9-1234-49cc-9a38-4818a1234567 --boot-mount-spec=UUID=26d962b2-1111-4453-9614-bf3f91234567 /target
Note option: -v /foo:/target used.