Use entire disk as PV.
Moray Henderson
Moray.Henderson at ict-software.org
Tue May 10 09:02:52 UTC 2011
Did you use a double dash for “--preexisting”? I didn’t notice as I was typing it that Outlook had “helpfully” changed the two dashes to a single emdash. Did the pvcreate command actually work: does that disk now have a full-disk PV on it? In the pvcreate documentation, I just came across
For whole disk devices only the partition table must be erased, which will effectively destroy all data on that disk. This can be done by zeroing the first sector with:
dd if=/dev/zero of=PhysicalVolume bs=512 count=1
Here’s something else to try:
echo "part pv.01 --onpart sdb --grow" >> /tmp/custom-part
echo "volgroup rootvg /dev/sdb pv.01" >> /tmp/custom-part
If kickstart refuses to create a partition on sdb, you will have to do something like
lvm pvcreate /dev/sdb
lvm vgcreate rootvg /dev/sdb
echo "logvol / --fstype ext3 --name=root --vgname=rootvg --size=4096 --useexisting" >> /tmp/custom-part
Moray.
“To err is human; to purr, feline.”
From: Speagle, Andy [mailto:andy.speagle at wichita.edu]
Sent: 09 May 2011 19:34
To: Discussion list about Kickstart
Subject: RE: Use entire disk as PV.
I’ve actually tried that in the past. It doesn’t work. But, for completeness, I tried it again… and I receive this error from anaconda:
Error Parsing Kickstart Config
The following error was found while parsing the kickstart configuration file:
The following problem occurred on line 2 of the kickstart file:
Tried to use undefined partition /dev/sdb in Volume Group specification
Any thoughts on that? I’m at a loss.
-Andy
From: kickstart-list-bounces at redhat.com [mailto:kickstart-list-bounces at redhat.com] On Behalf Of Moray Henderson (ICT)
Sent: Monday, May 09, 2011 11:39 AM
To: 'Discussion list about Kickstart'
Subject: RE: Use entire disk as PV.
As well as generating /tmp/custom-part for kickstart, your %pre script also has to execute the Linux commands to create the PV. There were some examples given earlier in this thread:
lvm pvcreate /dev/sdb
echo "volgroup rootvg /dev/sdb –useexisting" >> /tmp/custom-part
ought to give you a volgroup called rootvg consisting of the whole of /dev/sdb. See 31.4. <http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Installation_Guide/s1-kickstart2-options.html> Kickstart Options if you haven’t found it already.
Moray.
“To err is human; to purr, feline.”
From: Speagle, Andy [mailto:andy.speagle at wichita.edu]
Sent: 09 May 2011 15:14
To: Discussion list about Kickstart
Subject: RE: Use entire disk as PV.
Hi Team,
I’ve progressed a bit on this issue. What I’m presently trying to do is use a simple %pre script to generate a temp file with the commands to be included in the partitioning section of the kickstart. So, I run the %pre script, it creates /tmp/custom-part, which is included in the partitioning section using:
%include /tmp/custom-part
All of that works duckily… however anaconda refuses to use “rootvg” without it being defined using the “volgroup” command in the partitioning section. And sadly, I can’t get the “volgroup” command to work without a PV defined. If I try to specify the partition by passing the --useexisting and --onpart options to the “part” command… that fails too … so I continue to be stuck. This is what I do to have the /tmp/custom-part created:
echo "part /boot --fstype=ext3 --onpart=$BOOT" > /tmp/custom-part
echo "volgroup rootvg --useexisting" >> /tmp/custom-part
echo "logvol / --fstype=ext3 --name=root --vgname=rootvg --size=4096" >> /tmp/custom-part
echo "logvol swap --fstype=swap --name=swap --vgname=rootvg --size=2048" >> /tmp/custom-part
echo "logvol /var --fstype=ext3 --name=var --vgname=rootvg --size=2048" >> /tmp/custom-part
echo "logvol /var/tmp --fstype=ext3 --name=vartmp --vgname=rootvg --size=1024" >> /tmp/custom-part
echo "logvol /home --fstype=ext3 --name=home --vgname=rootvg --size=2048" >> /tmp/custom-part
echo "logvol /tmp --fstype=ext3 --name=tmp --vgname=rootvg --size=1024" >> /tmp/custom-part
echo "logvol /opt --fstype=ext3 --name=opt --vgname=rootvg --size=2048" >> /tmp/custom-part
Has anyone actually done this? Is there some magic I’m missing?
-Andy
_____
OM International Limited - Unit B Clifford Court, Cooper Way - Carlisle CA3 0JG - United Kingdom
Charity reg no: 1112655 - Company reg no: 5649412 (England and Wales)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/kickstart-list/attachments/20110510/d41b74e4/attachment.htm>
More information about the Kickstart-list
mailing list