12

I've got a persistent live USB set up that I'm running Ubuntu 14.04 off of. When I boot up my computer, I'm given the option of running the persistent live USB or running the persistent live USB "from RAM". My understanding is that with the first option "everything" will be read off the USB (which will be very slow), whereas with the second option "everything" will be read off the USB and put into RAM (which will be very fast).

Is this correct? If so, can someone narrow down what "everything" means? Is it just the OS that gets read into memory, or are all the persistent files also read into RAM? Conversely, if I choose not to use the "from RAM" option, what is read from the USB and what is read into the PC's memory? Also, at what point are any new files I've added written to the USB if I'm using the "from RAM mode"? Is it just at shutdown? If that's the case, what happens if my computer shuts off unexpectedly? Would I lose any files I've created in the current session?

Adam
  • 271

1 Answers1

10

The boot option toram makes the system read everything from the system image into RAM during boot. It means that the boot process is slower, but after that the system will be fast. It also means that /cdrom need not be mounted, and if it is a live-only drive, it can be removed or overwritten (for example installed into). But if there is a casper-rw partition or file there and you are running a persistent live session, obviously it is a bad idea to remove the drive.

Otherwise (without toram) the system image is mounted at /cdrom and programs and data are read from there, when needed (which is slower than to read from RAM).


The persistent overlay, which is read from casper-rw is managed independently of the toram boot option.

sudodus
  • 46,324
  • 5
  • 88
  • 152
  • What is included in the system image? Is the system image related to / based on the stuff in the casper-rw partition? It sounds like the main difference is that the "system image" is loaded into RAM vs read from the USB drive. – Adam Jan 07 '17 at 21:46
  • To state it briefly - the content of the iso file. There is a list 'md5sum.txt' (without toram seen at /cdrom/md5sum.txt), and it contains the file names of all files and their md5sums). – sudodus Jan 07 '17 at 21:52
  • 1
    Ok, so basically the operating system gets read into RAM, but anything in the casper-rw partition is still being read from the USB? – Adam Jan 07 '17 at 21:54
  • The file filesystem.squashfs is by far the biggest file, and it contains the all the programs and settings, that are not necessary for booting, but are extracted at a later stage. – sudodus Jan 07 '17 at 21:58
  • Ok, so the system image also contains my programs and settings. What isn't contained in the image? My documents etc? Also, how is the system image kept up-to-date? Is a new one created every time I shut down or something? – Adam Jan 07 '17 at 21:59
  • I made a tool to create persistent live drives, mkusb, but I must admit, that I am not quite sure, when the data are read from casper-rw: when needed or at boot. I think 'when needed', because the persistence can be much larger than the RAM. – sudodus Jan 07 '17 at 22:03
  • 1
    The boot toram option can be handy if you only have one flash drive. You can boot a Live, (no persistence), flash drive, then unmount the drive and, from RAM, install a Full system, or a Persistent system to it, (if you install mkusb to the Live drive). You need enough RAM for the amount of data on the Live drive. – C.S.Cameron Mar 08 '20 at 11:01