Permalink
Browse files

Add more scripts from Ayufan for Rock64

  • Loading branch information...
Cat5TV committed Aug 29, 2018
1 parent 1c7f39d commit 9da1d6fa7b592c5c5733fc687ae08f23e88eff42
@@ -0,0 +1,41 @@
#!/bin/bash
if [[ "$(id -u)" -ne "0" ]]; then
echo "This script requires root."
exit 1
fi
dev=$(findmnt / -n -o SOURCE)
case $dev in
/dev/mmcblk*)
DISK=${dev:0:12}
NAME="sd/emmc"
;;
/dev/sd*)
DISK=${dev:0:8}
NAME="hdd/ssd"
;;
*)
echo "Unknown disk for $dev"
exit 1
;;
esac
echo "Resizing $DISK ($NAME -- $dev)..."
set -xe
# move GPT alternate header to end of disk
sgdisk -e "$DISK"
# resize partition 7 to as much as possible
echo ",+,,," | sfdisk "${DISK}" -N7 --force
# re-read partition table
partprobe "$DISK"
# online resize filesystem
resize2fs "$dev"
Oops, something went wrong.

0 comments on commit 9da1d6f

Please sign in to comment.