How to unmount, then remount a persistence image from Buster live USB
by kkman007 from LinuxQuestions.org on (#58QCW)
Hi
I am using a persistence image file to store and save system settings such as WIFI for my Debian Buster Live image run from a USB stick. As I want to run the live image in RAM so I could remove the USB once the system boots up, I wanted to write a script to allow the persistence image to be unmounted after the saved settings are loaded.
However there are a number of mounts and I was hoping for some advise as what is the best way to unmount the persistence image after the system has booted up.
Below are the mounts which I think I need to remove, but is there a better way?
/dev/sda3 on /run/live/persistence/sda3 type ext2 (rw,noatime)
/dev/loop1 on /run/live/persistence/loop1 type ext3 (rw,noatime)
/dev/sda3 on /lib/live/mount/persistence/sda3 type ext2 (rw,noatime)
/dev/loop1 on /lib/live/mount/persistence/loop1 type ext3 (rw,noatime)
overlay on /etc/NetworkManager/system-connections type overlay (rw,noatime,lowerdir=/run/live/rootfs/filesystem.squashfs//etc/NetworkManager/system-connections,upperdir=/run/live/persistence/loop1/etc/NetworkManager/system-connections/rw,workdir=/run/live/persistence/loop1/etc/NetworkManager/system-connections/work)
Having unmounted the persistence image, can I remount it later within the running system, without needing a reboot and have it persist changes. Hope that makes sense.
Any advise would be helpful.
Thanks


I am using a persistence image file to store and save system settings such as WIFI for my Debian Buster Live image run from a USB stick. As I want to run the live image in RAM so I could remove the USB once the system boots up, I wanted to write a script to allow the persistence image to be unmounted after the saved settings are loaded.
However there are a number of mounts and I was hoping for some advise as what is the best way to unmount the persistence image after the system has booted up.
Below are the mounts which I think I need to remove, but is there a better way?
/dev/sda3 on /run/live/persistence/sda3 type ext2 (rw,noatime)
/dev/loop1 on /run/live/persistence/loop1 type ext3 (rw,noatime)
/dev/sda3 on /lib/live/mount/persistence/sda3 type ext2 (rw,noatime)
/dev/loop1 on /lib/live/mount/persistence/loop1 type ext3 (rw,noatime)
overlay on /etc/NetworkManager/system-connections type overlay (rw,noatime,lowerdir=/run/live/rootfs/filesystem.squashfs//etc/NetworkManager/system-connections,upperdir=/run/live/persistence/loop1/etc/NetworkManager/system-connections/rw,workdir=/run/live/persistence/loop1/etc/NetworkManager/system-connections/work)
Having unmounted the persistence image, can I remount it later within the running system, without needing a reboot and have it persist changes. Hope that makes sense.
Any advise would be helpful.
Thanks