Add partprobe before blkid invocation, and use compress-force for btrfs fstab

This commit is contained in:
oddlama 2020-11-06 18:58:15 +01:00
parent 375825c1e8
commit fbad0e2184
2 changed files with 3 additions and 1 deletions

View File

@ -302,7 +302,7 @@ create_default_disk_layout() {
if [[ $root_fs == "btrfs" ]]; then
DISK_ID_ROOT_TYPE="btrfs"
DISK_ID_ROOT_MOUNT_OPTS="defaults,noatime,compress=zstd,subvol=/root"
DISK_ID_ROOT_MOUNT_OPTS="defaults,noatime,compress-force=zstd,subvol=/root"
elif [[ $root_fs == "btrfs" ]]; then
DISK_ID_ROOT_TYPE="ext4"
DISK_ID_ROOT_MOUNT_OPTS="defaults,noatime,errors=remount-ro,discard"

View File

@ -121,6 +121,7 @@ get_blkid_field_by_device() {
local device="$2"
blkid -g \
|| die "Error while executing blkid -g"
partprobe
local val
val="$(blkid -o export "$device")" \
|| die "Error while executing blkid '$device'"
@ -141,6 +142,7 @@ get_device_by_blkid_field() {
local field_value="$2"
blkid -g \
|| die "Error while executing blkid -g"
partprobe
local dev
dev="$(blkid -o export -t "$blkid_field=$field_value")" \
|| die "Error while executing blkid to find $blkid_field=$field_value"