Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install/Deinstall loop with large ram and 'small' remaining os volume #3

Open
the-moog opened this issue Aug 10, 2024 · 1 comment
Open

Comments

@the-moog
Copy link

swap-file-creator: Release 3:7.0-1
Base OS: Debian 12.5
KickSecure: Not sure...

There seems to be a couple related issues with this package in that maybe it fails to consider
all the ways swap can work, in my case any of:
1: More than one swap partition
2: File based swap partitions
3: LVM based swap volumes
4: More than one disk
5: Swap partitions belonging to other OS
6: Looking in fstab for the best option.

I think some of this may be due to either adopting or getting misinformation from initramfs defaults.
So it could be some sort of site-config+initramfs+this package combination, rather than a single issue.

During offline install it decides it want to install a 22Gb swap partition.
Though the machine already has a >64Gb of swap partitions.
Machine boots, this fails to install, saying the volume is short by 6Gb.
Then
There also appears to be an issue with the way the dependencies are described within the apt package.
When it fails to install it causes other further failures by making itself a dependency of other important
packages. So when it uninstalls itself it uninstalls stuff it should leave alone; Those being about 20 or so
packages related to initramfs, grub, zulu, acpi, cryptsetup, live-boot, rfkill.
When the machine next boots it fails to find those packages and suggests they need 'upgrading', putting them
as well as 'swap-file-creator' back in place, which naturally fails again, and so on.....

This machine has three disks, all on LVM though one is multi boot and shared with more than one OS on it.
The OS partition, indeed only has about 20G free on the OS disk but that is more than enough as most stuff not
required to boot are on other volumes. That disk though it has a lot more space, is shared, and though each
partition has LVM each OS has it's own partition. So, without a time-consuming relocation of the actual data I
can't make it's boot & OS volumes bigger as that means moving the actual partition data.

But what about the actual swap? There are two. Both on LVM. One on the 1TB spinning disk (8Gb) the other
larger one (64G) is on the 2Tb NVME, with the idea that the NVME is fast but costly and wears out.
Anything big enough to require shifting in to virtual memory is likely not needed asap.
These disks have ~250G free and 1Tb+ free respectively.

But it seems it ignores the GUID in for swap in fstab and instead wants to create a new swap within the
unused bit of the shared OS disk (an LVM volume on another 1Tb NVME btw).

So I think the fix here is possibly simple and two part.
1:
Complex way
During install, task if it can re-use the existing swap pointed to by
initramfs.conf and/or fstab (which can get out of synch if you don't care about suspend to disk,)
Detect LVM and boldly use space in another VG
Seek an unused partition write over it, even if it's not identifiable.
Suggest resizing an exisiting partition and/or volume
or,
Simple way quitting with an error and stopping at that.
Then perhaps, either using cli utility or reading a config file, allow the user to tell it what to do?
I think that is perhaps safer than trying to work out what is possible and then destroying data.

2:
Disassociate the dependencies so if it can't install at least the other tools still work. I've not investigated
this actually works, but I doubt most if not all are true dependencies

Here is a log from one of the uninstalls.

Removing acpi-fakekey (0.143-5.1) ... 
Removing acpi-support (0.143-5.1) ... 
Removing acpi-support-base (0.143-5.1) ... 
Removing acpid (1:2.0.33-2+b1) ... 
Job for acpid.socket canceled. 
Removing cryptsetup (2:2.6.1-4~deb12u2) ... 
Removing grub-live (3:5.5-1) ... 
Removing grub-live-initramfs-tools (3:5.5-1) ... 
Removing zulucrypt-cli (6.2.0-1) ... 
Removing libzulucrypt-exe1.2.0:amd64 (6.2.0-1) ... 
Removing libzulucrypt-plugins:amd64 (6.2.0-1) ... 
Removing libzulucrypt1.2.0:amd64 (6.2.0-1) ... 
Removing libzulucryptpluginmanager1.0.0:amd64 (6.2.0-1) ... 
Removing live-boot (1:20230131) ... 
Removing live-boot-doc (1:20230131) ... 
Removing live-boot-initramfs-tools (1:20230131) ... 
update-initramfs: deferring update (trigger activated) 
Removing live-tools (1:20190831.1) ... 
Removing rfkill (2.38.1-5+deb12u1) ... 
Removing swap-file-creator (3:7.0-1) ... 
Processing triggers for libc-bin (2.36-9+deb12u7) ... 
Processing triggers for man-db (2.11.2-2) ... 
Processing triggers for security-misc (3:38.7-1) ...
@adrelanos
Copy link
Member

swap-file-creator: Release 3:7.0-1 Base OS: Debian 12.5 KickSecure: Not sure...

There seems to be a couple related issues with this package in that maybe it fails to consider all the ways swap can work, in my case any of: 1: More than one swap partition 2: File based swap partitions 3: LVM based swap volumes 4: More than one disk 5: Swap partitions belonging to other OS 6: Looking in fstab for the best option.

Not considered indeed. If a user wishes to use these fancy things, then best disable swap-file-creator as per documentation:
https://www.kicksecure.com/wiki/Swap-file-creator#Disable

Uninstallation not required.

Complex detection code for all sorts of different existing complex swap setups would be nice to have but not coming anytime soon, unless contributed.

I think some of this may be due to either adopting or getting misinformation from initramfs defaults. So it could be some sort of site-config+initramfs+this package combination, rather than a single issue.

During offline install it decides it want to install a 22Gb swap partition. Though the machine already has a >64Gb of swap partitions.

The swap button will be removed from Kicksecure's calamares installer. What calamares does isn't required because there is already swap-file-creator. Meanwhile, choose "no swap" in calamares installer. swap-file-creator will be installed anyhow.

Then There also appears to be an issue with the way the dependencies are described within the apt package. When it fails to install it causes other further failures by making itself a dependency of other important packages. So when it uninstalls itself it uninstalls stuff it should leave alone; Those being about 20 or so packages related to initramfs, grub, zulu, acpi, cryptsetup, live-boot, rfkill. When the machine next boots it fails to find those packages and suggests they need 'upgrading', putting them as well as 'swap-file-creator' back in place, which naturally fails again, and so on.....

Not a swap-file-creator issue. It's a meta package issue. Documented here:
https://www.kicksecure.com/wiki/Debian_Packages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants