1
0
This commit is contained in:
Jybz 2019-11-09 17:38:58 +00:00
parent 431f9c1c0c
commit f667080ee4

View File

@ -4,24 +4,29 @@ DEVICE="/dev/mmcblk0"
ROOT_PARTITION="${DEVICE}p1" ROOT_PARTITION="${DEVICE}p1"
ROOT_PARTITION="1" ROOT_PARTITION="1"
#Check dependency echo "Warning : this an early version to resize the root partition. Check the source code to ensure what you are doing."
hash growpart if [ ${1} = "force" ]; then
if [ ${?} -ne 0 ]; then #Check dependency
echo "install cloud-utils-growpart first. Hint : urpmi cloud-utils-growpart" hash growpart
exit 1 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
else
echo "If you read the source code, you should not have read that message... Exiting with out touching the partition."
fi 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 #Quit
exit 0 exit 0