I'm using Xubuntu 20.04 LTS live USB (non-persistent) and I just tried the toram
option. It got stuck on the logo screen (or so it seemed) so I force shut down the computer.
Now I booted normally without toram
and while I was working on the computer, I accidently removed the USB but to my surprise, everything is working normally. I mean, shouldn't it hang/freeze. Is this normal?
How can I make sure whether I'm running Xubuntu on ram or USB. And if it turns out to be from ram...how? Did I permenantly load Xubuntu to my ram? I thought everything gets deleted once I restart. If that's not the case, how can I delete is from ram?
Thanks for any help guys!
RAM or Not to RAM
I understand that even if Ubuntu is not booted
toram
that it still runs mostly in RAM. It seems to somewhat depend on how the Live/Persistent drive was created.If you boot normally, and open several programs, say GParted and LibreOffice Writer, then close the programs and unplug the USB, the programs should still be in memory and can be restarted without the USB. (This did not work for me with mkusb Persistent last time I tried). Programs that were not previously booted, will not boot with the USB unplugged.
If you Boot toram and unplug the USB, (after everything stabilizes), all the programs, (within filesystem.squashfs), should be bootable.
My recommendation is to wait until you are sure the USB is not being written to, yank the USB and try starting a program that you have not just been using, say Calculator or Solitaire. If it starts you are likely booted toram.
If you do not like the idea of yanking your USB you should be able to unmount it using:
sudo umount -lrf /cdrom
where is the path to the root partition.After you shut down a Live install that has been running in RAM, (such as an Etcher ISO9660 clone or Ventoy ISO file boot), all data in RAM disappears, as long as hibernation has not been set up on the disk. If hibernation has been set up, RAM data gets dropped into a swap file or partition and is available on resume. It is not easy to set up hibernation on a USB that does not have persistence or a Full install.
Comparing mountpoints without and with
toram
Live-only without toram:
Live-only with toram:
Comments
The crucial difference is what is mounted on the mountpoint
/cdrom
without toram a partition on the USB drive is mounted on
/cdrom
, and should be kept mounted for the system to work correctly, so the USB drive should be kept connected.with toram
/dev/shm
is mounted on/cdrom
, and this is a ramdrive. This means that the partition containing the system can be unmounted. (As you can see, Lubuntu mounts it under/media
, and it can be unmounted. Other Linux distros may not even have that partition mounted after copying to RAM.)You can check which boot options were used with the command
Edit: Checking the files of the live system brings them into RAM
I learned something today. The original poster, JJrussel, observed that there is a difference between Xubuntu 18.04 LTS and 20.04 LTS: It is possible to continue running 20.04 LTS live after removing the USB drive (that is was booted from).
I can verify it in a computer with 'enough' RAM (and many modern computers have enough RAM). I could start and run Firefox and LibreOffice after the USB drive was unplugged.
I continued testing by booting Xubuntu 20.04 LTS live (live-only) with the boot option
fsck.mode=skip
, which makes the boot process skip checking the files of the live system. In this case I could not start and run Firefox and LibreOffice after the USB drive was unplugged.In both cases I unmounted
/cdrom
before unplugging the USB drive,Conclusion:
Checking all the files of the live system brings them into RAM, and when there is enough RAM, they will remain there, so that they are available also after the USB drive is removed.