Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

We normally use autopart for patitioning. However, it's default sizing logic does not match our needs (we want to limit the size of the home logical volume).

When we try to manually partition the space (using part, volgroup, logvol) we run into the issue of not being able to make each volume group's name be based on the system (e.g., vg_delta1)

Does anyone have a solution for this? I initially thought we might be able to do template variables like so:

part pv.01 --size=1 --grow
volgroup vg_\$(name) pv.01

The problem is if the system's name had dashes and such. autopart deletes special characters. How do we imitate the same behavior?

share|improve this question
up vote 2 down vote accepted

Generate the partitioning in the %pre section of your kickstart (which is simply a shell script). Dump it into a file, and then %include the file at the appropriate point in your kickstart. For example:

%include /tmp/disk.ks


cat > /tmp/disk.ks <<EOF
part pv.01 --size=1 --grow
volgroup vg_$(hostname) pv.01

Read more about %include here.

share|improve this answer
Ahhhh smart. That way I could remove the special chars with shell tools. Thanks! – Belmin Fernandez Apr 21 '12 at 13:43

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.