I'd like to automate the upgrade from CentOS 4.6 to 5.1 as much as possible. Since upgrades per se are not really recommended, I'm planning to do a kickstart installation. However, I want to leave one of the existing partitions (/scratch) untouched during the installation. Here is my current layout (LogVol00 is swap so not shown in the df output below):
# df -hl Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol01 36G 11G 24G 30% / /dev/sda1 99M 17M 78M 18% /boot /dev/mapper/VolGroup00-LogVol02 36G 9.7G 24G 29% /scratch # vgscan Reading all physical volumes. This may take a while... Found volume group "VolGroup00" using metadata type lvm2 # pvscan PV /dev/sda2 VG VolGroup00 lvm2 [74.41 GB / 32.00 MB free] Total: 1 [74.41 GB] / in use: 1 [74.41 GB] / in no VG: 0 [0 ] # lvscan ACTIVE '/dev/VolGroup00/LogVol01' [35.75 GB] inherit ACTIVE '/dev/VolGroup00/LogVol02' [35.72 GB] inherit ACTIVE '/dev/VolGroup00/LogVol00' [2.91 GB] inherit
I've tried various alternatives of specifying the disk layout in the kickstart file, and here is my latest attempt:
part /boot --fstype ext3 --onpart sda1 part pv.2 --noformat --onpart sda2 volgroup VolGroup00 --noformat --useexisting --pesize=32768 logvol swap --useexisting --fstype swap --name=LogVol00 -- vgname=VolGroup00 logvol / --useexisting --fstype ext3 --name=LogVol01 -- vgname=VolGroup00
But when I try to install CentOS 5.1 via kickstart, anaconda complains that "You have not defined a root partition (/), which is required for installation of CentOS to continue". Has anyone successfully installed CentOS 5.X via kickstart and preserved at least one partition on a logical volume, and if so, could you please share your kickstart file?
Thanks, Alfred
On 29/04/2008, at 6:27 AM, Alfred von Campe wrote:
But when I try to install CentOS 5.1 via kickstart, anaconda complains that "You have not defined a root partition (/), which is required for installation of CentOS to continue". Has anyone successfully installed CentOS 5.X via kickstart and preserved at least one partition on a logical volume, and if so, could you please share your kickstart file?
Alfred,
This worked fine for me on a 4.6 kickstart I did recently. I can't remember whether I tried it on 5.x or not, sorry.
bootloader --location=mbr --driveorder=sda part /boot --onpart=sda1 --fstype=ext3 part swap --onpart=sda2 --fstype=swap volgroup vg --useexisting logvol / --useexisting --name=root --vgname=vg --fstype=ext3
Because the volgroup already exists you don't need to define a PV for it.
Hope this helps, although it doesn't look much different to your config!
Regards, Tom
On Apr 28, 2008, at 18:37, Tom Lanyon wrote:
This worked fine for me on a 4.6 kickstart I did recently. I can't remember whether I tried it on 5.x or not, sorry.
bootloader --location=mbr --driveorder=sda part /boot --onpart=sda1 --fstype=ext3 part swap --onpart=sda2 --fstype=swap volgroup vg --useexisting logvol / --useexisting --name=root --vgname=vg --fstype=ext3
Because the volgroup already exists you don't need to define a PV for it.
That last sentence was the key. I removed the line "part pv.2 -- noformat --onpart sda2" and did not make any other changes and now the "upgrade" is working fine. For future reference, here is what the relevant section of my kickstart file looked like:
bootloader --location=mbr --append="rhgb quiet" part /boot --fstype ext3 --onpart sda1 volgroup VolGroup00 --useexisting logvol swap --useexisting --fstype swap --name=LogVol00 -- vgname=VolGroup00 logvol / --useexisting --fstype ext3 --name=LogVol01 -- vgname=VolGroup00
Thanks for the help, Alfred