Use sync mode when running 'kpartx -a'
This commit is contained in:
parent
2f12cf985a
commit
a8596e0d89
1 changed files with 3 additions and 3 deletions
|
@ -36,7 +36,7 @@ connect_blkdev() {
|
||||||
init_nbd
|
init_nbd
|
||||||
qemu-nbd --discard=unmap -c $NBD_DEV "$1"
|
qemu-nbd --discard=unmap -c $NBD_DEV "$1"
|
||||||
sync
|
sync
|
||||||
kpartx -a $NBD_DEV
|
kpartx -as $NBD_DEV
|
||||||
sync
|
sync
|
||||||
CURRENT_IMAGE="$1"
|
CURRENT_IMAGE="$1"
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,7 @@ load_qimage() {
|
||||||
254MiB,,83;
|
254MiB,,83;
|
||||||
EOF
|
EOF
|
||||||
sync
|
sync
|
||||||
kpartx -a $NBD_DEV
|
kpartx -as $NBD_DEV
|
||||||
mkdosfs -n boot -F 32 -v $MAP_BOOT_DEV
|
mkdosfs -n boot -F 32 -v $MAP_BOOT_DEV
|
||||||
mkfs.ext4 -L rootfs -O "^huge_file,^metadata_csum,^64bit" $MAP_ROOT_DEV
|
mkfs.ext4 -L rootfs -O "^huge_file,^metadata_csum,^64bit" $MAP_ROOT_DEV
|
||||||
sync
|
sync
|
||||||
|
@ -123,7 +123,7 @@ EOF
|
||||||
sync
|
sync
|
||||||
qemu-nbd --discard=unmap -c $NBD_DEV image-${STAGE}.qcow2
|
qemu-nbd --discard=unmap -c $NBD_DEV image-${STAGE}.qcow2
|
||||||
sync
|
sync
|
||||||
kpartx -a $NBD_DEV
|
kpartx -as $NBD_DEV
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mount -v -t ext4 $MAP_ROOT_DEV "${ROOTFS_DIR}"
|
mount -v -t ext4 $MAP_ROOT_DEV "${ROOTFS_DIR}"
|
||||||
|
|
Loading…
Reference in a new issue