Bug 483446 - partitionmanger fails to create a valid entry in /etc/fstab when creating new part table and filesystem in one batch
Summary: partitionmanger fails to create a valid entry in /etc/fstab when creating new...
Status: REPORTED
Alias: None
Product: partitionmanager
Classification: Applications
Component: general (show other bugs)
Version: 24.02.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Andrius Štikonas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-13 14:55 UTC by Christian Hartmann
Modified: 2024-03-14 09:49 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Hartmann 2024-03-13 14:55:58 UTC
SUMMARY
partitionmanger fails to create a valid entry in /etc/fstab when creating new part table and filesystem in ONE batch
(new entry is valid when the same operation is done in two steps (or batches))

STEPS TO REPRODUCE
1. attach a new disk without a partition table
2. open partition manager
3. add new partition table, new filesystem and add mount point
4. click on 'Apply'

OBSERVED RESULT
new line in /etc/fstab, missing file system type and/or partition identification.

when trying to mount by LABEL the line is:
LABEL=DUMMY                                 /mnt              defaults   0 0

when trying to mount by UUID the new line is:
New Partition                                    /mnt               defaults   0 0 # Use 'blkid' to print the universally unique identifier for a device; this may

both at the new first line in file, both are missing the file system type (ext4 here)

EXPECTED RESULT
a valid new line in /etc/fstab such as:
UUID=80c16a75-da24-4970-a903-e94dd64bd125   /mnt        ext4   defaults   0 0

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: neon
KDE Plasma Version: 6.0.2
KDE Frameworks Version: 6.0.0

ADDITIONAL INFO:
new entry is valid when the same operation is done in TWO steps (or batches)
Comment 1 Andrius Štikonas 2024-03-13 21:54:19 UTC
The problem is that fstab editing is instantaneous, it's not batched (and I don't think we can batch it) while the other stuff is batched. So by the time you edit fstab, there isn't enough info to put into /etc/fstab. Perhaps we should try to disable fstab editing functionality on new partitions, but it could still be problematic in case of filesystem reformats (when UUID would change) but partition is not new. So I'm unsure about what to do...
Comment 2 Christian Hartmann 2024-03-14 07:09:54 UTC
i don't see the point in adding an entry in fstab that early in a "batched" process of individual steps.  by my observations it is created basically in the first step of the batch. but why? the first step is creating a partition table and in the second step crating the file system.  Both do not require this new entry.  just in the last step, when the new partition shall be set to get automatically mounted on system startup.
Comment 3 Andrius Štikonas 2024-03-14 09:49:33 UTC
(In reply to Christian Hartmann from comment #2)
> i don't see the point in adding an entry in fstab that early in a "batched"
> process of individual steps.  by my observations it is created basically in
> the first step of the batch. but why? the first step is creating a partition
> table and in the second step crating the file system.  Both do not require
> this new entry.  just in the last step, when the new partition shall be set
> to get automatically mounted on system startup.

No, it's not batched at all. It is created when you click OK in fstab editing dialog. Basically when you open fstab dialog, it reads /etc/fstab and when you close it, it writes it back to disk. You don't even need to click apply.