Difference between revisions of "Booting from a USB Thumbdrive"

From AwkwardTV
Jump to: navigation, search
(The image itself)
m (Reverted edits by Settlersonlinewiki (Talk) to last revision by IPing)
 
(83 intermediate revisions by 26 users not shown)
Line 1: Line 1:
= Booting from a USB Thumbdrive =
+
{{Template:Banner}}
 +
 
 +
 
 +
== Not Patchstick ==
 +
This page is not about Patchstick. I repeat: this page is '''not''' about Patchstick. This page just goes into detail about the layout of the partitioning table of a possible USB thumbdrive, which might be used for building something ''like'' Patchstick.
 +
 
 +
The image linked in this article is an ''empty'' image. No files. Really.
 +
 
 +
You have been warned.
  
 
== A bit of info on how the boot process works ==
 
== A bit of info on how the boot process works ==
Line 12: Line 20:
 
== A bit of info about the image ==
 
== A bit of info about the image ==
  
It's simple enough to create a GPT on a USB thumbdrive with the required attributes.  I used [http://www.gnu.org/software/parted/index.shtml GNU Parted] on Linux, and I'm sure equivalent tools exist for Mac and Windows.  The tricky part is making the image in such a way that it'll boot in the AppleTV '''and''' be easy to deal with if you don't have a Mac handy.  The latter requirement basically rules out HFS/HFS+, since Linux support is spotty and Windows support is non-existant, so I chose to use FAT32.
+
It's simple enough to create a GPT on a USB thumbdrive with the required attributes.  I used [http://www.gnu.org/software/parted/index.shtml GNU Parted] on Linux, and I'm sure equivalent tools exist for Mac and Windows.  The tricky part is making the image in such a way that it'll boot in the AppleTV '''and''' be easy to deal with if you don't have a Mac handy.  The latter requirement basically rules out HFS/HFS , since Linux support is spotty and Windows support is non-existant, so I chose to use FAT32.
  
 
Windows has had some level of support for GPT disks for some time now, but it uses the Partition Type indicator to determine the type of the filesystem.  Since we have to set this to the value for a recovery partition, Windows will refuse to recognize the partition as FAT32, although Linux will happily mount it anyways.
 
Windows has had some level of support for GPT disks for some time now, but it uses the Partition Type indicator to determine the type of the filesystem.  Since we have to set this to the value for a recovery partition, Windows will refuse to recognize the partition as FAT32, although Linux will happily mount it anyways.
Line 22: Line 30:
 
Note that as is, the recovery partition image won't boot completely from USB, since the kernel basically cuts its own head off when it disables USB.
 
Note that as is, the recovery partition image won't boot completely from USB, since the kernel basically cuts its own head off when it disables USB.
  
== The image itself ==
+
== The image itself (sized for 256MB Flash)==
 +
 
 +
The original image was posted as a base-64 text chunk within this page, it is now mirrored below.
 +
The complete image is only about 6K compressed. 
 +
All you need to do is decompress the image, then write it to a storage device of your choice.
 +
 
 +
'''Note:''' This is a raw disk image, and will expand to 257,949,696 bytes. Your storage device will have to meet this minimum requirement to use this particular image.
 +
 
 +
== Writing the Image ==
 +
 
 +
=== Mac OS X and other *NIX or *NIX like Operating Systems ===
 +
 
 +
You must have a Memory stick larger than 512MB of free post formated space for this to work.
 +
 
 +
Insert your storage device / thumb-drive / USB stick but don't mount it.  If your OS automounts the image (like OS X does) you'll need to unmount before you write to it.
 +
 
 +
<pre>$ mount
 +
...
 +
/dev/disk1s1 on /Volumes/UNTITLED (local, nodev, nosuid) <-- mounted partition on the thumb drive.  /dev/disk1 would be the thumbdrive itself.  See note below!
 +
</pre>
 +
 
 +
Unmount (as root) For those using OS X gui, find NetInfo Manager in the Utilities folder, click "Security" at the top menu, then "Authenticate." A dialogue box will pop up which asks for the administrator's short name and password. Notice the command for un-mounting is UMOUNT with no 'n' after the 'U.' This is the command, not a typo. Unmount with:-
 +
 
 +
<pre> # diskutil umountDisk /dev/diskX </pre>
 +
 
 +
then use ''dd'' to write the image to the storage device (change /dev/disk1 to be the device that corresponds to your OS and device).
 +
 
 +
<pre> $ dd if=Hybrid.img of=/dev/disk1 bs=1m</pre>
 +
 
 +
'''Important Note:''' You want to write to the device that correponds to the entire thumbdrive - '''not''' one of its partitions.  If you write the image to an existing partition, the all-important partition tables won't be written properly.  On Mac OS / Darwin, this will be something like <tt>/dev/diskX</tt> rather than <tt>dev/diskXs1</tt>.  On Linux, the device will probably be <tt>/dev/sdX</tt> for a USB device. (Note that SATA hard drives will probably also appear as <tt>/dev/sdX</tt> - use <tt>fdisk -l /dev/sdX</tt> to make sure you have the right device before writing to it!)
 +
 
 +
If your storage device has a pretty LED you'll see some activity, once finished you'll see something like:
 +
<pre>
 +
503808 0 records in
 +
503808 0 records out
 +
257949696 bytes transferred in 439.220493 secs (587290 bytes/sec)
 +
</pre>
 +
 
 +
The drive will more than likely mount once the above process is complete - unmount it and proceed with your install on the Apple TV.
  
I don't have any hosting at the moment, and the complete image is only about 6K compressed, so I've base-64 encoded it and embedded it in the text.  All you need to do is decode and decompress the image, then write it to a storage device of your choice.
+
=== Windows ===
  
If you have hosting available, '''please''' feel free to host the image elsewhere and remove this big blob of text.
+
Download [http://www.chrysocome.net/dd dd for Windows] and follow the steps above for writing the image.  You don't need to worry about the unmounting part.  Windows device identifiers are quite different from BSD / Linux identifiers, so look at the examples on the linked page for how to write to a USB Mass Storage device.
 +
 
 +
With <tt>dd.exe</tt> and the <tt>Hybrid.img</tt> file in the same folder type the following command to find out the name of your USB drive.
 +
<pre>
 +
dd --list
 +
</pre>
 +
You should see a bunch of output similiar to:
 +
<pre>
  
I have hosted the image (assuming I encoded it correctly) [http://www.novaoblivion.com/AppleTV/Hybrid.img.bz2 here] (Right Click Save As), please be gentle on my server! My host may force me to take it down so please mirror it.
+
\\.\Volume{5cd94d2c-3251-11d9-9444-806d6172696f}\
 +
link to \\?\Device\HarddiskVolume1
 +
fixed media
 +
Mounted on \\.\c:
  
[http://www.sneezingdog.com/Hybrid.img.bz2 Mirrored Here (still have to right click, save as)] - MrZarquon
+
\\.\Volume{129b1243-3252-11d9-b167-806d6172696f}\
 +
link to \\?\Device\CdRom0 CD-ROM
 +
Mounted on \\.\r:
 +
 +
\\.\Volume{e3429891-0eb9-11da-b18f-000d60dc98cd}\
 +
link to \\?\Device\Harddisk1\DP(1)0-0 3 removable media
 +
Mounted on \\.\d:
 +
</pre>
 +
We are interested in the device mounted to where your USB drive is (d: in this case).
  
File: Hybrid.img.bz2
+
We then do:
 
<pre>
 
<pre>
QlpoOTFBWSZTWWAattkAABn//////////////////f/////////////v////////////4AneAH1e
+
dd if=Hybrid.img of=\\?\Device\Harddis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t/UlnhS3f
 
n1JcsKX0FJc4pLuhSxaks0KXLqS9UibWJMLEmMiTYRJztRNhUTsokyW3RJ5VRNU2sSbnEm61E1MS
 
bL19ROWiTiYk2USa2JOdqJ4ESfLiTcKiYuJPE2kRdYKWHFLJiluHZKS2AUvAFGWqJrIk6uomJqJq
 
Ik4qomqUlvQpe4UllVJceKWOUlohS8EUsWKXzVJf8Ul5qkvpilr4pespLttapL/Apc2pL0vsiTKx
 
J+WonLVE+Tm4kw8ScJpIk8iJOmqJmYk7aJNFUTfYk6SJPEiTlqidfEmxqJ+aJMepLvBS4kUtgFLT
 
KSwFJdeknSxJu0Sa+JPaRJnaiZmJMN4USZ2onkxJw9ROMiTnqhb6KWgFLtxS9opLcRSyApccpLaB
 
S/aKWcFLeBS7pSXOqJ6GonHxJz1RMYiglL48kuwFLuRS7tSXmKS28Ut3UTv6ibxEnwok10SbOon8
 
Ild8pL1hSxopaoUuEUl7DbhSzwpf/F3JFOFCQp5XZ4w=
 
 
</pre>
 
</pre>
 +
 +
The important part is writing to the Partition0 part of the drive.  The Windows version of dd.exe does not support --size as noted in previous versions of this page.
 +
 +
You could also just download a Linux LiveCD.
 +
 +
== Download the image (Mirrors) ==
 +
 +
[http://atv.mylittleproject.co.uk/Hybrid.img.bz2 Here]  - dobedobedoh
 +
 +
[http://s3.simplyrented.com/appletv/Hybrid.img.bz2 Here] - anourkey
 +
 +
[http://dl.galphanet.ch/divers/Hybrid.img.bz2 Here] - Galphanet (Swiss server)
 +
 +
[http://www.sneezingdog.com/Hybrid.img.bz2 Here] (choose right click, save as) - MrZarquon
 +
 +
[http://www.novaoblivion.com/AppleTV/Hybrid.img.bz2 Here] (choose right Click Save As), please be gentle on this server, use as a last resort!
 +
 +
MD5:
 +
a00685206de5cf5a313ec62594d2ff9e  Hybrid.img.bz2 (compressed)
 +
 +
MD5:
 +
1533fdfb2503851a545cf1955c2daea6  Hybrid.img (uncompressed)
 +
 +
 +
[[Category:Software]][[Category:How-to]]

Latest revision as of 15:19, 30 December 2012

<Google>WIKI</Google>


Not Patchstick

This page is not about Patchstick. I repeat: this page is not about Patchstick. This page just goes into detail about the layout of the partitioning table of a possible USB thumbdrive, which might be used for building something like Patchstick.

The image linked in this article is an empty image. No files. Really.

You have been warned.

A bit of info on how the boot process works

Background reading:

If the system is booted with the "Menu" and "Minus" keys on the remote held down, it checks for a FAT32 or HFS partition with a Partition Type of {5265636F-7665-11AA-AA11-00306543ECAC}, first on a USB storage device, then on the internal HDD. If such a partition is found, it's mounted and a file called "boot.efi" is read from the root folder and executed.

A bit of info about the image

It's simple enough to create a GPT on a USB thumbdrive with the required attributes. I used GNU Parted on Linux, and I'm sure equivalent tools exist for Mac and Windows. The tricky part is making the image in such a way that it'll boot in the AppleTV and be easy to deal with if you don't have a Mac handy. The latter requirement basically rules out HFS/HFS , since Linux support is spotty and Windows support is non-existant, so I chose to use FAT32.

Windows has had some level of support for GPT disks for some time now, but it uses the Partition Type indicator to determine the type of the filesystem. Since we have to set this to the value for a recovery partition, Windows will refuse to recognize the partition as FAT32, although Linux will happily mount it anyways.

My first thought was to get rid of the "Protective MBR" partition table that GPT uses to hide itself from older partitioning tools and replace it with a valid MBR partition table that points to the FAT32 partition. Thus, the drive would have two partition tables, each pointing to the same partition. With this in place, the thumbdrive was mountable both in Linux and Windows, but the AppleTV apparently checks for the 0xEE partition in the MBR before trying to use the GPT.

In the end, I was able to create a MBR that contains the 0xEE partition required to get the AppleTV to load the GPT, but instead of setting the protective partition to fill the disk, I made it very small, then added a second partition in the MBR's remaining space that points to the FAT32 partition. Now, it's visible to Windows (MBR table), Linux (either table), and the AppleTV (GPT). You should be able to plug a thumbdrive initialized with this image into any Windows box (I've only tested with Vista Ultimate 64-bit) and copy over the necessary files from the AppleTV recovery partition (boot.efi, com.apple.Boot.plist, BootLogo.png, and mach_kernel.prelink). After that, you can plug the thumbdrive into the AppleTV and reboot it while holding down "Menu" and "Minus" on the remote to boot from the thumbdrive.

Note that as is, the recovery partition image won't boot completely from USB, since the kernel basically cuts its own head off when it disables USB.

The image itself (sized for 256MB Flash)

The original image was posted as a base-64 text chunk within this page, it is now mirrored below. The complete image is only about 6K compressed. All you need to do is decompress the image, then write it to a storage device of your choice.

Note: This is a raw disk image, and will expand to 257,949,696 bytes. Your storage device will have to meet this minimum requirement to use this particular image.

Writing the Image

Mac OS X and other *NIX or *NIX like Operating Systems

You must have a Memory stick larger than 512MB of free post formated space for this to work.

Insert your storage device / thumb-drive / USB stick but don't mount it. If your OS automounts the image (like OS X does) you'll need to unmount before you write to it.

$ mount
...
/dev/disk1s1 on /Volumes/UNTITLED (local, nodev, nosuid) <-- mounted partition on the thumb drive.  /dev/disk1 would be the thumbdrive itself.  See note below!

Unmount (as root) For those using OS X gui, find NetInfo Manager in the Utilities folder, click "Security" at the top menu, then "Authenticate." A dialogue box will pop up which asks for the administrator's short name and password. Notice the command for un-mounting is UMOUNT with no 'n' after the 'U.' This is the command, not a typo. Unmount with:-

 # diskutil umountDisk /dev/diskX 

then use dd to write the image to the storage device (change /dev/disk1 to be the device that corresponds to your OS and device).

 $ dd if=Hybrid.img of=/dev/disk1 bs=1m

Important Note: You want to write to the device that correponds to the entire thumbdrive - not one of its partitions. If you write the image to an existing partition, the all-important partition tables won't be written properly. On Mac OS / Darwin, this will be something like /dev/diskX rather than dev/diskXs1. On Linux, the device will probably be /dev/sdX for a USB device. (Note that SATA hard drives will probably also appear as /dev/sdX - use fdisk -l /dev/sdX to make sure you have the right device before writing to it!)

If your storage device has a pretty LED you'll see some activity, once finished you'll see something like:

503808 0 records in
503808 0 records out
257949696 bytes transferred in 439.220493 secs (587290 bytes/sec)

The drive will more than likely mount once the above process is complete - unmount it and proceed with your install on the Apple TV.

Windows

Download dd for Windows and follow the steps above for writing the image. You don't need to worry about the unmounting part. Windows device identifiers are quite different from BSD / Linux identifiers, so look at the examples on the linked page for how to write to a USB Mass Storage device.

With dd.exe and the Hybrid.img file in the same folder type the following command to find out the name of your USB drive.

dd --list

You should see a bunch of output similiar to:


\\.\Volume{5cd94d2c-3251-11d9-9444-806d6172696f}\
 link to \\?\Device\HarddiskVolume1
 fixed media
 Mounted on \\.\c:

\\.\Volume{129b1243-3252-11d9-b167-806d6172696f}\
 link to \\?\Device\CdRom0 CD-ROM
 Mounted on \\.\r:
 
\\.\Volume{e3429891-0eb9-11da-b18f-000d60dc98cd}\
 link to \\?\Device\Harddisk1\DP(1)0-0 3 removable media
 Mounted on \\.\d:

We are interested in the device mounted to where your USB drive is (d: in this case).

We then do:

dd if=Hybrid.img of=\\?\Device\Harddisk1\Partition0 bs=1M --progress

The important part is writing to the Partition0 part of the drive. The Windows version of dd.exe does not support --size as noted in previous versions of this page.

You could also just download a Linux LiveCD.

Download the image (Mirrors)

Here - dobedobedoh

Here - anourkey

Here - Galphanet (Swiss server)

Here (choose right click, save as) - MrZarquon

Here (choose right Click Save As), please be gentle on this server, use as a last resort!

MD5: a00685206de5cf5a313ec62594d2ff9e Hybrid.img.bz2 (compressed)

MD5: 1533fdfb2503851a545cf1955c2daea6 Hybrid.img (uncompressed)