Different partition layout after recovery with keep home partition
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OEM Priority Project |
Fix Released
|
Critical
|
Ara Pulido | ||
Precise |
Fix Released
|
Undecided
|
Unassigned | ||
partman-auto (Ubuntu) |
Fix Released
|
High
|
Colin Watson | ||
Precise |
Fix Released
|
High
|
Colin Watson | ||
ubiquity (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Precise |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
When using ubuntu-recovery to recover the system,
The partition layout is different when keeping home partition.
consider disk-recipe:
100 150 200 free
$iflabel{ gpt }
$reusemethod{ }
method{ efi }
format{ } .
128 512 256 ext2
$defaultignore{ }
method{ format }
format{ }
use_filesystem{ }
filesystem{ ext2 }
mountpoint{ /boot } .
32000 10000 32000 $default_filesystem
$lvmok{ }
method{ format }
format{ }
use_filesystem{ }
reserved_for_root{ 1 }
$default_
mountpoint{ / } .
8000 512 8000 linux-swap
$lvmok{ }
method{ swap }
format{ } .
500 10000 -1 $default_filesystem
$lvmok{ }
$reusemethod{ }
method{ format }
format{ }
use_filesystem{ }
$default_
label{ User_Data }
mountpoint{ /home } .
In this case, we want to build this layout in a 320G hard disk and keep the home partition.
If we recover system WITHOUT keeping home partition, the partition layout looks like:
Model: ATA ST320LT012-9WS14 (scsi)
Disk /dev/sda: 320072933376B
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Number Start End Size File system Name Flags
17408B 20479B 3072B Free Space
1 20480B 99999743B 99979264B fat32 EFI System Partition boot
2 99999744B 4100001791B 4000002048B fat32 Recovery Partition
3 4100001792B 36100001791B 32000000000B ext4
4 36100001792B 44100001791B 8000000000B linux-swap(v1)
5 44100001792B 320072916479B 275972914688B ext4 Ubuntu Home Partition
But if we recovery system WITH keeping home partition, the partition layout looks like:
Model: ATA ST320LT012-9WS14 (scsi)
Disk /dev/sda: 320072933376B
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Number Start End Size File system Name Flags
17408B 20479B 3072B Free Space
1 20480B 99999743B 99979264B fat32 EFI System Partition boot
2 99999744B 4100001791B 4000002048B fat32 Recovery Partition
4 4100001792B 42073001983B 37973000192B ext4
6 42073001984B 44100001791B 2026999808B linux-swap(v1)
5 44100001792B 320072916479B 275972914688B ext4 Ubuntu Home Partition
The behavior is abnormal.
According to my test, partman thinks the necessary space is 100+32000+8000 while the home partition is kept. And I discovered that partman knows EFI partition has $reusemethod option and the partition exists but it still adds the partition size to total. So the total need (40100m) is not equal to total free (40000M) and then partman use alternative recipe instead. This is the root cause of why partition layout is different.
-------
recipe.sh line: 187~ 209
foreach_partition () {
local - doing IFS pcount last partition
doing=$1
pcount=$(echo "$scheme" | wc -l)
last=no
IFS="$NL"
for partition in $scheme; do
restore_ifs
[ $pcount -gt 1 ] || last=yes
set -- $partition
eval "$doing"
pcount=$(($pcount - 1))
done
}
min_size () {
local size
size=0
foreach_partition '
size=$(($size + $1))'
echo $size
}
These codes are used for calculate total recipe size, and I can't find any expression deals with $reusemethod.
affects: | partman-auto (Ubuntu) → oem-priority |
summary: |
- Different partition layout after recover with keep home partition + Different partition layout after recovery with keep home partition |
Changed in oem-priority: | |
importance: | Undecided → Critical |
affects: | partman-auto → partman-auto (Ubuntu) |
Changed in oem-priority: | |
status: | New → Confirmed |
assignee: | nobody → Ara Pulido (apulido) |
Changed in partman-auto (Ubuntu): | |
assignee: | nobody → Canonical Foundations Team (canonical-foundations) |
tags: | added: patch |
Changed in partman-auto (Ubuntu): | |
status: | Confirmed → Incomplete |
Changed in partman-auto (Ubuntu): | |
status: | Incomplete → Confirmed |
Changed in partman-auto (Ubuntu): | |
assignee: | Canonical Foundations Team (canonical-foundations) → Colin Watson (cjwatson) |
status: | Confirmed → In Progress |
Changed in partman-auto (Ubuntu Precise): | |
status: | New → Triaged |
importance: | Undecided → High |
assignee: | nobody → Colin Watson (cjwatson) |
milestone: | none → ubuntu-12.04.4 |
Changed in partman-auto (Ubuntu Precise): | |
status: | Triaged → In Progress |
Changed in partman-auto (Ubuntu): | |
status: | In Progress → Fix Committed |
Changed in oem-priority: | |
status: | Confirmed → Fix Released |
Which release of Ubuntu were you testing this (and is important to fix) on?