[Casper] disk identifiers
Miles Leacy
miles.leacy at themacadmin.com
Fri Dec 19 13:26:20 PST 2008
Ok, here's the scenario...
All Xserves are purchased with three 80GB SATA drives. I want to have
zero-touch server deployment. The boot drive is to be a RAID 1 called
"Server HD".
In order to make this happen, I plan to:
1. Set up a prestage
2. Boot from a USB flash drive containing a restore image that runs Casper
Imaging automatically.
3. Deploy a configuration with a "before" script that uses diskutil to
create a RAID 1 from two of the three internal drives.
The script uses the command:
diskutil createRAID mirror Server\ HD JHFS+ disk0 disk1
In order for this to work, I need to know that I can count on the USB drive
never being assigned the disk identifiers "disk0" or "disk1". Or at least
know what the rules governing disk identifier assignment are so I can adjust
the script accordingly. I know what drives will be attached at first boot,
so once I know those rules, I can have a reliable script.
In case you're saying to yourself "He said there are three drives. What's
he doing with the third one?", I'm keeping that as a hot spare to rebuild
the mirror in case one of the other disks fail.
I'm considering how to automate that too. The basic logic so far is:
1. On every15, a policy runs a script that checks for a degraded mirror.
2. If a degraded mirror is found, the script issues a custom trigger which
runs a policy that deploys an empty receipt that is the criteria for
membership in a "Failed Mirror" smart group. The same policy includes a
"diskutil repairMirror" script that checks itself for success. If
successful, a third policy is triggered by custom trigger.
3. The third policy deploys an empty receipt which is criteria for
membership in a "Repaired Mirror" smart group.
4. Notification is sent on joining either of the two smart groups above.
This way, I don't get woken up at 2AM for a degraded mirror. I get an email
the next day and I have the bad drive replaced, which becomes the new hot
spare. None of this has been tested yet, I've just sketched the logic on a
legal pad so far.
One other hitch I've found in the zero-touch scenario is getting the
machines to boot from USB rather than the factory-installed OS. I suppose I
could have my reseller erase the internal drives before shipping. I don't
have a better idea on that. Even using netboot requires attaching a
keyboard and holding the "N" key. With blank hard drives and a bootable USB
key, you're truly zero-touch (other than having part of the rackmount
procedure be "insert USB drive"). I'll leave the USB drives attached as
restore & diagnostics boot drives.
----------
Miles A. Leacy IV
Certified System Administrator 10.4
Certified Technical Coordinator 10.5
Certified Trainer
Certified Casper Administrator
----------
voice: 1-347-277-7321
miles.leacy at themacadmin.com
www.themacadmin.com
On Fri, Dec 19, 2008 at 3:34 PM, Thomas Larkin <tlarki at kckps.org> wrote:
> I would assume it reads it from EFI (firmware) and then by bus for
> internals and externals just get the next available when plugged in. You
> could always try looping your scripts
>
> like
>
> for i in /usr/sbin/diskutil list
>
> if $i = something
>
> then do something
>
> else exit
>
> fi
>
> to give a really rough example...
>
>
> ___________________________
> Thomas Larkin
> TIS Department
> KCKPS USD500
> tlarki at kckps.org
> blackberry: 913-449-7589
> office: 913-627-0351
>
>
>
>
>
> >>> "Miles Leacy" <miles.leacy at themacadmin.com> 12/19/08 11:33 AM >>>
> Hey all,
>
>
> I know that disk identifiers (disk0, disk1, etc) are assigned in the
> order in which the disks were attached. For example, if you boot a Mac with
> a single internal drive, that drive will be disk0. Once booted, you can
> insert an optical disk, and the optical disk will be called disk1. If you
> later plug in a USB disk, the USB disk will be disk2.
>
>
> I'm trying to find out the order in which disk identifiers
> are assigned at boot time.
>
>
> For example, if you have an Xserve with three internal hard disks, an
> optical disk inserted, and a USB drive attached, can you count on the
> internal disks having the disk0, disk1, and disk2 identifiers? What
> identifiers would the optical and USB disks get?
>
>
> I'm guessing there's an order of precedence by bus, but is this
> documented somewhere? I've been flipping through Mac OS X Internals by Amit
> Singh and haven't found the answer yet. most of the comments I've found by
> googling assume that disk identifier assignment is a form of voodoo. This
> is a computer, not a witches' brew, so there has to be a set of rules that
> govern disk identifier assignment, and I'm hoping someone on the list knows
> what those rules are.
>
>
> I ask because I want to implement some diskutil scripts, but I need to
> know whether my assumption that SATA (or at least internal hard) disks
> always get the lowest disk identifiers at boot is true.
>
>
> ----------
> Miles A. Leacy IV
>
> Certified System Administrator 10.4
> Certified Technical Coordinator 10.5
> Certified Trainer
> Certified Casper Administrator
> ----------
> voice: 1-347-277-7321
> miles.leacy at themacadmin.com
> www.themacadmin.com
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.jamfsoftware.com/pipermail/casper/attachments/20081219/d2917c41/attachment.htm
More information about the Casper
mailing list