Hi,
I have a test system that booted fine using "Legacy Bios” mode and using the following Kickstart snippet configured the disks correctly:-
# Clear the Master Boot Record zerombr # Partition clearing information clearpart --all --initlabel # Disk partitioning information part raid.01 --fstype="raid" --ondisk=sda --size=500 part raid.02 --fstype="raid" --grow --ondisk=sda --size=1 part raid.03 --fstype="raid" --ondisk=sdb --size=500 part raid.04 --fstype="raid" --grow --ondisk=sdb --size=1 raid /boot --device=0 --fstype="xfs" --level=RAID1 raid.01 raid.03 raid pv.01 --device=1 --level=RAID1 raid.02 raid.04
For UEFi I changed it to the following:-
# Clear the Master Boot Record zerombr # Partition clearing information clearpart --all --initlabel # Disk partitioning information part raid.01 --fstype="raid" --ondisk=sda --size=500 part raid.02 --fstype="raid" --grow --ondisk=sda --size=1 part raid.03 --fstype="raid" --ondisk=sdb --size=500 part raid.04 --fstype="raid" --grow --ondisk=sdb --size=1 raid /boot --device=0 --fstype="xfs" --level=RAID1 raid.01 raid.03 part /boot/efi —fstype=“efi” --grow --maxsize=200 --size=20 raid pv.01 --device=1 --level=RAID1 raid.02 raid.04
The install fails under UEFi due to the fact the partitions are not cleared, and it doesn’t have any space to continue. Is there an extra step I need to do to remove the original partitions before the new layout will work ?
Thanks
On 08/19/2016 11:35 PM, Phil Manuel wrote:
The install fails under UEFi due to the fact the partitions are not cleared, and it doesn’t have any space to continue. Is there an extra step I need to do to remove the original partitions before the new layout will work ?
Yes. If you have pre-existing RAID partitions, they'll automatically assemble before Anaconda runs, and the installer won't be able to remove them. It's easiest to handle this interactively, using wipefs to clear the filesystems, RAID metadata, and disks. Because my systems are fairly predictable, I have a function in my kickstart file that I run from the %pre script when I specify a keyword in the boot parameters. You'll want to do something similar...
Stop logical volumes if present. Wipe filesystems with wipefs, and then stop the RAID volumes. Finally, wipe the disk partition table.
wipedisks() { vgchange -a n test -b /dev/md/efi && wipefs -a /dev/md/efi && mdadm --stop /dev/md/efi test -b /dev/md/boot && wipefs -a /dev/md/boot && mdadm --stop /dev/md/boot test -b /dev/md/primary && wipefs -a /dev/md/primary && mdadm --stop /dev/md/primary for x in /dev/md/* do mdadm --stop $x done for x in ${drives[@]} do for p in /dev/${x}[0-9]* do wipefs -a $p done wipefs -a $x done }
On Sun, 21 Aug 2016 at 12:51 Gordon Messmer gordon.messmer@gmail.com wrote:
On 08/19/2016 11:35 PM, Phil Manuel wrote:
The install fails under UEFi due to the fact the partitions are not
cleared, and it doesn’t have any space to continue. Is there an extra step I need to do to remove the original partitions before the new layout will work ?
Yes. If you have pre-existing RAID partitions, they'll automatically assemble before Anaconda runs, and the installer won't be able to remove them. It's easiest to handle this interactively, using wipefs to clear the filesystems, RAID metadata, and disks. Because my systems are fairly predictable, I have a function in my kickstart file that I run from the %pre script when I specify a keyword in the boot parameters. You'll want to do something similar...
Stop logical volumes if present. Wipe filesystems with wipefs, and then stop the RAID volumes. Finally, wipe the disk partition table.
wipedisks() { vgchange -a n test -b /dev/md/efi && wipefs -a /dev/md/efi && mdadm --stop /dev/md/efi test -b /dev/md/boot && wipefs -a /dev/md/boot && mdadm --stop /dev/md/boot test -b /dev/md/primary && wipefs -a /dev/md/primary && mdadm --stop /dev/md/primary for x in /dev/md/* do mdadm --stop $x done for x in ${drives[@]} do for p in /dev/${x}[0-9]* do wipefs -a $p done wipefs -a $x done }
Hi Gordon Thanks for your help. unfortunately it is still complaining. Currently, I try to install and it fails, I remove all the partitions from ALT-F3 console using wipefs, check with parted -l that the partitions and labels are wiped and then reboot.
It fails again with:-
ERR ananconda: Bootloader setup failed: failed to find a suitable stage1 device INFO anaconda: fs space: 0 B needed: 2861.02 MiB
If I reboot, select legacy BIOS it works
The only differences in the Kickstart files are as follows:
legacy KS bootloader --location=mbr --boot-drive=sda --driveorder=sda,sdb --append="console=tty0 console=ttyS1,9600 console=ttyS2,115200" clearpart --all --initlabel
--- UEFi Ks below: bootloader --location=partition --boot-drive=sda --driveorder=sda,sdb --append="console=tty0 console=ttyS1,9600 console=ttyS2,115200" clearpart --all --initlabel --drives=sda,sdb part /boot/efi --fstype="efi" --size=200 --ondisk=sda
And I have tried the latter with location as mbr still fails
What am I missing ?
Thanks
On 08/21/2016 11:56 PM, Phil Manuel wrote:
part /boot/efi --fstype="efi" --size=200 --ondisk=sda And I have tried the latter with location as mbr still fails What am I missing ?
I very vaguely remember struggling with this as well, but I can't find my notes from that work at the moment.
My kickstart files for non-RAID UEFI boots use something like this:
bootloader --location=mbr --append="net.ifnames=0 biosdevname=0" part /boot/efi --ondrive=sda --fstype=efi --label EFI part /boot --fstype=ext4 --ondrive=sda ...
My memory is really fuzzy, but if I remember right, this didn't work when I didn't specify "--label EFI" or some other really silly thing. I think I resolved the problem by doing a manual install and then working with the anaconda.ks file until I was satisfied.
On Tue, 23 Aug 2016 at 02:18 Gordon Messmer gordon.messmer@gmail.com wrote:
On 08/21/2016 11:56 PM, Phil Manuel wrote:
part /boot/efi --fstype="efi" --size=200 --ondisk=sda And I have tried the latter with location as mbr still fails What am I missing ?
I very vaguely remember struggling with this as well, but I can't find my notes from that work at the moment.
My kickstart files for non-RAID UEFI boots use something like this:
bootloader --location=mbr --append="net.ifnames=0 biosdevname=0" part /boot/efi --ondrive=sda --fstype=efi --label EFI part /boot --fstype=ext4 --ondrive=sda ...
My memory is really fuzzy, but if I remember right, this didn't work when I didn't specify "--label EFI" or some other really silly thing. I think I resolved the problem by doing a manual install and then working with the anaconda.ks file until I was satisfied.
OK So I tried your suggestion no joy. Installed i manually. Took the kickstart file from this install, and tried to use this as the install kickstart. It failed. I deleted all the partitions and tried again no joy, the default ks is as follows:-
#version=DEVEL # Use network installation url --url="http://192.168.0.156/CentOS7-x86_64/disc1/" # Use text mode install text ignoredisk --only-use=sda,sdb # Keyboard layouts keyboard --vckeymap=us --xlayouts='us' # System language lang en_US.UTF-8
# Network information network --bootproto=dhcp --device=enp0s31f6 --ipv6=auto --activate network --hostname=localhost.localdomain
# Root password rootpw --iscrypted # Do not configure the X Window System skipx # System timezone timezone Australia/Sydney # System bootloader configuration bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda autopart --type=lvm # Partition clearing information clearpart --all --initlabel --drives=sda,sdb
%packages @core kexec-tools
%end
%addon com_redhat_kdump --enable --reserve-mb='auto'
%end
Should I need to change anything to this ?
Thanks
On Tue, 23 Aug 2016, Phil Manuel wrote:
On Tue, 23 Aug 2016 at 02:18 Gordon Messmer gordon.messmer@gmail.com wrote:
On 08/21/2016 11:56 PM, Phil Manuel wrote:
part /boot/efi --fstype="efi" --size=200 --ondisk=sda And I have tried the latter with location as mbr still fails What am I missing ?
... lots of troubleshooting deleted ...
If all else fails, you can pull out the sledgehammer: dd. Add a %pre section to your kickstart.
%pre --interpreter=/usr/bin/bash # nuke all MBR and partition info. season list of # block devices to taste. for BLKDEV in sda sdb; do dd if=/dev/zero of=/dev/$BLKDEV bs=512 count=4 done %end
This will execute prior to anaconda trying to partition the disk. Note that it will erase or obfuscate all data on the disk(s) so it's definitely unsuited for systems on which you want to retain data.
Hi all,
This the latest output from anaconda.log:-
06:08:54,828 DEBUG anaconda: new disk order: [] 06:08:54,832 DEBUG anaconda: new disk order: [] 06:08:54,851 DEBUG anaconda: stage1 device cannot be of type disk 06:08:54,865 DEBUG anaconda: _is_valid_disklabel(sda1) returning True 06:08:54,867 DEBUG anaconda: _is_valid_size(sda1) returning True 06:08:54,867 DEBUG anaconda: _is_valid_location(sda1) returning True 06:08:54,867 DEBUG anaconda: _is_valid_format(sda1) returning False 06:08:54,867 DEBUG anaconda: is_valid_stage1_device(sda1) returning False 06:08:54,867 ERR anaconda: BootLoader setup failed: failed to find a suitable stage1 device 06:08:54,979 INFO anaconda: fs space: 0 B needed: 2861.02 MiB
The relevant kickstart section is:-
clearpart --all --initlabel --drives=sda,sdb ignoredisk --only-use=sda,sdb # System bootloader configuration part /boot/efi --fstype efi --grow --maxsize=200 --size=20 --ondisk=sda bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda1 autopart --type=lvm
So it's failing on the bootloader section. I've tried with the following line too:-
bootloader --append=" crashkernel=auto" --location=partition --boot-drive=sda1
Still fails.
Thanks
On Wed, 24 Aug 2016 at 02:07 Gordon Messmer gordon.messmer@gmail.com wrote:
On 08/22/2016 11:31 PM, Phil Manuel wrote:
Should I need to change anything to this ?
As far as I know, you shouldn't. If installation still fails, you'll probably need to post the logs somewhere to get more useful assistance.
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
On 08/25/2016 11:35 PM, Phil Manuel wrote:
The relevant kickstart section is:-
part /boot/efi --fstype efi --grow --maxsize=200 --size=20 --ondisk=sda bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda1 autopart --type=lvm
A couple of things to consider: * The documentation for "autopart" states that "The autopart command can't be used with the logvol, part/partition, raid, reqpart, or volgroup in the same kickstart file," so your use of autopart and "part /boot/efi" appear to be incompatible. Maybe drop the "part" line. * I specify partitions for kickstart, but my bootloader line is: bootloader --location=mbr --append="net.ifnames=0 biosdevname=0" No location is specified, the installer works it out. Given the error you posted, I think sda1 might not be where anaconda is putting the EFI partition.
Gordon Messmer wrote:
On 08/25/2016 11:35 PM, Phil Manuel wrote:
The relevant kickstart section is:-
part /boot/efi --fstype efi --grow --maxsize=200 --size=20 --ondisk=sda bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda1 autopart --type=lvm
A couple of things to consider:
- The documentation for "autopart" states that "The autopart command
can't be used with the logvol, part/partition, raid, reqpart, or volgroup in the same kickstart file," so your use of autopart and "part /boot/efi" appear to be incompatible. Maybe drop the "part" line.
- I specify partitions for kickstart, but my bootloader line is: bootloader --location=mbr --append="net.ifnames=0 biosdevname=0" No location is specified, the installer works it out. Given the
error you posted, I think sda1 might not be where anaconda is putting the EFI partition.
Just one more thing - I'm sure this was the case with 6, not sure about 7, but I think so - I think the command was autopart that couldn't deal with GPT, if you're using that. And I don't know that it will understand or set the /boot/efi/EFI to partition type BIOSDIR (or whatever the right type is), but it's *not* a normal type.
mark
IF you've sorted this out, skip this email, it might be confusing.
Your best bet might be to do this in a VM using custom partitioning then look at the resulting /root/anaconda-ks.cfg for hints. I find the nomenclature of anaconda kickstarts to be very confusing and non-obvious. And I'm willing to bet this stuff changes a LOT between versions of anaconda, especially in new areas like UEFI firmware as during Fedora testing in the approximate lifecycle of RHEL 7, there were lots of bugs and lots of fixes.
So I just tried a two disk autopartitioning with CentOS 7 (not 7.2) which is using anaconda-19.31.79-1. The kickstart I get
#version=RHEL7 # System authorization information auth --enableshadow --passalgo=sha512
# Use CDROM installation media cdrom # Run the Setup Agent on first boot firstboot --enable ignoredisk --only-use=vda,vdb # Keyboard layouts keyboard --vckeymap=us --xlayouts='us' # System language lang en_US.UTF-8
# Network information network --bootproto=dhcp --device=ens3 --onboot=off --ipv6=auto network --hostname=localhost.localdomain # Root password rootpw --iscrypted $6$ # System timezone timezone America/New_York --isUtc # System bootloader configuration bootloader --location=mbr --boot-drive=vda autopart --type=lvm # Partition clearing information clearpart --none --initlabel
%packages @core
%end
-----
So the screwy parts... bootloader --location=mbr makes zero sense to me on UEFI systems. Clearly it should be on a partition, the EFI system partition, and the installation that resulted in this kickstart file did create an EFI system partition, a bootloader is on it, and there is no bootloader code in the first 440 bytes of the PMBR. So, yeah... pretty screwy that this kickstart does the right thing.
FWIW I don't highly recommend this layout because what it does is creates a linear/concat of vda and vdb primarily for LVM, and spreads rootfs (and home) across both drives. One device failure means complete data loss. The install will let you create an mdadm raid level 1 (mirror) of the EFI system partition in custom partitioning on two drives. It's debatable if this is a great idea for enterprise software, but no one has bothered to come up with the kind of solution you'd see on other platforms where the thing that modifies the ESP is capable of modifying all ESPs, to keep them in sync, without using software RAID. So we're sorta stuck with mdadm raid1, or you'd have to create your own script that syncs a primary ESP to the secondary ESP (primary being the one mounted at /boot/efi and the only one that'd get updated bootloaders and bootloader config).
Yada.
Chris Murphy
On Fri, Aug 26, 2016 at 10:39 AM, Gordon Messmer gordon.messmer@gmail.com wrote:
On 08/25/2016 11:35 PM, Phil Manuel wrote:
The relevant kickstart section is:-
part /boot/efi --fstype efi --grow --maxsize=200 --size=20 --ondisk=sda bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda1 autopart --type=lvm
A couple of things to consider:
- The documentation for "autopart" states that "The autopart command can't
be used with the logvol, part/partition, raid, reqpart, or volgroup in the same kickstart file," so your use of autopart and "part /boot/efi" appear to be incompatible. Maybe drop the "part" line.
- I specify partitions for kickstart, but my bootloader line is: bootloader --location=mbr --append="net.ifnames=0 biosdevname=0" No location is specified, the installer works it out. Given the error you
posted, I think sda1 might not be where anaconda is putting the EFI partition.
That appears to be basically correct. It'll put it on sda1 but it doesn't want you to tell it to put it on sda1 when using autopart. Pretty much autopart wants to be told very little, and Phil's kickstart is being too explicit for autopart.
On 28 Aug 2016, at 10:04 AM, Chris Murphy lists@colorremedies.com wrote:
On Fri, Aug 26, 2016 at 10:39 AM, Gordon Messmer <gordon.messmer@gmail.com mailto:gordon.messmer@gmail.com> wrote:
On 08/25/2016 11:35 PM, Phil Manuel wrote:
The relevant kickstart section is:-
part /boot/efi --fstype efi --grow --maxsize=200 --size=20 --ondisk=sda bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda1 autopart --type=lvm
A couple of things to consider:
- The documentation for "autopart" states that "The autopart command can't
be used with the logvol, part/partition, raid, reqpart, or volgroup in the same kickstart file," so your use of autopart and "part /boot/efi" appear to be incompatible. Maybe drop the "part" line.
- I specify partitions for kickstart, but my bootloader line is:
bootloader --location=mbr --append="net.ifnames=0 biosdevname=0" No location is specified, the installer works it out. Given the error you posted, I think sda1 might not be where anaconda is putting the EFI partition.
That appears to be basically correct. It'll put it on sda1 but it doesn't want you to tell it to put it on sda1 when using autopart. Pretty much autopart wants to be told very little, and Phil's kickstart is being too explicit for autopart.
Thanks for all the comments to date, so I should try:-
clearpart --all --initlabel --drives=sda,sdb ignoredisk --only-use=sda,sdb # System bootloader configuration bootloader --append=" crashkernel=auto" --location=mbr autopart --type=lvm
There is also a nvme drive in the system too, hence the use of "ignoredisk --only-use=sda,sdb”.
Phil
Here is how i dig it up.
# efi partionen ??? %pre --interpreter /bin/sh if [ -d "/sys/firmware/efi" ]; then echo "part /boot/efi --fstype=efi --grow --maxsize=200 --size=200" >/tmp/efipartition-ks.tmp else echo "# no efi system" >/tmp/efipartition-ks.tmp fi %end
# System bootloader configuration bootloader --location=mbr # Clear the Master Boot Record zerombr # Partition clearing information clearpart --all --initlabel # Disk partitioning information %include /tmp/efipartition-ks.tmp part /boot --fstype="ext4" --size=250 # make the physical partition for the LVM to sit on "pv.01" is "partition volume number 01" alternatively something like "pv.02393" would be fine. # this partition should "grow" to fill the entire disk, the initial size is 1mb (don't use 0 here)
Sincerly Andy
Am Sonntag, den 28.08.2016, 21:36 +1000 schrieb Phil Manuel:
On 28 Aug 2016, at 10:04 AM, Chris Murphy lists@colorremedies.com wrote:
On Fri, Aug 26, 2016 at 10:39 AM, Gordon Messmer <gordon.messmer@gmail.com mailto:gordon.messmer@gmail.com> wrote:
On 08/25/2016 11:35 PM, Phil Manuel wrote:
The relevant kickstart section is:-
part /boot/efi --fstype efi --grow --maxsize=200 --size=20 --ondisk=sda bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda1 autopart --type=lvm
A couple of things to consider:
- The documentation for "autopart" states that "The autopart command can't
be used with the logvol, part/partition, raid, reqpart, or volgroup in the same kickstart file," so your use of autopart and "part /boot/efi" appear to be incompatible. Maybe drop the "part" line.
- I specify partitions for kickstart, but my bootloader line is:
bootloader --location=mbr --append="net.ifnames=0 biosdevname=0" No location is specified, the installer works it out. Given the error you posted, I think sda1 might not be where anaconda is putting the EFI partition.
That appears to be basically correct. It'll put it on sda1 but it doesn't want you to tell it to put it on sda1 when using autopart. Pretty much autopart wants to be told very little, and Phil's kickstart is being too explicit for autopart.
Thanks for all the comments to date, so I should try:-
clearpart --all --initlabel --drives=sda,sdb ignoredisk --only-use=sda,sdb # System bootloader configuration bootloader --append=" crashkernel=auto" --location=mbr autopart --type=lvm
There is also a nvme drive in the system too, hence the use of "ignoredisk --only-use=sda,sdb”.
Phil
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos