Entire disk in PV...

Cris Rhea crhea at mayo.edu
Fri Apr 29 20:47:32 UTC 2011


> Pablo Iranzo G??mez (Pablo.Iranzo at redhat.com)
> %pre
> set $(list-harddrives)
> d1=$1 # 1st hd device
> 
> lvm pvcreate $d1
> lvm vgcreate "Test" $d1
> 
> and then setup logvols or just keep creating with lvm
> 
> Regards
> Pablo



> Oh... I understand that.  But, they would know that /dev/sdb is sacrosanct.
> And messing with it would ensure a swift and painful death.  :)
> 
> I'm curious to see how handling that in a %pre script would work... 
> if you wouldn't mind submitting an example.
> 
> -Andy


Pablo provided a quick example for LVM... I'm still "old school" and
prefer hard partitions for /boot, /, /usr, /var, /tmp, /home...

Here's the type of thing I do in %pre sections:

%pre
# dd wipes out primary copy of GPT.
dd if=/dev/zero of=/dev/sda bs=512 count=20

# This is useless at this point due to the bug in Anaconda/parted.
# Leave here because an invalid partiton table (from the dd) stops install.
# Update: RedHat fixed Anaconda bug in RHEL 5 Update 3, so this should work.
sfdisk -uM /dev/sda <<EOF
,150,L
,,E
;
;
,512,L
,32768,S
,8000,L
,2048,L
,10000,L
,,L
EOF

# Device node exists, even when disk doesn't.  Try it to confirm.
# If /dev/sdb exists, wipe it out too...  might look like RAID mirror....
dd if=/dev/sdb of=/dev/null bs=512 count=1
if [ $? = 0 ]; then
dd if=/dev/zero of=/dev/sdb bs=512 count=20
sfdisk -uM /dev/sdb <<EOF
,,L
;
;
;
EOF
fi




-- 
 Cristopher J. Rhea
 Mayo Clinic - Research Computing Facility
 200 First St SW, Rochester, MN 55905
 crhea at Mayo.EDU
 (507) 284-0587



More information about the Kickstart-list mailing list