Page 1 of 1

Trying to run a portable USB install with persistence [SOLVED]

Posted: Sun Mar 02, 2025 6:23 am
by JimMX7
Hello guys,

I've created a USB install of MX-23.5 "Libretto" using Rufus (4.6p "portable" version). I can boot that USB on a couple of laptops i've tested it on so far (one Asus and one Acer) and running that "Live" version of MX-23.5 i've liked very much the look and feel of MX Linux so have decided to move past the hardware test stage and wish to do the following if it is possible:

1. Have a version of MX linux on a USB stick (or two) that I can use on any other PC without installing over the default OS on those systems (mostly these will be windows machines).

2. Be able to keep the GUI changes to MX I make, keep the software I download (for example Brave browser etc) and any settings/bookmarks added during the use of the USB installed MX linux above. Then when I use that USB later on the same machine or on another machine, have it keep all the changes made?

Now "persistence" seems to be the key word here to make this work, so i can have my version of MX Linux on a USB key that I can use across different machines and keep any changes I make during use. I've searched for persistence on the forum and looked at a couple of threads, but as a non expert Linux user (i've had a couple of years experience with Linux Mint previously, can use the terminal ok etc), i've not seen a clear answer to the kind of scenario i'm hoping to make work.

So my question is can i use MX Linux as a portable (on USB) OS choice and keep downloads and changes I make during my sessions as "persistent" so they will carry over/be saved for next time i run MX from my USB key? In effect have a regular install of MX Linux, do all those things you would on a full desktop install, just have that on a portable USB keydrive?

thanks in advance for any pointers.

Re: Trying to run a portable USB install with persistence

Posted: Sun Mar 02, 2025 7:42 am
by fehlix
suggest this:

* First post QSI "Quick System Info" found with the menu or within MX Tools., click the button "Copy for forum" in order to keep the [Code] tags within the report.
Post the QSI report un-modified.

Next
* Create a LiveUSB with help of "MX Live USB Maker"
This can be done from a running MX Live USB, which was made with Rufus, by selecting the MX ISO and plugin another USB stick,
as target for creating the new Live USB with "MX Live USB Maker"

Next;
* Boot with the newly made MX LiveUSB, and within the Live Boot Menu select a persistence mode, and additionally
also select with the option to "save" the made selections, in order the persistence mode selection will be pre-selected next boot.

Re: Trying to run a portable USB install with persistence

Posted: Mon Mar 03, 2025 7:40 am
by JimMX7
Ok thanks fehlix, i'm across 3 different laptops currently and have hit a small issue so will get back with the QSI details later as i get further in this project (and which laptop should i run that from or for all three, when i can?!).

Had an issue on one laptop with the version of MX Live I made as you suggested by using "MX Live USB maker", in that after selecting MX Linux to boot into (instead of windows) it decided to only want to boot into windows. On the USB version of MX that i had made with Rufus that laptop would boot into MX Linux ok. So i'm currently using the rufus made USB key to access that "problem" laptop, with the aim of doing a full install over windows on that system (Windows is fully broken beyond repair on that one).

For the other two laptops that we use at home, I hope to setup a persistent MX USB version for each, for accessing the internet and all the more secure stuff Linux offers over windows etc. I'll focus on getting this "portable USB with persistence" version working before tackling the full install on the borked windows laptop.

So at this point in time i'm looking at the "Persistence option" screen within the "advanced options" section of MX-23.5 (Libretto) I have running from the rufus made USB install of MX linux. I have 11 options to choose from. The USB keydrive is 32Gb (28 or so usable). I should have enough space to have everything on that size of USB, so i'm looking at "persist_static" or "p_static_root" as maybe being what i should choose? What do you suggest?

Re: Trying to run a portable USB install with persistence

Posted: Mon Mar 03, 2025 10:06 am
by thomasl
JimMX7 wrote: Sun Mar 02, 2025 6:23 am1. Have a version of MX linux on a USB stick (or two) that I can use on any other PC without installing over the default OS on those systems (mostly these will be windows machines).
Yes, this can be done. I have a so-called frugal install (ie with persistence) that runs on a variety of PCs from their internal SSDs but I also have a fast USB stick (128GB) with that same install that runs on almost every PC I've ever tried, with full root and home persistence. (This install also supports VirtualBox and my VMs, so to the complete consternation of friends I can boot my Linux on their PC and then run Windows in a VM.)
JimMX7 wrote: Sun Mar 02, 2025 6:23 am2. Be able to keep the GUI changes to MX I make, keep the software I download (for example Brave browser etc) and any settings/bookmarks added during the use of the USB installed MX linux above. Then when I use that USB later on the same machine or on another machine, have it keep all the changes made?
Look into the various persistence options. MX persistence is very flexible and there are a few permutations of root and/or home persistence. I've written down a few notes re persistence because this area can be a bit overwhelming for people new to these concepts: viewtopic.php?p=687788
A frugal install/persistence install is almost identical to a full install but there are some small differences (ie re systemd). But in now almost 7 years of using MX Linux as a daily driver I've never had any problems with my frugal installs. Quite the opposite, I'm convinced that this is the best way to run MX. But that's IMO and YMMV.

Re: Trying to run a portable USB install with persistence

Posted: Mon Mar 03, 2025 10:56 am
by fehlix
JimMX7 wrote: Mon Mar 03, 2025 7:40 am The USB keydrive is 32Gb (28 or so usable). I should have enough space to have everything on that size of USB, so i'm looking at "persist_static" or "p_static_root" as maybe being what i should choose? What do you suggest?
I'd suggest use persist_root, with no separate homefs persistence file:

Code: Select all

persist_root    Save root and home in RAM then saved at shutdown
p_static_root   Save root and home on disk together
Note: With Rufus-made LiveUSB you probably have a FAT filesystem, which limits max filesize to 4GiB. This can be a critical show stopper,
b/c overtime the rootfs persistence file will grow due to all accumulated changes. So you would need to remaster the LiveUSB with help "MX RemasterCC"
in order to squeeze the changes back into a new readonly linuxfs file and get new empty rootfs file.
Also FAT itself tend to create files system error, when used on LiveUSB with LiveSession. So not really recommend for a reliable LiveUSB.

Re: Trying to run a portable USB install with persistence

Posted: Mon Mar 03, 2025 11:14 am
by MikeR
I would like to suggest an alternative - and to my mind simpler - method. (Works for me...)
Have a look at Ventoy (https://www.ventoy.net/en/index.html)
pros:
Lots of help and How-tos, Documentation at not too technical a level
Setup once, and then load (copy) the iso files as-is to the USB stick.
There are bash scripts to help you create and load persistence space (see https://www.instructables.com/USB-Pesistence-in-Ventoy/
and/or /https://ventoy.net/en/plugin_persistence.html)

cons
Each persistence file is (at least, the way I have it setup) specific to one distro.
You might find it complicated to create a Windows bootable iso file.

My personal experience:
I have a 32GB USB stick which allows me to boot any one of four distros, with persistence of between 2GB and 6GB
It acts as my primary backup, and I have had occasion to use is to restore a complete system.
I am also able to take it with me, and boot it on another's PC.

HTH
Mike

Re: Trying to run a portable USB install with persistence

Posted: Mon Mar 03, 2025 1:09 pm
by fehlix
MikeR wrote: Mon Mar 03, 2025 11:14 am I would like to suggest an alternative - and to my mind simpler - method. (Works for me...)
Have a look at Ventoy (https://www.ventoy.net/en/index.html)
While Ventoy offers a method for persistence with its Live USB
functionality, there are some limitations to consider. This approach
does work, but it requires that the partition from which the Linux
filesystem (linuxfs) is loaded is writable.

Using Ventoy's persistence feature can lead to challenges over time, as
the persistence file accumulates numerous system changes, including new
packages. Eventually, this can result in the persistence file becoming
full, which may hinder your ability to update the system effectively.

In summary, while Ventoy provides a form of persistence, it is not as
fully integrated as the options offered by MX Live USB persistence.
Users should be aware of these limitations when choosing between
functionality offered by "MX Live USB" and Ventoy persistence.

Re: Trying to run a portable USB install with persistence

Posted: Mon Mar 03, 2025 1:51 pm
by DukeComposed
fehlix wrote: Mon Mar 03, 2025 1:09 pm In summary, while Ventoy provides a form of persistence, it is not as
fully integrated as the options offered by MX Live USB persistence.
Users should be aware of these limitations when choosing
I'd like to underline this point, since it can be hard to grasp for someone just getting started with trying out a persistent USB setup. Both options will work, but Ventoy with a persistent partition is not designed to provide the same level of integrated functionality that antiX and MX Linux's persistence options provide.

If you just want to boot a live session from a static ISO and be able to save files to your USB thumb drive, Ventoy is a great choice. If you want a portable Linux install where you can, for example, bookmark websites, change wallpapers, patch it, add software when you choose, and have that install be something you can live in and customize, Ventoy is not as good of an option as the persistence features of MX and antiX.

Re: Trying to run a portable USB install with persistence

Posted: Tue Mar 04, 2025 2:26 am
by MikeR
Using Ventoy:
The first time I boot an MX distro 'with persistence' in Ventoy I am offered the full gamut of persistence choices.
The caveat in this case is planning in advance to have sufficient persistence space.
Other distros e.g. Ubuntu allow persistence only as an all-or-nothing choice.
(I have no experience with Windows iso files)
As far as I have seen personal preferences, bookmarks, mail files have all been saved.

Re: Trying to run a portable USB install with persistence

Posted: Tue Mar 04, 2025 12:17 pm
by anticapitalista
Does Ventoy offer Remastering?

Re: Trying to run a portable USB install with persistence

Posted: Tue Mar 04, 2025 12:43 pm
by fehlix
anticapitalista wrote: Tue Mar 04, 2025 12:17 pm Does Ventoy offer Remastering?
It's kind of loop-mounting the ISO. Persistence boot option is injected into a re-written initrd.
So remastering is not possible.

Re: Trying to run a portable USB install with persistence

Posted: Tue Mar 04, 2025 1:31 pm
by JimMX7
Just to fire back a quick "thank you guys" for all your contributions. Probably i'll be back at this next weekend, just a quick update: Using either the rufus created USB pendrive or the "MX Live USB maker" version, and then trying a number of the persistence options in the menu before booting into MX Linux (i guess this is always a live version as i see options to "install MX" on the desktop environment still, so assume it is running like if you run a "live" linux from a DVD etc), I have not yet been able to make changes to the running version; some GUI changes like moving the taskbar to the bottom of the screen horizontally and installing Brave browser via the console, adding bookmarks or extensions to the browser (firefox and Brave). Whenever i then shutdown the session/logout the PC/shut it down etc, whenever i then reboot back into the MX usb keydrive (either one of the two i currently have) I have to redo all those changes again.

So i'm obviously not doing something important here, like a manual command to "fix" the persistence onto the USB key? Not sure based on my quick experiments over the last 48hrs or so. So i've used two types of rufus install, both the standard version and the "p" version (special for a specific "persistence" version), i've created the other USB key with the "MX Live USB maker" and had the same kind of issues getting anything to stick on the USB keydrive for the next boot/use. Inside those advanced options of MX linux (on both USB installs) i've tried maybe half of the "persistence" options from top to middle, not yet tried any of the "frugal" options but will look at those if i just can't get the other options to do what I'm aiming for. Does this sound normal? Should i atleast have seen some "persistence" stick or am i missing a step to make it so?

I'll pop back over the weekend and do some further reading to see what the issue might be and try some experiments based on all your advice so far given, and thanks for having such a friendly forum, refreshing and makes me want to stick around and give MX Linux a proper run as i'm loving it, and will certainly be running a full native install on that borked windows system, just really loving the idea of a portable "agnostic" USB keydrive version I can use on any PC and keep my install as I want it across different PC's.

And by the way I really like the general GUI and look and feel of MX, as a windows longtime user, then Linux Mint user for a few years, I think the dev team of MX and antiX (i'm learning the history as i go!) have got something very compelling here, fingers crossed i get past my newbie steps soon. Cheers for now guys.

Re: Trying to run a portable USB install with persistence

Posted: Wed Mar 05, 2025 2:10 am
by m_pav
Have yo done all the preparatory steps to each machine to facilitate MX Linux?
In the BIOS...
Disable fastboot (if it exists)
Disable SecureBoot**
Enable the Fn key interrupt to choose another boot media, e.g., from USB, there are many titles for this particular item.
Check the status of CSM. If it exists and is enabled, I suggest you turn it off.
** runnung live with persist should work with SecureBoot enabled when using our regular builds excluding AHS variants (KDE uses AHS)

For Dual-booters
In Windows, disable Fast Startup
Provision disk space, the more the merrier, but do not format it in Windows, format it within the Live Linux environment as ext4.
Hint, you can provision a swap partition if you wish, the Live system will automatically use whatever swap partitions it finds. I recommend 8GB for swap.


With these things taken care of, you'll have a good starting point for each machine.

Re: Trying to run a portable USB install with persistence

Posted: Mon Mar 10, 2025 6:01 pm
by JimMX7
Success! (touch wood!)

Ok so i followed some of the advice given in this thread, and found a few other options that made it work for me, as far as I can tell. I had to use the 2xUSB keydrive method as Grok explains here, with a little modification:

https://grok.com/chat/2e8fc626-eace-453 ... c9809b6e23

So i ended up using Rufus for the initial Live USB1 install and then used MX Live USB creator to "clone running live session" onto the second USB2 key drive. Then after removing the first USB1 drive that Rufus created, i booted into the second USB2 (F12 on my laptop brings up the boot menu on boot up) and set persistence options in the advanced menu selection. I went with persist_static, this then gave the options to set the default sizes for "rootfs" and "homefs" during that intital boot into the MX Linux environment. After that first bootup into this USB2 keydrive I installed some things, made changes etc to test persistence was working.

Note: after shutting down and restarting, IF i just boot right into the MX Linux "desktop" it looks like a normal Live session with no persistence. I have to first select the persistence options in the advanced menu, picking that persist_static option to get my changes to load back in. So a small hoop to jump through, it does not automatically boot up with persistence, but it is a small menu manipulation so i'm not worried about it.

The one thing i'm not sure on is keyboard and timezone settings? I did also set those up during the initial setup (my keyboard is French and my timezone is Brussels in Belgium! But my language is English) but it seems these are not kept in the persistence files? I could be wrong on that, and maybe just got nervous seeing them back to defaults before booting into the MX Linux "desktop" environment, so changed them again, just in case i got a keyboard that did not work as intended!

Anyway thanks to all the pointers here, i'm seemingly now working with persistence, which is a huge relief, and i'll test this all out over the coming months and report back on anything i think might help others trying this out. I'm looking forward to my MX Linux road ahead and coming from Linux Mint feel pretty at home so far. Thanks to the devs and guys and gals that made this really nice looking Linux :happy:

Re: Trying to run a portable USB install with persistence

Posted: Mon Mar 10, 2025 6:28 pm
by fehlix
JimMX7 wrote: Mon Mar 10, 2025 6:01 pm The one thing i'm not sure on is keyboard and timezone settings?
Lang, keyboard and timezone are set with LiveBoot at the LiveBoot Menu.
So you would select first Lang,Kbd,TZ and next any of the desired persistence option
and finally, select "Grub Save" under saved options (grubsave boot option).
With grubsave" the live boot-parameter are saved/stored into the grubenv.cfg (text file) under /boot/grub/grubenv.cfg
on the LiveUSB ( not within the running system persistence files)
During LiveBoot-up the LiveGrub reads the parameter back from /boot/grub/grubenv.cfg
and pre-populates the boot-parameter onto the kernel command line.,
also visible as pre-selected within the Live GRUB menu itself.

Re: Trying to run a portable USB install with persistence

Posted: Tue Mar 11, 2025 2:54 am
by JimMX7
:number1: Thanks for all your assistance fehlix! (and others too) Everything is looking good, working well. This is my first "portable" OS and it has huge potential and usage scenarios for me, so i'm stoked to carry on this journey with MX.

Keyboard and timezone settings are all saved in the persistence settings too it seems. Thanks everyone.

Re: Trying to run a portable USB install with persistence [SOLVED]

Posted: Tue Apr 01, 2025 2:11 am
by JimMX7
Just a little update:

All working perfectly. The USB key i used was 32GB, this seems the best minimum size for running MX Linux in this mode (16GB may be a little small for an all on disk setting?).
If I understand correctly using the persistence option of "persist_static" keeps everything running from the USB key, so this may be harder on the USB drive over time, but i need to be able to use it on all laptops/PC's and keep all my settings with me etc.

I was a fan of Linux Mint previously, had a nice dual-boot (with Windows) desktop system; but your MX Linux version seems faster overall (maybe it is lighter on resources than Mint?) and i'm enjoying it as my daily driver.