I want to create a persistent live-USB

I want to create a persistent live-USB so I can demonstrate some Linux software and associated data.

I found some instructions (unfortunately I didn’t make a note of where from), created a live-USB and a partition for the data. The next step is persistence, this is the suggestion:

echo “/ union” | sudo tee -a /path/to/usb/mount/point/persistent.conf

I tried:
echo “/ union” | sudo tee -a /run/media/chris/Fedora-WS-Live-39-1-5/persistent.conf

which worked. Very useful - as despite several attempts I’ve never got persistence to work before. Having looked up those commands I still don’t really know what it’s doing, but am guessing it’s linking ~ with the data partition i’ve created.

This is a 16B memory stick. 13GB is plenty of space for the data, but OS installation has only allocated 2GB for /. On my PC I allocate 25GB. There are two problems:

  • Unsurprisingly it hasn’t got space for the one small Flatpak I tried to install. Is there a way of increasing its size? It’s got 2 other partitions which I don’t want to mess about with immediately following it, then the data partition which could be shrunk.

  • I see no indication that the persistence would apply to the OS partition, so I would have to re-install the app every time. Is there some way of fixing this, maybe using a modification of the command above?

AFAIK the live media has no way to provide persistence – it is after all an iso9660 image with fixed size and the running system from that is only in RAM.

However it is very easy to install from the live media USB onto another USB, just as you would onto the system HDD. The usb installed to then would have all the same properties as an installed system and could be used as you indicate.


Related topic: Fedora USB persistence

Related wiki page: LiveOS image - Fedora Project Wiki

1 Like

I find it useful to have Fedora installed on a “small” (128 or 256GB) SSD in an external USB3 case. Many people have small SSD’s lying around after replacing an internal SSD with a larger model but if you don’t have one on hand, name-brand 128GB drives are not expensive.

1 Like

It has, as I mentioned in my first post.

(It can be done from DVD to USB stick too.) This is a good idea, it’s much more sensible than using a disk image and trying to change partition sizes. I have tried it and the persistence works too.

echo “/ union” | sudo tee -a .....................
I’ve now removed the flashy bits from the bash statement that made the partition persistent and realised that I just need to create a file in the top-level of the partition I want to make persistent - so I can do this to / and all the complications with location and space go away :slight_smile:

may i ask, if is possible to make fedora or fedora sb run all in ram ?
looking for a persistent live-usb linux distribution that could run without lag in usb 2.0 port (not always the 3.0 is available), i found that there are few that could load and run in RAM making the lag from usb interface inexistent (as i understand) . But also i already used with fedora and is my main distro, hence the question. If not possible to fedora run in ram, would it be very slow in a usb 2.0 interface ?

When booted to the live image of workstation fedora is running 100% in ram

but if i make persistent, will not running 100% in ram right ?
Asking that because what i understand is that there are other systems that run 100% in ram in persistent mode, wondering if is possible with fedora

i just want to have some files and apps persistent through boots, and also to be able to encrypt since will be a usb stick that i will care around

I think you are confusing persistence of files on the USB-stick and running all in memory.

The bash statement that I found somewhere else on the web which made the partition persistent, used piping and a command I’d never heard of. I had no idea what it was doing, which is why I had so many problems making it work…and all it was doing was creating a file!

There’s a lesson here for people offering “help”, The person being helped needs to understand what they’re doing as far as is possible, so the commands need to be as simple as possible and what they are doing needs to be explained. Writing a flashy super-complex command to show off their expertise might boost the poster’s ego - but it wouldn’t be any help to the reader and might make things much worse.

I dont think so, i know you can have persistent of some personal files in a live mode (creating a partition on usb for that), but apps and configs is not possible right ?

I’ve created a live-USB stick which is all persistent. I’ve no idea how it works and it may have problems that I don’t know about. I just want to do a demo of some software, so it’s no disaster if something goes wrong. I wouldn’t use it for anything important in case of data loss.
I haven’t got enough space to install an app, so don’t know whether that works yet.

A general statement such as this would be of much more benefit to all if it were identified with a link to the source so others may read exactly what you saw and then an informed discussion could be held. Without knowing the source it is impossible for us to know anything except what you provide as your own interpretation of that.

The flip side of that is that the person needing assistance must be able to provide as much detailed information about what they have done and where they got the ideas to perform those steps so others can identify what might have been done right or where understanding or instructions may have gone wrong.

These noted from your earlier post show what would probably work if the device mounted at /path/to/usb/mount/point/ is writable and would create a file that allows saving data in a persistent manner on that device in the file persistent.conf.

What it does is tell the tee command to create a union between the root file system (/) and the file (persistent.conf) so data can be stored there. The -a option tells it to not overwrite anything, merely append.

I was making a general point. I intentionally did not include a link as it would point a finger at an individual who might be offended or defensive.

You go on to say

without giving a link to an example, so perhaps you agree that generalisations can be more tactful.

seems to suggest the statement above will just to write / union to the terminal and the file, but maybe that page doesn’t cover it all. It would explain why I could just create the file myself, but then there may have been something leftover from using tee the first time.

Are you suggesting that any changes to / will be written into the file? Is that the loop device / in memory? This process seems a bit arcane so I am doubtful whether the installation of a Flatpak will be stored in such a way that it would work,

I misunderstood what that was saying, You are correct in that it only puts it into the .conf file, then actually creating the union requires another step that uses that config file.

Use linuxloops installer to install linux into image file. Than use Ventoy to boot this image. It is rw, everything is saved inside it.

1 Like

Bro, please update here when you achieve this, with the steps necessary to accomplish (maybe a guide to persistent on fedora) looking for the same thing, but im very noob on these stuffs, im learning though

I’ll read up on this and then try it.