Skip to content

Instantly share code, notes, and snippets.

@stu43005
Created July 3, 2022 06:21
Show Gist options
  • Save stu43005/27da08491b1ae9dbe219db8906ed1a14 to your computer and use it in GitHub Desktop.
Save stu43005/27da08491b1ae9dbe219db8906ed1a14 to your computer and use it in GitHub Desktop.
[筆記] 編輯 WSA system.img
# 擴充大小
system_size=$(( $(du -sB512 system.img | cut -f1) + 200000 ))
e2fsck -yf system.img
resize2fs system.img "$system_size"s
# 掛載映像檔
mkdir -p /tmp/system
sudo mount -o loop system.img /tmp/system
#
# << 在這邊編輯 /tmp/system 內容
#
# 取消掛載
sudo umount /tmp/system
# 精簡大小
e2fsck -yf system.img
resize2fs -M system.img
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment