How can I prevent this error during a kickstart install
Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How can I prevent this error during a kickstart install
I have what is intended to be an unattended install of a CentOS VM controlled through kickstart. I partition a drive into two parts, each to host a VM, using the sequence
I then install a VM on sdb1 and sdb2. The install on partition 1 works without issues. When the kickstart install is running on partition 2 however, the following dialog appears:
Code:
+--------------------------------¦ Warning +---------------------------------+
¦ ¦
¦ Error processing drive: ? ¦
¦ ? ¦
¦ pci-0000:00:04.0-virtio-pci-virtio1 ¦ ¦
¦ 944103MB ¦ ¦
¦ Virtio Block Device ¦ ¦
¦ ¦ ¦
¦ This device may need to be reinitialized. ¦ ¦
¦ ¦ ¦
¦ REINITIALIZING WILL CAUSE ALL DATA TO BE LOST! ¦ ¦
¦ ¦ ¦
¦ This action may also be applied to all other disks ¦ ¦
¦ needing reinitialization. ? ¦
¦ ¦
¦ +--------+ +------------+ +---------------+ +-------------------+ ¦
¦ ¦ Ignore ¦ ¦ Ignore all ¦ ¦ Re-initialize ¦ ¦ Re-initialize all ¦ ¦
¦ +--------+ +------------+ +---------------+ +-------------------+ ¦
¦ ¦
¦ ¦
+----------------------------------------------------------------------------+
I'm sure many of you are familiar with this dialog. I problem is I just want it to default to "Re-initialize all" and not interrupt my kickstart. Is there any way to do this?
I solved the problem, sort of, by using the command
Code:
dd if=/dev/zero of=/dev/sdb bs=1M count=1
to clear out the old partition table. In the past I've just cleared out the first 512 bytes and that seemed to suffice. At least I don't get the error from kickstart.
But there must be a *correct* way of doing this, clearing out old partitions and creating new ones, without the VM installing thinking it has a bad drive.
I spoke too soon. Even with bs=1M, I am hitting this error at times. Is there anyway to force the "Re-initialize all" option to be automatically selected in this case?
Barring that, I guess the solution would be to use a pre-script and format the partition manually, and tell kickstart to install on that partition directly without formatting it. That should do the trick, but I was hoping to avoid this approach...
Yes, I came up with a solution that works for us. I'd think you could adapt it to your case as well. What I did was write a %pre script that does this:
%pre --log=/root/anaconda-pre.log
echo "#####################################"
echo "# Running pre configuration script #"
echo "#####################################"
set -x
parted -l
cd /dev
for d in sd?; do
# Skip drive sda since this is the USB boot stick
if [ "$d" = "sda" ]; then continue; fi
# Everything else is a valid drive on the system, so go
# ahead and zap the disk and label it.
dd if=/dev/zero of=/dev/$d bs=1M count=1
parted -s /dev/$d mklabel gpt
done
%end
My install runs from a USB stick, so if you are booting from a DVD, you will want to remove the first two lines inside the for loop. What this code does is loop through all drives and wipes out the partition table, if any, and then creates gpt label on each drive. This %pre script is of course part of the kickstart script. The core steps of the kickstart script look like this:
install
text
poweroff
lang en_US.UTF-8
keyboard us
network --bootproto dhcp
rootpw root
firewall --disabled
selinux --disabled
timezone --utc America/Los_Angeles
firstboot --disable
bootloader --driveorder=sdb --location=mbr --append="console=tty0 console=ttyS0,115200"
part / --ondrive=sdb --fstype=ext4 --asprimary --size=10240
...
Note again that I am referencing drive sdb here because we are using a USB boot stick. You'd want to change this to sda if you are booting from a custom DVD.
Give this a try. If you need additional information, just let me know.
I would have thought so as well, but I resorted to the %pre script because that was the only method I found that avoided this "re-initialize" dialog...
I not only label the drive, but also create a partition on it. The main kickstart script then does this:
install
text
poweroff
lang en_US.UTF-8
keyboard us
network --bootproto dhcp
rootpw root
firewall --disabled
selinux --disabled
timezone --utc America/Los_Angeles
bootloader --location=mbr --append="console=tty0 console=ttyS0,115200"
clearpart --all --initlabel
part /boot --size=128 --fstype ext4 --asprimary
part swap --recommended --fstype swap --asprimary
part / --size 500 --grow --fstype ext4 --asprimary
So, as you see, I do end up doing the clearpart command, but without the %pre script, the clearpart command causes this re-initialize dialog to occur, stalling the kickstart script. It's a hack, but it works, at least this was the only solution I could find to avoid this dialog.
I couldn't use this approach. We are booting from a USB stick and the zerombr command zeros all MBRs on all disks, including the USB stick that we booted from.
I came up with a solution using a %pre script to make sure the drives don't look "uninitialized" by the time the main kickstart script starts. A bit of a hack but it works for us.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.