Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer 1

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

%pre

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

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
add comment

Your Answer

 
discard

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.