No capability to remove boot media with a savefile
No capability to remove boot media with a savefile
I am not entirely sure how to submit a bug report, but here goes.
Often I find it very handy to be able to boot a persistent Linux system to RAM from a thumb drive, then remove the thumb drive and use the system like normal until I need to save a file to it or save the session's changes to the persistence file, which is usually on shutdown. It seems logical to me that there should be a way to remove the boot media after booting to RAM, and still be able to use a persistence file without having to create a module with any changes each time a change is made.
I use MX Linux pretty extensively with a similar setup to what Porteus has to offer. I boot from a thumb drive with a copy to RAM cheatcode and a persistent savefile. However, it is setup only to save to the savefile on shutdown, so I am able to remove the thumb drive and use the system like normal until I decide to shutdown. The system even asks whether the drive is plugged in and whether or not I wish to save that session, and then searches for the savefile partition by UUID. However, it takes at least a minute even on an extremely fast thumb drive to copy all 2.5 GB into RAM and boot, and I would like to switch to Porteus with a similar setup, where I can copy a very similar system to RAM and boot in under 30 seconds.
I have found that I can achieve something very similar to this setup if I pass the changes=EXIT:/path_to_savefile boot code. However, even though this tells the system I only want to save changes on shutdown, the system still won't release the drive to be unmounted. I found several other topics where this is also the case. Here's three in particular:
Cheatcodes and removing USB
[Solved] Newbie - Remove CD/USB after booting
Caja - Unmount USB stick failed
First, if there is a way to release the thumb drive and still have a persistent file on it already, please enlighten me! I would love to find out this is already a capability.
Otherwise, I suppose this is less a bug report than a feature request. I may be the only one who wants this feature, but I'd be surprised if there aren't others who would benefit from this. Also admins feel free to move this topic if this is the incorrect location.
Thanks!
Often I find it very handy to be able to boot a persistent Linux system to RAM from a thumb drive, then remove the thumb drive and use the system like normal until I need to save a file to it or save the session's changes to the persistence file, which is usually on shutdown. It seems logical to me that there should be a way to remove the boot media after booting to RAM, and still be able to use a persistence file without having to create a module with any changes each time a change is made.
I use MX Linux pretty extensively with a similar setup to what Porteus has to offer. I boot from a thumb drive with a copy to RAM cheatcode and a persistent savefile. However, it is setup only to save to the savefile on shutdown, so I am able to remove the thumb drive and use the system like normal until I decide to shutdown. The system even asks whether the drive is plugged in and whether or not I wish to save that session, and then searches for the savefile partition by UUID. However, it takes at least a minute even on an extremely fast thumb drive to copy all 2.5 GB into RAM and boot, and I would like to switch to Porteus with a similar setup, where I can copy a very similar system to RAM and boot in under 30 seconds.
I have found that I can achieve something very similar to this setup if I pass the changes=EXIT:/path_to_savefile boot code. However, even though this tells the system I only want to save changes on shutdown, the system still won't release the drive to be unmounted. I found several other topics where this is also the case. Here's three in particular:
Cheatcodes and removing USB
[Solved] Newbie - Remove CD/USB after booting
Caja - Unmount USB stick failed
First, if there is a way to release the thumb drive and still have a persistent file on it already, please enlighten me! I would love to find out this is already a capability.
Otherwise, I suppose this is less a bug report than a feature request. I may be the only one who wants this feature, but I'd be surprised if there aren't others who would benefit from this. Also admins feel free to move this topic if this is the incorrect location.
Thanks!
Porteus 5.0. I'm still learning linux. I hate Big Tech spying on me and I like open source. I am really enjoying Porteus. I keep it on a thumb drive and I copy to ram in less time than it takes Windows on my hard drive to boot up.
No capability to remove boot media with a savefile
well,if i have understand you can use the root of the usb key to save a temporary file because is the only writeable place and if you remove the key is archived,and you can work with it after...
No capability to remove boot media with a savefile
If I understand you correctly @beny, I believe you are saying that after booting and copying to ram with the changes=EXIT:/path/to/savefile boot code, the system will remember (archive) the drive somehow, and one could remove the drive hot (hopefully won't catch it in a write). Later, before shutting down, the drive can be reinserted and on shutdown (because of the "archive") it should remember and use the drive to write the changes. Please correct me if I am incorrect in this interperetation.
Unfortunately, I have been unable to make this work.
After hot removing the drive, the system remains usable as expected. After making some change such as creating a file on my desktop, I reinserted the drive, waited a minute, and shutdown. The shutdown dialog acted as though everything worked okay, and even prompted saying it was writing changes, but after reboot, none of the changes persisted. I am able to replicate this behavior.
I tried mounting the drive after reinserting it, but strangly enough I was unable to test that because within a minute of mounting it, my graphical interface stopped working almost completely. I believe some of the kernel was still operational, because I was able to force it into init 3 (using CTRL + ALT + F3) but none of my logins (including root) worked. I am able to replicate this behavior.
I'd like to echo the sentements of @Mikie in his thread Unable to remove boot media and ask what is the purpose of the changes=EXIT... code if the drive cannot be removed in the interum? I may be entirely off track trying to use it in this way but I can't think of any other reason for it.
Thank you for any advice,
James
PS. After posting I found the Development topic. Apologies for posting this in the wrong thread.
Unfortunately, I have been unable to make this work.
After hot removing the drive, the system remains usable as expected. After making some change such as creating a file on my desktop, I reinserted the drive, waited a minute, and shutdown. The shutdown dialog acted as though everything worked okay, and even prompted saying it was writing changes, but after reboot, none of the changes persisted. I am able to replicate this behavior.
I tried mounting the drive after reinserting it, but strangly enough I was unable to test that because within a minute of mounting it, my graphical interface stopped working almost completely. I believe some of the kernel was still operational, because I was able to force it into init 3 (using CTRL + ALT + F3) but none of my logins (including root) worked. I am able to replicate this behavior.
I'd like to echo the sentements of @Mikie in his thread Unable to remove boot media and ask what is the purpose of the changes=EXIT... code if the drive cannot be removed in the interum? I may be entirely off track trying to use it in this way but I can't think of any other reason for it.
Thank you for any advice,
James
PS. After posting I found the Development topic. Apologies for posting this in the wrong thread.
Last edited by KingJames on 03 Aug 2023, 11:57, edited 1 time in total.
Porteus 5.0. I'm still learning linux. I hate Big Tech spying on me and I like open source. I am really enjoying Porteus. I keep it on a thumb drive and I copy to ram in less time than it takes Windows on my hard drive to boot up.
- Ed_P
- Contributor
- Posts: 8908
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
No capability to remove boot media with a savefile
If you want to remove the USB drive don't use the changes= cheatcode pointing to a file on the drive. A simple solution to a simple problem.
If you want to save files after the USB drive has been removed save them to a different drive. Of if you want/need to save files to the USB drive after it has been removed, remount it and save your file(s) to it either manually or with a script. A script you may find useful is posted here: Find Files in -specific- folders...
It's purpose is to reduce the writes to the USB drive which makes running the system faster and reduces the wear on the USB drive which helps extend it's life.
If you want to save files after the USB drive has been removed save them to a different drive. Of if you want/need to save files to the USB drive after it has been removed, remount it and save your file(s) to it either manually or with a script. A script you may find useful is posted here: Find Files in -specific- folders...

No capability to remove boot media with a savefile
Oh, that makes sense. Thank you for the info. I'll give the scripts a look.
Thank you,
James
Thank you,
James
Porteus 5.0. I'm still learning linux. I hate Big Tech spying on me and I like open source. I am really enjoying Porteus. I keep it on a thumb drive and I copy to ram in less time than it takes Windows on my hard drive to boot up.
- Rava
- Contributor
- Posts: 5424
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
No capability to remove boot media with a savefile
If by "hot remove" you mean remove the file without umounting?
That most likely won't work. Let's presume the following
Code: Select all
sda internal hard drive
sdb USB thumbdrive used for the live system (boot, save changes)
sdc another USB drive, added later.
When your setup is like so:
Code: Select all
sda internal hard drive
sdb USB thumbdrive used for the live system (boot, save changes)
Even when your system has no internal drive and you only have
Code: Select all
sda USB thumbdrive used for the live system (boot, save changes)
Therefore when the live system wants to write to e.g. /mnt/sda1/whatever (an in the last example) it fails since that designation is no longer valid.
So, when ou live OS doen't support unmounting the boot drive and mounting it later on by itself, seems you are out of luck, at least with this "hot unplug" attempt, when indeed by "hot remove" you meant remove the file without unmounting.
Added in 8 minutes 50 seconds:
Cave! Be aware that most likely in /home there are quite some files you do not want to save, e.g. the often quite large ~/.cache/ .
There are newer versions of creating a save file that omits many such folders, but since I not use save-on-exit I do not recall out of the box where they are on the forum.
The size of ~/.cache/ depends on how the program got used, e.g. your browser has almost nothing in there, but it could go up massively after you visited many sites, especially when you ot shut down your browser prior using the save-on-exit script.
Cheers!
Yours Rava
Yours Rava
- Ed_P
- Contributor
- Posts: 8908
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
No capability to remove boot media with a savefile
Yes and to address that there is the /etc/changes-exit.conf file.
These are folders I'm omitting saving:
Code: Select all
!/root/.local/share/Trash/
!/root/.cache/thumbnails/normal
!/home/guest/.local/share/Trash/
!/home/guest/.cache/thumbnails/large
!/home/guest/.cache/thumbnails/normal
!/home/guest/.cache/mozilla/firefox/ple67xm3.default-release/thumbnails/
!/home/guest/.cache/mozilla/firefox/ple67xm3.default-release/cache2/
!/home/guest/.mozilla/firefox/Crash?Reports/pending/
!/home/guest/.mozilla/firefox/ple67xm3.default-release/datareporting/archived
!/home/guest/.java/deployment/cache/6.0/
!/home/guest/.config/microsoft-edge-beta/Default/
!/home/guest/.config/microsoft-edge-beta/Edge?Shopping/
!/home/guest/.cache/microsoft-edge-beta/Default/Cache/
- Rava
- Contributor
- Posts: 5424
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
No capability to remove boot media with a savefile
I do not see any use of /etc/changes-exit.conf file in the code you gave in your answer:
But please enlighten me where I overlooked the use of /etc/changes-exit.conf in that code.fanthom wrote: ↑21 Oct 2012, 08:11Code: Select all
#!/bin/sh # folders to check (tweak for your needs): folders="/etc /home /root /opt /usr /var" # gather all files in one place: mkdir /tmp/backup_folder find $folders | xargs -I {} cp -a --parents {} /tmp/backup_folder #create the module on your desktop with current date: dir2xzm /tmp/backup_folder $HOME/Desktop/changes-`date +"%m-%d-%y"`.xzm rm -r /tmp/backup_folder
Cheers!
Yours Rava
Yours Rava
- Ed_P
- Contributor
- Posts: 8908
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
No capability to remove boot media with a savefile
I don't see the name of the file you posted
but these postings may help you:


And if you check your /etc/changes-exit.conf file at the top you will see this which may help enlighten you also.
Code: Select all
# Folders listed in this config file will be saved during reboot and shutdown when 'changes=EXIT:' cheatcode is used.
# Folders starting with '!' are omitted. This is useful if you want to save whole folder except for particular subfolder(s).
# An example is inclued in default config below: Porteus will save whole /var folder except for /var/run and /var/tmp subfolders.
# Other example: "!/home/guest/.mozilla/firefox/c3pp43bg.default/Cache" will skip saving of Firefox caches from guest account.
# Thanks to Rava for suggesting implementation of '!' exceptions in /etc/changes-exit.conf.

- Rava
- Contributor
- Posts: 5424
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
No capability to remove boot media with a savefile
When you refer to me, I just quoted the link you gave above verbatim. It was the info you shared and what was claimed by you simply was not to be found in the link you provided.
Cheers!
Yours Rava
Yours Rava
- Ed_P
- Contributor
- Posts: 8908
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
No capability to remove boot media with a savefile
Two different discussions. One for changes=EXIT, one for saving files without changes=EXIT. changes=EXIT uses the changes-exit.conf file, saving files without it doesn't.
Quoting a posted link and posting the contents of the link are not the same thing which can be confusing. If you could code a way for the posted code to use the .conf file, or a similar one, that would be great.
Quoting a posted link and posting the contents of the link are not the same thing which can be confusing. If you could code a way for the posted code to use the .conf file, or a similar one, that would be great.

- Rava
- Contributor
- Posts: 5424
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
No capability to remove boot media with a savefile
What precisely is the difference. Both refer to the very same data.
Better ask someone who uses save-on-exit since I never used it, not even once.
But you confuse me, when you say there is a config that defines what files/folders should be omitted in the changes-module, then you already must have a script that uses that technique and very confg, no?
Cheers!
Yours Rava
Yours Rava
- Ed_P
- Contributor
- Posts: 8908
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
No capability to remove boot media with a savefile
Same info, different views.
Yet you were involved in a discussion on a way to improve it that got implimented.
I was referring to the module that the OP's changes=EXIT cheatcode creates. And it would be very helpful to many if you could tweak the fanthom code you posted to exclude folders like you did for the changes=EXIT code. Your coding skills are much better than mine.
- Rava
- Contributor
- Posts: 5424
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
No capability to remove boot media with a savefile
Yes? And? You made it sound that this is some kind of bad thing?
I still do not get it.
To quote you:
That sounds like there is aleady some kind of solution. As you wroteEd_P wrote: ↑30 Aug 2023, 06:00Yes and to address that there is the /etc/changes-exit.conf file.
These are folders I'm omitting saving:Code: Select all
!/root/.local/share/Trash/ !/root/.cache/thumbnails/normal !/home/guest/.local/share/Trash/ !/home/guest/.cache/thumbnails/large !/home/guest/.cache/thumbnails/normal !/home/guest/.cache/mozilla/firefox/ple67xm3.default-release/thumbnails/ !/home/guest/.cache/mozilla/firefox/ple67xm3.default-release/cache2/ !/home/guest/.mozilla/firefox/Crash?Reports/pending/ !/home/guest/.mozilla/firefox/ple67xm3.default-release/datareporting/archived !/home/guest/.java/deployment/cache/6.0/ !/home/guest/.config/microsoft-edge-beta/Default/ !/home/guest/.config/microsoft-edge-beta/Edge?Shopping/ !/home/guest/.cache/microsoft-edge-beta/Default/Cache/
Highlighing by me.
The way you phrased that make it sound like /etc/changes-exit.conf does already somehow control the omission when creating the save-at-exit-changes.xzm module. To be able doing so there must a a script based solution already available. Maybe it's in initrd?
What else could your line "to address that there is the /etc/changes-exit.conf file" mean?
- Ed_P
- Contributor
- Posts: 8908
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
No capability to remove boot media with a savefile
Yup. It does and has for about 10 yrs now.
Agreed but I have no idea where. I'm sure it's been discussed, probably when it was implemented.