1
0
This repository has been archived on 2023-11-30. You can view files and clone it, but cannot push or open issues or pull requests.
dtux__mageia4arm/tools/resize_root.sh

28 lines
501 B
Bash
Raw Normal View History

#!/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