From e1e9f02e1cd91341feae34dffbabc688cb8513fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 21 Nov 2022 15:32:37 +0100 Subject: add mkfat32 --- mkfat32 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 mkfat32 diff --git a/mkfat32 b/mkfat32 new file mode 100755 index 0000000..558c369 --- /dev/null +++ b/mkfat32 @@ -0,0 +1,23 @@ +#! /bin/sh + +if [ ${UID} -ne 0 ] +then + echo "must be root" && exit 1 +fi + +if [ $# -eq 0 ] +then + echo "missing dev" && exit 1 +fi +DEV=$1 + +echo "dev is : ${DEV}" +echo "hit ENTER to continue" +read none + +echo "zero ${DEV}" && dd if=/dev/zero of=${DEV} bs=4096 status=progress +echo "syncing ..." && sync +echo "mklabel msdos" && parted ${DEV} --script -- mklabel msdos +echo "mkpart fat32" && parted ${DEV} --script -- mkpart primary fat32 1MiB 100% +echo "mkfsvfat -F32" && mkfs.vfat -F32 ${DEV}1 +echo "" && parted ${DEV} --script print -- cgit v1.1-2-g2b99