| 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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
10-11-2012, 05:53 PM
|
#1
|
|
Member
Registered: Jun 2012
Posts: 138
Rep: 
|
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
|
|
|
|
10-12-2012, 12:03 PM
|
#2
|
|
Member
Registered: Jun 2012
Posts: 138
Original Poster
Rep: 
|
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.
|
|
|
|
10-13-2012, 03:19 PM
|
#3
|
|
Member
Registered: Jun 2012
Posts: 138
Original Poster
Rep: 
|
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...
|
|
|
|
03-05-2013, 02:23 PM
|
#4
|
|
LQ Newbie
Registered: Mar 2013
Posts: 1
Rep: 
|
I'm having this problem as well. Did you ever figure out a solution?
|
|
|
|
03-05-2013, 05:56 PM
|
#5
|
|
Member
Registered: Jun 2012
Posts: 138
Original Poster
Rep: 
|
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
|
|
|
|
03-06-2013, 08:39 AM
|
#6
|
|
LQ Newbie
Registered: Jul 2012
Distribution: Red Hat
Posts: 4
Rep: 
|
I believe you can do a clearpart --initlabel
|
|
|
|
03-06-2013, 09:12 AM
|
#7
|
|
Member
Registered: Jun 2012
Posts: 138
Original Poster
Rep: 
|
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...
|
|
|
|
03-06-2013, 09:23 AM
|
#8
|
|
Member
Registered: Jun 2012
Posts: 138
Original Poster
Rep: 
|
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.
|
|
|
|
04-22-2013, 11:06 AM
|
#9
|
|
LQ Newbie
Registered: Apr 2013
Posts: 1
Rep: 
|
In my usecase (kickstart network install of RHEL6.4
inside VM on a RHEL6.4 host system),
adding the option
before clearpart in the kickstart script solved the problem.
|
|
|
|
04-22-2013, 11:13 AM
|
#10
|
|
Member
Registered: Jun 2012
Posts: 138
Original Poster
Rep: 
|
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.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 11:53 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|