-
Bug
-
Resolution: Unresolved
-
Normal
-
None
-
rhel-9.7
-
None
-
Yes
-
Moderate
-
rhel-anaconda
-
None
-
False
-
False
-
-
None
-
None
-
None
-
None
-
Unspecified
-
Unspecified
-
Unspecified
-
-
x86_64
-
None
What were you trying to do that didn't work?
Attempting to mount the installation media (e.g., /dev/sr0 or by label) during the `%post` (chroot) section of a Kickstart installation fails. While this was fully functional in RHEL 9.4, it now consistently fails in RHEL 9.5 and above.
For example,
%post --log=/root/ks-post.log mkdir /test # Using device name sr0 fails mount -v /dev/sr0 /test # Using device label RHEL-9-5-0-BaseOS-x86_64 fails # mount -v /dev/disk/by-label/RHEL-9-5-0-BaseOS-x86_64 /test %end
We see the error in the kickstart post log file.
# cat /root/ks-post.log mount: /test: /dev/sr0 already mounted or mount point busy.
Workaround
For the workaround we need to mount this device outside of chroot using the `%post --nochroot` option to mount this device and then use the `%post` to perform actual operation. The `umount` command work inside `%post` later on as seen below
%post --nochroot --log=/mnt/sysimage/root/ks-post-nochroot.log # 1. Mount the device. The path on the final system (/mnt) # must be prefixed with the chroot target path (/mnt/sysroot). mount -v /dev/sr0 /mnt/sysroot/mnt %end %post --log=/root/ks-post.log <your post script commands here> # 2. Unmount the device from the installed system's mount point. umount -v /mnt %end
What is the impact of this issue to you?
This breaks existing kickstart scripts which is used to copy additional data, configuration files, or custom RPMs from the local media to the target system . We need to use Kickstart scripts with `%post --nochroot` blocks for the same tasks from RHEL 9.5 to RHEL 9.7
Please provide the package NVR for which the bug is seen:
Anaconda in RHEL 9.5, 9.6 and 9.7 ISO.
How reproducible is this bug?:
100% reproducible on RHEL 9.5, 9.6 and 9.7.
Steps to reproduce
- Perform a Kickstart installation of RHEL 9.5.
- Include the following block in the Kickstart file:
%post --log=/root/ks-post.log mkdir /test mount -v /dev/sr0 /test %end
- After installation, review `/root/ks-post.log`
Expected results
The device should be mounted successfully to /test within the chroot environment.
Actual results
The mount command fails with the following `error: mount: /test: /dev/sr0 already mounted or mount point busy`.
- links to