Posts: 1,445
skidoo
Joined: 09 Feb 2012
#1
Possible to eject pendrive during"live + rootfs persist + toram" session?

During"live boot with semi-automatic rootfs persistence" sessions, I had hoped to use"toram" boot option and then unmount/eject the pendrive
but it seems to eternally remain"in use".

The presence of"mount_if_needed" statements within the persist-save script suggest that unmounting the pendrive (until/unless a save is performed) should be possible. Maybe some"necessary piece of the puzzle" is missing during sessions where the init script does not detect CD (isolinux) boot?

a related point of confusion for me (or, is it a bug?):
Typing"persist-save" at the pre-shutdown command prompt of the antix14-alpha-2 yields an error msg stating"another instance of persist-save is already running".
If a long-running process is really the trigger (vs a flag set during live-init) and it has a file open/locked, that would explain the"in use" status preventing pendrive eject.
Posts: 1,308
BitJam
Joined: 31 Aug 2009
#2
skidoo wrote:Possible to eject pendrive during"live + rootfs persist + toram" session?
Should be if you use dynamic persistence. Of course not if you use static root persistence or home persistence because both of those need to stay mounted to work. It certainly worked when the persistence device was on a separate usb stick. In fact I added code to identify the persistence usb stick by uuid instead of device /dev/name because someone had unplugged it and then plugged it back in after another usb device had been plugged in. The last time I checked, they both worked separately, maybe there is a bug when you use both together (IOW, persistence files and linuxfs file on same device). If the problem is home persistence or static root persistence then maybe you could move those rootfs and homefs files to a /antiX/ directory on a partition on an internal drive. The following boot options let you specify that partition:

Code: Select all

pdev=xxx plab=xxx puuid=xxx
If it is still a problem, you might want to investigate with commands like:

Code: Select all

mountpoint /live/boot-dev
fuser -v -m /live/boot-dev
sudo lsof | grep /live/boot-dev
losetup -a
df -h
During"live boot with semi-automatic rootfs persistence" sessions, I had hoped to use"toram" boot option and then unmount/eject the pendrive but it seems to eternally remain"in use".
We may now be running persist-save at startup (after you've entered new passwords, at least on MX. There was a huge delay in entering passwords on antiX-14 at this stage. Don't know why. I suspect the usually suspects, PAM, UDEV, etc) in order to save the new passwords even if the user forgets to do any kind of a persist-save. This was added recently so maybe it conflicts with toram + eject.
Typing"persist-save" at the pre-shutdown command prompt of the antix14-alpha-2 yields an error msg stating"another instance of persist-save is already running". If a long-running process is really the trigger (vs a flag set during live-init) and it has a file open/locked, that would explain the"in use" status preventing pendrive eject.
I don't know what the pre-shutdown command prompt is.

The persist-save program is never meant to stay running. In Semi-Automatic mode it is supposed to be launched at shutdown and then ask you if you want to save or not. Maybe you had previously launched a it manually and then didn't fully exit it. If it gets killed -9 then it may not have a chance to remove its lockfile. Several programs get mutually locked with persist-save. At least:

Code: Select all

persist-makefs
persist-save
remaster-live
These programs (unavoidably) muck around with your root filesystem. If they were not mutually locked then much badness could ensue. No one should want to run these simultaneously (unless their intent was to damage the system).

Didn't you get a message like:
Another copy of remaster-live or persist-save is running. If you are certain this is not so then delete the file: /live/config/locked and try again.
You can use:

Code: Select all

ps aux | grep [p]ersist-save
to see if another version is running. If you enabled toram then maybe a version is waiting patiently for you to mount the LiveUSB so it can save the new passwords but the output asking about this has scrolled off-screen.