LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This 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


Reply
  Search this Thread
Old 10-11-2012, 05:53 PM   #1
PeterSteele
Member
 
Registered: Jun 2012
Posts: 264

Rep: Reputation: Disabled
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

Code:
     dd if=/dev/zero of=/dev/sdb bs=512 count=1
     parted -s /dev/sdb mklabel gpt
     parted -s /dev/sdb mkpart primary ext4 0 20G
     parted -s /dev/sdb -- mkpart primary ext4 20G -1
     sleep 0.5
     partprobe /dev/sdb
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?

The command I am using to install my VM is this:

Code:
virt-install --connect=qemu:///system \
             --network bridge=br0 
             --initrd-inject=/ks.cfg \
             --extra-args="ks=file:/ks.cfg text console=tty0 utf8 console=ttyS0,115200" \
             --name=vmtest \
             --disk path=/dev/sdb2,bus=virtio \
             --vcpus=1 --ram=4096 --check-cpu --accelerate \
             --hvm --location=centos.iso \
             --nographics --noreboot
 
Old 10-12-2012, 12:03 PM   #2
PeterSteele
Member
 
Registered: Jun 2012
Posts: 264

Original Poster
Rep: Reputation: Disabled
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.
 
Old 10-13-2012, 03:19 PM   #3
PeterSteele
Member
 
Registered: Jun 2012
Posts: 264

Original Poster
Rep: Reputation: Disabled
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...
 
Old 03-05-2013, 02:23 PM   #4
jars99
LQ Newbie
 
Registered: Mar 2013
Posts: 1

Rep: Reputation: Disabled
I'm having this problem as well. Did you ever figure out a solution?
 
Old 03-05-2013, 05:56 PM   #5
PeterSteele
Member
 
Registered: Jun 2012
Posts: 264

Original Poster
Rep: Reputation: Disabled
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.

Peter
 
Old 03-06-2013, 08:39 AM   #6
BDJCL
LQ Newbie
 
Registered: Jul 2012
Distribution: Fedora
Posts: 5

Rep: Reputation: Disabled
I believe you can do a clearpart --initlabel
 
Old 03-06-2013, 09:12 AM   #7
PeterSteele
Member
 
Registered: Jun 2012
Posts: 264

Original Poster
Rep: Reputation: Disabled
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...
 
Old 03-06-2013, 09:23 AM   #8
PeterSteele
Member
 
Registered: Jun 2012
Posts: 264

Original Poster
Rep: Reputation: Disabled
Oops, I pulled out the wrong %pre script. The script I use for my VM kickstart scripts looks like this:

%pre
echo "####################################"
echo "# Running pre configuration script #"
echo "####################################"
set -x
dd if=/dev/zero of=/dev/vda bs=1M count=1
parted -s /dev/vda mklabel gpt
parted -s /dev/vda mkpart primary ext4 0 128
mkfs.ext4 /dev/vda1
%end

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.
 
Old 04-22-2013, 11:06 AM   #9
hfreyer
LQ Newbie
 
Registered: Apr 2013
Posts: 4

Rep: Reputation: Disabled
In my usecase (kickstart network install of RHEL6.4
inside VM on a RHEL6.4 host system),
adding the option
Quote:
zerombr
before clearpart in the kickstart script solved the problem.
 
Old 04-22-2013, 11:13 AM   #10
PeterSteele
Member
 
Registered: Jun 2012
Posts: 264

Original Poster
Rep: Reputation: Disabled
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pxe kickstart redhat install + vnc/smilar during install fishjohn Linux - Server 1 04-24-2010 09:22 AM
Error at post install scripts for fedora 10 kickstart installation ravis007 Linux - General 1 11-18-2009 04:31 AM
Fedora 10 install via Windows XP filezilla ftp server; ftp Url error in kickstart O(V)eGA_l2el) Fedora 2 09-28-2009 09:40 AM
Kickstart Error Error opening kickstart file (null): bad address Latitude Linux - Networking 0 06-03-2009 11:20 AM
Kickstart install error "Unable to read group information from repositories" GGGav Fedora 1 02-07-2008 01:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 10:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration