require_xfs_
ss=$sector_size_
+# On a 32-bit system, we must skip this test when $ss >= 4096.
+# Otherwise, due to an inherent 32-bit-XFS limit, dd would fail to
+# create the file of size > 16TiB
+if test $(uname -m) != x86_64; then
+ test $ss -le 2048 || exit 77
+fi
+
####################################################
# Create and mount a file system capable of dealing with >=2TB files.
# We must be able to create a file with an apparent length of 2TB or larger.
require_xfs_
ss=$sector_size_
+# On a 32-bit system, we must skip this test when $ss >= 4096.
+# Otherwise, due to an inherent 32-bit-XFS limit, dd would fail to
+# create the file of size > 16TiB
+if test $(uname -m) != x86_64; then
+ test $ss -le 2048 || exit 77
+fi
+
####################################################
# Create and mount a file system capable of dealing with >=2TB files.
# We must be able to create a file with an apparent length of 2TB or larger.
start_sector=$1
end_sector=$2
# echo '********' $(echo $end_sector - $start_sector + 1 |bc)
- dd if=/dev/zero of=$dev bs=$ss count=2k seek=$end_sector 2> /dev/null &&
+ dd if=/dev/zero of=$dev bs=$ss count=2k seek=$end_sector 2> dd-err ||
+ { cat dd-err 1>&2; return 1; }
parted -s $dev mklabel $table_type &&
parted -s $dev mkpart p xfs ${start_sector}s ${end_sector}s
}