Where is the frugal installation persistent data?  [Solved]

Help for MX Fluxbox
When asking for help, use Quick System Info from MX Tools. It will be properly formatted using the following steps.
1. Click on Quick System Info in MX Tools
2. Right click in your post and paste.
Message
Author
je55eah
Posts: 198
Joined: Fri Mar 17, 2023 5:45 am

Where is the frugal installation persistent data?

#1 Post by je55eah »

I created a frugal install on a USB drive by creating a live USB installation on the drive and then booting it with the frugal boot option which I have set to boot everytime. When I activated frugal the first time I was prompted to select the partition for the files and I selected a partition on the USB which I had created for this purpose. The system is functioning properly with persistence, but I am confused because the Live-usb-storage partition is still empty. I also found a Live-usb-storage file that has appeared on the internal hard drive of the laptop (mid 2012 MacBook Pro). That folder contains a demo and root folder and the root folder contains some live-log folders and files. Does this mean that the data is being saved to the internal drive and my changes will not travel with the USB drive? I was expecting the frugal data to be contained within two files on the USB drive.

There is another partition on the USB drive that is empty. I intended to use it as a place for virtual machine disk images, but that partition is owned by root and I expect that I will have a problem because I would need to run qemu or virtualbox with sudo to access files there. Can I safely change the ownership of that partition?

How can I make the USB installation use Live-usb-storage partition on the USB drive? I would like my changes to load on any computer I plug the USB drive into.

je55eah
Posts: 198
Joined: Fri Mar 17, 2023 5:45 am

Re: Where is the frugal installation persistent data?

#2 Post by je55eah »

Code: Select all

System:    Kernel: 5.10.0-20-amd64 [5.10.158-2] x86_64 bits: 64 compiler: gcc v: 10.2.1 
           parameters: BOOT_IMAGE=/antiX/vmlinuz quiet splasht nosplash frugal_static splasht 
           Desktop: Fluxbox 1.3.7 info: tint2 vt: 7 dm: LightDM 1.26.0 
           Distro: MX-21.3_fluxbox_x64 Wildflower January 15  2023 
           base: Debian GNU/Linux 11 (bullseye) 
Machine:   Type: Laptop System: Apple product: MacBookPro9,2 v: 1.0 serial: <filter> Chassis: 
           type: 10 v: Mac-6F01561E16C75D06 serial: <filter> 
           Mobo: Apple model: Mac-6F01561E16C75D06 v: MacBookPro9,2 serial: <filter> UEFI: Apple 
           v: 229.0.0.0.0 date: 07/24/2019 
Battery:   ID-1: BAT0 charge: 51.3 Wh (96.6%) condition: 53.1/62.9 Wh (84.5%) volts: 12.4 
           min: 10.9 model: SMP bq20z451 type: Li-ion serial: N/A status: Full cycles: 952 
CPU:       Info: Dual Core model: Intel Core i7-3520M bits: 64 type: MT MCP arch: Ivy Bridge 
           family: 6 model-id: 3A (58) stepping: 9 microcode: 21 cache: L2: 4 MiB 
           flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 23146 
           Speed: 1395 MHz min/max: 1200/3600 MHz Core speeds (MHz): 1: 1395 2: 1332 3: 1317 
           4: 1324 
           Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled 
           Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
           Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
           Type: meltdown mitigation: PTI 
           Type: mmio_stale_data status: Unknown: No mitigations 
           Type: retbleed status: Not affected 
           Type: spec_store_bypass 
           mitigation: Speculative Store Bypass disabled via prctl and seccomp 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW, STIBP: 
           conditional, RSB filling, PBRSB-eIBRS: Not affected 
           Type: srbds status: Vulnerable: No microcode 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: Intel 3rd Gen Core processor Graphics vendor: Apple driver: i915 v: kernel 
           bus-ID: 00:02.0 chip-ID: 8086:0166 class-ID: 0300 
           Device-2: Apple FaceTime HD Camera type: USB driver: uvcvideo bus-ID: 1-1.1:3 
           chip-ID: 05ac:8509 class-ID: 0e02 serial: <filter> 
           Display: x11 server: X.Org 1.20.11 driver: loaded: modesetting unloaded: fbdev,vesa 
           display-ID: :0.0 screens: 1 
           Screen-1: 0 s-res: 1280x800 s-dpi: 96 s-size: 338x211mm (13.3x8.3") 
           s-diag: 398mm (15.7") 
           Monitor-1: LVDS-1 res: 1280x800 hz: 60 dpi: 114 size: 286x179mm (11.3x7.0") 
           diag: 337mm (13.3") 
           OpenGL: renderer: Mesa DRI Intel HD Graphics 4000 (IVB GT2) v: 4.2 Mesa 20.3.5 
           compat-v: 3.0 direct render: Yes 
Audio:     Device-1: Intel 7 Series/C216 Family High Definition Audio driver: snd_hda_intel 
           v: kernel bus-ID: 00:1b.0 chip-ID: 8086:1e20 class-ID: 0403 
           Sound Server-1: ALSA v: k5.10.0-20-amd64 running: yes 
           Sound Server-2: PulseAudio v: 14.2 running: yes 
Network:   Device-1: Broadcom NetXtreme BCM57765 Gigabit Ethernet PCIe driver: tg3 v: kernel 
           port: efa0 bus-ID: 01:00.0 chip-ID: 14e4:16b4 class-ID: 0200 
           IF: eth0 state: down mac: <filter> 
           Device-2: Broadcom BCM4331 802.11a/b/g/n vendor: Apple AirPort Extreme driver: wl 
           v: kernel modules: bcma port: efa0 bus-ID: 02:00.0 chip-ID: 14e4:4331 class-ID: 0280 
           IF: wlan0 state: up mac: <filter> 
Bluetooth: Device-1: Apple Bluetooth USB Host Controller type: USB driver: btusb v: 0.8 
           bus-ID: 2-1.8.1.3:9 chip-ID: 05ac:821d class-ID: fe01 
           Report: hciconfig ID: hci0 rfk-id: 1 state: up address: <filter> bt-v: 2.1 lmp-v: 4.0 
           sub-v: 229a hci-v: 4.0 rev: 170f 
           Info: acl-mtu: 1021:6 sco-mtu: 64:1 link-policy: rswitch sniff link-mode: slave accept 
Drives:    Local Storage: total: 3.87 TiB used: 185.38 GiB (4.7%) 
           SMART Message: Unable to run smartctl. Root privileges required. 
           ID-1: /dev/sda maj-min: 8:0 vendor: Hitachi model: HTS543225A7A384 size: 232.89 GiB 
           block-size: physical: 512 B logical: 512 B speed: 3.0 Gb/s type: HDD rpm: 5400 
           serial: <filter> rev: A60W scheme: MBR 
           ID-2: /dev/sdb maj-min: 8:16 type: USB vendor: Seagate model: Backup+ Hub WH 
           size: 3.64 TiB block-size: physical: 4096 B logical: 512 B type: N/A serial: <filter> 
           rev: D781 scheme: GPT 
Swap:      Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default) 
           ID-1: swap-1 type: partition size: 10 GiB used: 0 KiB (0.0%) priority: -2 
           dev: /dev/sdb3 maj-min: 8:19 
Sensors:   System Temperatures: cpu: 71.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Repos:     Packages: note: see --pkg apt: 1691 lib: 806 flatpak: 0 
           No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list 
           1: deb http://deb.debian.org/debian bullseye-updates main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/debian.list 
           1: deb http://deb.debian.org/debian bullseye main contrib non-free
           2: deb http://security.debian.org/debian-security bullseye-security main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/mx.list 
           1: deb http://mxrepo.com/mx/repo/ bullseye main non-free
Info:      Processes: 222 Uptime: 1h 9m wakeups: 3 Memory: 7.68 GiB used: 1.49 GiB (19.5%) 
           Init: SysVinit v: 2.96 runlevel: 5 default: 5 tool: systemctl Compilers: gcc: N/A 
           alt: 10 Client: shell wrapper v: 5.1.4-release inxi: 3.3.06 
Boot Mode: UEFI

User avatar
fehlix
Developer
Posts: 10375
Joined: Wed Apr 11, 2018 5:09 pm

Re: Where is the frugal installation persistent data?

#3 Post by fehlix »

May be the confusing about persistence and frugal installation on an USB-device.

Instead frugal just do a normal Live-USB installation onto the USB-device
using LiveUSB Maker (either GUI or CLI tool)
This would do what you like to have: You can carry arround the USB device and would have all data,
and persistence data and LiveUSB storage on this one USB device.
Frugal installation is something else, intended to have a LiveUSB alike
installation on an internal device - not on extern USB device.
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

je55eah
Posts: 198
Joined: Fri Mar 17, 2023 5:45 am

Re: Where is the frugal installation persistent data?

#4 Post by je55eah »

Okay. I'll try it without the frugal stuff. With Puppy Linux frugal indicates that all of the persistence data is stored in a single disk image file.

When I create a new LiveUSB installation and I have a fresh demo and a root user, where will the data be stored and how do I activate persistence?

User avatar
BitJam
Developer
Posts: 2283
Joined: Sat Aug 22, 2009 11:36 pm

Re: Where is the frugal installation persistent data?  [Solved]

#5 Post by BitJam »

Welcome @je55eah!

On a live-usb the /live-usb-storage/ directory gives you persistent storage even with no persistence enabled. In the main live file system /root/live-usb-storage/ is bind mounted to /live-usb-storage/root/ (on the usb) and /home/demo/live-usb-storage/ is bind mounted to /live-usb-storage/demo/ (on the usb). It's a convenient way to store files directly on the live-usb device.

If you did a frugal install to an internal partition then the live-usb-storage/ directory will be created in that partition. We try to keep everything in one place. Either on the frugal partition if you did a frugal install or on the live-usb device if you made a live-usb with live-usb-maker.

Actual persistence files are only created if they don't already exists and you boot with persistence enabled. On a live-usb almost all the files we need (except for bootloader stuff) are under the /antiX/ directory. The three main files are:

Code: Select all

/antiX/linuxfs   (compressed main file system)
/antiX/vmlinuz   (kernel)
/antiX/initrd.gz (live initrd)
In addition there are some .md5 files and a few other minor things. We try to put as much as possible that is related to this instance of Linux in this one directory which makes things much easier when you want to boot several different instances of Linux on the same live-usb. The one exception (besides the bootloader stuff) is the /live-usb/storage/ directory. This lives outside of the /antiX/ directory so it can be easily (trivially) shared between different instances of Linux on the same device.

If you do a frugal install then we no longer use the /antiX/ top level directory for everything. Instead we use something like /MX-Frugal-$(uname -r)/ This allows you to put different frugal installs in the same partition as long has they have different kernels. it also helps ensure that the kernel you booted will match the kernel in the frugal install.

The actual persistence files are named "rootfs" and "homefs" for root and home persistence. They, of course, live in the /antiX/ directory (or the frugal directory if you did a frugal install). With modern hardware it is usually best to just use static root persistence in which case only the rootfs file will be created.

These files are created automatically very early in the boot process if you've enabled persistence and they don't already exist. This is very convenient and robust but it sometimes creates confusion when people are accustomed to using a less convenient and less easy-to-use system where you have to jump through hoops before persistence works.

We use the same strategy for doing frugal installs. We do it very early in the boot process without first booting into the normal live system. With a fast system (and fast fingers) you can do a frugal install and boot into the freshly installed system in 10 seconds or less. That's for antiX. MX may take a bit longer to boot. Still, it's probably the fastest install in the Linux-verse.

As fehlix already said, if you want a to create a portable system on an external device then you should use our live-usb-maker program to make a full feature live-usb. if this was already done to make the live device you booted from then you are done. If not, you normally need an iso file to make a live-usb. But if you boot MX or antiX live then you can use "clone" mode in live-usb-maker to clone the running live system to a new usb stick so you don't need an iso file.

On a full feature live-usb you enable persistence as a boot option. The first time you enable it, the persistence files will be created for you. You can choose to enable persistence or not on every live boot. For more "permanent" storage or if you forgot to enable persistence and you really really want to save something (not in ~/live-usb-storage/) you can do a live-remaster. This takes longer because we recompress the entire file system into a new /antiX/linuxfs file.

So typically someone will use ~/live-usb-storage/ for large files or files you want to share. Use static root persistence to save all other changes to the file system (including under /home). When the rootfs file starts to get full (or a little slow) then do a live-remaster. This will copy all your changes from rootfs into the large, compressed linuxfs file and reset the rootfs file.

If something goes wrong with the remaster then use the "rollback" boot option to get back to the state before you did the remaster. This gives you quick access to three different versions of your system which is convenient for system development. In addition, our snapshot tool works on the live system. It works like remaster by creating a new linuxfs file but it doesn't change your live-usb. Instead, it makes a new .iso file that you can use as a backup or can share with others.
"The first principle is that you must not fool yourself -- and you are the easiest person to fool."

-- Richard Feynman

je55eah
Posts: 198
Joined: Fri Mar 17, 2023 5:45 am

Re: Where is the frugal installation persistent data?

#6 Post by je55eah »

Wow @BitJam , thanks for the detailed reply. I have used dolphin oracles systemd iso to create a new live USB installation with the live usb maker program @fehlix . It doesn't appear that persistence is automatic. Even if I activate the checkbox to 'save this session' when shutting down my changes are not preserved. After reading BitJam's post a couple times I am getting the impression that I will need to activate persistence or frugal persistence from the boot menus. That is what I did with the earlier install too. So if that is the case, then I think the issue was not that I did something wrong but that the files were not where I expected them to be. BitJam explained that the live-usb-storage is just an extra area and the actual persistence data is stored at /MX-frugal-name or something.

I wonder about those files I found on my laptops internal hard drive. I deleted them and I will check if they return after activating frugal persistence again.

What is the purpose of the 'save this session' checkbox?

je55eah
Posts: 198
Joined: Fri Mar 17, 2023 5:45 am

Re: Where is the frugal installation persistent data?

#7 Post by je55eah »

I discovered that the antiX-Frugal partitition is required because it is where the data is kept, but the confusion arises because that partition is hidden from the running system.

I moved the demo and root files within Live-usb-storage which is within the antiX-Frugal partition to hide them. My expectation was that this would cause the vhanges I had made to disappear and that I could recover them by replacing those directories. I was wrong. The persistence was unafffected, everything loaded. Why is that partition hidden and what is its function?

Within that partition is another folder called antiX-Frugal-5.10.0-20-amd64 with a collection of boot files that is very similar to the files in MX-BOOT, the partition created by the MX Live USB Maker. Why does this redundancy exist?

The MX-BOOT partition also contains a Live-usb-storage folder. It does not appear to be linked to the Live-usb-stoorage folder in the antiX-Frugal partition. What is actually going on here?

I wanted to try the same trick on the /MX-frugal-name file, but I couldn't find it. If I want to delete or move the persistence data, where can I find it?
You do not have the required permissions to view the files attached to this post.

User avatar
BitJam
Developer
Posts: 2283
Joined: Sat Aug 22, 2009 11:36 pm

Re: Where is the frugal installation persistent data?

#8 Post by BitJam »

je55eah wrote: Thu Mar 23, 2023 2:23 pm I discovered that the antiX-Frugal partitition is required because it is where the data is kept, but the confusion arises because that partition is hidden from the running system.

I moved the demo and root files within Live-usb-storage which is within the antiX-Frugal partition to hide them. My expectation was that this would cause the changes I had made to disappear and that I could recover them by replacing those directories. I was wrong. The persistence was unafffected, everything loaded. Why is that partition hidden and what is its function?
I do not understand what you are doing and I do not understand this question. Sorry.

Usually the live partition we boot from is not hidden. It is mounted at /live/boot-dev/. But if you're trying to use systemd on the live system then things get twisted around in order to keep systemd from complaining and refusing to work.

The live partition normally needs to be mounted because we need access to the linuxfs file it contains in order to create the "main" filesystem. We create the main file system under /live/ at /live/aufs/ using the mounted linuxfs file at /live/linux/ and tmpfs at /live/aufs-ram/ or the rootfs file mounted at /live/persist-root/.

We then use the very tricky switch_root command to turn the file system inside out so /live/aufs/ becomes the root file system and the previous root file system moves to /live/.
Within that partition is another folder called antiX-Frugal-5.10.0-20-amd64 with a collection of boot files that is very similar to the files in MX-BOOT, the partition created by the MX Live USB Maker. Why does this redundancy exist?
Many/most people who do a frugal install don't want to rely on a live-usb to boot their frugal system so we supply everything needed to boot the frugal system on the frugal system. We even provide a snippet of grub.cfg configuration that people can add to their existing grub.cfg file so they can boot directly into the frugal system from their existing grub bootloader without needing a separate live-usb with the proper kernels.

Those files are small. The cost to copy them is negligible. We would be big fat jerks if we didn't provide them automatically so the frugal system can be independent. IIRC those files are also needed if you want to create a live-usb from the frugal install using live-usb-maker in clone mode.
The MX-BOOT partition also contains a Live-usb-storage folder. It does not appear to be linked to the Live-usb-storage folder in the antiX-Frugal partition. What is actually going on here?
Each live system has its own /Live-usb-storage/ folders. When you boot a (full featured) live-usb, it will show up on the live-usb. Perhaps you are calling this MX-BOOT. If you boot a frugal system then it will show up on the frugal system. It would make no sense to try to link together live-usb-storage folders on different devices.

As much as possible we try to keep things self contained. Your live-usb stuff should live on the live-usb device including its on version of the /live-usb-storage/ directories. Likewise the frugal install stuff should all live on the frugal partition, including its (different) version of the /live-usb-storage/ directories. If you create another MX or antiX live-usb then it too will have its on set of /live-usb-storage/ directories that are independent from the other ones.

Instead of seeing this like a normalized database it is better to think of it as a small kind of plant of flower. When you do a frugal install or make a live-usb or do an iso-snapshot we try to give the new system everything it needs to reproduce itself. This even extends to the "toram" command which copies the large linuxfs file into ram so you can remove the live-usb device and the system still runs (often blazingly fast). For most people all they need is the linuxfs file and since ram can be a scarce resource it might seem crazy that we copy extra stuff. But we do. By default we copy all of those "redundant" boot loader files into ram as well.

This allows you to use live-usb-maker in clone mode with the original live-usb unmounted. You can then plug it in and have live-usb-maker create a full featured live system on your original device. This is useful if you have only one usb-stick (for this) and you originally made a read-only live-usb and you want to convert it to a full featured read-write live-usb.

One theme that emerges is we gladly copy over small files along with the big ones in order to keep from boxing users into a corner. This took many years of hard work. Imagine a large diagram with circles labelled "Installed System" "live DVD" "Live CD" "Read-only Live-usb" "Full-featured live-usb" and "Frugal install". We tried to connect these all with as many arrows as possible.

One part I'm particularly happy with is you can go from live to installed back to live back to installed, etc. and not lose anything. This can seem utterly easy and simple to the user but we have to play all sorts of complicated tricks behind the scenes in order to make it simple for the users.
I wanted to try the same trick on the /MX-frugal-name file, but I couldn't find it. If I want to delete or move the persistence data, where can I find it?
Again, I don't understand you. Sorry. Perhaps we are using words differently. Live usb storage files lives under the /live-usb-storage/ directories. Persistence data resides inside the "rootfs" and "homefs" persistence files that usually live alongside the large linuxfs file.

Our live initrd comes with a fairly extensive README file that you can find on your system as well as here:

https://gitlab.com/antiX-Linux/Live-ini ... ive/README
"The first principle is that you must not fool yourself -- and you are the easiest person to fool."

-- Richard Feynman

je55eah
Posts: 198
Joined: Fri Mar 17, 2023 5:45 am

Re: Where is the frugal installation persistent data?

#9 Post by je55eah »

After many days of fiddling around with MX I think I finally understand everything you all have been telling me. I get the impression that frugal installs are very similar to regular live usb persistence, but the frugal install requires a boot loader. I also understand now that linuxfs, rootfs, and homefs are the files I was looking for. I appreciate everyone's patience and willingness to explain these things for me.

User avatar
BitJam
Developer
Posts: 2283
Joined: Sat Aug 22, 2009 11:36 pm

Re: Where is the frugal installation persistent data?

#10 Post by BitJam »

Yes! You've got it!

We tried hard to prevent the live system from doing stupid, destructive things to the system it runs on. For example, while our live-usb-maker will repartition the target device, we try to make sure that device is removable and not currently in use.

The frugal install is even more polite because it's meant to play well with whatever is already installed. We don't create new partitions and we absolutely do not touch the existing bootloader. Almost everything gets placed in a single directory we create on the selected partition. We wanted to avoid problems such as "I did a frugal install and now my system won't boot!". First do no harm.

You asked good questions so I tried to take the time to explain the overall architecture to you. To meet our design goals we had to create a lot of the live system from scratch. We took some ideas from the venerable Knoppix live system as well as a few from Gentoo and from the Mepis live system we started with which was derived from Knoppix. But then we went off in our own direction which was different from what most other Linux distros were doing.

Starting back in 2009 we focused on getting the most out of live-usbs by taking maximum advantage of their read/write access. This was back when people were using small usb sticks (1 to 4 Gig mostly) with the slow usb-2 and ungodly slow usb-1.x interfaces. Most other distros used their live system as a means to do an install and nothing more. So for them a read-only live-usb was just fine. We gambled on usb and flash technologies taking off while live-cds and live-dvds stagnated. Turned out this was a good bet. With the new usb-3 technology and the larger, faster usb sticks, the live system we had already created really started to shine.

BTW: if you want the persistence files to live on a different partition or device, use one of the pdev=, plab=, or puuid= boot options to specify the device name, label, or uuid of the partition to use for your persistence files.
"The first principle is that you must not fool yourself -- and you are the easiest person to fool."

-- Richard Feynman

Post Reply

Return to “MX Fluxbox Official Release”