2018-07-10 12:11:05 +01:00
|
|
|
#!/bin/sh
|
2017-10-08 21:18:48 +01:00
|
|
|
|
2018-07-17 07:32:30 +01:00
|
|
|
roottmp=$(lsblk -l -o NAME,MOUNTPOINT | grep '/$')
|
|
|
|
rootpart=/dev/${roottmp%% */}
|
|
|
|
rootdev=${rootpart%2}
|
|
|
|
rootdev=${rootdev%p}
|
2017-10-08 21:18:48 +01:00
|
|
|
|
2018-07-14 23:03:02 +01:00
|
|
|
flock $rootdev sfdisk -f $rootdev -N 2 <<EOF
|
2018-07-14 20:57:03 +01:00
|
|
|
,+
|
|
|
|
EOF
|
|
|
|
|
2018-07-14 23:03:02 +01:00
|
|
|
sleep 5
|
|
|
|
|
|
|
|
udevadm settle
|
|
|
|
|
|
|
|
sleep 5
|
|
|
|
|
|
|
|
flock $rootdev partprobe $rootdev
|
|
|
|
|
|
|
|
mount -o remount,rw $rootpart
|
2017-10-08 21:18:48 +01:00
|
|
|
|
2018-07-10 12:11:05 +01:00
|
|
|
resize2fs $rootpart
|
2018-07-14 23:03:02 +01:00
|
|
|
|
|
|
|
exit 0
|