mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Change format-disk to use exfat for better cross-platform compatibility
This commit is contained in:
@@ -25,14 +25,21 @@ format-drive() {
|
|||||||
else
|
else
|
||||||
echo "WARNING: This will completely erase all data on $1 and label it '$2'."
|
echo "WARNING: This will completely erase all data on $1 and label it '$2'."
|
||||||
read -rp "Are you sure you want to continue? (y/N): " confirm
|
read -rp "Are you sure you want to continue? (y/N): " confirm
|
||||||
|
|
||||||
if [[ "$confirm" =~ ^[Yy]$ ]]; then
|
if [[ "$confirm" =~ ^[Yy]$ ]]; then
|
||||||
sudo wipefs -a "$1"
|
sudo wipefs -a "$1"
|
||||||
sudo dd if=/dev/zero of="$1" bs=1M count=100 status=progress
|
sudo dd if=/dev/zero of="$1" bs=1M count=100 status=progress
|
||||||
sudo parted -s "$1" mklabel gpt
|
sudo parted -s "$1" mklabel gpt
|
||||||
sudo parted -s "$1" mkpart primary ext4 1MiB 100%
|
sudo parted -s "$1" mkpart primary 1MiB 100%
|
||||||
sudo mkfs.ext4 -L "$2" "$([[ $1 == *"nvme"* ]] && echo "${1}p1" || echo "${1}1")"
|
|
||||||
sudo chmod -R 777 "/run/media/$USER/$2"
|
partition="$([[ $1 == *"nvme"* ]] && echo "${1}p1" || echo "${1}1")"
|
||||||
echo "Drive $1 formatted and labeled '$2'."
|
sudo partprobe "$1" || true
|
||||||
|
sudo udevadm settle || true
|
||||||
|
|
||||||
|
omarchy-pkg-add exfatprogs
|
||||||
|
sudo mkfs.exfat -n "$2" "$partition"
|
||||||
|
|
||||||
|
echo "Drive $1 formatted as exFAT and labeled '$2'."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user