#3649 PR merged: swaps: initialize uuid and label as empty strings

Labels: bug, fixed / solved / done

svlv opened issue at 2026-10-02 12:51:

  • Type: Bug Fix

  • Impact: High (we experienced a system that failed to boot after recovery testing)

  • Reference to related issue (URL):

Description of the changes in this pull request:

The global uuid and label variables set in 230_filesystem_layout.sh are still in scope when 240_swaps_layout.sh runs, so a swap partition with no label inherits the label of the last filesystem processed.

Observed layout, where sda3 has no swap label:

lsblk -o name,fstype,label,mountpoint
NAME   FSTYPE LABEL  MOUNTPOINT
sda
├─sda1 vfat          /boot/efi
├─sda2 btrfs  leap16 /var
└─sda3 swap          [SWAP] <= no label for swap

Yet the generated disklayout.conf records a label for it:
swap /dev/sda3 uuid=cc512737-9cb1-4dfd-88a5-301572587ba7 label='leap16'

Unset uuid and label in 230_filesystem_layout.sh to keep them from leaking into other scripts, and explicitly initialize them as empty strings in 240_swaps_layout.sh to guard against the same problem recurring.

How was this pull request tested?

Ensured that swap label is empty in disklayout.conf:
swap /dev/sda3 uuid=cc512737-9cb1-4dfd-88a5-301572587ba7 label=

codacy-production commented at 2026-10-02 12:52:

Up to standards ✅

🟢 Issues 0 issues >
> > **Results:** > `0` new issues > > [View in > Codacy](https://app.codacy.com/gh/rear/rear/pull-requests/3649/issues) >

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

jsmeix commented at 2026-10-02 13:29:

@svlv
thank you for finding such issues and for your fix!

I fear we have rather many such shortcomings
in particular in the older code parts - but without
the older code parts ReaR would not exist at all.

gdha commented at 2026-10-03 06:39:

@svlv @jsmeix Merged this PR immediately as this was a real bug.


[Export of Github issue for rear/rear.]