Showing posts with label osx. Show all posts
Showing posts with label osx. Show all posts

Tuesday, 20 March 2012

UPDATE: Howto Restore from a Time Machine backup on a Drobo-FS

This is what I did. Not everything here may be important, but...

My Starting point:


  • A PowerBook G4.
  • A probably damaged file system (ie. I could not shrink a partition).
  • A recent Time Machine backup to a Time Machine enabled share on a Drobo-FS. This was 'updated' several times as I was cleaning out my file system. This also meant it is huge.
  • I removed all partitions on my hard drive - I wanted a clean start.

Note: my Drobo-FS share is accessible by 'Everyone'. My other shares require an account. This may be important as I am not sure if you will later be able to connect to this share by using a username and password. So, I would connect to your Drobo-FS and add 'Everyone' with Read/Write access.

What I wanted to do was install a tiny OSX partition, restore some of my old accounts, and install linux as well. My aim was to make Linux the main OS.


Howto Restore from a Time Machine backup on a Drobo-FS


  • Boot of install DVD. Mine was OSX Leopard 10.5
  • After first screen to select your language, turn on AirPort (icon in top right hand corner) and joined your home wireless network.
  • From the menu, select Utilities - we need to somehow find and mount your Drobo-FS share containing your Time Machine backup bundle.
  • Select Disk utility.
  • Select File - Open Disk Image. This will not actually work, but it will allow you to mount a Drobo-FS share. You should now see your Drobo-FS under SHARED in a Finder window.
  • Click on your Drobo-FS. Your shares should be listed.
  • Double-click on your Time Machine backup share. Your Drobo-FS backup share should now be mounted and accessibly for restoration.
  • Cancel back to Disk Utility.
  • Here, I created a Partition and gave it the identical name that it had before. In my case it was 'Macintiosh HD'. This may or may not be important.
  • Exit Disk Utility.
  • Select Utilities - Restore... (not sure exactly what is is called)
  • From here you should be able to select your Time machine backup share and your hard drive for the restore to proceed.

Note: I had trouble using the wired Ethernet port and enabling AirPort seemed to help - On previous attempts to migrate accounts, I found that Apple's installer could not  use my wired Ethernet port!?!
Note: This is not what I want, but I hope to be able to shrink this later to add other partitions for Linux.

Currently mine is up to 96%.

UPDATE: It did finish and all was well and Linux (Mint PPC) runs great!


Postscript

Dear Drobo,

You market these 'simple-to-use' devices and promote Time Machine compatibility - to a degree.

I should not have to go to some third party blog that suggests I run a terminal and type in a command that only geeks would know what it does or means. 

Should I?

This is your support page. - well, that is what I found. Is that the best you can do?

UPDATE: Drobo have contacted me and suggest looking at this page.

http://support.drobo.com/app/answers/detail/a_id/667/kw/restore

It looks very complicated and they indicate that it only works for Lion or later. 

I think my 'discovered' method is simpler. Drobo's instructions require terminal commands and details that would be hard to get if you are not familiar with low-level Unix commands and IP networking.

You now need to publish simple-to-use instructions on how to use Drobo's (especially networked ones) in situations where we, your customer's need instructions.

Why? Because your products don't 'just work'!!!

In the case your Drobo-FS product - the one I paid handsomely for on the basis of 'simple-to-use'... you need to publish at least these instructions:


  • Restore a machine from a Time Machine backup on a Drobo-FS share.
  • Migrate accounts at any time or after a fresh install of OS-X.

You need to test these instructions, try them of all supported OSs, you do do this already don't you? So document it so people can do it for themselves.

How can I recommend a Drobo-FS to someone when I had so much trouble restoring!?!

But, if I am the dummy here, please tell me where I went wrong. I have to do this a few more times!





Saturday, 19 February 2011

Boot a Real Mac OS-X Partition under Linux and VirtualBox - What Works

VirtualBox 4.0


Works (does something)
  • Nat networking
  • Safari (I have edited this post using Safari on the OS-X VM)
  • iTunes (starts - that is all I have done)
  • iPhoto (starts - that is all I have done)
  • About
  • System Preferences
  • Finder
  • Finder sees other SMB and AFS shares
  • Shutdown (mostly) 
  • 1 CPU runs flat-out - to 'fix' this I ran this command. When the VM is idle the host load is much reduced:
  • sudo rm -fr /System/Library/Extensions/AppleIntelCPUPowerManagement.kext
  • By removing /System/Library/Extension
  • Calculator
  • YouTube
  • Sound - I have tried IntelHD/ALSA
  • USB with VirtualBox extras
  • Disk Utility
  • Intel PRO/1000 MT Desktop (Bridged adapter, eth1)
  • Time Machine backup to Time Capsule if a network bridge is available

Does not work (or I can't get it working)
  • glxgears (X11 crashes repeatedly)
  • Shutdown (rarely)
  • V8 Benchmark runs too slow for Safari's liking

VirtualBox 3.2.8 OSE


Works (does something)
  • Nat networking
  • Safari
  • iTunes (starts - that is all I have done)
  • iPhoto (starts - that is all I have done)
  • About
  • System Preferences
  • Finder
  • Finder sees other SMB and AFS shares
  • Shutdown (sometimes) 
  • 1 CPU runs flat-out
  • Calculator
  • YouTube
  • Disk Utility

Does not work (or I can't get it working)
  • Bridge Networking
  • Audio
  • glxgears (X11 crashes repeatedly)
  • Finder can not connect to other SMB and AFS shares
  • Shutdown (sometimes)
  • V8 Benchmark runs too slow for Safari's liking


Boot a Real Mac OS-X Partition under Linux and VirtualBox

This should be easy, but Apple make it hard.

I have a MacBook Pro. I have OS-X Leopard 10.5.2 installed as well as Ubuntu 10.10 linux.

I wanted to get my OS-X partition to run as a virtual machine.

After many false starts I got something to work.



First, the specs.
Hardware: MacBook Pro 4,1, early 2008, 2.4GHz, 200GB, 15"
http://en.wikipedia.org/wiki/MacBook_Pro
Host OS: Ubuntu 10.10
VM Manager: VirtualBox 3.2.8 OSE r64453
Guest OS: OS-X 10.5.2 Leopard (I don't bother to update it as I don't use it much and it have virtually nothing installed)
Overview

1. Get VirtualBox to list the physical partition in the Virtual Media Manager.
2. Setup the VM
3. Tweak it.
3. Run it.

1. Setup Disk Image

Please proceed at your own risk. Only do this if you have backed-up your disk partitions (with Time Machine for example, but don't forget about your linux partition) or your don't care about any data on your disk.

I used this information to create my VMM vmdk file.
http://ejs.seniejitrakai.net/2010/11/01/running-virtualbox-guests-from-physical-drive/
In my case, my hard drive is /dev/sda under linux.



phil@max:~$ VBoxManage internalcommands listpartitions -rawdisk /dev/sda

Oracle VM VirtualBox Command Line Management Interface Version 3.2.8_OSE(C) 2005-2010 Oracle CorporationAll rights reserved.
Number  Type   StartCHS       EndCHS      Size (MiB)  Start (Sect)1       0xee  1023/254/63  1023/254/63           200            12       0xaf  1023/254/63  1023/254/63        119102       4096404       0x83  1023/254/63  1023/254/63         11444    2443309763       0xaf  1023/254/63  1023/254/63         23167    343011768


The OS-X partition in my case is number 3. It is about 23GB.

Then I made the vmdk file like this:

phil@max:~$ VBoxManage internalcommands createrawvmdk -filename /home/phil/.VirtualBox/HardDisks/example.vmdk -rawdisk /dev/sda -partitions 3 -register 
Oracle VM VirtualBox Command Line Management Interface Version 3.2.8_OSE(C) 2005-2010 Oracle CorporationAll rights reserved.
RAW host disk access VMDK file /home/phil/.VirtualBox/HardDisks/example.vmdk created successfully.

This made this file - yours will be different, but it should have the same structure:

# Disk DescriptorFileversion=1CID=279c9811parentCID=ffffffffcreateType="partitionedDevice"
# Extent descriptionRW 1 FLAT "example-pt.vmdk" 0RW 409639 ZERO RW 243921336 ZERO RW 23437500 ZERO RW 75243292 ZERO RW 47448016 FLAT "/dev/sda" 343011768RW 262184 ZERO 
# The disk Data Base #DDB
ddb.virtualHWVersion = "4"ddb.adapterType="ide"ddb.geometry.cylinders="16383"ddb.geometry.heads="16"ddb.geometry.sectors="63"ddb.uuid.image="99ca08b3-6d2e-4ed4-8790-2430cfe5a57a"ddb.uuid.parent="00000000-0000-0000-0000-000000000000"ddb.uuid.modification="00000000-0000-0000-0000-000000000000"ddb.uuid.parentmodification="00000000-0000-0000-0000-000000000000"

Now if you run Virtual Media Manager, you should now see a new hard drive entry for your physical partition.


That wasn't that hard, thanks to Sun/Innotek for making this easy.

2. Setup VM.

The key fields are these:
OS Type = Mac OS X
Use an existing hard disk - the one I created above: example.vmdk
The rest are the current defaults (which I will list below).
I also enabled 3D acceleration, but I can pick either.
Too easy, right?

3. Tweak VM

Apple OS-X checks to see if a special key is in a chip. VMs don't currently emulate this chip with the key, so you need to get the key off your machine and add it manually to the VirtualBox XML file that describes the VM.

The key is really a plea from Apple to not steal their OS. Here is their EULA for 10.5.

http://images.apple.com/legal/sla/docs/macosx105.pdf

It contains this clause:

A. Single Use. This License allows you to install, use and run one (1) copy of the Apple Software on a single Apple-labeled computer at a time. You agree not to install, use
or run the Apple Software on any non-Apple-labeled computer, or to enable others to do so. This License does not allow the Apple Software to exist on more than one
computer at a time, and you may not make the Apple Software available over a network where it could be used by multiple computers at the same time. 

I think this complies: One licensed and installed copy of OS-X on an Apple-labeled computer. I can't run it twice because that would do bad things to the file system.

So, I'll continue...

In my case the XML file is /home/phil/.VirtualBox/Machines/example/example.xml

This is what it might look like:


<?xml version="1.0"?>
<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.11-linux">
  <Machine uuid="{0db68b53-a452-40bd-bb83-ad8952411320}" name="example" OSType="MacOS" snapshotFolder="Snapshots" lastStateChange="2011-02-19T08:34:33Z">
    <MediaRegistry>
      <HardDisks/>
      <DVDImages/>
      <FloppyImages/>
    </MediaRegistry>
    <Hardware version="2">
      <CPU count="1" hotplug="false">
        <HardwareVirtEx enabled="true" exclusive="true"/>
        <HardwareVirtExNestedPaging enabled="true"/>
        <HardwareVirtExVPID enabled="true"/>
        <PAE enabled="true"/>
        <HardwareVirtExLargePages enabled="false"/>
        <HardwareVirtForce enabled="false"/>
      </CPU>
      <Memory RAMSize="1024" PageFusion="false"/>
      <Firmware type="EFI"/>
      <HID Pointing="USBTablet" Keyboard="USBKeyboard"/>
      <HPET enabled="true"/>
      <Chipset type="ICH9"/>
--- SNIP --- 


  </Machine>
</VirtualBox>

As you can see, the whole configuration of a VM is, more-or-less, understandable.

But wait! To do the next bit, you have to run the VM once. Until you do this scary thing, the XML file is missing bits that make the next part easier.

So, start the VM. When you see lots of text you can close the window and shutdown the VM.


This is all safe it seems.

My example VM XML file now looked like this - the highlighted bits are what we want to see:


<?xml version="1.0"?>
<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.11-linux">
  <Machine uuid="{57d6a1c9-833f-4fb7-b765-f4c37793bc56}" name="example" OSType="MacOS" snapshotFolder="Snapshots" lastStateChange="2011-02-19T08:27:47Z">
    <MediaRegistry>
      <HardDisks/>
      <DVDImages/>
      <FloppyImages/>
    </MediaRegistry>
    <ExtraData>
      <ExtraDataItem name="GUI/LastCloseAction" value="powerOff"/>
      <ExtraDataItem name="GUI/LastGuestSizeHint" value="1024,768"/>
      <ExtraDataItem name="GUI/LastNormalWindowPosition" value="400,61,1024,815"/>
      <ExtraDataItem name="GUI/LastWindowPostion" value="37,53,1024,815"/>
      <ExtraDataItem name="GUI/MiniToolBarAlignment" value="bottom"/>
      <ExtraDataItem name="GUI/SaveMountedAtRuntime" value="yes"/>
      <ExtraDataItem name="GUI/ShowMiniToolBar" value="yes"/>
    </ExtraData>
--- SNIP --- 
  </Machine>
</VirtualBox>

To tweak it, I followed these instructions:
http://www.takwing.idv.hk/tech/virtual/vb320_macvm/page3.html

Modify your VM's xml file by adding the following line to the section:

<ExtraDataItem name="VBoxInternal2/SmcDeviceKey" 
value="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"/>



Mine then looked like this:

<?xml version="1.0"?>
<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.11-linux">
  <Machine uuid="{57d6a1c9-833f-4fb7-b765-f4c37793bc56}" name="example" OSType="MacOS" snapshotFolder="Snapshots" lastStateChange="2011-02-19T08:27:47Z">
    <MediaRegistry>
      <HardDisks/>
      <DVDImages/>
      <FloppyImages/>
    </MediaRegistry>
    <ExtraData>
      <ExtraDataItem name="GUI/LastCloseAction" value="powerOff"/>
      <ExtraDataItem name="GUI/LastGuestSizeHint" value="1024,768"/>
      <ExtraDataItem name="GUI/LastNormalWindowPosition" value="400,61,1024,815"/>
      <ExtraDataItem name="GUI/LastWindowPostion" value="37,53,1024,815"/>
      <ExtraDataItem name="GUI/MiniToolBarAlignment" value="bottom"/>
      <ExtraDataItem name="GUI/SaveMountedAtRuntime" value="yes"/>
      <ExtraDataItem name="GUI/ShowMiniToolBar" value="yes"/>
      <ExtraDataItem name="VBoxInternal2/SmcDeviceKey" value="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"/>
    </ExtraData>
--- SNIP --- 
  </Machine>
</VirtualBox>    

4. Run it.

That's it.

Let me know if it worked for you, and if you have a different hardware, host, guest configuration.

If it didn't work, then I probably can't help - but you you want me to explain anything that I did in more detail then please ask.

BTW, if this kills you disk, damages your data, or generally make your life a misery then you will recall that I warned you, right?