Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Some of the machines that I'm provisioning have a separate /dev/sdb to be used for /home, and some only have a single disk.

Is there a way I can set up preseed so that if /dev/sdb exists, it uses 100% of that for /home, but if it doesn't, it makes a /home partition on /dev/sda?

share|improve this question
up vote 1 down vote accepted

Short answer: you can't.

Long answer: as far as I am aware, you will need to run some kind of early_command to read the current disks and echo the results of that to a file that partman will read later, presumably on /hd-media somewhere.

I have once found a program/script that would do this, I think, but my Google-fu does not seem to work right now =/

share|improve this answer
Thanks. What I ended up doing was writing a little script for my postinstall which, if the 2nd disk is present, moves the contents of /home to that disk and then does all the necessary stuff (fstab, etc) to make that the new /home. – dmd Mar 9 '13 at 15:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.