Revision f6e23601 snf-image-helper/tasks/10FixPartitionTable.in
b/snf-image-helper/tasks/10FixPartitionTable.in | ||
---|---|---|
20 | 20 |
retval=$(get_last_partition "$SNF_IMAGE_DEV") |
21 | 21 |
|
22 | 22 |
id=$(echo $retval | cut -d: -f1) |
23 |
pstart=$(echo $retval | cut -d: -f2) |
|
24 |
pend=$(echo $retval | cut -d: -f3) |
|
25 |
ptype=$(echo $retval | cut -d: -f5) |
|
23 | 26 |
|
24 | 27 |
if [ $id -gt 4 ]; then |
25 | 28 |
log_error "We don't support logical volumes" |
26 | 29 |
fi |
27 | 30 |
|
28 |
pstart=$(echo $retval | cut -d: -f2) |
|
29 |
pend=$(echo $retval | cut -d: -f3) |
|
30 |
ptype=$(echo $retval | cut -d: -f5) |
|
31 |
|
|
32 | 31 |
if [ x"$ptype" = "x" ]; then |
33 | 32 |
# Don't know how to handle this |
34 |
echo "Warning: Last partition with id: \`$id' is empty" \ |
|
35 |
"or has unknown filesystem" |
|
36 |
|
|
33 |
warn "Last partition with id: \`$id' is empty or has unknown filesystem" |
|
34 |
warn "I won't resize the partition" |
|
37 | 35 |
exit 0 |
38 | 36 |
fi |
39 | 37 |
|
... | ... | |
41 | 39 |
|
42 | 40 |
#Extend the partition |
43 | 41 |
|
44 |
$PARTED -s -m "$SNF_IMAGE_DEV" rm $id
|
|
42 |
$PARTED -s -m "$SNF_IMAGE_DEV" rm "$id"
|
|
45 | 43 |
$PARTED -s -m "$SNF_IMAGE_DEV" mkpart primary "$ptype" "$pstart" "$new_pend" |
46 | 44 |
|
47 | 45 |
#inform the kernel about the changes |
Also available in: Unified diff