Bugzilla – Bug 1225348
[Agama][Milestone8+] Storage proposal allows adding swap partition for Micro OS (after switching from TW to MicroOS)
Last modified: 2024-05-28 06:47:43 UTC
Created attachment 875128 [details] Screenshot: Adding swap allowed for MicroOS This is about Agama - the not-yet-official installer. The MicroOS product should not allow adding swap as an additional partition, which is does not be default, but when you first select Tumbleweed (and do some partitioning - not confirmed) and then you got to the Product selection and select MicroOS, later Partitioning proposal allows adding swap. This looks like some problem with caching. Especially as although it let's you add the swap partition, but the default filesystem is Ext4 and size is Range from 0 KiB to 0 KiB, which really does not sound like good defaults for swap.
Created attachment 875129 [details] YaST logs
Created attachment 875130 [details] Screenshot: Adding swap - the defaults
I just tried on TW with YaST, and the behavior there is very similar: - It lets me add a new partition as "Data or ISV application", and I can select filesystem type "swap" with mount point /tmp. >> balrog-tw-dev:~ # egrep '\s/tmp' /etc/fstab >> UUID=4850e012-495e-40d3-8b62-ea57e633717d /tmp swap defaults 0 0 >> >> balrog-tw-dev:~ # swapon >> NAME TYPE SIZE USED PRIO >> /dev/sda3 partition 2G 0B -2 >> /dev/sdb1 partition 299M 0B -3 (It's that 300 MiB /dev/sdb1 partition)
It also lets me create a 300 MiB swap partition with mount point /foo. >> balrog-tw-dev:~ # swapon >> NAME TYPE SIZE USED PRIO >> /dev/sda3 partition 2G 0B -2 >> /dev/sdb1 partition 299M 0B -3 >> >> balrog-tw-dev:~ # egrep '\s/foo' /etc/fstab >> UUID=ae2bd017-681f-44d0-b0f0-1ff1eebf6c43 /foo swap defaults 0 0 >> >> balrog-tw-dev:~ # df /foo >> df: /foo: No such file or directory >> >> balrog-tw-dev:~ # grep foo /proc/partitions >> balrog-tw-dev:~ #
It looks like with enough "criminal energy" you can cheat the partitioner into invalid setups, YaST as well as Agama. But then, we do warn the user that the partitioner should only be used by users who know what they are doing.
It also lets me create an XFS with mount point 'swap'. That only fails because it would need 300 MiB to create an XFS filesystem, and I have slightly less than that; it doesn't warn me about it in advance.
We have several layers of sanity checks in the partitioners, both in Agama and in YaST: - On the partitioner UI / storage-ng level - On the libstorage-ng level - When executing the filesystem tools that perform the change On the running system, this isn't so bad: You get an error, and you go back and try again. During installation, however, this may cause the entire installation to fail.
See bug #1161076: expert partitioner allows mount point "swap" for ext4
The list of product mount points was read too early, see https://github.com/openSUSE/agama/pull/1264.
Ivan, your fix works as expected. I can now only add / or /var Thx :)