diff --git a/easyinstall.sh b/easyinstall.sh index e5ee7499..d2688e23 100755 --- a/easyinstall.sh +++ b/easyinstall.sh @@ -221,7 +221,7 @@ function createDrive() { if [ ! -f $drivePath ]; then echo "Creating a ${driveSize}MB Drive" - dd if=/dev/zero of=$drivePath bs=1M count=$driveSize + truncate --size ${driveSize}m $drivePath echo "Formatting drive with HFS" formatDrive "$drivePath" "$driveName" diff --git a/src/web/file_cmds.py b/src/web/file_cmds.py index c424f82f..7ca5d19e 100644 --- a/src/web/file_cmds.py +++ b/src/web/file_cmds.py @@ -17,7 +17,7 @@ def create_new_image(file_name, type, size): file_name = file_name + "." + type return subprocess.run( - ["dd", "if=/dev/zero", "of=" + base_dir + file_name, "bs=1M", "count=" + size], + ["truncate", "--size", f"{size}m", f"{base_dir}{file_name}"], capture_output=True, )