We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3f41cab commit 5243d3bCopy full SHA for 5243d3b
1 file changed
steps/jump/move_disk.sh
@@ -22,7 +22,9 @@ while ! dd if=/dev/${DISK} of=/dev/null bs=512 count=1; do
22
done
23
24
# Create partition if it doesn't exist
25
-if [ $(($(stat -c "%Lr" "/dev/${DISK}") % 8)) -eq 0 ]; then
+# 'stat -c "%T"' prints the minor device type in hexadecimal.
26
+# The decimal version (with "%Lr") is not available in this version of stat.
27
+if [ $((0x$(stat -c "%T" "/dev/${DISK}") % 8)) -eq 0 ]; then
28
echo "Creating partition table..."
29
# Start at 1GiB, use -S32 -H64 to align to MiB rather than cylinder boundary
30
echo "2097152;" | sfdisk -uS -S32 -H64 --force "/dev/${DISK}"
0 commit comments