Re: Specifying an exact partition scheme?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for the reply Donald.

I did find a more satisfactory (to me) solution, and that is using the parted program.
It is availabe in %pre and I imagine possibly even used by anaconda itself?

Too bad Red Hat didn't allow for this in kickstart.

---SNIP---
	drive_size=`parted -s $device print|grep megabytes|cut -d"-" -f2|cut -d" " -f1`

        parted -s $device mklabel msdos # Clear and label partition table
        parted -s $device mkpart primary linux-swap 0 1000 # swap - 1G
        parted -s $device mkpart primary ext3 1000 2000 # / - 1G
        parted -s $device mkpart primary ext3 2000 7000 # /var - 5G
        parted -s $device mkpart extended 7000 $drive_size # Extended partition
        parted -s $device mkpart logical ext3 7000 12000 # /usr - 5G
        parted -s $device mkpart logical ext3 12000 17000 # /home - 5G
        parted -s $device mkpart logical ext3 17000 $drive_size # /data (size is the remainder of drive)
---SNIP---

Thanks.


-- 
Jake Gold
Systems Administrator
DTI Services

On Wed, 3 Dec 2003 10:41:01 -0500
"Bodle, Donald E" <donald_bodle@xxxxxxxxxx> wrote:

> Well, you said you don't want to "hack fdisk", but it works for me:
> 
> #STUFF removed
> %include /tmp/partfile
> %packages
> #STUFF removed
> %pre
> #STUFF removed
> ls /proc/ide/hdb > /dev/null 2>&1
> if [ $? -eq 0 ]
> then # hdb means cdrom is not hda, so ide disks exist
>   echo "Setting up IDE based partitioning" > /dev/tty3
>   echo "Setting up IDE based partitioning at `date`" >> /tmp/reyinstall.log
> # okay, here we have to use fdisk to do partitioning instead of letting
> # anaconda do it.  We already know its an ide device.  Just have to create
> # the right partitions with the right sizes
> 
> # start out fresh
> echo | fdisk /dev/hda << EOF
> o
> w
> EOF
> # now start creating partitions
> echo | fdisk /dev/hda << EOF
> n
> p
> 1
> 
> +64M
> n
> e
> 2
> 
> 
> n
> l
> 
> +4096M
> n
> l
> 
> +2048M
> n
> l
> 
> +2047M
> t
> 7
> 82
> n
> l
> 
> +512M
> n
> l
> 
> +448M
> n
> l
> 
> +320M
> n
> l
> 
> +256M
> w
> EOF
>   echo "IDE based partitioning completed" > /dev/tty3
>   echo "IDE based partitioning completed at `date`" >> /tmp/reyinstall.log
>   fdisk -l > /dev/tty3
>   fdisk -l >> /tmp/reyinstall.log
>   cat >> /tmp/partfile << EOF
> part /boot --onpart hda1
> part swap  --onpart hda7
> part /     --onpart hda10
> part /tmp  --onpart hda6
> part /usr  --onpart hda5
> part /var  --onpart hda8
> part /opt  --onpart hda11
> part /rs1  --onpart hda9
> EOF
>   echo "/dev/hda11" > /tmp/INSMGR_DEV
> else # if no hdb, then cdrom is hda, and scsi disks exist
>   echo "Setting up SCSI based partitioning" > /dev/tty3
>   echo "Setting up SCSI based partitioning at `date`" >> /tmp/reyinstall.log
> # okay, here we have to use fdisk to do partitioning instead of letting
> # anaconda do it.  We already know its a scsi device.  Just have to create
> # the right partitions with the right sizes
> 
> # start out fresh
> echo | fdisk /dev/sda << EOF
> o
> w
> EOF
> # now start creating partitions
> echo | fdisk /dev/sda << EOF
> n
> p
> 1
> 
> +64M
> n
> e
> 2
> 
> 
> n
> l
> 
> +4096M
> n
> l
> 
> +2048M
> n
> l
> 
> +2047M
> t
> 7
> 82
> n
> l
> 
> +512M
> n
> l
> 
> +448M
> n
> l
> 
> +320M
> n
> l
> 
> +256M
> w
> EOF
>   echo "SCSI based partitioning completed" > /dev/tty3
>   echo "SCSI based partitioning completed at `date`" >> /tmp/reyinstall.log
>   fdisk -l > /dev/tty3
>   fdisk -l >> /tmp/reyinstall.log
>   cat >> /tmp/partfile << EOF
> part /boot --onpart sda1
> part swap  --onpart sda7
> part /     --onpart sda10
> part /tmp  --onpart sda6
> part /usr  --onpart sda5
> part /var  --onpart sda8
> part /opt  --onpart sda11
> part /rs1  --onpart sda9
> EOF
>     echo "/dev/sda11" > /tmp/INSMGR_DEV
> fi
> 
> 
> Donald E. Bodle, Jr., RHCT
> Sr. Systems Integration Engineer
> Platform Development
> The Reynolds and Reynolds Co.
> (937) 485-1954
>  
> 
> 
> -----Original Message-----
> From: Jake Gold [mailto:jake-kickstart@xxxxxxxxxxxx] 
> Sent: Wednesday, December 03, 2003 10:21 AM
> To: kickstart-list@xxxxxxxxxx
> Subject: Re: Specifying an exact partition scheme?
> 
> 
> I've tried this, and this still has kickstart (anaconda/whatever) choosing
> the partitioning scheme, which I want to specify _exactly_.
> 
> Anyone?
> 
> Thanks
> 
> 
> -- 
> Jake Gold
> Systems Administrator
> DTI Services
> 
> On Wed, 3 Dec 2003 08:26:25 +0530
> "Joshi, Vinay (MED, GEMS-IT)" <Vinay.Joshi@xxxxxxxxxxxx> wrote:
> 
> > clearpart --all --initlabel
> > part / --fstype ext3 --size 3000 --ondisk sda --asprimary part swap 
> > --fstype swap --size 1024 --ondisk sda --asprimary part /usr --fstype 
> > ext3 --size 3000 --ondisk sda --asprimary part /var --fstype ext3 
> > --size 100 --ondisk sda part /local --fstype ext3 --size 3000 --ondisk 
> > sda part /opt --fstype ext3 --size 3000 --ondisk sda
> > part /logs --fstype ext3 --size 900 --ondisk sda --grow
> > 
> > this is what is use, and create sda1 to sda8
> > and it works....
> > 
> > 
> > 
> > -----Original Message-----
> > From: kickstart-list-admin@xxxxxxxxxx 
> > [mailto:kickstart-list-admin@xxxxxxxxxx]On Behalf Of Jake Gold
> > Sent: Wednesday, December 03, 2003 5:25 AM
> > To: kickstart-list@xxxxxxxxxx
> > Subject: Specifying an exact partition scheme?
> > 
> > 
> > Hello all!
> > 
> > I am creating a %pre script to setup the partition schemes dynamically 
> > for various drive sizes. I want to be able to specify the exact 
> > partitions to be used for the mount points, I don't want kickstart to 
> > have its way :-)
> > 
> > For example:
> > 
> > clearpart --all --initlabel
> > part swap --size 1000 --onpart sda1
> > part / --fstype ext3 --size 1000 --onpart sda2
> > part /var --fstype ext3 --size 5000 --onpart sda3
> > part /usr --fstype ext3 --size 5000 --onpart sda5
> > part /home --fstype ext3 --size 1 --grow --onpart sda6
> > 
> > 
> > As far as I can tell, you cannot use the --onpart option except when 
> > the partitions already exist, kickstart will not create these for you. 
> > And because I am clearpart'ing the partitions anyway there is no way 
> > the partitions will exist, nor would I want to set them up ahead of 
> > time.
> > 
> > Short of some ugly expect-style hacking of fdisk is there any way to 
> > do what I want?
> > 
> > Thanks in advance!
> > 
> > 
> > --
> > Jake Gold
> > Systems Administrator
> > DTI Services
> > 
> > 
> > _______________________________________________
> > Kickstart-list mailing list
> > Kickstart-list@xxxxxxxxxx 
> > https://www.redhat.com/mailman/listinfo/kickstart-list
> > 
> > 
> > _______________________________________________
> > Kickstart-list mailing list
> > Kickstart-list@xxxxxxxxxx 
> > https://www.redhat.com/mailman/listinfo/kickstart-list
> > 
> 
> 
> _______________________________________________
> Kickstart-list mailing list
> Kickstart-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/kickstart-list
> 
> 
> _______________________________________________
> Kickstart-list mailing list
> Kickstart-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/kickstart-list
> 




[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux