Installation: Multiboot options, and CLR_SWAP must be <= 8GiB

Hello I am installing clearlinux from live USB. My requirements:

  • ClearLinux will share one drive with Windows10 and Fedora32.
  • I would like to use hibernate and suspend.

There are several issues that are not clear.

  1. Will I be able to adjust the choices in “Safe Installation” before it takes effect?

  2. It is not clear whether I should reuse the existing 220MB /efi partition used by Windows and Fedora. Will the CLR_BOOT partition be only used as an /efi partition? Or will it accumulate kernels as in fedora /boot partition does? More generally will it require more space over time, or is sharing 100-150MB free space enough?

  3. The installer gives me an error: CLR_SWAP must be <= 8GiB. Is this a fundamental restriction of ClearLinux? How do you support hibernation / suspend-to-disk with larger RAM systems?

  4. In the advanced partition option. I create
    CLR_SWAP linux-swap 64GiB (want to hibernate)
    CLR_BOOT fat32 256MiB
    CLR_ROOT 63.75GiB
    roughly following the directions in
    https://docs.01.org/clearlinux/latest/tutorials/multi-boot/dual-boot-linux.html

Should this work and how? Thank you for your help!

  1. After resizing the swap partition, and closing the partition manager, the installer returns without the CLR_SWAP error, but it now says:
    Warning: No Media Selected. I reselect “Advanced Installation” and click “Partition Media” and the three CLR_??? partitions are still labelled. How do I proceed?

Even if I make a 4GiB swap partition CLR_SWAP, I get the <=8GB error. Perhaps because of an existing 64GB swap partition for another OS ?

Hi Philip,
I would definitely advise against trying to multi-boot 3 OS from the same drive. This scenario is not tested, and the desktop version of Clear Linux is not in active development. Also, as discussed elsewhere on the forum, hibernation is disabled in Clear Linux, so you won’t be able to hibernate even if you do succeed in getting the OS installed.

Chris

What does that mean?
Edit: Forget it. RIP

Thank you for your answer to my question 3b, and for letting me know the untestedness of 3 OSes. Apparently I have been confusing by bringing up too many issues at one time. Here is the first question.

  1. Will I be able to adjust the choices in “Safe Installation” before it takes effect? Or does it proceed automatically once you start that option?

@mhorn can you comment?

Only Advanced Installation allows for the modification of partition sizes.
Safe Installation will use all of the free space on the selected media; creating a small boot and the remaining space for the OS (and a swapfile).
The modification of the disk does not start until the final “Confirmation” of the installation start is selected. All options about the installation are selected first, then the installation proceeds without user interactions.

1 Like

Thank you @mhorn!
My original Question 2 I have found out the answer with a hint of @doct0rHu, who suggested looking at the USB boot partitions.
Answer: CLR_BOOT does not contain kernels.

So the next part of my original question is Question 3[a]:
3[a] The installer gives me an error: CLR_SWAP must be <= 8GiB. Is this a fundamental restriction of ClearLinux?

Just read the source code

I think you can avoid the limit by changing this line, provided that it’s valid uint64.

I had read the source code, as I had indicated at

What I didn’t have time to explore was:

Does the live USB contain all the prerequisites for recompiling the installer on the USB?

No, I don’t think so

The 8GiB limit was put in place intentionally. Mainly to prevent users from wasting space as the primary reason for such a large swap would be hibernation which is not supported.

You can override this limitation by adding the command line argument --skip-validation-size, no need to rebuild the application. You could also change this in the system configuration file for the installer by adding skipValidationSize: true to /usr/share/defaults/clr-installer/clr-installer.yaml.

3 Likes

I installed CL without a swap partition. How do I add a swap partition permanently? changes made through swapon / swapoff do not persist across reboots. /etc/fstab is not the CL way.

What is the right way to add a swap partition permanently?

Have a look here.

I believe /etc/fstab is fine, but if you want to bypass the use of that for purity sake, you would need to produce the same end result. That is to say, look at what systemd’s fs-tab-generator does, in order to produce systemd native unit files for swap/mounts:
https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html

Basically it parses /etc/fstab and produces the relevant systemd unit files to mount and prioritise swap and other mounts.

If you are going to the trouble, perhaps see if you want to go for zram or zswap (the latter still requires a backing swap partition/file), rather than solely a plain swap file or partition.

2 Likes

@SimpleOne, thank you for your suggestions of fstab generator and zram and zswap. These options had not appeared in our searches.

Your answer makes me wonder whether the systemd solution has really any advantage over /etc/fstab: They both would need to be reconfigured after any install; it is not clear that either is “less stateless” than the other. /etc/fstab is familiar and well documented, so I’ll probably go with that.

Thank you again.

No worries, hope it helps. The stuff below is probably not news to you @philip1, it’s just some background for anyone reading this in the future.

There’s really no great reason to bypass the use of /etc/fstab for most user modifications to mounts (unless you particularly enjoy playing with systemd unit files…)

In terms of user modifications to Clear, /etc (and it’s subdir’s and files) are for exactly that. Clear itself has no dependence on the contents of /etc to boot the core OS. If a system is rendered unbootable by changes you make, you can just delete /etc and reboot and most of the time the OS will come back (unless you do something really tragic; like overwrite the ESP with random data or something).

Whilst that isn’t all that there is to the whole ‘stateless’ thing, it’s an example of where user config is isolated from core OS config. The result of that separation is that it’s our problem to maintain, backup (and restore as needed) our own user modifications/overrides. That’s pretty simple, just backup (and version, if you are keen) your /etc directory, and any other user content (typically /home, but perhaps /opt and so forth).

In your case, you are correct, it’s basically the same amount of work to perform a restoration. You have to restore files into /etc, it’s just a question of what files. You either restore /etc/fstab and let the OS dynamically recreate the systemd unit files, or you would restore the relevant unit files directly (which you could have written yourself in the first place if you were keen enough).

In essence, unless you don’t trust fs-tab-generator to do the job, or you have something too complex for it to handle, then you may as well stick with that which is well documented as you say, the path of least resistance :slight_smile:

3 Likes

Thank you @SimpleOne, I searched the forum before asking, and had found the following advice:

  1. Use fstab!
  2. CL does not use fstab!

Thank you for a clear and thoroughgoing answer that clarifies the earlier advice.