From: Ruediger Meier Date: Tue, 13 Jun 2017 22:14:13 +0000 (+0200) Subject: misc: POSIX usage dd, regarding unit suffixes X-Git-Tag: v2.31-rc1~307 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bda267627e47081e7eed769e9cb437cefb54188b;p=thirdparty%2Futil-linux.git misc: POSIX usage dd, regarding unit suffixes In POSIX we have only 'b' and 'k' (case-sensitive). In the real work, OSX was the only system I've found which does not understand capital 'K'. Signed-off-by: Ruediger Meier --- diff --git a/sys-utils/losetup.8 b/sys-utils/losetup.8 index 60e9ff04ff..9dab580375 100644 --- a/sys-utils/losetup.8 +++ b/sys-utils/losetup.8 @@ -179,7 +179,7 @@ loop control device The following commands can be used as an example of using the loop device. .nf .IP -# dd if=/dev/zero of=~/file.img bs=1MiB count=10 +# dd if=/dev/zero of=~/file.img bs=1024k count=10 # losetup --find --show ~/file.img /dev/loop0 # mkfs -t ext2 /dev/loop0 diff --git a/tests/ts/fincore/count b/tests/ts/fincore/count index 0151016ee2..0b6f24dfe6 100755 --- a/tests/ts/fincore/count +++ b/tests/ts/fincore/count @@ -46,7 +46,7 @@ function check_dd_fs_feat touch "$testf" # NFS seems to fail for direct AND append - _dd if=/dev/zero of="$testf" bs=1K count=2 oflag=direct,append &>/dev/null \ + _dd if=/dev/zero of="$testf" bs=1k count=2 oflag=direct,append &>/dev/null \ || ts_skip "unsupported: dd oflag=direct,append" # TODO: Should we check for sparse file support? diff --git a/tests/ts/libmount/loop-overlay b/tests/ts/libmount/loop-overlay index dc9b73d6bc..df096bf304 100755 --- a/tests/ts/libmount/loop-overlay +++ b/tests/ts/libmount/loop-overlay @@ -36,7 +36,7 @@ IMG=$(ts_image_init 5) mkfs.ext2 -F "$IMG" &> /dev/null || ts_die "Cannot make extn on $IMG" OFFSET=$(stat -c %s "$IMG") -dd if="$IMG" of="$IMG" oflag=append bs=5MiB count=1 conv=notrunc &>/dev/null +dd if="$IMG" of="$IMG" oflag=append bs=1024k count=5 conv=notrunc &>/dev/null [ -d "$TS_MOUNTPOINT-1" ] || mkdir -p $TS_MOUNTPOINT-1 [ -d "$TS_MOUNTPOINT-2" ] || mkdir -p $TS_MOUNTPOINT-2