Creating a boot image that is using a remote kickstart file to install Red Hat

News Kickstart Recommended Books Recommended Links Modifying ISO image to include kickstart file Minimization of boot ISO  VNC-based Installation in Anaconda
Creating a boot image that is using a remote kickstart file to Install a system Modifying ISO image to include kickstart file Installation of Red Hat from a USB drive Installing RHEL via HTTP Installing via NFS   Loopback filesystem
  Administration Networking Move config files from one server to another Kickstart Pre- and Postinstall Scripts Humor Etc

Introduction

With UEFI boot, Red Hat 7, and HP ILO 4 things became way too complex.  The traditional BIOS can only boot from drives of 2.1 TB or less. If you have drives larger then that your only option is UEFI.  Other then that you can simplify you life sticking to traditional BIOS, unless you use some fancy options and UEFI provide advantages in this area.

There is no free lunch. while a more capable booting system, UEFI introduces additional complexity including, but not limited to,  a special 200MB UEFI partition which should be formatted as FAT. That's throws a monkey wrench into some operations related to kickstart, specifically to the modification of ISO disk to include reference to remote kickstart file in the boot menu. This is not fatal, but still if can aviod those troubles you should.  also incase of UEFI boot manager installed in the boot partition, but most server hardware is able to deal with this non-standard situation and boot correctly even if boot loader is located incorrectly.

RHEL 7 is another story of adding complexity to already very complex system. For booting, most of this complexity is related to use of systemd instead of initd and replated changes of how you work with networking. "What if we just don't do any of that bullshit?" is indeed a great question to ask in this case. May be you need to simplify a system not to make it more complex.

Combination of several complex, poorly understood (due to excessive complexity and the fact that installation represents only a tiny chunk of sysadmin workload)  subsystems lead to the  situation when everything became kind of brittle as in "one step left or one step right and guards shout without warning". Kind of electronic gulag for system administrators ;-). In other words, when you are using Kickstart for servers with UEFI boot,  you are walking of eggshells.  that actually means that for servers that still have disks less then 2TB good old MBR might still be a better option ;-).  What is interesting that with identical blades and identical kickstart files RHEL 6.9 Anaconda it gave me several different error messages during the installation.  Also it does not like hard drive that was not initialized and asks for confirmation. That can be suppressed via option --initlabel in clearpart statement of you ks.cfg. .

Kickstart used to work pretty well probably up to RHEL 6.5. Not any more.  

The key idea for using kickstart for unattended installation of multiple severs is creating  modified boot image of RHEL which included modified isolinux.cfg. Which in turn specify the location of the kickstart file and the necessary network information. It should be simple and well documented. But it is neither. And recently I need to install Red Hat on 12 servers and I spend more than 20 hours trying to make it work on RHEL 6.8, which helped slight improve this page (note this was not even 7.x  with  its own set of warts ;-).

If I just did it manually I probably could save half of this time, doing several installations in parallel  ;-).   Of course HP hardware presents its own can of worms, but I digress.

In any case the best way to access kickstart file is to put it on HTTP server, if you know this staff. If not then NFS is another option. After that comes FTP.   

Highlights of this process

Preliminary steps

  1. Install the required packages to create ISO9660 images, as follows:
    yum install -y genisoimage
  2. Mount the boot image
    mount -o loop /path/to/rhel-server-boot-image.iso /mnt
  3. Copy the required files  preserving attributed

STEP 1: First you need to modify specific line in the fist (default) item of boot menu in  isolinux.cfg

Modify append line in the first section of boot option in the isolinux.cfg file assign as a minimum location of ks.cfg on HTTP server and what Ethernet interface should be used (servers usually have multiple Ethernet interfaces. Two ports are minimal. for posts are common.  In case of static IP you need also provide the usual troika (IP/netmask/default router). 

STEP 2: You need to verify the files on you HTTP sever has right permission and are assessable.

STEP 3:  You need to modify your prototype kickstart file obtained from the server. Kickstart file generated by anaconda for your first server (the one that you installed manually) has directives for creating partitions commented out. you need to uncomment and correct them.

STEP 4: Verify parts of kickstart file using Kickstart Configurator and, if necessary make some corrections.  Please note that Kickstart Configurator is completely broken and after you load your kickstart file into it will never produce correct modified file. But some sections of generated file can be re-used to modify your initial file ks.cfg file manually. One useful feature is more precise selection of packages. If you experience errors, of if it crashes when you attempt to save file you can try first to preview you modified kickstart file and then save it. sometimes this work. If not you can select all area in preview using Ctrl-A and  copy it to your text editor window. See  Chapter 29. Kickstart Configurator

STEP 5:  Put back the modified file in image and test resulting image. It should be bootable. Recently this part became most difficult part due to existence of  UEFI boot partition

Possible further minimization of boot image

If you work via VPN and do not have Advanced license on HP server (you can get trial licence for 30 days from HP for free; that's usually enough for initial installation of OS)  further minimization of image can be important for you.

  1. You can copy only /isolinux folder. It is enough for this purpose. For example
    mkdir -p /root/iso
    cp -r /mnt/isolinux /root/iso
    umount /mnt
  2. You can minimize boot  menu to just two items, deleting the rest.  this does not make much sense, but there is such possibility if you like to experiment :-) The content above the first  label linux statement is not critical to the task in hand.
    rm -f /root/iso/isolinux/isolinux.cfg
    The resulting "tail" of  "standard"  isolinux.cfg file might look as following"
    label linux
      menu label ^Install Red Hat Enterprise Linux 6.8
      kernel vmlinuz
      append initrd=initrd.img ks=10.10.10.19/kickstart.ks ksdevice=eth0 ip=dhcp
    label local
      menu label Boot from ^local drive
      localboot 0xffff
    
    menu end

Creation of modified ISO file

Now we need to create the ISO. There are two different situations here

  1. You use traditional BIOS. In this case you  just need to rebuild ISO using mkisofs
    cd /location_of_file_tree_created_from_boot_cd # for example /svr/www/Boot
    mkisofs -o ../myboot.iso -b isolinux/isolinux.bin -c isolinux/boot.cat --no-emul-boot --boot-load-size 4 --boot-info-table -J -R -V disks .

    Also works

    mkisofs -o ../myboot.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -J -r .

    The resulting ISO image should be bootable and should pick up the necessary ks.cfg file.

    NOTE: mkisofs command in the form above is suitable only for legacy boot (MBR based) --  it does not create UEFI boot partition in the following example. As the result the resulting  image will be much smaller then the original and will not boot:
     

  2. You have UEFI BIOS.

    In case you server uses UEFI boot it is easier to said then done, because UEFI partition if FAT-based.

    mkisofs -o /tmp/efiboot.iso -b isolinux/isolinux.bin -c isolinux/boot.cat --no-emul-boot --boot-load-size 4 \
    --boot-info-table -eltorito-alt-boot -e images/efiboot.img \
    -graft_points EFI/BOOT=/mnt/EFI/BOOT images/efiboot.img=/mnt/images/efiboot.img \
    -no-emul-boot -J -R -V disks .

    (assuming you boot image is mounted on /mnt )

    After that you need to run

    isohybrid --uefi efiboot.iso

     Quoting from How can we create a customized Golden Image or RHEL ISO with kickstart file:

    Rebuild the DVD iso image
        # cd /rhel
        # mkisofs -o /tmp/new.iso -b isolinux/isolinux.bin -c isolinux/boot.cat  --no-emul-boot --boot-load-size 4 --boot-info-table -J -R -V disks .
    

    NOTE: In RHEL7, please make sure that you specify the volume id with -V option, and it's same as Volume_ID in step 6.

    8. Boot the machine from this ISO

    Kickstart has detailed documentation in the Installation Guide

    Important Note:

    • The image which will be created using the steps above won't be UEFI enabled. So to have an UEFI enabled image, use the following extra options.
    
    
    • And the graft point as follows.
    EFI/BOOT={0}/EFI/BOOT images/efiboot.img={0}/images/efiboot.img
    
    • Where {0} is replaced by the location where the existing DVD is mounted/extracted.
    • One should also run isohybrid on it so that it can be booted by both BIOS and UEFI:
    isohybrid --uefi boot.iso 

    but this truncated ISO image might still be bootable if your server has legacy boot option.

    More information on the options used with the mkisofs command can be found in the man pages for mkisofs(1).

    Google is also you friend but it does not provide useful references in this case.  Opening Red hat ticket is another option and if you are perssisten anough they might even help, not just bounce you to some semi-useless documents that they found by searching their database for relevant keywords.

Note of UEFI issues with USB sticks

Here is an exchange from microsoft Technet forum that explains the problem: Creating a bootable USB stick - differences between UEFI-BIOS and GPT-MBR

EckiS August 02, 2016
When it were true that a different USB stick was needed for different Bios, then the Windows Installation media could never boot on all Bios versions. But it can.

Maybe you formatted the USB stick with NTFS? On the page you linked:

If your server platform supports Unified Extensible Firmware Interface (UEFI), you should format the USB flash drive as FAT32 rather than as NTFS. To format the partition as FAT32, type format fs=fat32 quick, and then click ENTER.

....

XXX

Thanks, Ecki,

that's exactly my point of view.

In the forum a user claimed that that'd be true for DVDs but not for USB sticks. Now I want to make sure. And I want to make clear for every user out there that there is no peculiarity to UEFI except for a requirement of "\efi\boot\bootx64.efi" existing on the boot media.

... ...

XXX

From what I read (and from what I tested): UEFI can not boot from NTFS:

https://en.wikipedia.org/wiki/EFI_system_partition#Overview

https://github.com/pbatard/rufus/issues/589

https://blogs.technet.microsoft.com/askcore/2013/03/20/creating-bootable-usb-drive-for-uefi-computers/

XXX
Last week I received a Microsoft OEM Windows 10 Recovery USB stick from HP. That stick is formatted in NTFS (hell knows why, as it doesn't work with UEFI).

Trying to copy its contents to my USB stick (which I formatted FAT32) failed, because HP added a file larger than 4GB.

Now this is really getting difficult. I guess I'll need to use Rufus now in order to create a USB Stick layout having two partitions: The Active one using FAT, containing just the NTFS drivers and the UEFI boot loader, and a second partition using NTFS containing the contents from the HP/Microsoft OEM Windows 10 Recovery USB stick.

Gee ... Did no one at Microsoft/HP think of testing their USB stick when buring data to it?

RUFUS

Rufus - Create bootable USB drives the easy way

Create bootable USB drives the easy way
[rufus screenshot]

Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.

It can be especially useful for cases where:

 

Despite its small size, Rufus provides everything you need!

Oh, and Rufus is fast. For instance it's about twice as fast as UNetbootin, Universal USB Installer or Windows 7 USB download tool, on the creation of a Windows 7 USB installation drive from an ISO. It is also marginally faster on the creation of Linux bootable USB from ISOs. (1)
A non exhaustive list of Rufus supported ISOs is also provided at the bottom of this page.

Notes on ISO Support:

All versions of Rufus since v1.1.0 allow the creation of a bootable USB from an ISO image (.iso).

Creating an ISO image from a physical disc or from a set of files is very easy to do however, through the use of a CD burning application, such as the freely available CDBurnerXP or ImgBurn.

Notes on UEFI & GPT support:

Since version 1.3.2, Rufus support UEFI as well as GPT for installation media, meaning that it will allow you to install Windows 7, Windows 8 or Linux in full EFI mode.
However, Windows Vista or later is required for full UEFI/GPT support. Because of OS limitations, Windows XP restricts the creation of UEFI bootable drives to MBR mode.

 


Top Visited
Switchboard
Latest
Past week
Past month

NEWS CONTENTS

Old News ;-)

[Sep 18, 2017] Kickstart File Example

Kickstart File Example

Below is an example of a kickstart file that you can use to install and configure Parallels Cloud Server in unattended mode. You can use this file as the basis for creating your own kickstart files.

# Install Parallels Cloud Server

install

# Uncomment the line below to install Parallels Cloud Server in a completely unattended mode

# cmdline

# Use the path of http://example.com/pcs to get the installation files.

url --url http://example.com/pcs

# Use English as the language during the installation and as the default system language.

lang en_US.UTF-8

# Use the English keyboard type.

keyboard us

# Uncomment the line below to remove all partitions from the SDA hard drive and create these partitions: /boot, /, /vz, and swap.

# clearpart --drives=sda --all --initlabel

# zerombr

part /boot --fstype=ext4 --size=512

part / --fstype=ext4 --size=20096

part /vz --fstype=ext4 --size=40768 --grow

part swap --size=4000

# Use a DHCP server to obtain network configuration.

network --bootproto dhcp

# Set the root password for the server.

rootpw xxxxxxxxx

# Use the SHA-512 encryption for user passwords and enable shadow passwords.

auth --enableshadow --passalgo=sha512

# Set the system time zone to America/New York and the hardware clock to UTC.

timezone --utc America/New_York

# Set sda as the first drive in the BIOS boot order and write the boot record to mbr.

bootloader --location=mbr

# Tell the Parallels Cloud Server installer to reboot the system after installation.

reboot

# Install the Parallels Cloud Server license on the server.

key XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX

# Create the virt_network1 Virtual Network on the server and associate it with the network adapter eth0.

vznetcfg --net=virt_network1:eth0

# Configure the ip_tables ipt_REJECT ipt_tos ipt_limit modules to be loaded in Containers.

# Use the http://myrepository.com to handle Fedora OS and application templates.

vztturlmap $FC_SERVER http://myrepository.com

# Install the listed EZ templates. Cache all OS templates after installation. Skip the installation of pre-created templates.

nosfxtemplate

%eztemplates --cache

centos-6-x86_64

centos-6-x86

mailman-centos-6-x86_64

mailman-centos-6-x86

# Install the packages for Parallels Cloud Server on the server.

%packages

@base

@core

@vz

@ps

Kickstart file example for installing on EFI-based systems

You can use the file above to install Parallels Cloud Server on BIOS-based systems. For installation on EFI-based systems, you need to modify the following places in the file (the changes are highlighted in bold):

# The following 4 commands are used to remove all partitions from the SDA hard drive and create these partitions: /boot/efi (required for EFI-based systems), /boot, /, /vz, and swap.

# clearpart --drives=sda --all --initlabel

part /boot/efi --fstype=efi --grow --maxsize=200 --size=20

part /boot --fstype=ext4 --size=512

part / --fstype=ext4 --size=20096

part /vz --fstype=ext4 --size=40768 --grow

part swap --size=4000

# Configure the bootloader.

bootloader --location=partition

Kickstart file example for upgrading to Parallels Cloud Server 6.0

Below is an example of a kickstart file you can use to upgrade your system to Parallels Cloud Server 6.0.

# Upgrade to Parallels Cloud Server rather than perform a fresh installation.

upgrade

# Use the path of http://example.com/pcs to get the installation files.

url --url http://example.com/pcs

# Use English as the language during the upgrade and as the default system language.

lang en_US.UTF-8

# Use the English keyboard type.

keyboard us

# Set the system time zone to America/New York and the hardware clock to UTC.

timezone --utc America/New_York

# Upgrade the bootloader configuration.

bootloader --upgrade

[Sep 18, 2017] RHEL ISO with kickstart file

Aug 06, 2017 | unix.stackexchange.com

Hugo , asked Jan 7 '15 at 16:36

I am trying to edit the original RHEL 6.5 DVD (rhel-server-6.5-x86_64-dvd.iso) from redhat in order to add kickstart file on it. The goal is to have one 3.4Go iso with automatic install. And not one boot media and one DVD.

This technique is not supported by redhat officially, but I found a procedure : https://access.redhat.com/solutions/60959

My ks.cfg looks like :

install
cdrom
repo --name="Red Hat Enterprise Linux"  --baseurl=file:/mnt/source --cost=100
repo --name=HighAvailability --baseurl=file:///mnt/source/HighAvailability

I got an error when the installer start : it didn't find the disk Red Hat Enterprise Linux.

I guess this is because installer is not looking on its own media.

Is there a way to achieve this ? Does the cdrom have optional parameter to hard link the device ?

tonioc , answered Jan 7 '15 at 17:30

You don't need to set the repo URLs in ks.cfg, here is an example of kickstart that I use currently with rhel6.
# interactive install from CD-ROM/DVD
interactive
install
cdrom

key --skip
lang en_US.UTF-8
# keyboard us

#
clearpart --all --initlabel
part /boot --fstype ext4 --size=100
part pv.100000 --size=1 --grow
volgroup vg00 --pesize=32768 pv.100000
logvol / --fstype ext4 --name=lvroot --vgname=vg00 --size=15360
logvol swap --fstype swap --name=lvswap --vgname=vg00 --size=2048
logvol /var --fstype ext4 --name=lvvar --vgname=vg00 --size 5120

timezone Europe/Paris
firewall --disabled
authconfig --useshadow --passalgo=sha512
selinux --enforcing

#skipx

# pre-set list of packages/groups to install 
%packages
@core
@server-policy
acpid
device-mapper-multipath
dmidecode
# ... and so on the list of packages/groups I pre-customize (and with - those I don't want)
vsftpd
wget
xfsprogs
-autoconf
-automake
-bc
# ... and so on
#-----------------------------------------------------------------------------
# postinstall, execution avec chroot dans le systeme installé.
%post --interpreter=/bin/sh --log=/root/post_install.log
echo -e "================================================================="
echo -e "       Starting kickStart post install script "

# do some extra stuff here , like mounting cd-rom copying add-ons specific for my product

Hugo , asked Jan 7 '15 at 16:36

I am trying to edit the original RHEL 6.5 DVD (rhel-server-6.5-x86_64-dvd.iso) from redhat in order to add kickstart file on it. The goal is to have one 3.4Go iso with automatic install. And not one boot media and one DVD.

This technique is not supported by redhat officially, but I found a procedure : https://access.redhat.com/solutions/60959

My ks.cfg looks like :

install
cdrom
repo --name="Red Hat Enterprise Linux"  --baseurl=file:/mnt/source --cost=100
repo --name=HighAvailability --baseurl=file:///mnt/source/HighAvailability

I got an error when the installer start : it didn't find the disk Red Hat Enterprise Linux.

I guess this is because installer is not looking on its own media.

Is there a way to achieve this ? Does the cdrom have optional parameter to hard link the device ?

tonioc , answered Jan 7 '15 at 17:30

You don't need to set the repo URLs in ks.cfg, here is an example of kickstart that I use currently with rhel6.
# interactive install from CD-ROM/DVD
interactive
install
cdrom

key --skip
lang en_US.UTF-8
# keyboard us

#
clearpart --all --initlabel
part /boot --fstype ext4 --size=100
part pv.100000 --size=1 --grow
volgroup vg00 --pesize=32768 pv.100000
logvol / --fstype ext4 --name=lvroot --vgname=vg00 --size=15360
logvol swap --fstype swap --name=lvswap --vgname=vg00 --size=2048
logvol /var --fstype ext4 --name=lvvar --vgname=vg00 --size 5120

timezone Europe/Paris
firewall --disabled
authconfig --useshadow --passalgo=sha512
selinux --enforcing

#skipx

# pre-set list of packages/groups to install 
%packages
@core
@server-policy
acpid
device-mapper-multipath
dmidecode
# ... and so on the list of packages/groups I pre-customize (and with - those I don't want)
vsftpd
wget
xfsprogs
-autoconf
-automake
-bc
# ... and so on
#-----------------------------------------------------------------------------
# postinstall, execution avec chroot dans le systeme installé.
%post --interpreter=/bin/sh --log=/root/post_install.log
echo -e "================================================================="
echo -e "       Starting kickStart post install script "

# do some extra stuff here , like mounting cd-rom copying add-ons specific for my product

[Sep 17, 2017] RHEL6 Unable to download kickstart file

Sep 17, 2017 | unix.stackexchange.com
Oops! I didn't mean to do this.
up vote down vote favorite

robertpas , asked Nov 9 '15 at 15:13

In our lab we have a set of scripts that automatically configure a kickstart installation for RHEL5 on HP ProLiant DL380p Gen8. Based on data from several configuration files, it does the following steps:
  1. mounts redhat dvd
  2. modifies isolinux.cfg accordingly
  3. creates ks.cfg
  4. creates a bootdisk with the installation data (isolinux.cfg, ks.cfg, etc)
  5. creates a http server with the bootdisk directory.
  6. mounts the bootdisk through ILO ( /dev/scd1 )
  7. installs RHEL5

Here is the line referring to the kickstart file location :

append initrd=initrd.img ks=hd:scd1:/isolinux/ks.cfg ksdevice=eth4

Everything works well for RHEL5, but there have been requests for RHEL6.

For RHEL6, everything seems to work OK until #7, where it returns the message "unable to download kickstart file" . I have commented some lines in the scripts, eliminating the installation part and leaving only the ILO mount part.

The bootdisk is mounted and accessible on /dev/scd1 . The ks.cfg file is present there. I have also tested and the files from the Kickstart server are accessible with wget .

I have also tried accessing the ks.cfg file through http :

append initrd=initrd.img ks=http://<ip>:<port>/boot/isolinux/ks.cfg ksdevice=eth4

The above part did not work.

But what really vexes me is that RHEL5 works in the same conditions, but RHEL6 does not.

I have been talking to redhat support for a week and they don't seem to know what is wrong.

Any help would be greatly appreciated.

robertpas , answered Nov 11 '15 at 8:11

I have figured out the problem.

There seems to be a difference between RHEL5 and RHEL6 at the installation level.

RHEL5 will detect your physical cdrom and mount it on /dev/scd0 , therefore the location of the mount will be /dev/scd1 . RHEL6 does not seem to do this, therefore the mount location will be /dev/scd0 .

The correct way to declare the ks file location in a case like this is :

append initrd=initrd.img ks=hd:scd0:/isolinux/ks.cfg ksdevice=eth4

I hope someone will find this helpful in the future.

[Aug 10, 2017] Kickstart Problem with --initlabel

Notable quotes:
"... Last edited by phatrik; 08-07-2012 at 11:17 AM . Reason: prefixed with solved ..."
Aug 07, 2012 | www.linuxquestions.org
phatrik
Kickstart: Problem with --initlabel

I'm having a problem when using kickstart to deploy CentOS 6.3 KVM guest OS and no one seems to know why so I figured I'd ask in the KVM SF :-) Details:

- Tyring to install CentOS 6.3
- Doing a netinstall using a FTP site
- The installation is for a guest OS (KVM).

The install is being launched with:

virt-install -n server1.example.com -r 768 -l /media/netinstall -x "ks=ftp://192.168.100.2/pub/ks.cfg"

The install starts and gets to the point where I see "Error processing drive. This device may need to be re-initialized." The relevant part of my KS file:

clearpart --initlabel --all

# Disk partitioning information

part /boot --fstype="ext4" --size=500
part /home --fstype="ext4" --size=2048
part swap --fstype="swap" --size=2048
part / --fstype="ext4" --grow --size=1

When I switch to the 3rd terminal for information, here's what I see:

required disklable type for sda (1) is None
default diskalbel type for sda is msdos
selecting msdos diskalbel for sda based on size

Based on "required diskalbel type for sda (1) is none" I decided to remove the --initlabel parm, however I still face the same problem (prompted to initialize the disk).

TIA

Erik


Last edited by phatrik; 08-07-2012 at 11:17 AM . Reason: prefixed with solved
dyasny 08-07-2012 Registered: Dec 2007 Location: Canada Distribution: RHEL,Fedora Posts: 995
I'd just abandon virt-install and deploy VMs from a template instead. Much faster and easier to do
phatrik 08-07-2012, 08:14

Thank you for your reply, but that's obviously not the answer I'm looking for. Yes I know virt-clone could be used but what I'm truly interested in is getting at the bottom of this problem.

wungad

From RedHat Knowledge base
Issue

The 'clearpart --initlabel' option in a kickstart no longer initializes drives in RHEL 6.3.

Environment
Red Hat Enterprise Linux 6.3
Anaconda (kickstart)

Resolution

Use the 'zerombr' option in the kickstart to initialize disks and create a new partition table.

Use the 'ignoredisk' option in the kickstart to limit which disks are initialized by the 'zerombr' option. The following example will limit initialization to the 'vda' disk only:
zerombr
ignoredisk --only-use=vda

phatrik

Thank you for your reply, that's exactly what I was looking for.

Quote:

Originally Posted by wungad Issue
The 'clearpart --initlabel' option in a kickstart no longer initializes drives in RHEL 6.3.

Environment

Red Hat Enterprise Linux 6.3
Anaconda (kickstart)

Resolution

Use the 'zerombr' option in the kickstart to initialize disks and create a new partition table.
Use the 'ignoredisk' option in the kickstart to limit which disks are initialized by the 'zerombr' option. The following example will limit initialization to the 'vda' disk only:
zerombr
ignoredisk --only-use=vda

[Aug 08, 2017] Kickstart option to set GRUB drive location?

Notable quotes:
"... ignoredisk --drives=sdb ..."
Aug 08, 2017 | www.centos.org

andersbiro " 2010/03/04 12:36:32

Hello, I have successfully created a Centos USB stick installation with an automated kickstart configuration according to the instructions at http://wiki.centos.org/HowTos/InstallFromUSBkey .

Everything works flawlessly with the exception that the installation writes the GRUB Boot Loaders on the USB stick instead of the destination hard drive and hence can only be booted from the USB stick.

Afterwards I can solve this manually by editing grub.conf to point to the hard drive and using the grub utility I can nstall the Grub loader on the hard drive MBR instead and then it boots normally.

The aim is however to create a fully automated installation since the end users in question are expected to be technically proficient so my question is if there is a kickstart option to explicitly write GRUB correctly to the hard drive from the very beginning?

There seems to be a kickstart "bootloader" option but I can not really see any flags that would explicitly set the GRUB on a specified hard drive? Top


AlanBartlett
Forum Moderator
Posts: 9310
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact: Contact AlanBartlett Website
Re: Kickstart option to set GRUB drive location?

Post by AlanBartlett " 2010/03/04 18:52:16

In the CentOS wiki article that you reference, under the heading Notes , there is a [color=ff1480]cherry-red[/color] block of text. Isn't that appropriate?

If not, do you have any suggestions for improvement to the article? Top


pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact: Contact pschaff Website
Kickstart option to set GRUB drive location?

Post by pschaff " 2010/03/04 21:36:41

andersbiro wrote:
...
There seems to be a kickstart "bootloader" option but I can not really see any flags that would explicitly set the GRUB on a specified hard drive?

How about Kickstart Options : Code: Select all

bootloader (required)
Specifies how the boot loader should be installed. This option is required for both installations and upgrades.

* --append= ? Specifies kernel parameters. To specify multiple parameters, separate them with spaces. For example:

bootloader --location=mbr --append="hdd=ide-scsi ide=nodma"

* --driveorder ? Specify which drive is first in the BIOS boot order. For example:

bootloader --driveorder=sda,hda

* --location= ? Specifies where the boot record is written. Valid values are the following: mbr (the default),
partition (installs the boot loader on the first sector of the partition containing the kernel), or
none (do not install the boot loader).

Still can't guarantee that a totally automated approach is possible, unless the hardware is identical, as the devices and ordering will be system-dependent. Top


andersbiro
Posts: 12
Joined: 2010/02/22 10:07:54
Re: Kickstart option to set GRUB drive location?

Post by andersbiro " 2010/03/08 08:48:17

AlanBartlett wrote:
In the CentOS wiki article that you reference, under the heading Notes , there is a [color=ff1480]cherry-red[/color] block of text. Isn't that appropriate?

If not, do you have any suggestions for improvement to the article?

To my understanding this specific part of the text refers to an interactive installation but since I deal with a fully automatic installation I do not think that part is appropriate so that is why I am looking for corresponding kickstart options to achieve the same thing.
To be fair it also mentions the line bootloader --driveorder=cciss/c0d0,sda --location=mbr" that might be appropriate but since I am not very proficient with completely comprehending the parameters. Top


andersbiro
Posts: 12
Joined: 2010/02/22 10:07:54
Re: Kickstart option to set GRUB drive location?

Post by andersbiro " 2010/03/08 08:58:16

pschaff wrote:
andersbiro wrote:
...
There seems to be a kickstart "bootloader" option but I can not really see any flags that would explicitly set the GRUB on a specified hard drive?

How about Kickstart Options : Code: Select all

bootloader (required)
Specifies how the boot loader should be installed. This option is required for both installations and upgrades.

* --append= ? Specifies kernel parameters. To specify multiple parameters, separate them with spaces. For example:

bootloader --location=mbr --append="hdd=ide-scsi ide=nodma"

* --driveorder ? Specify which drive is first in the BIOS boot order. For example:

bootloader --driveorder=sda,hda

* --location= ? Specifies where the boot record is written. Valid values are the following: mbr (the default),
partition (installs the boot loader on the first sector of the partition containing the kernel), or
none (do not install the boot loader).

I was aware of these parameters but I am not fully sure about how to apply them... the "--location" flag seemed easy enough and also driveorder but the "append" kernel parameters eludes me but perhaps this is not required.

I know that the kernel and Grub part should reside on the first partition of disk "sda" and the USB stick on "sdb" so would setting the "--driveorder=sda,sdb" insure that grub.conf points to the sda disk?

Also, would that automatically write the GRUB loader on "sda" as well or do you need to use the "partition flag" for that? Top


andersbiro
Posts: 12
Joined: 2010/02/22 10:07:54
Re: Kickstart option to set GRUB drive location?

Post by andersbiro " 2010/03/08 12:04:09

As a matter of fact I tried the --driveorder flag and that actually worked as it now can boot directly without USB stick which is a great step forward.
The only remaining obstacle is that somehow the FAT32 partition disappear from the USB stick so it cannot be used for future installations.
This can however be fixed by using FDISK to create a new FAT32 partition in the same space and somehow this also restores the previous file in the partition.

Since the GRUB bootloader seems to be written to the destination disk I must say that I cannot understand at all why the FAT32 partition disappears?
Are additional flags required to prevent this from happening? Top


pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact: Contact pschaff Website
Re: Kickstart option to set GRUB drive location?

Post by pschaff " 2010/03/08 12:51:41

andersbiro wrote:
...
Since the GRUB bootloader seems to be written to the destination disk I must say that I cannot understand at all why the FAT32 partition disappears?
Are additional flags required to prevent this from happening?

I have not seen that happen. You have both FAT32 and ext3 partitions, and the FAT32 one is gone after the install? I'd check the kickstart file carefully to be sure it is not inadvertently messing with the USB drive.

Thanks for reporting back, and please keep us posted. Any recommendations for the Wiki article appreciated. Top


andersbiro
Posts: 12
Joined: 2010/02/22 10:07:54
Re: Kickstart option to set GRUB drive location?

Post by andersbiro " 2010/03/08 14:49:12

I managed to solve the issue by adding the "ignoredisk --drives=sdb" parameter for the USB drive and now the installer leaves the USB stick intact and the installation works flawlessly.
I however still do not know why the installer affected the disk in the first place but this flag did at any rate solve the problem for me. Top
pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact: Contact pschaff Website
Re: Kickstart option to set GRUB drive location?

Post by pschaff " 2010/03/08 14:53:40

Thanks for the additional info. Still seems that a general solution is elusive, as there's no guarantee that on a different set of hardware the USB drive will show up as /dev/sdb. Top
nektoid
Posts: 1
Joined: 2012/04/03 17:00:26
Re: Kickstart option to set GRUB drive location?

Post by nektoid " 2012/04/03 17:06:27

Hi. I ran into this recently kickstarting both 5.5 and 6.2 hosts. Kickstarts worked one day and the next the bootloader wanted to be on the usb key, odd. This is was an example of what worked for me with 5.5 where the usb key was consistently seen as sdb. Both at their respective parts in the preamble section of ks.cfg.

#stop writing bootloader to usb
bootloader --driveorder=sda,sdb --location=mbr

#stop erasing my usb stick
ignoredisk --drives=sdb

[Aug 06, 2017] Unable to download the kickstart file

Aug 06, 2017 | community.hpe.com
Hi there
There is a kickstart file on http://10.10.0.3/ks.cfg it opens in the browser fine and I can read the content.
Also wget http://10.10.0.3/ks.cf works flawlessly yet the installation fails with the following error : "Unable to download the kickstart file, please modify the kickstart parameter..."
I'm using apache as a web server.
Any idea what's causing the problem ?
Do I need some special configuration of Apache ?

Jesus is the King Solved! Go to Solution. 0 Kudos Reply

12 REPLIES Michal Kapalka (mikap) Honored Contributor

‎11-15-2010 11:54 PM

‎11-15-2010 11:54 PM

Re: Unable to download the kickstart file
hi,

check this forum thread :

http://web.archiveorange.com/archive/v/YcynVy2jK7BBdYo5BvqY

mikap 0 Kudos Reply Piotr Kirklewski Super Advisor

‎11-16-2010 05:50 AM

‎11-16-2010 05:50 AM

Re: Unable to download the kickstart file
Well - I'm not using NFS here.
So it seems to me that post is irrelevant unless I don't get it. Jesus is the King 0 Kudos Reply Piotr Kirklewski Super Advisor

‎11-16-2010 06:08 AM

‎11-16-2010 06:08 AM

Re: Unable to download the kickstart file
Also I have only one NIC in my VM and I'm not specifying the ksdevice in my ks.cfg .
Should I do that ? Jesus is the King 0 Kudos Reply Matti_Kurkela Honored Contributor

‎11-17-2010 01:52 AM

‎11-17-2010 01:52 AM

Re: Unable to download the kickstart file
You did not mention the name of your Linux distribution, but Kickstart suggests RedHat or one of its derivatives.

RedHat's installer sets up a shell prompt on one of the virtual consoles, and a log or two on other virtual consoles.

You might take a look at the logged messages, and/or use the shell prompt to verify the system has a working network connection.

See paragraph 4.1.1 of this document for a description of the virtual console functionality of the installer (this part of the installer has not changed significantly since RHEL 3):

http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/3/html/Installation_Guide_x8664/ch-guimode.html

Another possibility is that the web server offers the kickstart file using a MIME content type the installer does not like. I guess "text/plain" would be acceptable, but this might not be Apache's default content type for .cfg files.

If this is the case, you might have to add the file type to your Apache configuration:

AddType text/plain .cfg

MK MK 0 Kudos Reply Jimmy Vance HPE Pro

‎11-17-2010 04:06 AM

‎11-17-2010 04:06 AM

Re: Unable to download the kickstart file
You don't mention the server model or distribution version your working with. Even though other systems can access the ks file OK, maybe the system your trying to install on does not have proper NIC drivers during boot to access the ks file?

__________________________________________________
No support by private messages. Please ask the forum! I work for HPE

If you feel this was helpful please click the KUDOS! thumb below! 0 Kudos Reply Piotr Kirklewski Super Advisor

‎11-17-2010 09:47 AM

‎11-17-2010 09:47 AM

Re: Unable to download the kickstart file
I'm trying to install Centos5.5 64-bit
The PXE server is Debian.

vim /tftpboot/pxelinux.cfg/default

### CENTOS 5.5 - CUSTOM ###
LABEL Centos 5.5 x86_64 Custom
kernel CentOS/vmlinuz noapic
append initrd=CentOS/initrd.img ks= http://10.10.0.3/ks.cfg text nofb
TEXT HELP
Customized, unatended installation version of Centos 5.5
ENDTEXT
\n

Did you mean to add this to apache config ? :

DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm index.cfg ks.cfg

Jesus is the King 0 Kudos Reply Jimmy Vance HPE Pro

‎11-17-2010 10:15 AM

‎11-17-2010 10:15 AM

Re: Unable to download the kickstart file

OK, so now we know your working with CentOS

Does the CentOS 5.5 initrd image your booting from contain the correct NIC drivers for the server your trying to install on? You didn't mention the server model.

__________________________________________________
No support by private messages. Please ask the forum! I work for HPE

If you feel this was helpful please click the KUDOS! thumb below! 0 Kudos Reply Piotr Kirklewski Super Advisor

‎11-17-2010 02:30 PM

‎11-17-2010 02:30 PM

Re: Unable to download the kickstart file
It's a VM on ESXi 4.1.
I'm already using the same intrd here:
Label CentOS 5 64-bit installer & rescue
kernel centos5x64/vmlinuz
append initrd=centos5x64/initrd.img text vga=791
\n

I have just copied it to a different dir and started working on the kickstart installation.
The manual installation goes without any problems so I can't see why would it be different for the kickstart.
Jesus is the King 0 Kudos Reply Jimmy Vance HPE Pro

‎11-17-2010 04:56 PM

‎11-17-2010 04:56 PM

Solution
Re: Unable to download the kickstart file
A manual installation from media doesn't matter if it is bare iron, or a VM, the network does not come into play. For bare iron, or a VM, network installation the boot installer needs to be able to access the network to pull the KS file. While your in the installer switch over to one of the other console screens F2, F4, etc and see if the network is functional

__________________________________________________
No support by private messages. Please ask the forum! I work for HPE

If you feel this was helpful please click the KUDOS! thumb below! 1 Kudo Reply Piotr Kirklewski Super Advisor

‎11-18-2010 04:52 PM

‎11-18-2010 04:52 PM

Re: Unable to download the kickstart file
Alt + F3 shows the following message:
ERROR: No network device in choose network device!
ERROR: No network drivers for dooing kickstart
ERROR: Unable to bring up network

Where do I go from there ?

Jesus is the King 0 Kudos Reply Jimmy Vance HPE Pro

‎11-18-2010 05:12 PM

‎11-18-2010 05:12 PM

Re: Unable to download the kickstart file
Hopefully someone with more VMware experience than I have will chime in. I'm not sure what driver you need to load for the virtual NIC VMware presents to the guest OS

__________________________________________________
No support by private messages. Please ask the forum! I work for HPE

If you feel this was helpful please click the KUDOS! thumb below! 0 Kudos Reply DeafFrog Valued Contributor

‎11-22-2010 12:05 AM

‎11-22-2010 12:05 AM

Re: Unable to download the kickstart file
Hi ,

pls check this :

http://www.vmware.com/support/vsphere4/doc/vsp_41_new_feat.html

section "network" > ESXi configuration guide > page 96 .

hope this helps..

Reg. FrogIsDeaf

[Aug 06, 2017] Customising Anaconda uEFI boot menu to include kickstart parameter - Red Hat Customer Portal

Aug 06, 2017 | access.redhat.com
Customising Anaconda uEFI boot menu to include kickstart parameter Latest response March 3 2017 at 6:50 AM Hi

I am producing a remastered RHEL 6.5 which contains a custom kickstart. I have got the ISO to boot using the kickstart from a BIOS boot by making the standard modifications to isolinux.cfg (i.e. "append initrd=initrd.img ks=cdrom:/ks-x86_64.cfg"). However I cannot locate the correct file(s) to perform the same customisation when I boot to UEFI. I can enter the "ks=cdrom:/ks-x86_64.cfg" parameter to the UEFI anaconda boot menu by editing the kernel parameters but I cannot find a way of customising it like you can with editing isolinux.cfg.

Does anyone know how to customise the anaconda boot parameters when using UEFI?

Many thanks Started March 21 2014 at 11:55 AM by Aidan Beeson Community Member 87 points Join the conversation Responses Guru 6863 points 21 March 2014 4:03 PM James Radtke Community Leader Hey Aidan - I don't know this for certain (and don't have time to validate right now) but hopefully to get you moving forward.

Look in /EFI/BOOT in your media. It seems to resemble what is in /isolinux

Specifically, check out BOOTX64.conf

Raw
#debug --graphics
default=0
splashimage=/EFI/BOOT/splash.xpm.gz
timeout 5
hiddenmenu
title Red Hat Enterprise Linux 6.4
    kernel /images/pxeboot/vmlinuz
    initrd /images/pxeboot/initrd.img
title Install system with basic video driver
    kernel /images/pxeboot/vmlinuz xdriver=vesa nomodeset askmethod
    initrd /images/pxeboot/initrd.img
title rescue
    kernel /images/pxeboot/vmlinuz rescue askmethod
    initrd /images/pxeboot/initrd.img

I'll revisit this later if I have something to update/change. But, hopefully this is correct and helpful. ;-)

Community Member 87 points 21 March 2014 4:26 PM Aidan Beeson Hi James,

That does look promising. Bit of a "d'oh" moment as it was kinda obvious really! When I get a chance to get onto the UEFI hardware again I'll have a play and update this thread...

Thanks!

Community Member 87 points 25 March 2014 10:07 AM Aidan Beeson James,

You're correct, the configuration is located in the /EFI/BOOT/BOOTX64.conf.
Unlike the non-efi Anaconda boot it uses a standard grub menu rather than the (slightly) fancier one. To get it to boot anaconda using the kickstart file I've used the following:

Raw
#debug --graphics
default=0
splashimage=/EFI/BOOT/splash.xpm.gz
timeout 60
# hiddenmenu
title Install RHEL with kickstart
    kernel /images/pxeboot/vmlinuz ks=cdrom:/ks-x86_64.cfg
    initrd /images/pxeboot/initrd.img
title Install Standard Red Hat Enterprise Linux OS
    kernel /images/pxeboot/vmlinuz
    initrd /images/pxeboot/initrd.img
title Install system with basic video driver
    kernel /images/pxeboot/vmlinuz xdriver=vesa nomodeset askmethod
    initrd /images/pxeboot/initrd.img
title rescue
    kernel /images/pxeboot/vmlinuz rescue askmethod
    initrd /images/pxeboot/initrd.img

Many thanks

:)

Guru 6863 points 25 March 2014 2:27 PM James Radtke Community Leader Good to hear it. I'm glad we were on the right page. I believe this (uEFI) will start to become more of a hot topic as time goes on. (I know I have a lot to learn yet ;-) Community Member 30 points 9 March 2015 5:33 PM Jun Li Yes, uefi is becoming more popular now, uefi is standard now for HP G9 servers, while IBM/Lenovo x series made uefi standard couple years ago.

Satellite 6 is falling behind, so far, it doesn't support pxe uefi kickstart, reasons are:
1. tftp server doesn't have uefi boot image, only has bios boot image;
2. dhcp server config doesn't have have definition for uefi based pxe request. This actually isn't a satellite/foreman issue, because foreman is missing the function of update dhcpd.conf when a subnet defined.
3. A uefi compatible pxe config file is missing when a new host defined in foreman/satellite.
the one that defined in /var/lib/tftpboot/pxelinux.cfg only works for bios based pxe.

Based on the 3 issues, I got pxe uefi kickstart working this morning, by addressing the above 3 accordingly:

  1. Manually add uefi boot image to ttftp server:

[root@capsule tftpboot]# pwd
/var/lib/tftpboot
[root@capsule tftpboot]# cd efi/
[root@capsule efi]# ls
bootx64.efi efidefault images splash.xpm.gz TRANS.TBL
[root@capsule efi]#
[root@capsule efi]# pwd
/var/lib/tftpboot/efi
[root@capsule efi]# ls
bootx64.efi efidefault images splash.xpm.gz TRANS.TBL
[root@capsule efi]# ls -l images/pxeboot/
total 36644
-r--r--r-- 1 root root 33383449 Mar 6 12:27 initrd.img
-r--r--r-- 1 root root 441 Mar 6 12:27 TRANS.TBL
-r-xr-xr-x 1 root root 4128944 Mar 6 12:27 vmlinuz
[root@capsule efi]#
[root@capsule efi]# cat efidefault

debug --graphics

default=0
splashimage=(nd)/splash.xpm.gz
timeout 5
hiddenmenu
title Red Hat Enterprise Linux 6.5
root (nd)
kernel /images/pxeboot/vmlinuz ks=http://satellite6.example.com:80/unattended/provision?token=fc25b9df-8c28-41cf-af5d-fa42b6401c29 ksdevice=bootif network kssendmac
initrd=/images/pxeboot/initrd.img
IPAPPEND 2
title Install system with basic video driver
kernel /images/pxeboot/vmlinuz xdriver=vesa nomodeset askmethod
initrd /images/pxeboot/initrd.img
title rescue
kernel /images/pxeboot/vmlinuz rescue askmethod
initrd /images/pxeboot/initrd.img
[root@capsule efi]#

  1. Add one section to serve uefi based pxe request, so the cliet will get bootx64.efi boot image instead of pxelinux.0

class "pxeclients" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
next-server 10.1.1.1;

Raw
              if option arch = 00:06 {
                      filename "efi/bootia32.efi";
              } else if option arch = 00:07 {
                      filename "efi/bootx64.efi";
              } else {
                      filename "pxelinux.0";
              }

}

  1. every time when a new host defined in satellite 6/foreman, you will get a unattended provision url, copy this url, replace the ks url in /var/lib/tftpboot/efi/efidefault,

Now you should be able to kickstart a uefi system via pxe in a satellite 6/capsule environment.

Community Member 95 points 6 March 2015 12:02 AM David Worth Hi,

I am trying to create a custom iso for kickstart builds on servers with UEFI. From looking at the post, it looks like you were able to create a boot iso for EFI. If that is the case, what were the steps that you followed to create it? I am struggling to find good detailed info.

Thanks,
David

Community Member 39 points 9 March 2015 3:35 PM Aidan Beeson Hi David,

There are probably better/different ways of doing this but this is how I got it to work:

  1. Loop mount the install iso.
  2. Create local disk copies of "isolinx", "EFI" and "images" directories.
  3. Modify files in isolinux & EFI directories as required (e.g. isolinux.cfg and EFI/BOOT/BOOTX64.conf)
  4. Create the new ISO:
Raw
 mkisofs -o my.iso \
        -R -J -A "MyProject" \
  -hide-rr-moved \
  -v -d -N \
  -no-emul-boot -boot-load-size 4 -boot-info-table \
  -b isolinux/isolinux.bin \
  -c isolinux/isolinux.boot \
  -eltorito-alt-boot -no-emul-boot  \
  -eltorito-boot images/efiboot.img \
  -x ${mountDIR}/isolinux \
  -x ${mountDIR}/images \
  -x ${mountDIR}/EFI \
  -x .svn \
  -graft-points /path/to/loopmount/install_dvd my_kickstart.cfg=my_kickstart.cfg isolinux/=isolinux images=images EFI=EFI

The isolinux.cfg and BOOTx64.conf should contain a reference to the ks file, for example:

(isolinux.cfg)

Raw
label linux
  menu label ^Install OS using kickstart
  menu default
  kernel vmlinuz
  append initrd=initrd.img ks=cdrom:/my_kickstart.cfg
label vesa
  menu label Install ^standard Red Hat Enterprise Linux OS
  kernel vmlinuz
  append initrd=initrd.img 
label rescue
  menu label ^Rescue installed system
  kernel vmlinuz
  append initrd=initrd.img rescue
label local
  menu label Boot from ^local drive
  localboot 0xffff
label memtest86
  menu label ^Memory test
  kernel memtest
  append -

(BOOTx64.conf)

Raw
  title Install OS using kickstart
        kernel /images/pxeboot/vmlinuz ks=cdrom:/my_kickstart.cfg
        initrd /images/pxeboot/initrd.img
title Install standard Red Hat Enterprise Linux OS
        kernel /images/pxeboot/vmlinuz
        initrd /images/pxeboot/initrd.img
title Install system with basic video driver
        kernel /images/pxeboot/vmlinuz xdriver=vesa nomodeset askmethod
        initrd /images/pxeboot/initrd.img
title rescue
        kernel /images/pxeboot/vmlinuz rescue askmethod
        initrd /images/pxeboot/initrd.img

Hope this helps. I've tested it using a VMware EFI emulation but not in anger on any "real" EFI systems.

Aidan

Community Member 95 points 11 March 2015 8:23 PM David Worth Thanks for the info. We are building new servers on HP gen8 and 9 servers. The Gen9's are defaulting to UEFI. For this go around I reverted back to legacy, but we will have more builds to come. So it would be nice to figure a way to boot and install using UEFI. I am guessing that is the direction hardware vendors are going. Also interesting that it was not too easy to find a lot of good info. Just pieces here and there.

I will give this a try on the next hardware build using EFI.

Thanks again!

Community Member 95 points 22 March 2015 12:44 AM David Worth Hi Aidan

Thanks again for the info. I was troubleshooting why boot from SAN was not working with a HP bl460Gen9 blade. I was trying legacy mode, but would not boot after install from kickstart. Waiting For HP on this issue.

However, I created a dual boot ISO, legacy and EFI. I was able to set the bios to EFI and image the server from kickstart. I just added the following to EFI/BOOT/BOOTX64.conf:

debug --graphics

default=0
splashimage=/EFI/BOOT/splash.xpm.gz
timeout 360
title RHEL 6.6 l00l
kernel /images/pxeboot/vmlinuz ks=nfs:nfsserver:/ifs/data/kickstart/KSConfigs/l001/l001-ks.cfg initrd=rhe6664.img ksdevice=eth0 ip= gateway= netmask=255.255.255.0 dns=
initrd /images/pxeboot/initrd.img
title RHEL 6.6 l002
kernel /images/pxeboot/vmlinuz ks=nfs:nfsserver:/ifs/data/kickstart/KSConfigs/l002/l002-ks.cfg initrd=rhe6664.img ksdevice=eth0 ip= gateway= netmask=255.255.255.0 dns=
initrd /images/pxeboot/initrd.img
title Red Hat Enterprise Linux 6.6
kernel /images/pxeboot/vmlinuz
initrd /images/pxeboot/initrd.img
title Install system with basic video driver
kernel /images/pxeboot/vmlinuz xdriver=vesa nomodeset askmethod
initrd /images/pxeboot/initrd.img
title rescue
kernel /images/pxeboot/vmlinuz rescue askmethod
initrd /images/pxeboot/initrd.img

There was only one instance where the ISO booted up and was went to a grub menu. Not sure why, but rebooted and everything was good. So your steps also work with physical as well.

Regards,
David

Community Member 35 points 18 June 2015 5:38 PM Jose Carlos Alves Hi David,

What you have in your file isolinux/isolinux.cfg?

Regards,
Sara

Community Member 95 points 18 June 2015 10:24 PM David Worth Hi Sarah,

To setup a dual legacy and EFI boot iso, I mount the latest RHEL 6.x dvd and copy the following directories to a work area on my server.

EFI/ images/ isolinux

If you are just setting up legacy boot, you can ignore the EFI and images directories.

Here is an example of what I am putting in the isolinux.cfg

------start of file --------
default vesamenu.c32

prompt 1

timeout 600

display boot.msg

menu background splash.jpg
menu title Welcome to Red Hat Enterprise Linux 6.6!
menu color border 0 #ffffffff #00000000
menu color sel 7 #ffffffff #ff000000
menu color title 0 #ffffffff #00000000
menu color tabmsg 0 #ffffffff #00000000
menu color unsel 0 #ffffffff #00000000
menu color hotsel 0 #ff000000 #ffffffff
menu color hotkey 7 #ffffffff #ff000000
menu color scrollbar 0 #ffffffff #00000000

label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append initrd=initrd.img
label vesa
menu label Install system with ^basic video driver
kernel vmlinuz
append initrd=initrd.img xdriver=vesa nomodeset
label rescue
menu label ^Rescue installed system
kernel vmlinuz
append initrd=initrd.img rescue
label local
menu label Boot from ^local drive
localboot 0xffff
label servera-set-Network
kernel vmlinuz
append ks=nfs:nfsserver.example.com:/kickstart/location/servera-ks.cfg initrd=initrd.img ksdevice=eth0 ip=192.168.1.5 gateway=192.168.1.1 netmask=255.255.255.0 dns=1192.168.1.2
label serverb-dhcp
kernel vmlinuz
append ks=nfs:nfsserver.example.com:/kickstart/location/serverb-ks.cfg initrd=initrd.img ksdevice=eth0

------end of file --------

Then you have to run mkisofs to create the iso.

Hope that helps.

Regards,
David

Community Member 35 points 19 June 2015 8:15 AM Jose Carlos Alves Hi David,

My problema is because I have a HP Gen9 with UEFI and not EFI

I have
images
isolinux

In the isolinux.cfg, I have this

default=0
splashimage=/EFI/BOOT/splash.xpm.gz

prompt 1

timeout 5
hiddenmenu

label ptmtshdpnopp01
kernel vmlinuz
append initrd=initrd.img ksdevice=eth0 ip=10.126.77.11 netmask=255.255.255.224 gateway=10.126.77.1 dns=10.126.26.47 ks=nfs:10.126.58.136:/apps/redhat/ks-rhel-server-6.6-x86_64_hdp.cfg

label ptmtshdpnopp02
kernel vmlinuz

append initrd=initrd.img ksdevice=eth0 ip=10.126.77.12 netmask=255.255.255.224 gateway=10.126.77.1 dns=10.126.26.47 ks=nfs:10.126.58.136:/apps/redhat/ks-rhel-server-6.6-x86_64_hdp.cfg

I create th iso with

mkisofs -N -J -joliet-long -D -V "HADOOP" -o rhel-server-6.6-x86_64-hadoop.iso -b "isolinux/isolinux.bin" -c "isolinux/boot.cat" -hide "isolinux/boot.cat" -no-emul-boot -boot-load-size 4 -boot-info-table isolinux-6.6-x86_64/

But the machine doesn't see the iso

Thanks for the help
Regards,
Sara

Community Member 95 points 19 June 2015 1:18 PM David Worth Hi Sara,

I ran into the same thing earlier this year. We started using Gen9's. We had issues with boot from San and switching them to legacy mode, so we went with EFI, aka UEFI. EFI or UEFI boot is a different method of managing booting the OS. It was developed by HP in the Itanium servers. But you can search for the features and differences with legacy boot.

The way I went after booting with an ISO for kickstart installs is to create a dual boot ISO, legacy and EFI boot. Anything that will boot from legacy mode will read the isolinux.cfg and EFI mode will read the Bootx64.conf.

To create a dual ISO, create directory and copy EFI/ images/ isolinux/ directories from an install DVD. Next all you legacy boot entries will go into the isolinux/isolinux.cfg. You can see the example I have above. For EFI, you will have to edit the EFI/BOOT/BOOTx64.conf. Here is an example of what I put into mine.

-----start------

debug --graphics

default=0
splashimage=/EFI/BOOT/splash.xpm.gz
timeout 900
title Red Hat Enterprise Linux 6.6
kernel /images/pxeboot/vmlinuz
initrd /images/pxeboot/initrd.img
title rescue
kernel /images/pxeboot/vmlinuz rescue askmethod
initrd /images/pxeboot/initrd.img
title server-d
kernel /images/pxeboot/vmlinuz ks=nfs:nfsserver.example.net/kickstart/KSConfigs/server-d-ks.cfg ksdevice=eth0 ip=192.168.5.6 gateway=192.168.5.1 netmask=255.255.255.0 dns=192.168.2.2
initrd /images/pxeboot/initrd.img
title server-e
kernel /images/pxeboot/vmlinuz ks=nfs:nfsserver.example.net/kickstart/KSConfigs/server-e-ks.cfg ksdevice=eth0
initrd /images/pxeboot/initrd.img

------End------
In the example above, I put in an example of setting an IP as well as using DHCP. After you edit your legacy or EFI configs, then you have to create the ISO. Here is what I run to create a dual ISO:

  1. cd into the directory that contains the 3 directories I mentioned earlier.
  2. run > mkisofs -o ../my-iso-name.iso -R -J -A "MyDualISO" -hide-rr-moved -v -d -N -no-emul-boot -boot-load-size 4 -boot-info-table -b isolinux/isolinux.bin -c isolinux/isolinux.boot -eltorito-alt-boot -no-emul-boot -eltorito-boot images/efiboot.img -x ${mountDIR}/isolinux -x ${mountDIR}/images -x ${mountDIR}/EFI .

Also, after this is done, your kickstart will need to be able to work with EFI boots. First, the partition table will need to be gpt. Next, the bootloader location needs to be partition. Last, you will need a partition /boot/efi with fstype as efi and size 200.

If you need help with that, I can send you my disk layout from my kickstart config. Just let me know.

Regards,
David

Community Member 97 points 5 August 2015 7:26 PM Ivan Borghetti Hello David, how are you. I am also trying to create an iso that supports dual boot , i am now testing the UEFI boot and it works however i still need to customize the menu to list my different kickstarts, etc.

After copying the directories i needed i created the iso running mkisofs however i did not have the following lines in my command:

-x ${mountDIR}/isolinux -x ${mountDIR}/images -x ${mountDIR}/EFI .

Would you mind explaining me why those are needed and which would be the $(mountDIR) , i guess is the parent directory where those 3 subdirectories are, right? in my case would be iso

iso_cfg/
├── EFI
│ └── BOOT
├── images
│ └── pxeboot
└── isolinux

thanks in advance

Community Member 95 points 8 August 2015 10:27 AM David Worth Hi Ivan,

I am almost sure you do not need them. The -x is similar to the -m, which if you look in the man page, it allows you to exclude files. I was basing my mkisofs command off the one in this thread above. I thought I removed it from the one I use, but I still have it in.

Try removing it and see what happens. Can you let me know the outcome? Just curious.

Community Member 97 points 10 August 2015 12:12 PM Ivan Borghetti Hello David, thanks for your response, I tried without those parameters and it worked without issues,

thanks again

Community Member 95 points 10 August 2015 1:06 PM David Worth Great. Thanks for letting me know. I will take it out of my build script as well. Community Member 35 points 19 June 2015 2:37 PM Jose Carlos Alves Hi David,

Yes please, let me know what you have in your kickstart config about the disk layout.

Thanks,
Sara

Community Member 95 points 19 June 2015 3:05 PM David Worth Hi Sara,

I am setting up my disk partitioning in a pre section, then writing the disk to a file that gets included. The script will check for all drives and then only select a disk that is greater than 130000MB, roughly 126GB. This is to deal with the ISO, USB, or cdrom that you are using to image the server. It will ignore that and select my disk which is 134GB.

--------start---------

Disk Configuration

%include /tmp/partitioning

End Disk Configuration

%pre --log /root/ks-rhn-pre.log

Find OS disk

tdsk=""
list-harddrives | while read DISK DSIZE
do
#Convert float into int
DSIZEI=${DSIZE%.*}
# get scsi ID for disk
scsi_id="$(/mnt/runtime/lib/udev/scsi_id -gud /dev/${DISK})"
echo "F-$DSIZE I-$DSIZEI-- ID $scsi_id"

Raw
# determine if we should partition this device
###  if disk is smaller than 130000, than change the size in mb to reflect it.
if [ ${DSIZEI} -gt 130000 ]; then
     # add device to ignoredisk --only-use list
     ##the following is for SAN disks##
     tdsk="/dev/disk/by-id/scsi-${scsi_id}"
     ##End SAN Disk###

    ##if using local disks, comment the tdsk above and use this###
    ##tdsk="/dev/$DISK"
    ###End Local disk###

    echo "DISK - $tdsk"
Create GPT partition

echo "creating gpt on ${tdsk}"
parted -s ${tdsk} mklabel gpt

cat << EOF >> /tmp/partitioning
bootloader --location=partition --driveorder=${tdsk}
ignoredisk --only-use=${tdsk}
zerombr
clearpart --linux --drives=${tdsk}

part /boot/efi --fstype=efi --size=200 --ondisk=${tdsk}
part /boot --fstype ext4 --size=512 --ondisk=${tdsk}
part pv.4 --size=100 --grow --ondisk=${tdsk}
volgroup vg00 --pesize=32768 pv.4

logvol / --fstype ext4 --name=lvroot --vgname=vg00 --size=10240
logvol /opt --fstype ext4 --name=lvopt --vgname=vg00 --size=2048
logvol /home --fstype ext4 --name=lvhome --vgname=vg00 --size=2048
logvol /tmp --fstype ext4 --name=lvtmp --vgname=vg00 --size=6144
logvol /var --fstype ext4 --name=lvvar --vgname=vg00 --size=5120
logvol /usr/local --fstype ext4 --name=lvulocal --vgname=vg00 --size=4096
logvol swap --fstype swap --name=lvswap1 --vgname=vg00 --size=16384
logvol swap --fstype swap --name=lvswap2 --vgname=vg00 --size=16384
EOF
exit
fi
done

%end

--------end---------

Also note, I am booting from SAN so this line will work for SAN disks. > tdsk="/dev/disk/by-id/scsi-${scsi_id}"

If you are using local disks or VMware, use this > tdsk="/dev/$DISK"

I added comments to the pre script so you can see where to make changes. Hope that helps.

Regards,
David

Community Member 95 points 19 June 2015 3:18 PM David Worth It seems the formatting of the code is off. Let me try again. Raw
##Disk Configuration##
%include /tmp/partitioning

##End Disk Configuration##

%pre --log /root/ks-rhn-pre.log
##Find OS disk

 tdsk=""
 list-harddrives | while read DISK DSIZE
 do
    #Convert float into int
    DSIZEI=${DSIZE%.*}
    # get scsi ID for disk
    scsi_id="$(/mnt/runtime/lib/udev/scsi_id -gud /dev/${DISK})"
        echo "F-$DSIZE I-$DSIZEI-- ID $scsi_id"

    # determine if we should partition this device
###  if disk is smaller than 130000, than change the size in mb to reflect it.
    if [ ${DSIZEI} -gt 130000 ]; then
         # add device to ignoredisk --only-use list
##the following is for SAN disks##
         tdsk="/dev/disk/by-id/scsi-${scsi_id}"
##End SAN Disk###

    ##if using local disks, comment the tdsk above and use this###
    ##tdsk="/dev/$DISK"
    ###End Local disk###

        echo "DISK - $tdsk"

##Create GPT partition
echo "creating gpt on ${tdsk}"
parted -s ${tdsk} mklabel gpt

cat << EOF >> /tmp/partitioning
bootloader --location=partition --driveorder=${tdsk}
ignoredisk --only-use=${tdsk}
zerombr
clearpart --linux --drives=${tdsk}

part /boot/efi --fstype=efi --size=200 --ondisk=${tdsk}
part /boot --fstype ext4 --size=512 --ondisk=${tdsk}
part pv.4 --size=100 --grow --ondisk=${tdsk}
volgroup vg00 --pesize=32768 pv.4

logvol / --fstype ext4 --name=lvroot --vgname=vg00 --size=10240
logvol /opt --fstype ext4 --name=lvopt --vgname=vg00 --size=2048
logvol /home --fstype ext4 --name=lvhome --vgname=vg00 --size=2048
logvol /tmp --fstype ext4 --name=lvtmp --vgname=vg00 --size=6144
logvol /var --fstype ext4 --name=lvvar --vgname=vg00 --size=5120
logvol /usr/local --fstype ext4 --name=lvulocal --vgname=vg00 --size=4096
logvol swap --fstype swap --name=lvswap1 --vgname=vg00 --size=16384
logvol swap --fstype swap --name=lvswap2 --vgname=vg00 --size=16384
EOF
        exit
     fi
 done

%end

Community Member 35 points 29 June 2015 8:52 AM Jose Carlos Alves Thanks David,

I already installed my machines with your help.

Best regards,
Sara Soares

Community Member 32 points 1 October 2015 6:45 PM Gustavo Vegas Hello everyone,
I have a similar requirement, in our case we use ISO images to kickstart our servers. With pieces of information from this thread as well as some other resources out there, I have been able to get the RHEL6 side working. Now, I am also trying to do this for RHEL7, and things seem to have changed. The BOOTX64.conf seems to be getting ignored and GRUB2/grub.conf seems to be the one been taken into account. Any insights on how to work this out on RHEL7? Any help would be appreciated.

Thanks.

Red Hat Active Contributor 190 points 2 October 2015 1:07 PM Petr Bokoc Hello,

For RHEL7 on UEFI systems, the file you want to modify on the boot media is BOOT/EFI/grub.cfg . You can append the inst.ks= parameter to the line starting with linuxefi in any of the entries. The second entry is selected by default; you can use the set_default= option at the beginning of the file to change that (entries are numbered from 0).

After you change grub.cfg to your preferences, you can follow the instructions in the Anaconda Customization Guide to create a new bootable ISO image with the modified boot menu.

Newbie 11 points 3 March 2017 11:48 AM systeembeheer beeldengeluid Hello, just a update to help a few people along te way on Rhel 7.3 the dual(UEFI/Bios) boot iso, it can be build with a few steps.

Use following steps : Copy the content from a iso boot image say "rhel-server-7.3-x86_64-boot.iso" to your own image directory. Where you modify your dualboot image. Modify the EFI/Boot/grub.cfg for your UEFI boot needs. Modify the isolinux/isolinux.xfg for your BIOS based Boot needs.

Now the right mkisofs command( this one did it for me) Start this in the root of your own image directory mkisofs -U -A "RHEL-7.3 x86_64" -V "RHEL-7.3 x86_64" -volset "RHEL-7.3 x86_64" -J -joliet-long -r -v -T -x ./lost+found \ -o ../Kickstart_lab_7.3-disc1-dualboot.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 \ -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot .

The volume name ( "RHEL-7.3 x86_64") may come back to bite you ( haven't tried to change it) This label important in the Uefi part of your dual boot and comes back in the EFI/BOOT/grub.cfg. In two places, first in the search line and second after inst.stage2 parameter in the menu entry.

------------------- snippet grub.cfg------

search --no-floppy --set=root -l 'RHEL-7.3 x86_64'

--### BEGIN /etc/grub.d/10_linux ###-- menuentry 'Install Red Hat Enterprise Linux 7.3' --class fedora --class gnu-linux --class gnu --class os { linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=RHEL-7.3\x20x86_64 quiet initrdefi /images/pxeboot/initrd.img

}

After the inst.stage2 you can place your inst.ks parameters you need.

The isolinux/isolinux.cfg has your bios based boot parameter

Have fun.. and good luck

[Aug 06, 2017] Nathan Mike - Senior System Engineer - LPI1-C and CLA-11

Notable quotes:
"... mkdir -p bootdisk/RHEL ..."
"... example: cp -R /mnt/isolinux/* ~/bootdisk/RHEL/ ..."
"... cd ~/bootdisk/RHEL/ ..."
"... example: cp ks.cfg ~/bootdisk/RHEL/ ..."
"... mkisofs -r -T -J -V "RedHat KSBoot" -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -v -o linuxboot.iso . ..."
"... linux ks=cdrom:/ks.cfg ..."
"... linux ks=cdrom:/ks.cfg append ip=<IPaddress> netmask=<netmask> ksdevice=<NICx> ..."
"... example: linux ks=cdrom:/ks.cfg append ip=10.10.10.10 netmask=255.255.255.0 ksdevice=eth0 ..."
Aug 06, 2017 | mikent.wordpress.com
How to create a kickstart ISO boot disk for RedHat Posted by mikent on April 12, 2012 14 Votes


1) logon as root

2) create a directory name bootdisk/RHEL

mkdir -p bootdisk/RHEL

3) copy the directory isolinux from your RedHat DVD or other location containing RedHat binaries in bootdisk/RHEL

example: cp -R /mnt/isolinux/* ~/bootdisk/RHEL/

4) change direcotry to ~/bootdisk/RHEL/

cd ~/bootdisk/RHEL/

5) create (or copy) your ks.cfg (it will be discussed later in another post how to create a kickstart file) in ~/bootdisk/RHEL/

example: cp ks.cfg ~/bootdisk/RHEL/

6) Now, you can create the ISO boot disk as follow (make sure you run the command from ~/bootdisk/RHEL/) :

mkisofs -r -T -J -V "RedHat KSBoot" -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -v -o linuxboot.iso .

7) Burn your iso linuxboot.iso into a blank cd-rom or mount it as it is on a Virtual Machine for example

8) At linux boot prompt, type the following command:

linux ks=cdrom:/ks.cfg

if you need to install using a specific IP address using a specific Ks boot device, type the following:

linux ks=cdrom:/ks.cfg append ip=<IPaddress> netmask=<netmask> ksdevice=<NICx>

example: linux ks=cdrom:/ks.cfg append ip=10.10.10.10 netmask=255.255.255.0 ksdevice=eth0

9) your are done!

[Aug 06, 2017] How can I troubleshoot a failing Linux kickstart installation

Aug 06, 2017 | serverfault.com
down vote favorite I am having some trouble getting my pxebooting kickstart process working.

The script is known to work when installed via a DVD with the local media on the disk. I have updated the script to work with a remote repository and am leveraging PXEBooting so this can be leveraged for my enterprise. The script executes fine up until it starts to download packages.

Checking the log files on the web server hosting the repository, the first file is downloaded successfully with a 200 HTTP code. But the server running the kickstart indicates a failure and attempts to download the package again. I have confirmed this on the web server, as I see multiple requests for the same package repeated, all with the 200 HTTP code. But kickstart indicates that the download failed.

I am using CentOS 5. I copied the entire first DVD (I do not need the OpenOffice suite from the second) to the location on the web server, so the repodata already exists.

I have been able successfully download software from this repository using other systems that have already been built.

No errors appear in any of the log files that I have found on the kickstarted server, no messages are output to the screen. I have not been able to find any means of debugging this issue.

I am hoping that someone here can provide a link or information on how to attain more detailed debugging information to resolve this.

Thank you in advance. linux centos installation kickstart

share improve this question edited Apr 21 '15 at 14:34 ewwhite 162k 64 332 643 asked May 22 '12 at 13:48 Nick V 105
1
Try hitting ALT+F2 and ALT+F3 on the server you are kickstarting to see if it has any additional information that might help. – becomingwisest May 22 '12 at 14:03
If you download the package from that URL, do you get a valid package? – larsks May 22 '12 at 14:22
I have tried ALT+F2 and ALT+F3. F2 brings me to the BusyBox prompt, but no error messages. I have looked through the entire filesystem and nothing. The install logs under /mnt/sysimage/root/ do not even contain information. – Nick V May 22 '12 at 14:31
I am able to download a package from the repository without error. The issue only exists when I attempt to use the repository for installation. I even attempted to run a manual installation from the repository. The image/stage2.img file is loaded, but when it comes time to download packages the behavior is the same. At this point, I have loopback-mounted the first DVD but the same issue exists. (using CentOS 5.8) – Nick V May 22 '12 at 14:32
add a comment |
1 Answer active oldest votes
up vote down vote accepted Can you post an excerpt of your kickstart? What is the relationship between the repository and the system you're building? Same subnet?

I had a period of kickstart installation problems during the middle of the CentOS 5 series. The best thing to do from your standpoint is to check the other virtual terminals during the installation. Are you running the installation in graphical (X Windows) or text mode?

Here's what the different virtual terminals display. You should be able to debug from there.

Alt-F1
The installation dialog when using text or cmdline

Alt-F2
A shell prompt

Alt-F3
The install log displaying messages from install program

Alt-F4
The system log displaying messages from kernel, etc.

Alt-F5
All other messages

Alt-F7
The installation dialog when using the graphical installer

At some point, I was unable to resolve a kickstart performance issue. I ended up changing the installation method to NFS and the issues disappeared. See: CentOS 5.5 remote kickstart installation stalls at "Starting install process." How to debug?

share improve this answer edited Apr 13 at 12:14 Community ♦ 1 answered May 22 '12 at 14:42 ewwhite 162k 64 332 643
For the same mystical reason, the NFS change resolved the issue. – Nick V Aug 6 '12 at 4:33

[Aug 06, 2017] TipsAndTricks-KickStart - CentOS Wiki

Aug 06, 2017 | wiki.centos.org
Tips and tricks for anaconda and kickstart

For full documentations, please see https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Installation_Guide/ch-kickstart2.html (CentOS 5), https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/ch-kickstart2.html (CentOS 6) or https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/chap-kickstart-installations.html (CentOS 7)

Tuning the %packages section

When using %packages to define the set of packages that should be installed there are a number of more or less documented options that can be set:

--resolvedeps
Dependencies between packages will be automatically resolved. This option has been deprecated in Centos 5, dependencies are resolved automatically every time now.
--excludedocs

Skips the installation of files that are marked as documentation (all files that are listed when you do rpm -qld <packagename>)

--nobase
Skips installation of @Base. This won't work unless you know what you're doing as it might leave out packages required by post installation scripts
--ignoremissing
Ignore missing packages and groups instead of asking what to do. This option has been deprecated in Centos 5, dependencies are resolved automatically every time now.

Example of minimal package selection for CentOS 4:

%packages --resolvedeps --excludedocs --nobase
kudzu

please note that essential stuff will be missing. There will be no rpm, no yum, no vim, no dhcp-client and no keyboard layouts. Kudzu is required, because the installer fails if it is missing.

Example of minimal package selection for CentOS 5:

%packages --excludedocs --nobase
@Core

Again, this will leave you with a *very* basic system that will be missing almost every feature you might expect.

The --resolvedeps used with CentOS 4 is not required for CentOS 5 and newer releases as the newer installer always resolves dependencies.

Partitioning

If you start out with a unpartitioned disk, or a virtual machine on a unpartitioned image, use the --initlabel parameter to clearpart to make sure that the disklabel is initialized, or Anaconda will ask you to confirm creation of a disklabel interactively. For instance, to clean all partitions on xvda , and initialize the disklabel if it does not exist yet, you could use:

clearpart --all --initlabel --drives=xvda
Running anaconda in real text-mode

You probably already know that you can make anaconda run with a ncurses interface instead of the X11 interface by adding the line "text" to your kickstart file. But there's another option: install in real shell-like textmode. Replace the "text"-line with a "cmdline"-line in your kickstart file and anaconda will do the whole installation in textmode. Especially when you use %packages --nobase or run complex %post scripts this will probably save hours of debugging, because you can actually see the output of all scripts that run during the installation.

Enable/disable firstboot

You all know firstboot, the druid that helps you to set up the system after install. It can be enabled and disabled by adding either "firstboot --enable" or "firstboot --disable" to the command section of your kickstart file.

What the different terminals display
Alt-F1
The installation dialog when using text or cmdline
Alt-F2
A shell prompt
Alt-F3
The install log displaying messages from install program
Alt-F4
The system log displaying messages from kernel, etc.
Alt-F5
All other messages
Alt-F7
The installation dialog when using the graphical installer
Logging %pre and %post

When using a %pre or %post script you can simply log the output to a file by using --log=/path/to/file

%post --log=/root/my-post-log
echo 'Hello, World!'

Another way of logging and displaying the results on the screen would be the following:

%post
exec < /dev/tty3 > /dev/tty3
chvt 3
echo
echo "################################"
echo "# Running Post Configuration   #"
echo "################################"
(
echo 'Hello, World!'
) 2>&1 | /usr/bin/tee /var/log/post_install.log
chvt 1
Trusted interfaces for firewall configuration

You can use the --trust option to the firewall option multiple times to trust multiple interfaces:

# Enable firewall, open port for ssh and make eth1 and eth2 trusted
firewall --enable --ssh --trust=eth1 --trust=eth2
Use a specific network interface for kickstart

When your system has more than one network interface anaconda asks you which one you'd like to use for the kickstart process. This decision can be made at boot time by adding the ksdevice paramter and setting it accordingly. To run kickstart via eth0 simply add ksdevice=eth0 to the kernel command line.

A second method is using ksdevice=link . In this case anaconda will use the first interface it finds that has a active link.

A third method works if you are doing PXE based installations. Then you add IPAPPEND 2 to the PXE configuration file and use ksdevice=bootif . In this case anaconda will use the interface that did the PXE boot (this does not necessarily needs to be the first one with a active link).

Within the kickstart config itself you need to define the network interfaces using the network statement. If you are using method 2 or 3 then you don't know which device actually will be used. If you don't specify a device for the network statement anaconda will configure the device used for the kickstart process and set it up according to your network statement.

Forcing kickstart to ask for network configuration

Starting at CentOS 5, there a undocumented option that enable a prompt asking for network configuration during the installation. At the network statement, put the query keyword at the --bootproto= networking configuration, as we see below:

network --device=eth0 --bootproto=query

And a dialog box will appear asking for IP addressing, as well the hostname configuration.

Useful collection of ready-made kickstart files

At https://github.com/CentOS/Community-Kickstarts you can find a collection of ready-made kickstart files. Their primary goal is to provide functional sample kickstarts and snippets for the various types of deployments used in the community.

[Aug 06, 2017] Unable to get kickstart file from http webserver

Aug 06, 2017 | superuser.com
up vote down vote favorite I'm trying to get a vm up using a kickstart file. However, whenever the virtual machine initalize, it says it is unable to located the kickstart file from the location provided.

Code to build vm:

virt-install --name guest --ram 2048 --disk /vm/guest.img --location /CentOS-6.6-x86_64-bin-DVD1.iso -x "ks=http://192.168.1.72/engineer.cfg ksdevice=eth0 ip=192.168.0.1 netmask=255.255.255.0 dns=8.8.8.8 gateway=192.168.1.254"

kickstarter file:

#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url="http://192.168.1.72/"
# Root password
rootpw --iscrypted $1$AcXRM2i4$9Wzd1rjvrLNREmeIsM9.W1
# System authorization information
auth  --useshadow  --passalgo=sha512
# Use graphical install
graphical
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --enforcing
# Installation logging level
logging --level=info

# System timezone
timezone  Asia/Singapore
# Network information
network  --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all  
# Disk partitioning information
part /boot --fstype="ext4" --size=100
part swap --fstype="swap" --size=512
part / --fstype="ext4" --grow --size=1

%post
echo "ENGINEERING WORKSTATION" > /etc/issue
%end

The file is located at the /var/www/html directory of the webserver.

Any advice on what I may have missed will be greatly appreciated. linux virtual-machine centos httpd kickstart

share improve this question asked Jan 28 '15 at 17:12 user4985 1
add a comment |
1 Answer active oldest votes
up vote down vote Make sure that your .cfg file have right permissions and is readable by other users/systems. You may try to wget or just simply open it from any other PC in your network and see if it works.

If you have permissions problem try to set chmod to 666.

chmod 666

How can we create a customized Golden Image or RHEL ISO with kickstart file

Rebuild the DVD iso image
Raw
    # cd /rhel
    # mkisofs -o /tmp/new.iso -b isolinux/isolinux.bin -c isolinux/boot.cat --no-emul-boot --boot-load-size 4 --boot-info-table -J -R -V disks .

NOTE: In RHEL7, please make sure that you specify the volume id with -V option, and it's same as Volume_ID in step 6.

8. Boot the machine from this ISO

Kickstart has detailed documentation in the Installation Guide

Important Note:

  • The image which will be created using the steps above won't be UEFI enabled. So to have an UEFI enabled image, use the following extra options.
Raw
-eltorito-alt-boot -e images/efiboot.img -no-emul-boot
  • And the graft point as follows.
Raw
EFI/BOOT={0}/EFI/BOOT images/efiboot.img={0}/images/efiboot.img
  • Where {0} is replaced by the location where the existing DVD is mounted/extracted.
  • One should also run isohybrid on it so that it can be booted by both BIOS and UEFI:
Raw
isohybrid --uefi boot.iso 

To use a Kickstart file to install a system:

  1. Boot the system from a bootable medium or from a network installation server that supports PXE client installation. If you need to modify the boot command, press Esc to access the command line. Note, however, that the boot configuration might not allow you to modify the boot command.

    For PXE clients, it is usual to specify the Kickstart parameters in the boot loader configuration. For example, the following example configures a Kickstart installation for a PXE client that boots using pxelinux:

    prompt 0
    default ol6u6
    timeout 0
    
    label ol6u6
    kernel vmlinuz-OL6u6
    append initrd=initrd-OL6u6.img ksdevice=eth0 kssendmac ks=http://10.0.0.11/ksfiles/ol6u6_cfg.ks

    The ksdevice=eth0 parameter specifies the interface to be used for network installation. If a system has multiple network interfaces, this prevents the installation from prompting you to choose an interface. Alternatively, you could specify ksdevice=bootif and add an ipappend 2 entry after the append entry:

    prompt 0
    default ol6u6
    timeout 0
    
    label ol6u6
    kernel vmlinuz-OL6u6
    append initrd=initrd-OL6u6.img ksdevice=bootif kssendmac ks=http://10.0.0.11/ksfiles/ol6u6_cfg.ks
    ipappend 2

    This configuration also prevents you from being prompted to choose a network interface but it does not control which interface is selected.

    The next example configures a Kickstart installation for a PXE client that boots using GRUB:

    default=0
    hiddenmenu
    splashimage=(nd)/splash.xpm.gz
    timeout=0
    title Oracle Linux 6 Update 6 Installation
        root (nd)
        kernel /vmlinuz-OL6u6 ksdevice=eth0 kssendmac ks=http://10.0.0.11/ksfiles/ol6u6_cfg.ks
        initrd /initrd-OL6u6.img
    NOTE:
    1. If you have not customized the boot configuration to use Kickstart, you can use the ks option to specify the location of the Kickstart file.
    2. The following boot command specifies that the Kickstart file is on the boot CD:
    boot: linux ks=cdrom:/ks.cfg
    1. If the Kickstart file is located on an NFS server, you might use a boot command such as the following:
    boot: linux ksdevice=eth0 ip=dhcp ks=nfs:10.0.0.11:/ksfiles/ks.cfg

    where ksdevice=eth0 specifies the network interface and ip=dhcp specifies that DHCP should be used to configure this interface.

    For more information, see Section 2.2, "Installation Boot Options".

Hands-Off Fedora Installs with Kickstart - O'Reilly Media

Creating the Kickstart Config File, ks.cfg

ks.cfg makes unattended installs possible. It holds canned responses to the questions posed during an interactive install. The examples assume you've saved this file under the web server's document root as kickstart/ks.cfg.

There are several ways to create ks.cfg. (I did warn you that Kickstart was flexible.) If you're plotting a clone farm, build one machine to your specs and use /root/anaconda-ks.cfg on that host as a starting point for the others.

Barring that, use the redhat-config-kickstart GUI (from the redhat-config-kickstart package). This tool doesn't support LVM for disk layout, but is a valuable learning tool nonetheless. You can hand-edit the generated ks.cfg to use LVM (described below).

You can also create or edit ks.cfg using any text editor, provided you know the directives. Here's a walk through the directives in the sample ks.cfg.

You probably already have the redhat-config-language, hwdata, and tzdata RPMs installed already. They are not required, but include files that simplify hand-editing ks.cfg.

Installation Type

The first entries are the installation type and source.

install
url --url http://kickstart-server/FC1-install

The type may be install or upgrade. The url directive specifies an HTTP installation and indicates the URL of the install media. (The directory Fedora, from the install media, must be a subdirectory of the URI part of the URL.) Other installation sources include cdrom for swapping CDs or DVDs, nfs for mounting the install media from an NFS share, and the self-explanatory ftp.

Recommended Links

Softpanorama hot topic of the month

Softpanorama Recommended

Top articles

Sites

Top articles

Sites

Editor's note: Ethan has collected this series and other information into Managing RPM-Based Systems with Kickstart and Yum. This series continues in Advanced Linux Installations and Upgrades with Kickstart and Pre-patched Kickstart Installs.

Chapter 28. Kickstart Installations

Unattended Installation of Red Hat Enterprise Linux 7 ...



Etc

FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available in our efforts to advance understanding of environmental, political, human rights, economic, democracy, scientific, and social justice issues, etc. We believe this constitutes a 'fair use' of any such copyrighted material as provided for in section 107 of the US Copyright Law. In accordance with Title 17 U.S.C. Section 107, the material on this site is distributed without profit exclusivly for research and educational purposes.   If you wish to use copyrighted material from this site for purposes of your own that go beyond 'fair use', you must obtain permission from the copyright owner. 

ABUSE: IPs or network segments from which we detect a stream of probes might be blocked for no less then 90 days. Multiple types of probes increase this period.  

Society

Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers :   Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism  : The Iron Law of Oligarchy : Libertarian Philosophy

Quotes

War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda  : SE quotes : Language Design and Programming Quotes : Random IT-related quotesSomerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose BierceBernard Shaw : Mark Twain Quotes

Bulletin:

Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 :  Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method  : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law

History:

Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds  : Larry Wall  : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOSProgramming Languages History : PL/1 : Simula 67 : C : History of GCC developmentScripting Languages : Perl history   : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history

Classic books:

The Peter Principle : Parkinson Law : 1984 : The Mythical Man-MonthHow to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Hater’s Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite

Most popular humor pages:

Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor

The Last but not Least


Copyright © 1996-2016 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License.

The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.

Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.

This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...

You can use PayPal to make a contribution, supporting development of this site and speed up access. In case softpanorama.org is down you can use the at softpanorama.info

Disclaimer:

The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the author present and former employers, SDNP or any other organization the author may be associated with. We do not warrant the correctness of the information provided or its fitness for any purpose.

Last modified: August, 13, 2017