10
November
2023
Modes PErsistence и frugal в MX Linux и antix
13:20

Modes PErsistence и frugal в MX Linux и antix

10 November 2023 13:20

For use at work and at home, a loading USB carrier containing everything you need for work - Linux OS, drivers, browser, utilities can be useful.

Introduction

ДанAn article on how to create Live USB with the possibility of support the state of the file system between sessions. We are talking about MX Linux 23.1 (LIBretto), который вышел в середине октября 2023. Рассмотрена редакции "32.1_minimal" для DVD диска, с объемом дистрибутива 1.8 ГБ. Эта же статья годится для любой редакции MX Linux и aNTIX.

images of installation discs can be downloaded by links:
ISO mx linux files in the editorial office MX-MinimaL.
ISO mx linux main edition files MX Linux XFCE
*ISO antix linux of the last edition Antix ISO

MX Linux andantiX имеют возможность создания автономного Live USB с 2019 года. В этом гибридном режим загрузки с Live USB, названном разработчиком "PerSistence " - in translation " Resistance ", the state of the file system is stored on the USB disk between the downloads: the installed programs and data data on LiveUSB are not discarded from the original state.

When loading the Live USB carrier Live USB, the MX Linux operating system can not only select the language and start the installation, but configure the parameters before starting, in the graphic menu. There are many points with words f in the menu point "Extended options" rugal или perSistence, each of which has options.

Why are the Live CD modes "Frugal" и "PerSistence "?

PErsistence (переводится как "стойкость", "настойчивость", "упорство") - хранение данных между сессиями на USB Flash накопителе. При её использовании загрузочную "флешку" можно переносить между различными ПК, изменения в домашнем каталоге /home и в корневой файловой системе / будут записаны на USB диск при выключении или перезагрузке MX Linux или aNTIX. At the next load, Live USB detects data in an additional section on the flash drive and uploads it. It turns out such a hybrid mode - loading from the unchanged part of Live USB ("only for reading" ISO 9660 ") and is changed in reserved when creating a Live USB space, the contents of which can change with each new session.
In the regime of semi -automatic or manual "perseverance" of Persistence, when turning off the PC, you can refuse to preserve the changed state of the system, which saves time.

frugal (переводится "бережливый" или "экономичный") - возможность установки ОС на компьютеры с малым объёмом жесткого диска (менее 6 ГБ). При использовании frugal на диске вместо множества файлов в каталогах папки /root хранятся лишь 3 сжатых файла, содержащие разделы дисков linuxfs, rootfs и homefs, для системного раздела, изменённого рута и домашней папки, соответственно. Режим Frugal используется только с HDD (НЖМД). При режиме Frugal скорость работы существенно выше, чем при флешке USB 2.0, а занимаемый операционной системой объём на диске ниже, чем при обычной установке. Например, типичный файл linuxfs занимает 2 ГБ, roots от 100 МБ до 2 ГБ и homE from 10 MB to 2 GB.

Requirements for Persistence

1) The volume of the flash drive is needed 16 GB :
* 1.8-2.2 * GB is assigned to the distribution of the operating system.
about
0.5-0.7 GB ** - for storage of changed data data "rootfs". Размер rootfs не может быть больше ОЗУ. Максимальный размер "rOOTFS " in a normal situation should not exceed the size of OS 2.2 GB.

  • from 200 MB to 10 GB for home folder "Homefs". Типичный размер 0.5 ГБ. При малом количестве "своих" данных в каталоге home, можно выделять под homEFS space 200-300 MB.
    • 2.5 GB + 2.5 GB for temporary remaster files (which is required only to perform this optional operation) - for Rootfs.new and linuxfs.new files.
  • temporary file Linuxfs.bak который также можно удалить, но он занимает место,
    in practice, the flash drive is used about 10 GB . Accomplishment: in extreme cases, you can place all the files per one flash drive 4 GB (2.2 GB of Linuxfs, 200 MBrootfs и 250 МБ homEFS) .

2) when recording a boot USB FLash накопителя нужно использовать программы Unetbootin MX_Live_USB_Maker-24.6.glibc2.28-x86_64.AppImage (Linux) или Rufus (Windows), т.к. консольная команда dd или BalenaEtcher создают файловую систему ISO9660 как компакт-диск, "только для чтения" (reaD only).

To record the ISO image on the USB, you need to select the ISO file with the image of the disk, and the target carrier of the USB.

3) We need one working USB port in a PC from which the OS will be loaded. It is desirable that the speed of the USB port and the USB medium be as possible - for example, USB 3.2. A stable USB 2.0 is also suitable. This USB port must belong to the motherboard of the laptop or PC (USB expansion fees will not work).

4) for the possibility of dynamic methods of PErsistence, необходим чуть больший объём объём оперативной памяти (ОЗУ), чем обычно необходимо Linux - минимум 3 ГБ для комплекта ОС + браузер Firefox. Поскольку при динамических способах раздел изменений rootfs с USB диска загружается в память. При статических способах persistence и frugaL This requirement is not mandatory, and it is enough to have RAM 512 MB.

5) Entrance to BIOS or BOOT should be availablemenu, где можно включить загрузку с USB flash в случае Persistence или изменить порядок загрузки с HDD в случае FrugaL.

6) when using PErsistence нужно иметь подключенную загрузочную флешку Live CD MX/antiX каждый раз для запуска ПК, при использовании FrugaL has a method of loading PC and without Live CD.

6) when using a transparent compression in LZ4 and extracting data in RAM when working with USB FLash, требования к процессору не высокие. Для выполнения же операции "ремастеринга", т.е. компиляции изменений в новый образ LiveCD, слабый процессор Intel Atom не подойдет, нужен хотя бы AMD Phenom II 710 / Intel CorE2Duo 8200.

Conditions for applying the option frugaL.

At the option frugal происходит сжатие файловой системы и запись 1 неизменный системный файл и 2 изменяемых файла на жёстком диске. Этот способ повышает скорость обмена в десятки раз по сравнению с USB flaSH, but requires both a hard drive and a section for conservation (with a volume of about 8 GB). When using the LZ4 compression on the fly, the processor power does not play a role, but with a more efficient compression of GZIP, which is used when there is a lack of a disk space, it can be assumed that the requirements for the processor are higher.

Dynamic and static constancy options Persistence

With a dynamic method, datarootfs сначала читаются в ОЗУ, из-за чего используемый объём оперативной памяти достигает 1.7 ГБ. Динамический Persistence обеспечивают очень высокую скорость работы даже при загрузке с USB Flash накопителя. При завершении сеанса можно сохранить изменения автоматически или полуавтоматически при помощи persist_saVe.

PErsistence_schemE.

Dynamic and static stability methods FrugaL.

The main method frugal - статическое связывание. Так как загрузка в ОЗУ обычно не требуется. Совмещенный способ - Frugal+PerSistence works and accelerates slightly compared to static, but lengthens the loading of the OS.

frugal_schemE.

Using a dynamic method (with RAM), as wrote above, for frugal is not required.

Selection options in the MX Live CD or Antix Live CD options

All options are divided into 2 large groups:

* Persistence * - Option for saving data when launch from Live USB from session to session.
frugal ** - Options for the economy of a hard drive (for machines with a small volume of HDD)

Persistence ("resistance" or "perseverance") is divided into 2 large groups - dynamic (RAM) and static (changes are written immediately on a USB disk).

Damy Persistence:
* PErsist_all* - считывать корень диска "/" в ОЗУ, за исключением домашней папки /home (статическая на USB устройстве хранения). При корректном выключении ПК изменения rOOTFS will be recorded on a USB disk. The method is the first on the list, but not the fastest, left not the best impressions (see speed measurements at the end of the article).
PErsist_root** - писать изменения всей ОС - "/" и '/home' в ОЗУ. В оперативную память грузится измененная система "/" и папка пользователя "/home". Быстрый режим, но при выключении нужно сохранять изменения на диск. Либо в середине работы запускать persist-saVe.

Static persistence:
* PErsist_static* - самый медленный способ, который имеет смысл применять лишь для сильно устаревших ПК, имеющих ОЗУ менее 3 ГБ: записывать изменения на USB не дожидаясь завершения работы или перезагрузки. При данном способе "/" и ''/home" записываются в раздельные файлы на устройстве perSIST (USB flash drive)
p_static_root** - то же что _persiststatic, но "/" и "/homE " together on the storage device. The speed is doubled for a PC with a small volume of RAM.
* PErsist_home - ОС грузится с Live USB, а данные домашней папки при изменении сразу записываются на USB диск. Также медленный способ. На устройстве хранения каталог "/homE ".

Shutdown persistence:
*If you do not go into extended settings, Live USB will start with the person passist_Off option - launch of Live CD occur “for clean”, and no data between sessions are saved, not transmitted. This mode is used to install the OS on a stationary PC or laptop (the LIVE mode is first launched, and the OS can be installed from it.

For the current launch of the OS, the settings that the user selected by pressing the F5 button in the download menu are used, which is responsible for the PE modes PErsistence/frugal и которые можно сохранить при нажатии F8 - save**. Изменения в графическом меню автоматически отражаются в файле grUB.CFG loading disk.

Sign USB flash drive with MX Linux for Persistence option

1) I excluded the UNETBOOTIN method. Modern method - file mx_live_usb_maker-24.6.glibc2.28-x86_64.AppImag.zip ,which can be downloaded from GitHub MX-Linux.

2) So that the USB flash drive is determined in the system, pull it out and insert to work on the mount.

3) If nothing was done with her (clean flash drive from the store), we miss this item.

If something was recorded, we clean the flash drive:

LSBLK

Find an external USB disk, for example /DEV /SDD

sudo fdisk /dev/SDD

Команда (m для справки): d (клавиша Enter)

Выбранный раздел 1
Раздел 1 был удален.

Команда (m для справки): n (Enter key)

Тип раздела
p основной (0 primary, 0 extended, 4 free)
e расширенный (контейнер для логических разделов)
Выберите (по умолчанию - p): p (клавиша Enter)
Номер раздела (1-4, по умолчанию 1): 1 (клавиша Enter)
Первый сектор (2048-30719999, по умолчанию 2048): (клавиша Enter)
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-30719999, по умолчанию 30719999): (клавиша Enter)

The question is possible
Удалить сигнатуру? [Y] Да/[N] Нет: y (клавиша Enter)

Команда (m для справки): t (клавиша Enter)
Hex code or alias (type L to list all): 7 (клавиша Enter)

Тип раздела 'Linux' изменен на 'HPFS/NTFS/exFAT'.

Команда (m для справки): w

Таблица разделов была изменена.
Синхронизируются диски.

Create a Fat32 file system with a commandmkfs.faT:

sudo umount /dev/SDD1
sudo mkfs.fat /dev/SDD1

4) So that the USB flash drive is determined in the system, pull out and insert to work on the mount.

5) Launch of the LiveUSB recording program.

Z archive need to extract the file *. AppimaGE and run it to execution in the terminal:

sudo ./MX_Live_USB_Maker-24.6.glibc2.28-x86_64.AppImaGE

7) Select ISO disk image, indicate the previously uploaded distribution file MX Linux or Antix (ISO)

8) Select the target flash drive and to start the recording, click the ok button.

mx_live_from_appimaGE

8) We wait 20 minutes, while the recording of the files on the "flash drive".

Live usb mode launch

In BIOS, select the loading from the USB flash drive ("Boot" menu - boot option #1 - uEfi disk), save the settings (F10) and load from it.

Options for choosing the "Persistence" mode.

LiveUSB loading menu in various versions of MX Linux and Antix may differ, but the points are approximately the same.
To select the desired mode in the initial menu of the loading USB disk, select the Russian language and item "Extended options" ( "Advanced options") - "Параметры сохранения" ("perSistence Option ").

Persistence modes with the preservation of the state in the RAM
and / or for the USB medium section

The name of the regime Storageroot_fs Хранение homE_FS Type Preservation of changes Speed ​​of work
PErsist_all ОЗУ <=> USB flash USB flash Динамический "/" в ОЗУ; статический /homE on the storage device At will* Low
PErsist_root ОЗУ <=> USB flash ОЗУ <=> USB flaSh Dynamic At will* High
PErsist_static USB flash USB flaSh Static Immediately Low
P_STatic_root USB flash USB flaSh Static Immediately Low
PErsist_home нет USB flaSh Static Immediately Low

* when starting PErsist_saVE or with a positive response to the question of maintaining changes in the FS during the rebooting of the PC.

Options for "economical" installation mode for a hard drive ("frugal ")

The regime of economical installation allows you to reduce the required volume of the hard disk section by 4 times. Since the data is stored in compressed form (SQSHFS), unlike detailed programs (on Ext4). For example, if the OS requires 12 GB of the root OS ( /Bin, /Boot, /ETC, /LIB, /LIB64, /SBIN, etc.), then when using frugaL-section requires the same size as the initial installation carrier has, i.e. 2-3 GB.

Modes while maintaining the system into a special section on a hard drive (Frugal)
(It is used if the hard drive is available and the ability to create an empty section on it).

Also, winning speed compared to USB due to the reading speed when contacting HDD / SSD.

The name of the regime Storageroot_fs Хранение homE_FS Type Preservation of changes Speed ​​of work
frugal_persist ОЗУ <=> НЖМД спец. раздел НЖМД Динамический root - НЖМД - статический HomE At will* High
frugal_rOOT RAM <=> NZHMD RAM <=> NZHMD Dynamic - NZHMD At will* Very high
frugal_staTIC specialist. Section of NZHMD specialist. Section of NZHMD Static - NZHMD Immediately High
F_STatic_rOOT specialist. Section of NZHMD specialist. Section of NZHMD Static - NZHMD Immediately High
frugal_homE No specialist. Section of NZHMD Static - NZHMD Immediately High
frugal_only нет нет Статический
Без сохранения homE
No ?

* when starting PErsist_saVE or with a positive response to the question of maintaining changes in the FS during the rebooting of the PC.

The similarity of PE modesrsistence и frugaL.

As can be seen from the schemes above, the modes are similar. Just frugal is used to save on a hard drive.

PErsistence - USB FrugaL - HDD
PErsist_all frugal_perSIST
PErsist_root frugal_rOOT
PErsist_static frugal_staTIC
P_STatic_root f_static_rOOT
---- frugal_only

The difference is PErsistence / frugal от режима toram

In the moderam, included through the menu of additional options (F6) , the contents of the boot USB. The carrier before starting the OS is loaded into RAM (RAM):

  • when turning on toram - может быть долгое копирование с носителя USB 1.1 в ОЗУ, но затем загрузочный диск можно вытащить (когда светодиод флешки перестанет мигать)
  • with the simultaneous use of the flag toram и динамического способа persist_root наблюдается отличная отзывчивость системы (см. измерения скорости в конце статьи).

What is the mode forram?

1) For example, if the PC has a very slow USB 1.0 port and a lot of RAM, at the beginning of the work you can load the entire carrier in memory in 30 minutes = 2100 MB / 1.2 MB / s., But then to engage in the system (installation and configuration) will be more pleasant, the system will work quickly.
2) for maximum speed of the OS in the "PErsist_rOOT ".

Another way to create a system on a USB with "persistence".

In the installed MX Linux andantiX есть программа live-usb-maker (В загруженной ОС antiX / MX Linux - меню "Пуск" - "MX Инструменты" - "Создание USB носителя". Эта программа - та же, что упомянутый выше MX_Live_USB_Maker... AppImaGE, but as part of the operating system.

Changing the "resistance" mode after installing the system on liveUSB

Preservation of "resistance" settings is used either when choosing a menu item grubsave и запуске загрузки с USB носителя с помощью первого пункта верхнего уровня меню. Либо при помощи F8 в главном меню - SaVE (save changes).

Static "resistance" can be replaced with dynamic in the initial load menu (blue window):

  • Change the method PErsistence / frugal in menu F5
    *Save the setting "Expanded options" ( "Advanced options") - Параметры сохранения - grubsaVE
  • Carry out the OS (upper, first loading menu item).

Regime compatibility

To make files in the home directory, you need to consider the compatibility of options when changing the mode FrugaL.

When starting with Live USB, modes are compatible:

  • PErsist_static <=> persist_aLL
  • p_static_root <=> persist_rOOT

When starting from a hard drive, the modes are compatible:

  • F_STatic_root <=> frugal_rOOT
  • frugal_home <=> frugal_static <=> frugal_perSist

What is remastering and why is it needed?

With remaster of changesrootfs, связанные с установкой пользователем программ, переносятся в состав загрузочного livecd. Например, Вы установили новую программу - браузер Chromium и обновления для пакетов ОС. На разделе rootfs, где хранятся изменения файловой системы относительно исходного варианта LiveUSB, увеличилось использование диска на 200 Мбайт и при загрузке с динамическим типом "стойкости" будет тратиться время при старте компьютера на чтение в ОЗУ. Ремастеринг сокращает используемый размер диска (с 200 до 20 Мбайт), интегрируя браузер Chromium и обновления в сам LiveUSB, возвращая LiveUSB отзывчивость, скорость работы. То есть процесс ремастеринга похож на создание "сборок", но под свои нужды. Время, необходимое на ремастеринг - примерно 20-30 минут на среднем ПК (требуется много ядер c высокой тактовой частотой). Для слабых ПК вроде eeePC / Intel Atom ремастеринг можно выполнять на более мощных ПК (AMD Phenom, Athlon, Ryzen 3, Ryzen 5 или Intel Core i3 / i5 / i7.

How to launch remaster?

In the "Start" menu - "MX TOOLS" - "remasting control center" Press the "remaster" .

How to configure file sizesrootfs и homEFS after installation?

Method number 1

  • Immediately after installing the system, you can go to the "Remaster Management Management Center" and set file sizesrootfs и homefs в меню "Настройка сохранения данных". После перезагрузки рекомендую удалить временные файлы bak с помощью этой же программы (меню обслуживание).

Method number 2.

  • If the initial sizerootfs был выбран неправильно - загрузить любую ОС, кроме данной и с носителя в sudo nemo удалить файл rootfs. При следующем запуске antiX или MX Linux с опциями persistence или frugal, будет задан вопрос о создании нового файла rOOTFS, the size of which can be made to others.

How to specify the dimensions correctlyrootfs и homefs, файла swaP.

  • rootfs - от 400 МБ до 3 ГБ (при ремастеринге создаётся файл rootfs.new, so you can distinguish more than 3 GB. With ordinary actions, no more than 80 MB is stored in the file, so 200-400 MB is enough.
    * Home * - From 200 MB to 1 GB (you can even more, up to 10 GB, but this makes no sense - the boot "flash drive" is not designed to download large volumes from the Internet)
    SWap** - 200 МБ (минимальный объём, т.к. swaP is practically not used).

How to change the way to preserve the state of manual / automatic / semi -automatic?

  • Introduce the menu in the search bar "rem" - "MX центр ремастеринга" - 4-й пункт "Настройка сохранения данных" - Save-mODE - I recommend the option ** 2 semi -automatically " - OK.

How to save the condition before rebooting or turning off the PC?

If the Persistence configuration indicates automatic maintenance of the condition, during the rebooting the message is not issued. If the paulumatic preservation of the condition, the user can decide whether to maintain the condition (it takes about 80 seconds) or not (complete the work of the OS immediately).
If you answer " n " (no) - the condition of the session will not be preserved, " y " (yes) - conditionrootfs и homE on the storage device will be updated.
Positive answer 'y' about the need to save the session

Also, the condition can be saved in Start - MX tools in the application "remoster control center" - the first item "preservation of condition" .

Пароль по умолчанию для пользователя demo я делаю такой же - demo

Choose

  • Action "Root: Create the preservation of the root folder" - ok; Size - 100 MIB. (indicate at will)
    *action "HomE: Create the preservation of the home folder " - ok: size: 100 mib. (indicate at will)

(The size of the home folder can be changed in the same menu and in the future).

The 1 GIB file creation time is several minutes, 100 MB is a few seconds. At the end, the window was displayed that the file was successfully created.

В версии MX 23.3 при завершении работы можно сохранить сеанс автоматически при завершении работы - галочка "Сохранить сеанс"., which is equivalent to the actions described above in the "remoser control center".

Distributive bug 23.1_minimaL.

Assembly MX Linux 23.1 "minimal " not laid out on Official site mxlinux.org, this is the so -called option from / for "Community ", i.e., the minimum assembly only with the most necessary, created to the requests of users:MX-Minimal на SourceForGE.
В сBroke "minimal" есть ошибка - при запуске не загружается boot меню grUB2. The message is displayed:

"GFXBOOT.C32 not A COM32R IMAGE" .

Here you need to enter a word from the keyboard
grub
And press Enter .

Comparison of the speed of work with various options for "resistance" person

Completed a comparison in the scenario of use:

  • Launch of the OS
  • launch of the browser Mozilla Firefox and automatic opening of a home web page
  • Completion of OS work without saving Rootfs.

    Persistence methods are sorted by speed:

Method Loading OS, min: sec Launch Firefox, min: sec Completion of OS, min: sec
PErsist_root + toram 3:40 0:05 0:10
PErsist_rOOT 2:25 0:16 0:15
PErsist_aLL 2:40 5:13 0:57
PErsist_homE 2:13 4:38 0:48
P_STatic_rOOT 5:30 4:30 3:30
PErsist_staTIC 9:00 10:00 4:47

When using persist_root + toram нет ощущения, что запуск ОС произведён с флешки, браузер и веб страницы открываются мгновенно.

Comparison of the speed of work with various options for "perseverance" FrugaL.

Completed a comparison of the use script:

  • Launch of the OS

The launch of a browser or office text editor occurs at the same speed of 9-13 seconds.

methods frugal are sorted by speed:

Method Loading OS, min: sec
frugal_staTIC 0:52
F_STatic_rOOT 0:53
frugal_homE 0:55
frugal_perSIST 1:38
frugal_rOOT 1:40

Thus, the optimal launch mode from the hard drive is Frugal_staTIC

How to save changes to USB?

in versions until 23.3:
If the "semi -automatic" method of conservation is included, the question will be displayed before reloading in the text window whether to save or not. To save you need to press Enter.

If the "automatic" method of conservation is used, the changes will be recorded on USB without questions when rebooting or turning off the PC.

Recording changesrootfs и homefs из ОЗУ на флеш накопитель можно выполнить досрочно при помощи команды persist-saVe:

sudo persist-saVe

in version 23.3
At the end of the work, install the "Save the condition" checkbox.

Loading OS with USB

The selected flash drive modes are preserved and the main menu is not necessary to configure.
Start the start of the system with a flash drive.
At the first inclusion, it will be proposed to change the user password:

User Root.
New passworD:
(Enter the new Root user password)

Then:

DEMO user
New passworD.
(Enter the new Demo user password)

ПосLe what - in the text mode will be requested by the conservation moderootfs - рекомендую полуавтоматический "2. Semi-AutomaTIC ".

Creating a new user

At the first launch, the system will load into the profile of the user DEMO.
You can add another user with a command

sudo useradd -m user
sudo passwd user

Then we retain the condition of the section of the root folder Root, as written above.

User change: click on the "Start" menu on the icon with the image of the output and press "go out". In the invitation window menu, select user No. 2 - user and his password - enter.

After loading the desktop, you can continue to work in the OS or complete the work. At the end: Put the "Save the session" box and press the "Turn off" button.

Accumulation and reduction of changes

Changes in the system during work are not written in the image, but only in foldersrootfs (различия операционной системы) и homefs (изменения домашней папки пользователя). Когда в системе накопится много изменений, использование этих разделов возрастет. Для rootfs разработчик предусмотрел режим "ремастеринг", который добавит накопленные изменения в образ, что сократит использование пространства файла rootfs. Сократить размер домашней папки - удалить ненужные файлы которые были скачанные в неё (например, очистить кеш браузера). Ремастеринг - рискованная процедура, т.к. LiveUSB может стать не запускаемым. В 99% ремастеринг не требуется, т.к. выгодно иметь оригинальный образ linuxfs и изменения к нему в файлах rootfs / homefs. При этом, можно делать резервные копии и даже пересылать по почте сжатые файлы rootfs / homEFS.

Launch of the regime frugal without the use of booting liveUsb

This will be described in next article - параграф "Загрузка с жесткого диска (НЖМД) antiX / MX Linux с режимом FrugaL ".

Links:
Download ISO files MX Linux from the sitemxlinux.orG
Download ISO MX Linux from SO siterceForger
Loading ISO Linux Antix files
Documentation: Installation Persistence
Documentation: Installation frugaL.
Documentation: Remastering

Last amendment of the document: 24.12.2024