FireWire hard disk emulation

I’ve discovered a way to use a file on a computer as a FireWire Harddisk for another computer. This is a handy way to work with older Apple computers because it’s way easier than burning CD’s or using a read FW HDD.

The setup is not that complicated but still there is some to do.

And in advance: Only HDD’s are emulated. So you can’t use CD images (or at least not directly, for Mac OS X I’ve covered that below) and write access to the disk image is required (shouldn’t be a hurdle).

Requirements

  • Computer with a FireWire interface (of course)
  • Linux with Kernel 3.4+ and the required module (firewire_sbp2)
  • targetcli to easily configure it

I’ve tested Ubuntu 14.04 and Fedora 20 on my MacBook Pro (2009): – Ubuntu’s targetcli is not able to handle FireWire – Fedora 20 can be used from Live CD/USB and targetcli supports firewire

After this I’ve stopped searching for more distributions. And all instructions are for Fedora 20, I only used the Live mode but shouldn’t be different if installed.

Setup

  • Boot into Fedora 20
  • Ensure you have a network connection to install packages
  • All commands are executed as root, so do a sudo in front of each command or login / gain access to root
  • Install targetcli: yum install targetcli
  • Create a disk image or copy one, important: the file must be writeable
  • Use targetcli to set everything up

Disk images

Fedora seem to not have HFS+ write support, but since a writeable file is required I added a new ExFat partition (with Disk Utility on OS X) to my system and installed the driver: yum install fuse-exfat.

I’ve mounted the partition by hand: mount /dev/sha4 /mnt/images.

It seems that targetcli does not work with files and paths which have spaces or the equal sign in it! You have to avoid them, also maybe in volume names because if automatically mounted they are used in the path.

Since only hard disks are emulated a cd imageg can still added but the computer will not boot from it (usually) becuase booting from HDD and CD are handeled differently.

But for OS X DVD’s it’s easy to convert them:

  • Using Disk Utility on OS X create a new blank disk image
    • The image must be, of course, big enough to hold the DVD, mount the DVD and use the finder to get the size
      but don’t make the image too big because it will be stored uncompressed
    • Format: “Mac OS X Extended (Journaled)”, maybe without journaling for old OS X
    • Partitions: “Single partiotion – GUID Partition map” for Intel Macs and
      “Single partition – Apple Partition Map” for PowerPC Macs (the one you want to boot not the “server”)
  • Copy all files form the DVD to the Image
  • Eject both
  • Use the image

targetcli Basics

All commands can either be executed in the interactive targetcli shell or as a parameter to targetcli (for perforimg a single action).

In the interactive shell you can either walk around in the tree and perform actions there or pass the working directory as the first argument, examples

# "walk around"
cd /backstores
ls
# "as parameter"
/backstores ls

If not using the interactive shell you of course have always to use the second method. All commands here are given as direct calls to make them easier to batch.

Usage

Add a disk image: targetcli /backstores/fileio create name=10.4-PPC file_or_dev=/mnt/images/10.4-PPC.dmg. The name parameter is used to reference to this entry furthermore, feel free to add as many images as you want.

To create the FireWire system you have to figure out your “WWN” with targetcli /sbp info and then create it targetcli /sbp create eui.64b9e8fffecd98ca.

Add the image to firewire with: targetcli /sbp/eui.64b9e8fffecd98ca/luns create /backstores/fileio.10.4-PPC. You can add multiple images and all of them will be available.

Enable the FireWire system: targetcli /sbp/eui.64b9e8fffecd98ca enable.

With targetcli / ls you can get a listing of your current setup, here is mine:

o- / ............................................................................... [...]
  o- backstores .................................................................... [...]
  | o- block ........................................................ [Storage Objects: 0]
  | o- fileio ....................................................... [Storage Objects: 1]
  | | o- 10.4-PPC ............... [/mnt/images/10.4-PPC.dmg (2.8GiB) write-back activated]
  | o- pscsi ........................................................ [Storage Objects: 0]
  | o- ramdisk ...................................................... [Storage Objects: 0]
  o- iscsi .................................................................. [Targets: 0]
  o- loopback ............................................................... [Targets: 0]
  o- sbp .................................................................... [Targets: 1]
  | o- eui.64b9e8fffecd98ca ........................................................ [...]
  |   o- luns .................................................................. [LUNs: 1]
  |     o- lun0 ............................. [fileio/10.4-PPC (/mnt/images/10.4-PPC.dmg)]
  o- vhost .................................................................. [Targets: 0]

Now it’s time to connect the FireWire cable to the two machines and use it.

Here you can see my boot selection screen with the FireWire image. And yes, it’s no FireWire symbol but it still is one and works.

fwhdd-bootscreen

And a screenshot where you can see my attatched disk image.

fwhdd-info

With targetcli /sbp/eui.64b9e8fffecd98ca/luns delete 0 you can remove the 1st image from FireWire. You should add or remove luns only when the cable is not connected or the other computer is turned off. The images in ‘/backstores/fileio/…’ does not have to be removed with the lun.

0 Responses to “FireWire hard disk emulation”


  • No Comments

Leave a Reply