Monday, May 7, 2012

Portable OS anyone?

Around a month ago a friend from work told me how he installed Ubuntu to a USB flash drive. Now he walked around with his desktop with him! Any computer that could boot from USB could be his desktop. I had to try this.

While I read about the subject, I found out how flash memory has a limited number of read/write cycles. This can be a problem if you’re running a entire OS from your USB flash drive, as a regular OS writes stuff in its host partition regularly. I had to find a Linux distro that limited the number of read/writes to its host partition.

I found several Linux distros that ran directly from RAM. I wanted a distro that:

1) Could be run entirely from RAM on a PC with 256~512MB of RAM;
2) Only saves the session periodically or once it’s shutdown (to reduce the wear of the flash drive).

I googled for this and found PendriveLinux and LinuxLive USB Creator and some distros. PendriveLinux and LinuxLive USB Creator break the first rule, so they’re out. Here are the distros that could run from RAM that I found:

- SLAX;
- DSL (Damn Small Linux);
- Puppy Linux (and its derivatives) ;
- Slitaz.

I tested them on my friend’s ex-laptop (see post #4). Here are the specs:

Semprom 1800MHz CPU;
Onboard ATI video card;
512MB of RAM (32MB shared with video card);

Porteus is actually the successor of SLAX. SLAX’s latest version was released in 2009. Upon booting Porteus 1.1 CD you’re presented with several options like using KDE or LXDE as DE, running from RAM (that’s what I was after), run without saving session, etc. To be able to copy the whole OS to RAM you need at least 768MB. I chose to run with LXDE as DE. It was nice and fast but since my laptop only has 512MB of RAM (actually 512MB minus Video RAM) I couldn’t boot it entirely into RAM, so it doesn’t fulfill the first requirement I listed above. I tried it briefly on my desktop which has 3GB of RAM and I liked it, It seems to be a hell of a distro. Computers with at least 1GB of RAM are very common these days, just that I wanted something... slimmer. Porteus 1.2RC1 comes with XFCE as DE but has the same limitation as the LXDE version I mentioned above, 768MB or more of RAM for the OS to be able to copy itself to RAM. Below are screenshots of LXDE and XFCE desktops.

Porteus 1.1 -  LXDE 
Porteus 1.2RC1 - XFCE


DSL, which has seen his latest release in 2008, and Tiny Core are FAST but seemed “too old school” to me. With this USB flash drive setup I want to be able to boot from almost anywhere, but I’m not gonna use this on really old hardware. After what I have seen on Porteus, I thought I could dismiss DSL and Tiny Core. These were TOO slim! :)

The last two distros, Puppy Linux and Slitaz, I had already tried a few weeks after I started using Linux. I had read about these very lightweight distros. I even downloaded the isos (they’re really small, around 230MB for Puppy and around 30MB for Slitaz).

I had downloaded Slitaz 3 a few months ago and it was as fast as Tiny Core and DSL. I didn’t find it very user friendly and I remembered that some of the software I wanted wasn’t available in the repos. Slitaz 4 just came out (April 10th 2012) and I downloaded it. I tried, but Slitaz 4 CD just booted to the command line. I gave up on Slitaz for now, let’s see if Puppy works well enough.

Puppy Linux is a very lightweight (and popular, if you check distrowatch.com, you'll see puppy ranks to 9th on most page hits) distro that copies it self to RAM if the computer has at least 256MB. It can be installed in a way that it uses the whole partition on hdd or USB flash drive, or you can do a frugal install, where it copies some files to a hdd or flash drive. Your flash drive can use any file system you like, the save file that Puppy creates contains a ext2/ext3 file system inside it. Puppy Linux also has several puplets, user-made versions of Puppy with special features.

I downloaded three versions of Puppy:

- Lucid Puppy 5.2.8.005 (compatible with Ubuntu Lucid Lynx);
- Slacko Puppy 5.3.1 (compatible with Slackware 13.37);
- Saluki 0.20 (puplet with XFCE as DE);

I downloaded Saluki just because it used XFCE as DE but the performance compared to the other two is a bit worse (Slacko and Lucid use JWM as window manager, and that’s way lighter than XFCE) and Ubuntu and Slackware repos are full of good software for installing, unlike Saluki’s repos. So, I really liked the idea of using XFCE on Puppy but I gotta dismiss Saluki for now.

Between Lucid and Slacko the fight is tough. Slacko is compatible with the latest Slackware release and Lucid with Lucid Lynx, last Ubuntu LTS release (supported until april 2013, according to this). Lucid is more mature and less buggy though. I can’t recall exactly the problems I had with Slacko, but I did have some problems related to my laptop’s touch pad and wifi card. I decided to test Lucid Puppy then.

I booted the Lucid Puppy CD and used the Puppy Universal Installer to make a frugal install on my FAT32 formatted USB flash drive. It asks a few questions and after you’re done you should logout. After logging out Puppy asks if you want to save your session. I answered yes since I wanted a persistent system on my USB flash drive. I chose to use ext3 file system and it created the file lupusave.3fs on the root of my USB flash drive. Now I just had to reboot and set the BIOS to boot from USB to try out my Puppy system.

When I got into BIOS, a surprise: I couldn’t set it to boot from USB (it’s an OLD laptop!). I googled to see if there was a way to make it boot from USB and I found one: PLoP boot manager. On this laptop I was testing Puppy on, I had Arch Linux and GRUB as boot loader. Following these instructions, I managed to add an entry on my GRUB menu for PLoP and now I could boot from USB! Just below those instructions for GRUB are the ones for GRUB2. On my other laptop I have Xubuntu and GRUB2 as boot loader. Those instructions didn’t work for me though. Here’s what I had to do to make it work:

- Added the text displayed for GRUB2 on the link above to /etc/grub.d/40_custom/;
- Actually on mine I had to swap root=(hd0,1) to root=(hd0,msdos1). The reason why is: I checked my /boot/grub/grub.cfg and all the boot options used (hd0,msdos1);
- Run “sudo update-grub” (without the “”, of course).

Anyway, I managed to boot Lucid Puppy on my USB flash drive using PLoP boot manager. Puppy asks some questions at the startup and configures everything for you. Wifi was also very easy to setup. The JWM desktop is simple and functional. ROX is the default file manager. It’s kinda awkward at first but you get used to it. As for office applications, Abiword and Gnumeric are the default word and spreadsheet processors, respectively. Several other useful software are installed by default, such as Mplayer, dvd burning software, etc. Dillo is the default browser but you can use another by downloading your favorite browser with the package manager, just update the package list of the repos (it’s very user friendly) and grab what you want. My default browser on Lucid Puppy is FireFox. You can also easily install flash player and java from the package manager. Another handy tool to be downloaded with the package manager is Wine (specially with this portable OS setup, you may have to use this on a Windows 8) Computer). Since Lucid Puppy is compatible with Lucid Lynx Ubuntu, you can get anything available on Lucid Lynx repos and use on your Puppy. Here are some screenshots I took while booting my USB flash drive on my wife’s Netbook.

Default Lucid Puppy desktop screen.

Firefox running on Lucid Puppy.

Firefox + Flash = Youtube video.

All in all Lucid Puppy is great. Tons of software on a light and easy to use interface. ROX file manager needs some "getting used to" though. I'll see if I can switch it to PCmanFM (LXDE default file manager) or Thunar (XFCE default file manager).

For now Puppy is saving the session every half hour (I think) and on shutdown. I’m looking for a way to save sessions only every hour (to reduce the wear on the flash drive) and at shutdown. If somebody knows, please tell me.

PS: Porteus 1.2RC2 has just been released (today, may 7th).

No comments:

Post a Comment