Best approach, USB persistence or Not?

So i was reading some fedora docs, and found this :

On live images, you can include a feature called a persistent overlay, which allows changes made to persist across reboots. You can perform updates just like a regular installation to your hard disk, except that kernel updates require manual intervention and overlay space may be insufficient. Without a persistent overlay, the stick will return to a fresh state each time it is booted.

On live images, you can also have a separate area to store user account information and data such as documents and downloaded files, with optional encryption for security and peace of mind.

By combining these features, you can carry your computer with you in your pocket, booting it on nearly any system you find yourself using.

So i would like a opinion what is the best approach taking speed and security (regard encryption, because it will be in a usb stick that i will carry around in consideration) in consideration since looks like with live image its also possible to encrypt, and make things persistent like apps.

Also appears that live-image is possible to load fedora on ram (which would benefit speed in usb 2.0 interfaces on computers), idk if this is also possible on usb persistence mode.

Each use-case may have different requirements. There is no reason to encrypt the default live image as anyone can download it. Some use cases would suffer from the memory constraints of running the OS in RAM, others may benefit (e.g., tasks that don’t need much RAM and USB2 support is needed). If the use case is limited to command-line usage, a much smaller live image can be used.

In the good old days when we didn’t need to encrypt system disks it was (too!) often necessary to use a Live Linux USB to rescue data from some Windows box that refused to boot: check drive health, copy critical files to a server, and attempt to wipe user’s personal info before handing the box to IT.

sorry my ignorance, I though running the OS in RAM would be the best in almost all scenarios, since is very common usb2 ports yet, and almost all computers that i interact have 8gb ram. So in that situation , usb2 and 8gb ram what would be your approach ?

Also, would use gnome, not full CLI

I would LUKS encrypt during the process of installation (if persistence on usb) (also dont know if is the best approach )

Hello @crazymonkey and @gnwiii ,
Would it not be easier to actually install Fedora onto the USB device as you normally would on your PC’s drive? You just use BIOS selection of boot options to get your USB device.

1 Like

I would suggest installing to a USB device and using luks if that level security is desired.

Then any pc or laptop capable of booting from a usb device could be used and you would be able to keep the installed os fully updated with persistence and the work-arounds already suggested would be moot.

I think you are confusing the demands of the gui with the cli. A gui desktop requires far more ram and processing power than would a purely cli environment.

Using a live image and adding additional apps is far more demanding of RAM than running an os that is installed. Everything must reside 100% in ram with the live image where with an installed OS it can be left on the drive until needed and offloaded when no longer used. Newly installed apps take up space in RAM that otherwise would be written to disk. If it was not on the live image initially it resides 100% in RAM.

A live image is stuck in time with no ability to update unless the PC has an enormous amount of RAM, and even if that is the case it is impossible to update the kernel since rebooting wipes out everything that has been downloaded.

I strongly suggest you follow the suggestion of @jakfrost and install to a usb device.

If you really do want to install your OS on a thumb drive, beware that most thumb drives (today) aren’t designed for good random I/O performance. They’ll often seem to perform OK for the first few 10s of megabytes of I/O, but then they’ll suddenly drop to crazy slow read/write speeds; sometimes as slow as just a few KB per second. The USB port isn’t the limitation (even USB 2 can transfer at 50MB/s). I have a few of these that I am happy with as far as their random I/O performance (though I don’t actually run an OS on them, I have two of them that hold a mirrored and encrypted ZFS filesystem).

1 Like

do you think the performance would be ok , to run a complete OS on it ?

thanks for that, i really thought that the usb2 was the reason that cause the slowness

thanks, and probably this is the best approach, just wondering about the slowness of a full system (with luks encryption) on thumb drive trough usb2 port might have

Hello,
There are definitely thumb drives that are of better quality, just like SDCards, it all come down to you get what you pay for. But really if you are just wanting the ease of plugging in a drive, there are also portable units (ssd mostly now I think) that could easily be used as a device to install your OS onto. I have a seagate Bup I use for backup, but it could as easily be used to install an OS onto and use it as you are describing.

I read that in real world scenario, USB 2 would top at 35MB/s and most cheap usb sticks can surpass that, with 100 MB/s , so what im missing (who is lying to me rsrsrsr because clearly some usb sticks are very low but in theory they are not limited to usb 2) ? i mean you said that the issue is the random speed, so that is what i should look on buying a usb stick ? i think that info is not mentioned on the usb specs

thanks, and yeah , im thinking in get a nvme ssd and put it in a enclosure to connect trough usb

Personally, I would think unless connections are USB C (and is that
even fast enough?) they are never going to utilize nvme ssd interface
speeds, but I could be mistaken. Plus, I found standard ssd drives in
the 2.5" form factor are fairly cheap, even as external devices. All
major vendors have them I think.

Remember that speeds are rated in Mb/s on the USB ports
480 Mb/s is ~60 MB/s so one must be careful to know what units are being presented when comparing performance.

image

Yes, if you install an OS on the USB stick, its access patterns will be random, not sequential, so you will want to use a USB stick with good (sustained) random I/O performance.

Megabits versus Megabytes, I assume.

I’ve done that and, while I sometimes use that, it is incredibly slow.

It is slower to boot than a live image, which makes no sense to me, because IIUC the live version booting must copy everything to ram, while a normal install must only copy some things to ram. But with several different slow USB sticks, on many different computers, I have found the real install much slower to boot.

Once booted, the real install has many random stalls as content that isn’t cached in ram gets cached. If the ram size were smaller and it should actually bump cached content back out of ram, that would make sense. But I was doing simple things that should have no memory pressure, on machines that have at least 8GB (usually much more) ram.

I don’t use it often enough to have gone to the trouble to figure out how to set up persistence instead. The many different ways of doing that all seem to me to be poorly documented (random bits of detailed instructions with no hint of how they fit into the start-to-finish sequence of steps).

i read that in real life is not possible that 60 MB/s , so would be around 35-40 MB/s in a USB2, and a cheap sandisk could top indeed 100 MB/s (sequential, the marketing only talk about sequential)but as the friend above said, the bottleneck are the random speed, sometimes that same usb sticks can reach only 10 MB/s on top in random even doing 100 MB/s in sequential

did you test that persistent install on a ssd through USB ? asking because i saw some cristal mark tests of thumbs drives reaching only 7-8 MB/s on random which is very slow

I tried to be clearer. I haven’t ever tried “persistent” in Fedora. I should.

Three basic install types for this question:

  1. Live

  2. Live + persistent

  3. Ordinary install but on USB

I was talking about comparing the first of those vs. the third on slow USB sticks.

For a tool I rarely need, but then need on short notice, I’d rather it tie up cheap and physically small media.

I have also tried the first vs. third of those on much faster USB media and the difference in boot time either goes away or even reverses.