diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2022-11-21 15:32:37 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2022-11-21 15:32:37 +0100 |
commit | e1e9f02e1cd91341feae34dffbabc688cb8513fe (patch) | |
tree | 0287b24f68684c00d1a1396177e7c6d207af35c2 | |
parent | 2fedb07ddecd0985c0c8f038f5c6dd05385ecfd6 (diff) | |
download | bin-e1e9f02e1cd91341feae34dffbabc688cb8513fe.zip bin-e1e9f02e1cd91341feae34dffbabc688cb8513fe.tar.gz |
add mkfat32
-rwxr-xr-x | mkfat32 | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -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 |