Pass disk name to pxe preseed?

I need to make sure I always install the OS to the right drive since my
servers have multiple disks and some motherboards are different than others
and my flash drives that I run the OS from dont always come up as /dev/sda.
Right now all my servers are Ubuntu Trusty and I already have a custom
preseed setup, but I have no idea where I should be storing the disk name
in foreman that i want to make sure the OS is already installed onto and
how necessarily to pass that to the preseed template. Suggestions?

Does anyone have clarification questions on this if its to confusing?

Thanks for the suggestion, the following ended up working perfectly for me
in order to automatically pick the USB flash drive:
>
>
d-i partman/early_command string debconf-set partman-auto/disk "$(for
device in /sys/block/;do if udevadm info --query=property --path=$device |
grep -q ^ID_BUS=usb; then echo /dev/${device##
/};fi;done)"

Hi Mark, I might have misunderstood your question, but are you maybe
looking at the following debian preseed line?

d-i partman-auto/disk string /dev/sda

I think you can provide a list of all the drives. Partman should ignore the
one missing and just pick the one it finds. Providing your disks of
preference could do the trick.
I have no means to try that out, unfortunately. If the question was about a
different need, then I apologize.

Nicola

··· On Wednesday, July 1, 2015 at 4:53:57 PM UTC+2, Mark Chaney wrote: > > Does anyone have clarification questions on this if its to confusing? >

No, i would need to be able to do it by the actual size of the device or
the name of the model number of the it or something like that. Doing it by
sda just isnt going to work as that relies on a specific order. Crossing my
fingers didnt work in this case.

··· On Wed, Jul 1, 2015 at 10:05 AM, Nicola V wrote:

On Wednesday, July 1, 2015 at 4:53:57 PM UTC+2, Mark Chaney wrote:

Does anyone have clarification questions on this if its to confusing?

Hi Mark, I might have misunderstood your question, but are you maybe
looking at the following debian preseed line?

d-i partman-auto/disk string /dev/sda

I think you can provide a list of all the drives. Partman should ignore
the one missing and just pick the one it finds. Providing your disks of
preference could do the trick.
I have no means to try that out, unfortunately. If the question was about
a different need, then I apologize.

Nicola


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Hi,

preseeding in general has some more ways to determine what disk to use.

For example according to
https://www.debian.org/releases/wheezy/example-preseed.txt

#d-i partman/early_command string debconf-set partman-auto/disk
"$(list-devices disk | head -n1)"

would choose the first disk of the list.

Maybe you can tweak that to execute a different command which will
then determine the right disk.

It should also be possible to execute a script which will then
determine the right disk.
Output of the script should look like "/dev/sdx".
Needs to be downloaded to the server before executing it. Could look
something like this:

#d-i preseed/early_command string in-target wget -P /tmp/
$server/script.sh; in-target chmod $+x /tmp/script.sh; in-target
/tmp/script.sh
#d-i partman/early_command string sh /tmp/script.sh

Haven't tried it via script though.

Hope it helps,

Hauke

··· On 07/01/2015 08:00 PM, Mark Chaney wrote: > No, i would need to be able to do it by the actual size of the > device or the name of the model number of the it or something like > that. Doing it by sda just isnt going to work as that relies on a > specific order. Crossing my fingers didnt work in this case. > > On Wed, Jul 1, 2015 at 10:05 AM, Nicola V > <volpini.nicola@gmail.com > > wrote: > > On Wednesday, July 1, 2015 at 4:53:57 PM UTC+2, Mark Chaney wrote: > > Does anyone have clarification questions on this if its to > confusing? > > > Hi Mark, I might have misunderstood your question, but are you > maybe looking at the following debian preseed line? > > d-i partman-auto/disk string /dev/sda > > I think you can provide a list of all the drives. Partman should > ignore the one missing and just pick the one it finds. Providing > your disks of preference could do the trick. I have no means to try > that out, unfortunately. If the question was about a different > need, then I apologize. > > Nicola > > -- You received this message because you are subscribed to the > Google Groups "Foreman users" group. To unsubscribe from this group > and stop receiving emails from it, send an email to > foreman-users+unsubscribe@googlegroups.com > . To post to > this group, send email to foreman-users@googlegroups.com > . Visit this group at > http://groups.google.com/group/foreman-users. For more options, > visit https://groups.google.com/d/optout. > > > -- You received this message because you are subscribed to the > Google Groups "Foreman users" group. To unsubscribe from this group > and stop receiving emails from it, send an email to > foreman-users+unsubscribe@googlegroups.com > . To post to > this group, send email to foreman-users@googlegroups.com > . Visit this group at > http://groups.google.com/group/foreman-users. For more options, > visit https://groups.google.com/d/optout.