Slax author's Blog (RSS)
20
August2024
Updated documentation for persistent changes
I noticed that the documentation for persistent changes was outdated, so I've updated it to be more accurate. Here is a copy of the text
Persistent changes
Slax, when booted from read-only media such as CD/DVD, stores all system changes in memory only. These changes are lost upon reboot. However, when Slax is booted from writable media like a USB drive, all changes made to the operating system are saved and restored on subsequent boots.
If the writable media uses a FAT filesystem (which is common for USB flash drives), Slax saves persistent changes using a series of files stored within subfolders of the /slax/changes/
directory on your boot device. These subfolders are named sequentially (e.g., /slax/changes/1/
, /slax/changes/2/
, etc.), each representing a different saved session.
Maximum size of persistent changes on FAT filesystem is 16GB by default, and can be increased by specifying boot parameter perchsize, for example perchsize=64GB
. Once the maximum size is increased, the boot parameter does not need to be specified next time.
Storage format for changes on FAT filesystem uses DynFileFS. If the writable media uses a native Linux filesystem such as ext4, the subfolders will contain all modified files directly, without any size limitations.
To access the contents of the changes stored in any particular session on FAT fs, you can use dynfilefs
binary, which can be found in /run/initramfs/bin/
directory. This requires two mounting steps.
First, while running Slax, use the following command:
/run/initramfs/bin/@mount.dynfilefs -f /path/to/changes.dat -m /mnt mount -o loop /mnt/virtual.dat /mnt
The first command will mount the changes as a single virtual file at /mnt/virtual.dat
, which acts as a loop device with an XFS filesystem, and the second command mounts the loop device to reveal the actual files. After mounting, you can access the changed files in the /mnt directory. When you're done, remember to unmount twice — once for each mount operation — to fully unmount the changes properly.
User comments
Hi Tomas,
thanks for maintaining Slax!
I have tried to add a user and group for running a service under this identity. It was in Slax running from read only ISO file in KVM/QEMU virtual machine.
After adding the user and installing the service I made "savechanges /tmp/changes.sp" and then "genslaxiso slax_new.iso /tmp/changes.sp".
After booting from new ISO file the service binaries where there, service was enabled, but the new user and group were missing. The /etc/passwd and /etc/groups were unchanged.
I checked the /tmp/changes.sp by converting it with sb2dir utility. Inside the sb package the /etc/passwd and /etc/groups were correct with the new user and group.
What am I doing wrong?
Thank you for advice!
Michal
Goodness Tomas, why the bloody *beep* is it not possible to from=UUID=/dev/disk/by-uuid/ or by-id ? Currently looking into chroot'ing over to a ext4-partition after booting from a fat32 (uefi). Slax is partally wonderful, but *this* issue really nags.