[CentOS] LVM and kickstarts ?

Tue Mar 4 18:42:26 UTC 2008
Ross S. W. Walker <rwalker at medallion.com>

Michael Gale wrote:
> Ross S. W. Walker wrote:
> > Michael Gale wrote:
> >> Hey,
> >>
> >> 	So I have created another kickstart that I believe 
> >> should be correct 
> >> and it fails the same way with the same problems:
> >>
> >> --snip--
> >> zerombr yes
> >> clearpart --all --initlabel
> >> part /boot --fstype ext3 --size=100
> >> part swap --size=1000
> >> part pv.os --size=8000 --grow --maxsize=8000 --asprimary
> >> volgroup os_volgroup01 pv.os
> >> logvol / --fstype ext3 --name=os_root --vgname=os_volgroup01 --size=1024 --grow
> >> --snip--
> > 
> > How about:
> > 
> > --snip--
> > zerombr yes
> > clearpart --all --initlabel
> > part /boot --fstype ext3 --size=100 --asprimary
> > part swap --size=1000
> > part pv.os --size=8000
> > volgroup os_volgroup01 pv.os
> > logvol / --fstype ext3 --name=os_root --vgname=os_volgroup01 --size=1024 --grow
> > --snip--
> > 
> > I removed the '--grow' and '--maxsize' options from the pv.os partition setup as
> > you know what the size you want it to be, there is no need for these. I also
> > moved the --asprimary option to the /boot partition, really only /boot needs to
> > be --asprimary, and then again you really only need that if you have existing
> > partitions on disk that are being preserved, which with 'clearpart --all' you
> > won't have.
> > 
> > I would put swap into the volgroup though as there is no need for a completely
> > separate swap partition anymore. In fact swap files work just as well these
> > days as swap partitions or swap logical volumes, but anaconda still needs a
> > swap partition or logical volume, so create a swap logical volume, then you
> > can extend it later if necessary or create a swapfile and move over to that.
> > 
> >> Michael
> >> Ross S. W. Walker wrote:
> >>> Michael Gale wrote:
> >>>> Hey,
> >>>>
> >>>> 	Can anyone tell me why option 1 works and option 2 fails ? I know I 
> >>>> need swap and such, however in trouble shooting this issue I trimmed 
> >>>> down my config.
> >>>>
> >>>> It fails on trying to format my logical volume, because the mount point 
> >>>> does not exist (/dev/volgroup/logvol)
> >>>>
> >>>> It seems that with option 2, the partitions are created and LVM is setup 
> >>>> correctly. However the volgroup / logvolume was not made active, so my 
> >>>> /dev/volgroup/logvol did not exist.
> >>>>
> >>>> Running `lvm lvchange -a -y pathname` from with in the shell after 
> >>>> anaconda failed made the volgroup / logvol active. Which would allow the 
> >>>> format command to complete.
> >>>>
> >>>> Option 1:
> >>>> zerombr yes
> >>>> clearpart --all --initlabel
> >>>> part /boot --fstype ext3 --size=100
> >>>> part pv.os --size=10000 --grow --maxsize=10000 --asprimary
> >>>> volgroup os_volgroup01 pv.os
> >>>> logvol swap --fstype swap --name=os_swap_logvol --vgname=os_volgroup01 --recommended
> >>>> logvol / --fstype ext3 --name=os_root --vgname=os_volgroup01 --size=1024 --grow
> >>>>
> >>>> Option 2:
> >>>> zerombr yes
> >>>> clearpart --all --initlabel
> >>>> part /boot --fstype ext3 --size=100
> >>>> part pv.os --size=10000 --grow --maxsize=10000 --asprimary
> >>>> volgroup os_volgroup01 pv.os
> >>>> logvol / --fstype ext3 --name=os_root --vgname=os_volgroup01 --size=1024 --grow
> >>> I do this through kickstart and here's what I use:
> >>>
> >>> bootloader --location=mbr
> >>> zerombr yes
> >>> clearpart --linux --initlabel --drives=sda
> >>> part /boot --fstype ext3 --size=128 --ondisk=sda --asprimary
> >>> part pv.0 --size=0 --grow --ondisk=sda
> >>> volgroup CentOS --pesize=32768 pv.0
> >>> logvol / --fstype ext3 --name=root --vgname=CentOS --size=4096 --grow --maxsize=16384
> >>> logvol swap --fstype swap --name=swap --vgname=CentOS --size=1024 --grow --maxsize=2048
> >>>
> >>> I haven't tried without swap and I think anaconda expects there to be a swap definition
> >>> in kickstart, so that might be it, lv wasn't activated because swap was missing.
> >>>
> >>> Best I can think of.
> >>>
> 
> Hey,
> 
> 	So I copied the example you provided and it still 
> failed in the same way as all my earlier tests.
> 
> Our normal kickstarts cover all the things you suggested so we have and 
> most others have not see this issue yet.
> 
> But there definitely appears to be a problem with LVM being made 
> available during the install phase after it was created and before the 
> formatting takes place.
> 
> Adding a swap section to the lvm setup seems to be like a work around or 
> requirement for now.

Weird, I guess maybe it calls for a bug report to be filed for anaconda.

I would probably just setup swap on LVM anyways if I was using LVM, so
it's not a show stopper, but it seems with anaconda right now if you
are doing kickstart and using LVM then swap needs to be on LVM.

Can you try this while you have your test system working:

--snip--
bootloader --location=mbr
zerombr yes
clearpart --all --initlabel
part /boot --fstype ext3 --size=128 --asprimary
part swap --fstype swap --size=4096
part pv.os --size=0 --grow
volgroup CentOS pv.os
logvol / --fstype ext3 --name=root --vgname=CentOS --size=4096 --grow --maxsize=8192
logvol swap --fstype swap --name=swap --vgname=CentOS --size=1024 --grow --maxsize=2048
--snip--

Oh, oh, I just saw the problem as I was typing.

part swap --fstype swap --size-4096

Originally you had:

part swap --size=1000

And was missing '--fstype swap' that just might be the problem!

-Ross

______________________________________________________________________
This e-mail, and any attachments thereto, is intended only for use by
the addressee(s) named herein and may contain legally privileged
and/or confidential information. If you are not the intended recipient
of this e-mail, you are hereby notified that any dissemination,
distribution or copying of this e-mail, and any attachments thereto,
is strictly prohibited. If you have received this e-mail in error,
please immediately notify the sender and permanently delete the
original and any copy or printout thereof.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3971 bytes
Desc: not available
URL: <http://lists.centos.org/pipermail/centos/attachments/20080304/ef72e5ec/attachment-0004.bin>