mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 13:30:02 +08:00
Comments
This commit is contained in:
parent
98de341812
commit
b800a91ad0
6
disk.sh
6
disk.sh
@ -16,13 +16,17 @@ NEW_SIZE=$(numfmt --from=iec "${DISK_SIZE}")
|
|||||||
FILE="$IMG/data$DISK_SIZE.img"
|
FILE="$IMG/data$DISK_SIZE.img"
|
||||||
|
|
||||||
if [ ! -f "$FILE" ]; then
|
if [ ! -f "$FILE" ]; then
|
||||||
|
# Create an empty file
|
||||||
truncate -s "${NEW_SIZE}" "${FILE}"
|
truncate -s "${NEW_SIZE}" "${FILE}"
|
||||||
|
# Format as BTRFS filesystem
|
||||||
mkfs.btrfs -q -L data -d single -m dup "${FILE}" > /dev/null
|
mkfs.btrfs -q -L data -d single -m dup "${FILE}" > /dev/null
|
||||||
#qemu-img convert -f raw -O qcow2 -o extended_l2=on,cluster_size=128k,compression_type=zstd,preallocation=metadata "$TMP" "$FILE"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ ! -f "$FILE" ] && echo "ERROR: Virtual DSM data-image does not exist ($FILE)" && exit 83
|
[ ! -f "$FILE" ] && echo "ERROR: Virtual DSM data-image does not exist ($FILE)" && exit 83
|
||||||
|
|
||||||
|
# Resizing requires mounting a loop device which in turn requires
|
||||||
|
# the container to be privileged, so we must disable it for now.
|
||||||
|
#
|
||||||
# OLD_SIZE=$(stat -c%s "${FILE}")
|
# OLD_SIZE=$(stat -c%s "${FILE}")
|
||||||
#
|
#
|
||||||
# if [ "$NEW_SIZE" -ne "$OLD_SIZE" ]; then
|
# if [ "$NEW_SIZE" -ne "$OLD_SIZE" ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user