[Feature Request] enhance recipe format to allow specifying an existing partition

Bug #195608 reported by Michael Brown on 2008-02-25
This bug affects 4 people
Affects Status Importance Assigned to Milestone
partman-auto (Ubuntu)

Bug Description

Binary package hint: partman-auto

Fundamental problem for Dell install is that we would like to be able to let the user re-install their system, but keep the contents of their /home directory intact.

One potential way to solve this would be to put /home on a separate partition and not format it during the install, but since partman does not allow this level of specification in the preseed file, this will not work.

(Conceptually) What we need in order for this to work is something like:
  Partition /home /dev/disk/by-id/edd-int13_dev80_part5 --noformat
  Partition / use-free-space --automatic --format
  Partition swap use-free-space --automatic --format

Any other way to keep /home during a re-install would also be acceptable. Currently, the disk partitioning looks like:
  /dev/sda1 --> Dell Utility Partition
  /dev/sda2 --> Dell Reinstallation Partition
  /dev/sda3 --> /
  /dev/sda4 --> extended
  /dev/sda5 --> swap

Changed in dell:
importance: Undecided → High
Colin Watson (cjwatson) on 2008-02-29
Changed in partman-auto:
importance: Undecided → High
status: New → Confirmed

We'll look at this, but cannot promise a fix at this point; I have looked at other requests for the same feature in partman-auto in the past and it isn't straightforward to implement. I'll see what we can do.

Changed in dell:
status: New → Confirmed

Is there any plan to have this bug resolved in jaunty because it's seems already corrected in Colin's branch ?

Jerone Young (jerone) wrote :

Dell no longer has a use for this request with their current recovery solution.

Changed in dell:
status: Confirmed → Invalid
Changed in partman-auto (Ubuntu Hardy):
status: Confirmed → Invalid
dave g (dlgarfinkel) on 2012-03-05
Changed in partman-auto (Ubuntu):
status: Confirmed → Fix Committed
Changed in partman-auto (Ubuntu):
status: Fix Committed → Triaged
Christopher Townsend (townsend) wrote :

I have a use case in which I'm trying to use a fully automated install using oem-config. I've taken Colin's branch and applied it to the latest version of partman-auto in Precise and built a test version of Ubiquity and have included it in a build.

The disk-recipe is written such that /home should be it's own partition. The intention is that if the partition does not exist, then a new one should be created. If the partition already exists, then it should be kept and left untouched.

However, using the diff from Colin's branch, I have run into a few issues and shortcomings.

1. When installing, Ubiquity would spin at the point that it starts to partition disks. After much investigation, I found this is due to error at this line in the diff:
    partno="$(echo "$*" | sed '\''s/.*\$partno{ \([0-9][0-9]*\) }.*/\1/'\'')"

I ended up addressing this by changing it to:
    partno="$(echo "$*" | sed 's/.*\$partno{ \([0-9][0-9]*\) }.*/\1/')"

I'm not sure if this really correct, but it seems to have fixed that problem.

2. The next issue I ran into is if I set the $partno{ x } directive and the partition does not exist, it goes into an infinite loop. I found the following code block to be the culprit:
     if [ -z "$partid" ]; then
        logger -t partman-auto \
        "Partition number $partno in recipe not found; creating new partition instead"

I then fixed this loop by changing this block to this:
     if [ -z "$partid" ]; then
        logger -t partman-auto \
        "Partition number $partno in recipe not found; creating new partition instead"

3. With the last change in place, the next issue I ran into is that if the partition does not exist, then a new one will not be created.

4. Lastly, If I leave the $partno directive out and let partman-auto create the partition and then add the $partno directive back in when the partition exists, then the partition will be preserved, but it is not added to /etc/fstab and so the partition is not automatically mounted and used by the install and the running system.

Dimitri John Ledkov (xnox) wrote :

I am inclined to close this bug as fix-released.

partman-auto: gained automatically_partition/reuse & automatically_partition/replace strategies back in 2011-02-11.

This is meant to be reinstall without changing disk partitioning while preserving (reuse) or not preservering (replace) user configuration for the squashfs based install media.

If these automatic-partitioning strategies not good enough for one reason or the other (e.g. it does too much or not enough preservation) then please open a new bug explaining your use case.

You can test the reuse method by following steps:
1) boot into 12.10 DVD
2) Do a full-disk install
3) Boot into installed system and do any changes you want to test.
4) boot into 12.10 DVD and select "Reinstall Ubuntu 12.10" option
5) Boot into installed system and check which desired/undesired changes got preserved or not.

Colin Watson (cjwatson) wrote :

Dmitrijs: I don't agree - those are fine for some limited cases, but they're not a full recipe format extension and that's what we should have.

Changed in somerville:
importance: Undecided → High
status: New → Invalid
no longer affects: dell
Timothy R. Chavez (timrchavez) wrote :

The bug task for the somerville project has been removed by an automated script. This bug has been cloned on that project and is available here: https://bugs.launchpad.net/bugs/1306063

no longer affects: somerville
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers