Unverified Commit 702d0770 authored by Kroese's avatar Kroese Committed by GitHub
Browse files

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.
parents 86d6be7b 0ebe6ac7
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -48,9 +48,9 @@ if [ -f "${DATA}" ]; then
      if [ "$ALLOCATE" = "Z" ]; then

        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

@@ -92,9 +92,9 @@ if [ ! -f "${DATA}" ]; 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

+2 −2
Original line number Diff line number Diff line
@@ -127,9 +127,9 @@ if [ "$ALLOCATE" != "Z" ]; then
else

  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