source: install/initboot.sh @ 548499b

perl-5.22
Last change on this file since 548499b was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 1.2 KB
Line 
1#!/bin/bash
2#Syn-3 diskinit (C)2005 DatuX
3#-Combine all the specified partitions into a Syn-3 bootable md0 device.
4#-Partitions should be type FD
5
6.       dialoglib.sh || exit 1
7
8exec 2>&1
9
10
11PART_COUNT=0
12for PART in $*; do
13        echo -e "\n* Clearing parition $PART:"
14
15        #remove raid partition superblocks
16        #(may fail)
17        mdadm --misc --zero-superblock --force $PART &>/dev/null
18       
19        #remove other confusing stuff thats in the partition           
20        dd if=/dev/zero of=$PART count=1 &>/dev/null || exit 1
21        (( PART_COUNT++ ))
22
23done
24
25# create BOOT raid array md0, always RAID 1
26# We create 5 extra missing discs, so that all new discs automatically
27# become bootable. (we don't want hot spares for md0!)
28echo -e "\n* Creating Boot RAID ARRAY (md0):"
29(( TOTAL = PART_COUNT + 5 ))
30mdadm --create --run --metadata=1.0 -l1 -n$TOTAL -amd /dev/md0 $* missing missing missing missing missing || exit 1
31
32
33
34
35####################### Create filesystems
36# Boot will be in /dev/md0
37
38#create filesystems
39echo -e "\n* Creating filesystem:"
40##clear all previous xfs superblock, if its still there
41##dd if=/dev/zero of=/dev/md0 bs=1M count=1 &>/dev/null
42mkfs.ext3 -F -O '^64bit' /dev/md0 -L BOOT || exit 1
43
44
45echo -e "\n* DONE"
46#release the flying monkeys:
47exit 0
48
Note: See TracBrowser for help on using the repository browser.