[Ovirt-devel] [PATCH node] Added support for local storage configuration.

Daniel P. Berrange berrange at redhat.com
Wed Nov 12 13:51:06 UTC 2008


On Wed, Nov 12, 2008 at 08:42:52AM -0500, Darryl L. Pierce wrote:
> This patch wipes out the entire disk on the node and replaces it with
> a set of partitions. The partitions are a raw partition to hold the bootable
> kernel, and the rest of the disk is taken up as an physical volume.



> +            Y|y)
> +                printf "Preparing local storage. Please wait..."
> +
> +                {
> +                vgroups=$(vgdisplay -C | awk '{ print $1" "; }')
> +                vgremove -f $vgroups
> +
> +                dd if=/dev/zero of=$DRIVE bs=1K count=1
> +                blockdev --rereadpt $DRIVE
> +                partprobe -s $DRIVE
> +
> +                parted $DRIVE -s "mklabel msdos"

Since we've no particular need for MS DOS compatability, how about
we just use GPT partitions, avoiding the whole 2TB limit.

> +                parted $DRIVE -s "mkpart primary ext2 0.0 ${BOOT_SIZE}M"
> +                parted $DRIVE -s "mkpart primary ext2 ${BOOT_SIZE}M -1s"
> +                parted $DRIVE -s "set 2 lvm on"
> +
> +                pvcreate "${DRIVE}2"
> +                pvck
> +                vgcreate /dev/HostVG "${DRIVE}2"
> +
> +                lvcreate --name Swap    /dev/HostVG --size ${SWAP_SIZE}M
> +                lvcreate --name Root    /dev/HostVG --size ${ROOT_SIZE}M
> +                lvcreate --name Config  /dev/HostVG --size ${CONFIG_SIZE}M
> +                lvcreate --name Logging /dev/HostVG --size ${LOGGING_SIZE}M
> +                lvcreate --name Data    /dev/HostVG --size ${DATA_SIZE}M
> +
> +                mke2fs -T ext2 "${DRIVE}1"         -L "BOOT"

Why no journal on /boot. This means if the host shuts down uncleanly
it'll have todo a full fsck.

> +                mke2fs -T swap /dev/HostVG/Swap

That isn't the way you create a swap partition. You want mkswap.

And still need to disable the various auto-fsck settings on all 
partitions

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the ovirt-devel mailing list