Bug 1225348

Summary: [Agama][Milestone8+] Storage proposal allows adding swap partition for Micro OS (after switching from TW to MicroOS)
Product: [openSUSE] openSUSE Tumbleweed Reporter: Lukas Ocilka <locilka>
Component: InstallationAssignee: E-mail List <yast2-maintainers>
Status: VERIFIED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: aschnell, jlopez
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Screenshot: Adding swap allowed for MicroOS
YaST logs
Screenshot: Adding swap - the defaults

Description Lukas Ocilka 2024-05-27 11:41:29 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.
Comment 1 Lukas Ocilka 2024-05-27 11:41:58 UTC
Created attachment 875129 [details]
YaST logs
Comment 2 Lukas Ocilka 2024-05-27 11:42:39 UTC
Created attachment 875130 [details]
Screenshot: Adding swap - the defaults
Comment 3 Stefan Hundhammer 2024-05-27 12:37:57 UTC
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)
Comment 4 Stefan Hundhammer 2024-05-27 12:41:38 UTC
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:~ #
Comment 5 Stefan Hundhammer 2024-05-27 12:42:58 UTC
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.
Comment 6 Stefan Hundhammer 2024-05-27 12:56:43 UTC
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.
Comment 7 Stefan Hundhammer 2024-05-27 13:10:20 UTC
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.
Comment 8 Arvin Schnell 2024-05-27 13:51:10 UTC
See bug #1161076: expert partitioner allows mount point "swap" for ext4
Comment 9 José Iván López González 2024-05-27 14:01:26 UTC
The list of product mount points was read too early, see https://github.com/openSUSE/agama/pull/1264.
Comment 10 Lukas Ocilka 2024-05-28 06:47:43 UTC
Ivan, your fix works as expected. I can now only add / or /var
Thx :)