Bug#785112: wrong mountpoint for live medium after boot if used with persistence
Source: live-boot
Version: 5.0~a3-1
Severity: normal
When booting with persistence the live medium ends up being mounted on
/lib/live/mount/persistence/*devname* after boot. It should instead be
mounted on /lib/live/medium. This happens because while probing for
persistence already mounted devices are moved to
/lib/live/mount/persistence and this is not rolled back if no
persistence is found on the device.
This bug was always present, but only uncovered by commit
e5904f5079fd4362c4dd63027075fce4b47c51c5. Which tried to not blacklist
the live medium device when searching for persistence. It tried to
instead blacklist the devices containing the underlay filesystems (eg.
loop device for a squashfs image). While this is the right thing to do
in theory, the commit has two major problems:
1. "$(what_is_mounted_on d)" should be "$(what_is_mounted_on ${d})"
2. At that point during the boot, the underlay filesystems are not yet
mounted below /live/rootfs, so /live/rootfs/* does not actually find
them. They are instead mounted directly below / which makes it very
hard to find them. They are only later during the boot moved to
/live/rootfs. There is an old comment in the code that not mounting
them directly below / breaks some things. I'm not sure if this is
still relevant. If not the easiest fix is probably to mount the
devices at the right place from the start and not move them around
afterwards.
I see several possible solutions. These are non exclusive. A full fix
needs a combination of all of this:
- Revert e5904f5079fd4362c4dd63027075fce4b47c51c5 until a better
solution is implemented.
- Instead of moving the mount point of already mounted devices, just
bind mount them when looking for persistence. This would also make it
easy to rollback if no persistence is found.
- Implement a proper solution for the blacklisting of underlay
filesystems.
Gaudenz
-- System Information:
Debian Release: stretch/sid
APT prefers testing-proposed-updates
APT policy: (500, 'testing-proposed-updates'), (500, 'testing'), (100, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Reply to: