Merge pull request #92 from nevesenin/master

Fix "resizing" wrong partition when having two disks
This commit is contained in:
Travis Staton 2025-03-17 10:59:51 -04:00 committed by GitHub
commit 3e8100d5e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -248,7 +248,7 @@ in
# Figure out device names for the boot device and root filesystem. # Figure out device names for the boot device and root filesystem.
rootPart=$(${pkgs.util-linux}/bin/findmnt -n -o SOURCE /) rootPart=$(${pkgs.util-linux}/bin/findmnt -n -o SOURCE /)
bootDevice=$(lsblk -npo PKNAME $rootPart) bootDevice=$(lsblk -npo PKNAME $rootPart)
partNum=$(lsblk -npo MAJ:MIN $rootPart | ${pkgs.gawk}/bin/awk -F: '{print $2}') partNum=$(lsblk -npo PARTN $rootPart)
# Resize the root partition and the filesystem to fit the disk # Resize the root partition and the filesystem to fit the disk
echo ",+," | sfdisk -N$partNum --no-reread $bootDevice echo ",+," | sfdisk -N$partNum --no-reread $bootDevice