Created
March 30, 2022 06:23
-
-
Save cuu/1b3d311564bdc0b72db4098c88159fc7 to your computer and use it in GitHub Desktop.
resize devterm d1 rootfs without reboot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GREEN='\033[1;32m' | |
NC='\033[0m' | |
printf "${GREEN}Installing dependencies...${NC}\n" | |
# Install growpart util | |
export DEBIAN_FRONTEND=noninteractive | |
sudo apt-get -y install cloud-guest-utils | |
printf "${GREEN}Growing partition...${NC}\n" | |
# Grow root partition | |
sudo growpart /dev/mmcblk0 4 | |
printf "${GREEN}Resizing file system...${NC}\n" | |
# Resize file system | |
sudo resize2fs /dev/mmcblk0p4 | |
printf "${GREEN}Cleaning up...${NC}\n" | |
# Uninstall growpart package again | |
#sudo apt-get -y remove cloud-guest-utils | |
printf "\n${GREEN}Done! 😊 ${NC}\n\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment