Monthly Archives: December 2010

Reinstall Ubuntu on CR-48 notebook with USB

Introduction

According to the /etc/X11/xorg.conf in the Chrome OS, the USB devices need to be manually mounted (AutoAddDevices=’false’). I inserted a sample USB device and run lsusb command to see if detected. It detected successfully without any problem. I then copied the image file with 5GB of size onto the USB drive with a little bit of issue. Using only steps from one small section on the official Chromium OS page, I was able to successfully reinstall Ubuntu on the Chrome OS in about 45 minutes (and downgraded to 10.04 since WebDAV support is broken in 10.10). Here are the detailed steps:

Steps

  1. You need an empty USB thumb drive. The file we are going to copy to the USB drive is more than a little 5GB. The file system for the most flash drives is vfat (FAT file system). It has a single file size limit of about 3GB which our file would fail to copy to the disk. To solve this issue, you need to reformat your flash drive to the file system format other than FAT using the Disk Utility from System -> Administration menu.
  2. Copy rootfs.bin you converted from VDI image to the USB drive.
  3. After it’s finished, insert the drive into the USB slot of CR-48.
  4. Boot into Chrome OS, press Ctrl + Alt + => to switch to develop mode, and login as chronos.
  5. Type sudo su to login to root and type the following line to get the information on where the USB drive is located:[bash]dmesg | grep sd[/bash]
  6. My USB drive is located at /dev/sdb1, so I type the following to the command line (replace sdb1 with yours):

    [bash]
    mkdir /tmp/usb
    mount /dev/sdb1 /tmp/usb
    [/bash]

  7. After it’s mounted, copy rootfs.bin to sda7 with dd command:[bash]
    cd /tmp/usb
    cat rootfs.bin | dd of=/dev/sda7
    [/bash]

    This should take about 20 minutes.

  8. Mount sda7 after that and copy the necessary files to the disk:[bash]
    mkdir /tmp/urfs
    mount /dev/sda7 /tmp/urfs
    cd /tmp/urfs
    cp /usr/bin/cgpt usr/bin/cgpt
    chmod a+rx usr/bin/cgpt
    cd /lib/modules
    cp -ar * /tmp/urfs/lib/modules/
    [/bash]
  9. And finally, don’t forget to unmount the disk:[bash]
    umount /tmp/urfs
    umount /tmp/usb
    [/bash]
  10. There you have it, a brand new Ubuntu installation. You can use the following command to boot into Ubuntu or use the aliases from my last post:[bash]
    cgpt add -i 6 -P 5 -S 1 /dev/sda
    [/bash]

Have issues?

Do you have any issues with any of the steps above? Please feel free to discuss them below.

My First Tip on using Ubuntu with Chrome OS on CR-48 Notebook (Updated)

Update (12/19/2010): I wrote a post on how to use your flash/USB drive to (re)install Ubuntu on the CR-48. Check it out.

Update (12/18/2010): I just discovered that .bashrc file is never executed in Chrome OS unless running another bash after chronos is logged in, and .profile is the file which being executed after each login. Therefore I changed the following instruction to .profile for Chrome OS. If you already created .bashrc file in the chronos home folder, you just have to rename it to .profile using the command below:

[bash]
mv .bashrc .profile
[/bash]

Introduction

I have used the newly received CR-48 from Google for two days. I enjoyed so far for web browsing, but not so for web development / programming. Since I couldn’t find any good IDE on the cloud which has support for WebDAV, I decided to following the instruction on the Chromium Project website to install Ubuntu onto this device. After several hours of installation, Ubuntu loaded to the device. However, because it comes from a VirtualBox disk image, it’s nearly impossible to reinstall Ubuntu without re-transferring the disk image from my laptop to this notebook which is a 5GB file, it would spend another 5 hours just for transferring this file over ssh. I’m trying to shorten this long waiting hours. I will post another tip if I find a way. But for now, here are the two scripts I wrote to switch between Ubuntu and Chrome OS using the alias command.

Steps

First of all, I assume you also received a CR-48 notebook and installed Ubuntu on it by following on this page.

This first script is for Ubuntu:

  1. Open the file named .bashrc in the home folder using your favorite text editor (make sure to show the hidden files by pressing Ctrl+H).
  2. Add the following line to the end of the file:
    [bash]
    alias chromeos=’sudo cgpt add -i 6 -P 0 -S 0 /dev/sda;echo "Switched to Chrome OS, restart the machine to take effect"’
    [/bash]
  3. Open a new terminal window to load the new alias.
  4. Type chromeos and a message will be displayed stating that you need to restart to switch to Chrome OS
  5. Restart your device and you are in the Chrome OS.

Now inside the Chrome OS:

  1. Press Ctrl + Alt + -> (the Forward button in the first row) and login as chronos
  2. Since Chrome OS also uses bash, we can write to the .profile file, but this time in the chronos home folder.
    [bash]
    qemacs .profile
    [/bash]

    The command above creates and opens a new file called .profile inside the home folder using the only text editor available in Chrome OS qemacs.

  3. Insert the following line into .profile
    [bash]
    alias ubuntu=’sudo cgpt add -i 6 -P 5 -S 1 /dev/sda;echo "Switched to Ubuntu, restart the machine to take effect"’
    [/bash]
  4. Execute bash to launch another instance of bash, or if you are confused, you could just logoff current session by typing exit command and login again.
  5. Typing ubuntu command to switch to Ubuntu on the next startup.
  6. Restart your device to begin using Ubuntu.

In the future, you could just use chromeos and ubuntu commands to switch back and forth between Chrome OS and Ubuntu without changing back to normal mode using the small switch on the back of the battery.

Enjoy the free dual-boot notebook from Google.