Skip to content

Instantly share code, notes, and snippets.

@cuu
Created March 30, 2022 06:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cuu/1b3d311564bdc0b72db4098c88159fc7 to your computer and use it in GitHub Desktop.
Save cuu/1b3d311564bdc0b72db4098c88159fc7 to your computer and use it in GitHub Desktop.
resize devterm d1 rootfs without reboot
#!/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