Installing Ubuntu Touch Preview for the Nexus Devices on Mac or PC.

The official instructions on Ubuntu.com require that you have Ubuntu installed on a PC before you can install the Touch OS preview on your Galaxy Nexus, Nexus 4, Nexus 7, or Nexus 10. Let’s be real though–not a lot of people use ubuntu compared to the amount of people who have Nexus devices.

Thankfully there is a quick way to get around this and it’s pretty simple–if you are familiar with flashing custom ROM’s like CM or AOKP you’ll find this delightfully satisfying.

If you DON’T have Clockwork Recovery, or TWRP already Installed Start Here:

The first thing you’ll want to do is make sure you have the Android SDK, if you don’t go download it from Android.com.

Once you’ve got the SDK cd into the platform-tools folder as you’ll need fastboot. If you’ve got it installed in your home folder you should be able to get there using the following command:

cd ~/androidsdk/platform-tools

Once you are in your platform-tools folder head on over to the ubuntu file repo and grab the correct recovery image for your device. In my example I am installing it on my Nexus 7 so I went with grouper. 

If you don’t know your device use this chart to learn:

Screen Shot 2013 02 21 at 5.17.40 PM Installing Ubuntu Touch Preview for the Nexus Devices on Mac or PC.

Now it’s time to plug your device into your PC. Once you’ve got it plugged in run the following command in platform-tools:

./fastboot flash recovery /path/to/recovery/image/you/downloaded

Now you’ll have the Ubuntu compatible recovery–don’t be alarmed if it looks like it didn’t change. It seems to me that Ubuntu is actually using Clockwork Recovery, which I found amusing.

If you DO have Clockwork Recovery, or TWRP already Installed Start Here:

Now the next thing on the list is to first download this file here (roughly 400MB) which seems to be the “Core” OS install file. Then you’ll want to go back to the ubuntu file repo and snatch the file specific to your devices code name. Again since I am using the Nexus 7 the file I grabbed was quantal-preinstalled-armel+grouper.zip the file should be about 50MB in size. To my understanding these are the device specific files for each supported device.

Now, as you probably figured, you’ll want to drop these 2 zip files on the root of your SD card.

Once that’s done boot up into recovery and flash the 2 zip files using Clockwork Recovery like you would any other custom ROM. Be sure to flash the smaller device specific zip file before you flash the Core OS.

The device specific zip shouldn’t put out any messages, however, the core OS when installing will report the following message:

Welcome to the Ubuntu RootFS Updater…

If you are currently looking at this screen, congrats! you are on your way to installing the new Ubuntu Touch OS Preview. icon smile Installing Ubuntu Touch Preview for the Nexus Devices on Mac or PC.

If you want to go back to Android you can easily restore yourself back to a stock state using Google’s OS images available here.

“Secure Erasing Android Devices” Guide for the Super Paranoid Seller.

Any of my friends would tell you that I’m crazy paranoid about malicious users–especially when I sell off my old electronics. I’m the type of guy who’d prefer to put a nail through an old device. Unfortunately I’m also the type of guy that likes to buy the new Nexus devices every time they release–so I prefer to sell my old devices to help fund my new purchases. To do this I had to come up with a way to make myself feel good about selling my old devices. Now I know one really easy way to do this is to enable encryption on your device and then format it. For some reason when selling my HTC One X the encryption just kept failing and the SD card is non removable so I needed to find a way to get piece of mind and still sell the device–which led me to come up with this method.

I’m not 100% sure, but I believe you might need BusyBox/Root installed to do this–or it’s possible you can do it using just using the Android SDK (which, you will need) but I am going to assume anyone who understand that factory resetting your device doesn’t actually remove any data are more than likely the same type of people who’d be rooting their android devices.

Also just as a side note, I’m not saying this is the most secure thing in the world but it’s what I do and it makes me feel pretty good. I’ve confirmed by running Recuva in deep scan mode that I wasn’t able to recover any data from the /sdcard, however, I have no way to confirm for the /data partition. I’m just assuming it works just as well as it did for the internal SD card.

This process essentially includes 2 steps

  1. Formatting the Storage
  2. Zeroing out /sdcard, and /data

 

So let’s get started…

Step 1 – Formatting the Storage

This is a pretty basic deal and when you buy a phone online that’s used it’s likely as far as the other user has gone to secure the data–which I assure you isn’t much at all. All this is going to do is tell the OS that where your data used to be is now “Available” so that the OS can write over it. If you were to run a tool like Recuva after running a simple Factory Reset you’ll be able to recover much of the files. This isn’t just an Android thing–it applies to all storage mediums though not so much to flash media as hard drives. The reason I used this as a starting point is to tell the OS that everything is “available” for writing, which is how we want it. To do this you can either use your recovery or by going to Settings > Backup and Reset > Factory Reset and let the OS do its thing.

Step 2 – Zeroing out /sdcard and /data

Now that we’ve labeled all the data on the device as available for the writing, it’s time to start “Zeroing Out” the data. Which essentially means writing 0′s over the data that we previously marked as “Available”. Ideally after doing this if someone attempts to restore your data they’ll be restoring the 0′s and not your personal data. On older HDD’s it’s a good idea to do this multiple times but many experts have suggested one pass is all that’s necessary on flash media.

First thing you’ll want to do is fire up the Android SDK using the command line and navigate to the platform-tools folder where you’ll find fastboot and adb. It’s found in /androidsdk/platform-tools.

Once in your platform tools run the following command:

./adb devices

If you get a print out with a serial number you are good to go–this means that your computer is reading your phone just fine. If you don’t get anything be sure to go into your Developer Settings and enable USB Debugging. 

Once you’ve got the phone and the SDK speaking together type the following command to access the shell of your device:

./adb shell

You should be greeted by a bash as shown in the image below:

Screen Shot 2013 02 16 at 1.10.14 PM Secure Erasing Android Devices Guide for the Super Paranoid Seller.

Once in your phones command line run the following command:

dd if=/dev/urandom of=/sdcard/junkfile

You won’t get a response for a while, what this is essentially doing is creating a file filled with random data on your phones SD Card until it’s completely full–at which point it will be brought to a hault. You can verify this by going into Settings > Storage and watching the % free on your SD card continue to go down.

When the process is all done you should get a message like the following, that details the amount of space written. It should resemble the size of your SD Card.

Screen Shot 2013 02 16 at 5.01.55 PM Secure Erasing Android Devices Guide for the Super Paranoid Seller.

Once the process is complete we’ll want to repeat the same line, with a slight modification as follows:

dd if=/dev/urandom of=/data/junkfile

This will create another junk file on your device with random data, except rather than being in /sdcard it’ll be in /data. /data is where all the settings for your various apps are stored. The way that I verified this process was still running was by opening a another terminal window and using ./adb shell to run ls -all -h to watch the size of the file continue to grow as shown below:

Screen Shot 2013 02 16 at 4.59.52 PM Secure Erasing Android Devices Guide for the Super Paranoid Seller.

You can see the size of “junkfile” going from ~600MB to ~1.5GB. Once the /data folder is completely full you’ll not only get a confirmation on the shell but your Android device should pop down a message in your notification window that the data partition is full and system functions might start breaking–for once this is good!

So at this point you’ve successfully filled your /data and /sdcard folders, the two main areas where personal information is stored on Android, with a bunch of random data.

The next and final step of the process is to simply return to Step 1 and Factory Reset the phone one last time. This will mark the data as “Available” and give the new owner of your device a “new phone” experience. It’s not necessary I suppose, but I’m guessing the buyer of your phone won’t take too kindly to turning on a phone filled with error messages. icon wink Secure Erasing Android Devices Guide for the Super Paranoid Seller.

I’m not expert, however, as I stated before when running recovery software I was unable to recover any data from my HTC One X when I sold it–so I’d say this method is pretty handy at cleaning the device from 99.9% of users out there.

A little over the top? Definitely. That’s exactly how I like it!