Hi List,
I use a kickstart file to install my operating systems. In the kickstart file, I put the clearpart options to erase all my partition. But the install failed because the partition aren't erased. Does someone have the same issue ?
Regards
Kevin C
From: Kevin C linux@tuxalafenetre.net
I use a kickstart file to install my operating systems. In the kickstart file, I put the clearpart options to erase all my partition. But the install failed because the partition aren't erased. Does someone have the same issue ?
Which clearpart parameters do you use? Something like that? clearpart --drives=sda --all Personally I use a %pre script to manually wipe+partition+format...
JD
On Mon, 25 Jul 2011 02:18:53 -0700 (PDT), John Doe wrote:
Which clearpart parameters do you use? Something like that? clearpart --drives=sda --all
I used this on CentOS 5 without any problems : clearpart --all --initlabel
I also use an pre script to detect the number of drives on the server
%pre # Determine how many drives we have set $(list-harddrives) let numd=$#/2 d1=$1 # This is the device of disk 1 d2=$3 # This is the device of disk 2, etc. S1=$2 # This is the size of disk 1 S2=$4 # This is the size of disk 2, etc.
# This would be a partition scheme for two or more drives if [ $numd -ge 2 ]; then cat << EOF >> /tmp/partinfo # Partition clearing information clearpart --drives=$d1,$d2 --all --initlabel part / --asprimary --fstype="ext3" --ondisk=$d1 --size=1024 part /boot --asprimary --fstype="ext3" --ondisk=$d1 --size=200 part swap --fstype="swap" --ondisk=$d1 --recommended part /var --fstype="ext3" --ondisk=$d1 --grow --size=1 part /var/spool/squid --fstype="ext3" --ondisk=$d2 --grow --size=1 part /usr --fstype="ext3" --ondisk=$d1 --size=4096 part /tmp --fstype="ext3" --ondisk=$d1 --size=1024 part /home --fstype="ext3" --ondisk=$d1 --size=5120 EOF
else
cat << EOF >> /tmp/partinfo # Partition clearing information clearpart --drives=$d1 --all --initlabel part / --asprimary --fstype="ext3" --ondisk=$d1 --size=1024 part /boot --asprimary --fstype="ext3" --ondisk=$d1 --size=200 part swap --fstype="swap" --ondisk=$d1 --recommended part /var --fstype="ext3" --ondisk=$d1 --size=4096 part /var/spool/squid --fstype="ext3" --ondisk=$d1 --grow --size=1 part /usr --fstype="ext3" --ondisk=$d1 --size=4096 part /tmp --fstype="ext3" --ondisk=$d1 --size=1024 part /home --fstype="ext3" --ondisk=$d1 --size=5120 EOF fi
Personally I use a %pre script to manually wipe+partition+format...
In Python,Perl or Shell? I'm searching how to wipe all drives with parted or fdisk.
Here is my kickstart :
# platform=x86, AMD64, ou Intel EM64T # version=CentOS6 ##### DEBUG : #cmdline #### # Firewall configuration firewall --disabled # Install OS instead of upgrade install # Root password rootpw --iscrypted S€cr€t # Network information network --device eth0 --bootproto dhcp # System keyboard keyboard fr-latin9 # System language lang en_US.UTF-8 # SELinux configuration selinux --enforcing # Do not configure the X Window System skipx # Installation logging level logging --level=info # Utilisation d'une installation via un serveur NFS nfs --server=172.18.101.24 --dir=Miroir/CentOS/6.0/os/i386 # Reboot after installation reboot # System timezone timezone --isUtc Europe/Paris # System bootloader configuration bootloader --location=mbr # Disk partitioning information clearpart --all --initlabel # Magically figure out how to partition this thing %include /tmp/partinfo
%pre # Determine how many drives we have set $(list-harddrives) let numd=$#/2 d1=$1 # This is the device of disk 1 d2=$3 # This is the device of disk 2, etc. S1=$2 # This is the size of disk 1 S2=$4 # This is the size of disk 2, etc.
# This would be a partition scheme for two or more drives if [ $numd -ge 2 ]; then cat << EOF >> /tmp/partinfo # Partition clearing information clearpart --drives=$d1,$d2 --all --initlabel part / --asprimary --fstype="ext3" --ondisk=$d1 --size=1024 part /boot --asprimary --fstype="ext3" --ondisk=$d1 --size=200 part swap --fstype="swap" --ondisk=$d1 --recommended part /var --fstype="ext3" --ondisk=$d1 --grow --size=1 part /var/spool/squid --fstype="ext3" --ondisk=$d2 --grow --size=1 part /usr --fstype="ext3" --ondisk=$d1 --size=4096 part /tmp --fstype="ext3" --ondisk=$d1 --size=1024 part /home --fstype="ext3" --ondisk=$d1 --size=5120 EOF
else
cat << EOF >> /tmp/partinfo # Partition clearing information clearpart --drives=$d1 --all --initlabel part / --asprimary --fstype="ext3" --ondisk=$d1 --size=1024 part /boot --asprimary --fstype="ext3" --ondisk=$d1 --size=200 part swap --fstype="swap" --ondisk=$d1 --recommended part /var --fstype="ext3" --ondisk=$d1 --size=4096 part /var/spool/squid --fstype="ext3" --ondisk=$d1 --grow --size=1 part /usr --fstype="ext3" --ondisk=$d1 --size=4096 part /tmp --fstype="ext3" --ondisk=$d1 --size=1024 part /home --fstype="ext3" --ondisk=$d1 --size=5120 EOF fi
%packages @base @console-internet @core vim-enhanced -firstboot -pcmciautils -at -rfkill yum-presto squid postfix gcc make sgpio dos2unix unix2dos ftp lftp bind-libs yum-plugin-fastestmirror libss ConsoleKit-libs libedit libtar nss_compat_ossl libfprint libnih fipscheck-lib wget
%post --log=/root/ks-post.log wget -N http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rp... rpm -Uvh epel-release-6-5.noarch.rpm sed -i".bak" s/NM_CONTROLLED=yes/NM_CONTROLLED=no/ ifcfg-eth* service network restart yum install -y squidGuard yum update -y chkconfig postfix on mount -t nfs 172.18.101.24:/Scripts/ /mnt cp /mnt/linsecu.pl /root/linsecu.pl umount /mnt
JD _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
From: Kevin C linux@tuxalafenetre.net
if [ $numd -ge 2 ]; then cat << EOF >> /tmp/partinfo
Did you check the partinfo file to see if the variables are correctly replaced?
In Python,Perl or Shell? I'm searching how to wipe all drives with parted or fdisk.
In an external shell script. I just do a simple dd (I still use msdos partitioing): dd if=/dev/zero of=$DEVICE bs=512 count=1 >/dev/null 2>&1 Then I use sfdisk with values calculated for the correct stripe size depending on the server RAID. Then I format with a stripe-width and optionally -m 0. I only let the ks do the mounting. Disclaimer: did not test with CentOS 6 yet...
clearpart --all --initlabel
needed since you already put one in your partinfo file?
JD
On Mon, 25 Jul 2011 05:46:15 -0700 (PDT), John Doe wrote:
From: Kevin C linux@tuxalafenetre.net
if [ $numd -ge 2 ]; then cat << EOF >> /tmp/partinfo
Did you check the partinfo file to see if the variables are correctly replaced?
You're right, I have an error is this file, with /dev/sda1 instead of /dev/sda
part /var/spool/squid --fstype=ext3 --ondisk=/dev/sda1 --grow --size-1
In Python,Perl or Shell? I'm searching how to wipe all drives with parted or fdisk.
In an external shell script. I just do a simple dd (I still use msdos partitioing): dd if=/dev/zero of=$DEVICE bs=512 count=1 >/dev/null 2>&1 Then I use sfdisk with values calculated for the correct stripe size depending on the server RAID. Then I format with a stripe-width and optionally -m 0. I only let the ks do the mounting. Disclaimer: did not test with CentOS 6 yet...
clearpart --all --initlabel
needed since you already put one in your partinfo file?
I don't think so. I put it twice only to test.
JD _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
The list-harddrives results change on CentOS 6. It show all disks and partition. In C5, it only show all drives.
On Mon, 25 Jul 2011 15:06:50 +0200, Kevin C wrote:
On Mon, 25 Jul 2011 05:46:15 -0700 (PDT), John Doe wrote:
From: Kevin C linux@tuxalafenetre.net
if [ $numd -ge 2 ]; then cat << EOF >> /tmp/partinfo
Did you check the partinfo file to see if the variables are correctly replaced?
You're right, I have an error is this file, with /dev/sda1 instead of /dev/sda
part /var/spool/squid --fstype=ext3 --ondisk=/dev/sda1 --grow --size-1
In Python,Perl or Shell? I'm searching how to wipe all drives with parted or fdisk.
In an external shell script. I just do a simple dd (I still use msdos partitioing): dd if=/dev/zero of=$DEVICE bs=512 count=1 >/dev/null 2>&1 Then I use sfdisk with values calculated for the correct stripe size depending on the server RAID. Then I format with a stripe-width and optionally -m 0. I only let the ks do the mounting. Disclaimer: did not test with CentOS 6 yet...
clearpart --all --initlabel
needed since you already put one in your partinfo file?
I don't think so. I put it twice only to test.
JD _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos