I've got a bootable usb drive with a live linux distro on it. We set it up to support persistence, so normally the changes make are kept between reboots. Booting into ram seems to make linux a lot faster than normal, which makes it a convenient way to use the live usb, especially since the live usb is a lot slower and sometimes hangs compared to a normal installation on a sata drive.
We can boot the live usb into ram by adding the boot parameters
toram in the grub menu. However, obviously this breaks the persistence feature, as the filesystem is loaded onto ram, so all changes are lost upon reboot.
Once we made changes and decide we want to keep them, how can we flush the filesystem changes from the ram back to the usb drive?
For the record, I followed these instructions to make the live usb support persistence: https://docs.kali.org/downloading/kali-linux-live-usb-persistence