Saturday, December 3, 2011

Recovering ChromeOS with a small flash drive on FreeBSD

If you've got a Chromebook and have ever made a typing error in DEV mode while switching over to a Linux installation, you've probably know what it's like to put your machine into an unusable state. You will need to resort to using a recovery image, and the instructions are right here for that.

Google has a few recovery utilities on various platforms to build a bootable image for a broken Chromebook: The utilities are runnable on Linux, Windows and Apple machines. However, if your Chomebook crashed and you don't have a 4GB flash drive for use with the Window utility, and only have a FreeBSD machine, there is still a way to recover.

Truth be told, the actual stable channel recovery image is only 97+ MB of data, so you really don't need a 4GB flash stick to recover your machine. Unfortunately, under Windows, the recovery software requires you have a 4 GB stick or SD card. But all you really need is a 1G stick or SD card.

If you're using FreeBSD, the Linux version of the software will let you download an image, but it wants to use process file system which has been phased-out. You can still install a Linux compatible process file system for the sake of the script, but it will not recognize anything plugged into the USB ports for some reason.

The best thing under these circumstances is to make a bootable device yourself, and this means simply downloading the latest stable channel image from here. If you are on FreeBSD and use wget, it will complain about an unverifiable SSL certificate, so you must tell it to ignore that:

# wget --no-check-certificate https://dl.google.com/dl/chromeos/recovery/cr48-stable-recovery

Unzip the image, and plug in your flash stick:

# unzip cr48-stable-recovery

It shouldn't matter what's on the stick as long as you've backed it up, because the next command will wipe it out entirely and drop the image raw on whatever used to be there:

# dd if=chromeos_0.15.1011.118_x86-mario_recovery_stable-channel_mp-v2.bin of=/dev/da0 bs=4194304 conv=sync

# sync


The command above was stolen from Google's Linux recovery script which fails to recognize a flash drive under FreeBSD. The huge blocksize greatly reduces the transfer time, and sync seals the deal when it's done. When you plug the stick into the CR-48, it will go through some tests, print some graphics to the screen, and may tell you the recovery failed. However, if you pull out the stick from the USB port, it will reboot into Chrome just fine :)

No comments:

Post a Comment