#!/bin/bash #Syn-3 diskinit (C)2005 DatuX #-Combine all the specified partitions into a Syn-3 bootable md0 device. #-Partitions should be type FD . dialoglib.sh || exit 1 exec 2>&1 PART_COUNT=0 for PART in $*; do echo -e "\n* Clearing parition $PART:" #remove raid partition superblocks #(may fail) mdadm --misc --zero-superblock --force $PART &>/dev/null #remove other confusing stuff thats in the partition dd if=/dev/zero of=$PART count=1 &>/dev/null || exit 1 (( PART_COUNT++ )) done # create BOOT raid array md0, always RAID 1 # We create 5 extra missing discs, so that all new discs automatically # become bootable. (we don't want hot spares for md0!) echo -e "\n* Creating Boot RAID ARRAY (md0):" (( TOTAL = PART_COUNT + 5 )) mdadm --create --run --metadata=1.0 -l1 -n$TOTAL -amd /dev/md0 $* missing missing missing missing missing || exit 1 ####################### Create filesystems # Boot will be in /dev/md0 #create filesystems echo -e "\n* Creating filesystem:" ##clear all previous xfs superblock, if its still there ##dd if=/dev/zero of=/dev/md0 bs=1M count=1 &>/dev/null mkfs.ext3 -F -O '^64bit' /dev/md0 -L BOOT || exit 1 echo -e "\n* DONE" #release the flying monkeys: exit 0