添加 fixgpt.sh

This commit is contained in:
悟空的日常镜像仓库 2025-04-08 19:54:34 +08:00
parent d265d6939e
commit 854dc4150e

18
fixgpt.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/bash
set -e
sudo apt update -y
sudo apt install -y gdisk
sudo apt install -y expect
DISK="/dev/sda"
expect <<EOF
spawn sudo gdisk "$DISK"
expect "Command (? for help):" { send "w\r" }
expect "correct this problem? (Y/N):" { send "Y\r" }
expect "Do you want to proceed? (Y/N):" { send "Y\r" }
expect eof
EOF
echo "GPT分区表已成功修复 您可以使用U盘/硬盘剩余空间啦 $DISK"