aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJybz <j.biernacki@free.fr>2019-11-09 17:35:07 +0000
committerJybz <j.biernacki@free.fr>2019-11-09 17:35:07 +0000
commit431f9c1c0c2b9314108a70d44e2073cceb20f64f (patch)
treeb331d274cd0ce6a3496fa37d5d53cf43f6a8e5fd /tools
parent57362fa37479f6d248c14b483cba039ef00017b9 (diff)
downloadmageia4arm-431f9c1c0c2b9314108a70d44e2073cceb20f64f.tar
mageia4arm-431f9c1c0c2b9314108a70d44e2073cceb20f64f.tar.gz
mageia4arm-431f9c1c0c2b9314108a70d44e2073cceb20f64f.tar.bz2
mageia4arm-431f9c1c0c2b9314108a70d44e2073cceb20f64f.tar.xz
mageia4arm-431f9c1c0c2b9314108a70d44e2073cceb20f64f.zip
New possibility to resize the root partition.
Diffstat (limited to 'tools')
-rw-r--r--tools/resize_root.sh27
1 files changed, 27 insertions, 0 deletions
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