From 431f9c1c0c2b9314108a70d44e2073cceb20f64f Mon Sep 17 00:00:00 2001 From: Jybz Date: Sat, 9 Nov 2019 17:35:07 +0000 Subject: [PATCH] New possibility to resize the root partition. --- tools/resize_root.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tools/resize_root.sh diff --git a/tools/resize_root.sh b/tools/resize_root.sh new file mode 100644 index 0000000..3686c1a --- /dev/null +++ b/tools/resize_root.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +DEVICE="/dev/mmcblk0" +ROOT_PARTITION="${DEVICE}p1" +ROOT_PARTITION="1" + +#Check dependency +hash growpart +if [ ${?} -ne 0 ]; then + echo "install cloud-utils-growpart first. Hint : urpmi cloud-utils-growpart" + exit 1 +fi + +#Check the partition : +e2fsck -f ${ROOT_PARTITION} + +#Change the size : BUG: app doesn't support "octet". +LC_ALL=C growpart ${DEVICE} ${ROOT_PARTITION} + +#Resize the partition with the new size : +resize2fs ${ROOT_PARTITION} + +#Sync (just to be sure) +sync + +#Quit +exit 0