Saturday, January 2, 2010

Alternative USB installation

(QUICK EDIT: I have been noticing a significant improvement in overall battery life with this approach!!! Also, make sure you buy a USB drive with optimum throughput. In most cases these devices only advertise storage space, but some brands (usually the cheaper ones), have poor throughput capabilities. In my experience, using a USB 2.0 with powerful throughput capabilities makes it a seamless experience, I can't tell the difference from my usual hard drive!)

On a previous blog entry I discussed how you could setup a liveUSB to take Linux with you and be able to run it anywhere, anytime. However, as I used this setup more and more, I started to find things I didn't like about it.

A LiveUSB setup is exactly that, it allows you to install your choice of Linux distro any time, logs in straight into your live desktop without asking questions, and makes it convenient and easy to take a quick glance. However, due to its core nature, it has disadvantages should you want to use it (as I do) as a portable Linux setup.

In my case, the company I work for uses Windows and they have a global policy to encrypt local hard drives. As a result, a Wubi installation would not work. I didn't want to mess around with partitions and risk losing any work data, so I needed a solution that would be as little intrusive as possible. In fact, the perfect scenario would be to have an implementation of Linux that would not modify in any way the corporate build in my computer.

Some might ask why go through all this trouble? Well, I personally don't like Windows much, and pretty much use Linux exclusively for anything other than work. Therefore, when I travel and have spare time at the airport or the hotel, I enjoy having my Linux setup with me. I also use it when I have my work laptop at home. In any case, the concept is that I can use my work laptop for personal stuff not having to worry about modifying anything that administrators at work might have setup. In addition, there is a performance component to my rationale. Even though there is an obvious performance drag when using a USB drive as your main hard drive, it still performs much better than my work machine using Windows. The corporate build is so full of security policies and nonsense applications at startup that it is so awfully slow it is painful. Add firewall and anti-virus on top of that and it is plain depressing.

Anyways, the LiveUSB thingy seemed to be a great solution to all this. I tried Ubuntu and Fedora, but was not very happy with the end result. The LiveUSB setup is a bit special in that there is a lot of tweaking to it. There is a generic user account setup to automatically boot to which has full admin rights, no questions asked. This feature is perfect for the LiveUSB or LiveCD functionality, but terrible if you want your USB drive to act as a standard drive, holding personal information.

Obviously, if you lost your USB drive with that setup, anybody could simply plug it in and boot to a root type account, having immediate access to all your contents. I tried many things to overcome this security flaw, but nothing worked out. I even tried to create my own account and disable automatic booting into that generic account, but with no luck. Even if I logged out of that generic account and logged in as myself, the generic account would still be in use somehow.

I decided I needed a different setup, one that behaved exactly as my own local hard drive would. Achieving such setup was extremely easy in the end, but required a bit of trial and error.

All you need to do is boot to a LiveCD of your choice and install on your USB drive. However, as you may realise, there is one catch. If you did so with your local hard drive available the installer would detect it and try to set up a dual installation, modifying GRUB on your local hard drive. You obviously don't want that to happen, so simply disconnect your local hard drive(s) before you boot from the LiveCD and you will be good to go.

Now, that may sound difficult or dangerous in case you have not done it before, but it is not like that at all. If you own a laptop, chances are it is very easy. Simply make sure you disconnect your battery and AC plugs before removing your hard drive. While you are installing on your USB drive, make sure you place your hard drive on a static-free environment. If you have a desktop, you may get away with just unplugging the data and power cables from it.

I can now enjoy a true Linux install (Ubuntu 9.10 in my case) any time, and it works great!!

PS: Just for your reference, since I installed all applications I normally would in a standard PC (it trully is a desktop experience), it took about 5GB of space out of my 8GB USB drive. Depending on your needs, you may want to use a 16GB or larger drive.

No comments:

Post a Comment