mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 21:40:01 +08:00
Write random data instead of zeroes
When writing zeroes the underlying virtio driver detects and skips them, so fill the file with random data instead.
This commit is contained in:
commit
b9c2e1cba2
@ -48,9 +48,9 @@ if [ -f "${DATA}" ]; then
|
|||||||
if [ "$ALLOCATE" = "Z" ]; then
|
if [ "$ALLOCATE" = "Z" ]; then
|
||||||
|
|
||||||
GB=$(( (REQ + 1073741823)/1073741824 ))
|
GB=$(( (REQ + 1073741823)/1073741824 ))
|
||||||
echo "INFO: Writing ${GB} GB of zeroes, please wait.."
|
echo "INFO: Writing ${GB} GB of random data, please wait.."
|
||||||
|
|
||||||
dd if=/dev/zero of="${DATA}" seek="${OLD_SIZE}" count="${REQ}" bs=1M iflag=count_bytes oflag=seek_bytes
|
dd if=/dev/urandom of="${DATA}" seek="${OLD_SIZE}" count="${REQ}" bs=1M iflag=count_bytes oflag=seek_bytes status=none
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
@ -92,9 +92,9 @@ if [ ! -f "${DATA}" ]; then
|
|||||||
|
|
||||||
if [ "$ALLOCATE" = "Z" ]; then
|
if [ "$ALLOCATE" = "Z" ]; then
|
||||||
|
|
||||||
echo "INFO: Writing ${DISK_SIZE} of zeroes, please wait.."
|
echo "INFO: Writing ${DISK_SIZE} of random data, please wait.."
|
||||||
|
|
||||||
dd if=/dev/zero of="${DATA}" count="${DATA_SIZE}" bs=1M iflag=count_bytes
|
dd if=/dev/urandom of="${DATA}" count="${DATA_SIZE}" bs=1M iflag=count_bytes status=none
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
@ -127,9 +127,9 @@ if [ "$ALLOCATE" != "Z" ]; then
|
|||||||
else
|
else
|
||||||
|
|
||||||
GB=$(( (SYSTEM_SIZE + 1073741823)/1073741824 ))
|
GB=$(( (SYSTEM_SIZE + 1073741823)/1073741824 ))
|
||||||
echo "Install: Writing ${GB} GB of zeroes, please wait.."
|
echo "Install: Writing ${GB} GB of random data, please wait.."
|
||||||
|
|
||||||
dd if=/dev/zero of="${SYSTEM}" count="${SYSTEM_SIZE}" bs=1M iflag=count_bytes
|
dd if=/dev/urandom of="${SYSTEM}" count="${SYSTEM_SIZE}" bs=1M iflag=count_bytes status=none
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user