to save or not to save: machine-id

Post tutorials, HOWTO's and other useful resources here.
rych
Warlord
Warlord
Posts: 716
Joined: 04 Jan 2014, 04:27
Distribution: Porteus 5.0 x64 OpenBox
Location: NZ
Contact:

to save or not to save: machine-id

Post#1 by rych » 27 Sep 2024, 10:07

Using changes=EXIT: we can specify folders (not individual files) to be saved in the /etc/changes-exit.cfg, for example,
/bin
/etc
/home
/lib
/lib64
/opt
/root
/sbin
/usr
#Let's try to exclude var completely and see what happens
#/var
So, which live folders do we want on the next reboot and which are just easily reproducible junk, like cache etc.?

As you can see, I've excluded (omitted) the /var folder. Something broke this week. I've discovered one file which must be saved at least once, (or exactly once): /var/lib/dbus/machine-id. See https://unix.stackexchange.com/question ... machine-id and https://dbus.freedesktop.org/doc/dbus-uuidgen.1.html

If that file doesn't exist, then a new, randomly different machine-id is generated every reboot! Now, some of the host-limited licensed software will consider this a different machine and you'd have to somehow re-activate it each time! So, at least that file, that subfolder of the /var is better to be persistent.

User avatar
Ed_P
Contributor
Contributor
Posts: 8572
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

to save or not to save: machine-id

Post#2 by Ed_P » 27 Sep 2024, 17:38

2 Simple solutions: :)

1. Don't reboot.
2. Don't exclude the /var/lib/dbus folder.
2a. Include /var
2b. Exclude the 12 non /var/lib/ folders and the 21 non /var/lib/dbus folders you don't want. ! /var/... & !/var/lib/....

Personally I only exclude the !/var/run & !/var/tmp folders. :happy62:

User avatar
AcnapyxoB
Shogun
Shogun
Posts: 205
Joined: 24 Dec 2014, 10:15
Distribution: Porteus 5.01
Location: Planet Earth

to save or not to save: machine-id

Post#3 by AcnapyxoB » 27 Sep 2024, 18:22

rych wrote:
27 Sep 2024, 10:07
So, which live folders do we want on the next reboot and which are just easily reproducible junk, like cache etc.?
Personally I use a different approach.
Instead of eliminating folders I add the ones that I need.
for example network settings, passwords, firefox and thunderbird:

Code: Select all

/etc/NetworkManager/system-connections/
/etc/shadow*
/home/guest/.mozilla/
/home/guest/.thunderbird/
!/home/guest/.mozilla/firefox/*.default-release/cache*
!/home/guest/.mozilla/firefox/*.default-release/minidumps/
!/home/guest/.mozilla/firefox/*.default-release/saved-telemetry-pings/
!/home/guest/.thunderbird/*.default/.parentlock
!/home/guest/.thunderbird/*.default/minidumps/
p.s. Because I use an encrypted save.dat file I keep only confidential information on it.
Other (non confidential) stuff I'm saving in modules.
Last edited by AcnapyxoB on 28 Sep 2024, 13:41, edited 3 times in total.
Porteus v5.01 KDE x86_64

reisub
White ninja
White ninja
Posts: 14
Joined: 18 Oct 2016, 16:27
Distribution: 3.2rc3
Location: America

to save or not to save: machine-id

Post#4 by reisub » 28 Sep 2024, 13:24

AcnapyxoB wrote:
27 Sep 2024, 18:22
Instead of eliminating folders I add the ones that I need.
A good approach. :happy62:

User avatar
Ed_P
Contributor
Contributor
Posts: 8572
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

to save or not to save: machine-id

Post#5 by Ed_P » 28 Sep 2024, 19:12

reisub wrote:
28 Sep 2024, 13:24
A good approach.
Indeed. :o

So rych can keep his #/var and just add /var/lib/dbus. :good: A good suggestion AcnapyyxoB. :worship:

I assume with your code example you have deleted, or commented out, the /etc and /home lines in your changes-exit.conf.
AcnapyxoB wrote:
27 Sep 2024, 18:22

Code: Select all

/etc/NetworkManager/system-connections/
/etc/shadow*
/home/guest/.mozilla/
/home/guest/.thunderbird/

User avatar
AcnapyxoB
Shogun
Shogun
Posts: 205
Joined: 24 Dec 2014, 10:15
Distribution: Porteus 5.01
Location: Planet Earth

to save or not to save: machine-id

Post#6 by AcnapyxoB » 29 Sep 2024, 10:39

"Due to the high interest" :D, my complete changes-exit.conf:

Code: Select all

/etc/changes-exit.conf
/etc/NetworkManager/system-connections/
/etc/openvpn/
/etc/shadow*
/home/guest/.cache/keepassxc/keepassxc.ini
/home/guest/.config/FreeTube/profiles.db
/home/guest/.config/keepassxc/
/home/guest/.config/kdeconnect/
/home/guest/.config/VeraCrypt/
/home/guest/.local/share/MikroTik/WinBox/
/home/guest/.mozilla/
/home/guest/.thunderbird/
/home/guest/.wine/drive_c/users/guest/AppData/Roaming/Mikrotik/Winbox/
/var/lib/bluetooth/
!/home/guest/.mozilla/firefox/*.default-release/*Cache
!/home/guest/.mozilla/firefox/*.default-release/cache*
!/home/guest/.mozilla/firefox/*.default-release/minidumps/
!/home/guest/.mozilla/firefox/*.default-release/saved-telemetry-pings/
!/home/guest/.thunderbird/*.default/.parentlock
!/home/guest/.thunderbird/*.default/minidumps/
!/var/lib/bluetooth/*/cache
Porteus v5.01 KDE x86_64

User avatar
Ed_P
Contributor
Contributor
Posts: 8572
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

to save or not to save: machine-id

Post#7 by Ed_P » 29 Sep 2024, 16:16

AcnapyxoB wrote:
29 Sep 2024, 10:39
my complete changes-exit.conf:
So rather than tweaking the Porteus /etc/changes-exit.conf file you replaced it with your own version. :hmmm:
And you save it.
AcnapyxoB wrote:
29 Sep 2024, 10:39

Code: Select all

/etc/changes-exit.conf
:punk:

User avatar
AcnapyxoB
Shogun
Shogun
Posts: 205
Joined: 24 Dec 2014, 10:15
Distribution: Porteus 5.01
Location: Planet Earth

to save or not to save: machine-id

Post#8 by AcnapyxoB » 29 Sep 2024, 17:02

Ed_P wrote:
29 Sep 2024, 16:16
So rather than tweaking the Porteus /etc/changes-exit.conf file you replaced it with your own version.
Yes, exactly :)
Porteus v5.01 KDE x86_64

Post Reply