3

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
6
  • I seem to be having exactly the same problem. Did you manage to fix it? I'm using the same kickstart from a manual install in a VirtualBox, and am beginning to suspect the problem lies in the HW configuration.
    – LSerni
    Oct 1, 2018 at 6:18
  • @LSerni are you using a custom kickstart file stored in the USB key?
    – manash
    Oct 1, 2018 at 16:18
  • Yes, even if it's a DVD disk, but I believe the issues are the same. But I'm not convinced it is the kickstart file: an empty kickstart, a kickstart containing deliberate, clear errors, and the same kickstart created from a manual installation, all yield the exact same result.
    – LSerni
    Oct 1, 2018 at 16:37
  • 1
    @LSerni It's not the kickstart file - it's probably the same issue I encountered where the file can't be used for some reason. Do a simple test - put your kickstart file on a web server and reference the HTTP URL in the boot options.
    – manash
    Oct 1, 2018 at 16:40
  • 1
    Disabled the UEFI boot and wrote the same kernel directives in isolinux. And it works flawlessly. I'll have to flesh up on EFI basics, maybe I can find out where things go awry.
    – LSerni
    Oct 1, 2018 at 17:50

1 Answer 1

2

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 to inst.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 this inst.ks=hd:LABEL=YOURLABEL:/anaconda-ks.cfg, but you have to give the USB drive a label using mlabel 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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .