Commit 65c48b66 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

We should relocate GPT backup to the end of disk

parent 809b50b4
......@@ -28,8 +28,13 @@ rootdevice() {
}
freespaceafter() {
local label
local escaped
local start
label="$(sfdisk -d $1 2> /dev/null | sed -n 's/^label: *//p')"
if [ $label = "gpt" ]; then
sfdisk --relocate gpt-bak-std $1 > /dev/null
fi
escaped="$(echo ""$2"" | sed 's|/|\\/|g')"
start="$(sfdisk -d $1 2> /dev/null | sed -n "/$escaped/p" | sed -r 's/.*start=\s*([0-9]+),.*/\1/g')"
sfdisk -q -F $1 2> /dev/null | sed -n '/^\s*[0-9]/p' | sed -r 's/^\s*([0-9]+)\s.*/\1/g' | while read freespace
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment