Commit b4fdf8e0 authored by Mike Hibler's avatar Mike Hibler
Browse files

Prepare for the coming of MBR version 3.

Ironic. After all that hoo-haw about dynamically-created MBRs in the
previous commit, we introduce a new hardcoded static MBR...

Goals:
 * Single OS partition, in the fast area of rotating disks
 * Proper alignment for 4k sector drives and SSDs (1MB alignment)
 * Still works on 40GB disk (aka, pc850s)
 * P1 16 GiB: goldilocks FS: not too small (> 10GB), but not too big (< 30GB)
 * P2  3 GiB: can hold a co-loaded MBR 1 image (e.g., FBSD410 delay node OS)
 * P3  3 GiB: at least as much swap at currently (>= 1GB)

The partition table:
  P1:     2048	33554432	FS, 16GiB
  P2: 33556480	 6291456	possible delay-node OS or additional swap, 3GiB
  P3: 39847936	 6291456	swap, 3GiB
  P4: 46139392	34278848+	extrafs, 16+GB

The larger size and partition alignment are why I pushed this through despite
my noble intentions.
parent 4a8604b1
#!/bin/sh #!/bin/sh
# #
# Copyright (c) 2000-2013 University of Utah and the Flux Group. # Copyright (c) 2000-2014 University of Utah and the Flux Group.
# #
# {{{EMULAB-LICENSE # {{{EMULAB-LICENSE
# #
...@@ -63,6 +63,7 @@ fi ...@@ -63,6 +63,7 @@ fi
# versions of the MBR: # versions of the MBR:
# v1 (partition 1 size 6281352) # v1 (partition 1 size 6281352)
# v2 (partition 1 size 12305790) # v2 (partition 1 size 12305790)
# v3 (partition 1 size 33554432)
# Currently we only install a new MBR if the existing one is the # Currently we only install a new MBR if the existing one is the
# wrong size, just in case the user has customized the boot program. # wrong size, just in case the user has customized the boot program.
# #
...@@ -84,6 +85,9 @@ tweakmbr() { ...@@ -84,6 +85,9 @@ tweakmbr() {
12305790s) 12305790s)
_CUR=2 _CUR=2
;; ;;
33554432s)
_CUR=3
;;
s) s)
# special case: no part1 so probably no MBR at all, make sure we install # special case: no part1 so probably no MBR at all, make sure we install
echo "Found no MBR on $_DSK, installing version $_NEW" echo "Found no MBR on $_DSK, installing version $_NEW"
......
...@@ -66,6 +66,7 @@ get_value() ...@@ -66,6 +66,7 @@ get_value()
# versions of the MBR: # versions of the MBR:
# v1 (partition 1 size 6281352) # v1 (partition 1 size 6281352)
# v2 (partition 1 size 12305790) # v2 (partition 1 size 12305790)
# v3 (partition 1 size 33554432)
# Currently we only install a new MBR if the existing one is the # Currently we only install a new MBR if the existing one is the
# wrong size, just in case the user has customized the boot program. # wrong size, just in case the user has customized the boot program.
# #
...@@ -92,6 +93,9 @@ tweakmbr() ...@@ -92,6 +93,9 @@ tweakmbr()
12305790s) 12305790s)
cur_mbr_ver=2 cur_mbr_ver=2
;; ;;
33554432s)
cur_mbr_ver=3
;;
s) s)
echo "Found no MBR on $disk, installing version $new_mbr_ver" echo "Found no MBR on $disk, installing version $new_mbr_ver"
;; ;;
......
...@@ -900,7 +900,8 @@ sub GetDiskOffset($) ...@@ -900,7 +900,8 @@ sub GetDiskOffset($)
# XXX these should come out of the DB or not exist at all! # XXX these should come out of the DB or not exist at all!
my %mbr = ( my %mbr = (
"1" => [0, 63, 6281415, 12562830, 12819870], "1" => [0, 63, 6281415, 12562830, 12819870],
"2" => [0, 63, 12305853, 24611643, 26712000] "2" => [0, 63, 12305853, 24611643, 26712000],
"3" => [0, 2048, 33556480, 39847936, 46139392]
); );
# Must be a real reference. # Must be a real reference.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment