I'm trying to install CentOS 7 using kickstart.
I created a bootable USB key containing a modified ISO. I'm not able to launch a regular installation with the inst.ks
parameter. I precise that the installation launches without this parameter.
The screen hangs at the following line:
dracut-initqueue[719]: mount: /dev/sdb is write-protected, mounting read-only
loop: module loaded
I tried many changes to my kickstart file but still doesn't work.
This is the boot configuration I use:
menuentry 'Custom Installation CentOS 7' --class fedora --class gnu-linux --class gnu --class os {
linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 inst.ks=cdrom:/anaconda-ks.cfg
initrdefi /images/pxeboot/initrd.img
}
Any idea?
EDIT:
I used the following commands to create the USB key:
mkisofs -J -T -o /root/centos7-ks.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -m TRANS.TBL -graft-points -V "CentOS 7 x86_64" /root/centos7-install/
isohybrid /root/centos7-ks.iso
implantisomd5 /root/centos7-ks.iso
dd if=/root/centos7-ks.iso of=/dev/sdb bs=512k
My kickstart file:
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Use CDROM installation media
install
cdrom
# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot --enable
#Only use disk sdb for installation
ignoredisk --only-use=sdb
# Keyboard layouts
keyboard --vckeymap=fr --xlayouts='fr'
# System language
lang en_US.UTF-8
# Network information
network --bootproto=static --device=eno1 --gateway=10.10.0.1 --ip=10.10.0.9 --nameserver=10.10.0.1 --netmask=255.255.240.0 --noipv6 --activate
network --bootproto=static --device=eno1 --ip=10.201.0.9 --netmask=255.255.0.0 --noipv6 --activate --vlanid=2021 --interfacename=eno1.2021
network --bootproto=static --device=eno1 --ip=10.10.128.9 --netmask=255.255.224.0 --noipv6 --activate --vlanid=3501 --interfacename=eno1.3501
network --bootproto=dhcp --device=eth0 --onboot=off --ipv6=auto
network --hostname=myhostname
#Reboot after installation
reboot
# Root password
rootpw --iscrypted mycryptedpassword
#Disable SELinux
selinux --disabled
#Skip X Window System configuration
skipx
# System services
services --disabled="chronyd"
# System timezone
timezone Europe/Paris --isUtc
# System bootloader configuration
bootloader --location=mbr --boot-drive=sdb
#Clear MBR
zerombr
# Partition clearing information
clearpart --initlabel --drives=sdb --all
# Disk partitioning information
part /boot/efi --fstype="efi" --ondisk=sdb --size=200 --fsoptions="umask=0077,shortname=winnt"
part /boot --fstype="xfs" --ondisk=sdb --size=1024
part / --fstype="xfs" --ondisk=sdb --size=10240 --grow
%packages
@^minimal
@core
epel-release
net-snmp-libs
net-snmp
net-snmp-utils
traceroute
mtr
bind-utils
tcpdump
iptraf
arpwatch
nano
vim
elinks
nmap
rsync
mlocate
mailx
dmidecode
telnet
conntrack-tools
unzip
fping
ntpdate
ntp
net-tools
openvpn
lldpd
pam_radius
yum-utils
wget
iptables-services
java-1.8.0-openjdk
%end
%addon com_redhat_kdump --disable --reserve-mb='auto'
%end
%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end
%post --nochroot
#commands
%end
Best Answer
The problem here is with the
inst.ks=cdrom:/anaconda-ks.cfg
directive. You are installing not from a cdrom, that is why it cannot find the kickstart file. Had the same issue, chaged it toinst.ks=hd:sdc:/anaconda-ks.cfg
and it worked. Also, in order to make it more general I think you can find the installation media by label like thisinst.ks=hd:LABEL=YOURLABEL:/anaconda-ks.cfg
, but you have to give the USB drive a label usingmlabel
or something.Also, mind the instructions in Install From USB CentOS Wiki. According to this, you should use dd if you are copying the image from a Linux/Mac. On Windows, not all the tools work correctly, there is a list of tools that do work on the Wiki page.