Quantcast
Viewing all articles
Browse latest Browse all 60069

Kickstart - Pre section fdisk command fails

By using the %Pre in the Kickstart.cfg for a VMWare ESX 3.02 installation we want to insure the dev/sda

drive is the correct size before we start the installation.

 

The problem is the fdisk command doesn't work, doesn't do anything with no output.

 

I confirmed the fdisk is in the path - usr/sbin coming from stage2.img,  I changed the script to call the

 

fdisk from the /sbin directory in case there was a path issue.  Just in case I ran a echo "$PATH" to

confirm the path is correct, which it was.

 

fdisk version 2.11y  (fdisk -v)

 

The question is why doesn't the fdisk command work?

 

-


%packages

@base

 

%pre

 

 

#!/bin/sh

  1. init

function pause(){

        read -p "$*"

}

 

drivesize=`fdisk -l | grep Disk | grep /dev/sda | awk '{ print $5 }'`

echo $drivesize

        if [[ $drivesize -ge 62773001240 && $drivesize -le 62773003240 ]]; then

                echo "Drive exists and is within limits."

        else

                pause 'Disk /dev/sda is not within limits.  Press ENTER to reboot system'

                reboot

        fi

 

 

%post

-


 

I also tried calling the fdisk from --interpreter /usr/bin/python - same results - no output from the

 

command.

 

Any ideas on a workaround or another way to determine the size of the hard drive before we clearpart

 

--all.

 

Don...


Viewing all articles
Browse latest Browse all 60069

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>