Ubuntu off Micro-SD... Interesting

    I recently decided to attempt at making an install of Ubuntu 12.04 64bit on a cheap 16GB MicroSD. In the past, in my high-school years with windows 2000 and Ubuntu (probably something like version 6 or 7 and only ext3!), I have attempted an SSD-like setup using a Chinese CF to IDE converter, though with success, I would not say it was efficient, as the system lagged horribly.

    Despite my testing of Windows 2000 and Ubuntu on a CF, understandably, at that time my knowledge of Linux was quite limited, and as having a few more ideas, I decided to give this test another try! Knowing now that the basic flash memory in SD cards suck when it comes to random read/writes, I made a mistake back in the day; I installed Ubuntu while preserving the Swap partition, thinking that Linux actually NEEDS IT OR DEATH AND DESTRUCTION WOULD RESULT, as the warning tries to explain to you, if you were psychopathic enough to not set a Swap partition and hit the next button for install... So, this time I ignored the warning.

    Ubuntu took quite a long time to install, and even longer to grab initial updates during the install... about 2 hours... it was... grueling... but, during that time I noticed something interesting, small updates installed very rapidly, while the larger updates (larger files) took much longer than it seemingly should, this must indicate where mechanical storage excels. After the install, I had yet another 443 updates... another hour passed, and finally... DONE. So I thought...

    I noticed that larger applications took quite a while to start up, as expected, as my previous experience with installing Ubuntu on a CF many years ago, but to my surprise, it really was not too shabby, most applications loaded up nice and snappy, battery life increased, and I experienced less heat radiating into my leg while sitting with my laptop as the mechanical hard drive automatically powered off for energy savings.

    Despite the interesting pro's and the low cost of flash these days, I then decided to look up exactly how many read/write cycles typically a flash storage medium will last in this situation... the results... not so good, roughly 100,000 read/writes per sector... So, with curiosity, and knowing I would most likely burn out my flash quite rapidly in this situation, I decided to look up some simple tweaks to prevent Ubuntu from writing to disk as much as possible. What I found most useful was moving the /tmp directory to RAM using sudo gedit /etc/fstab, as it would no longer reside on my flash, this should, in theory improve performance, and increase the longevity of the flash storage, with a trade-off for being unable to recover documents in office applications... to screw with that I say, performance FTW! I then entered another line and also moved the /log to RAM, as this could cause many, yet small, writes to the Flash.

    After the system restart I noticed a gigantic performance gain, firefox would load up within 15 seconds, instead of 30 seconds (estimate), and web browsing experienced far less hangs after clicking on a link.

    Honestly, this was a surprisingly great success, I am not entirely sure if I exactly want to go back, that is... as long as I don't burn out my Flash too quickly in the process. My /home directory is encrypted, I can boot any computer through a USB adapter, battery life has increased, boot times are faster than windows, yet slightly slower than a mechanical Ubuntu install, I personally do not see many con's.

   I think I will work on this for quite a while longer and see exactly how long it takes to reach a point where the read/writes finally kill the Flash, in the mean time, ill just grab another 16GB microSD for just in case for my camera.

 Update:

    I have begun tweaking firefox to require less disk activity by forcing it to cache with ram. Even though I do not care about my web history and all that, I still have to say that this significantly increases RAM usage, and at this point currently I am using 512MB out of my 4GB! Even though I have plenty of RAM left, it just goes to show that if you want any use out of an Ubuntu install on a microSD, you need a system with lots of RAM. This will drastically limit the number of systems that I will be able to boot using this SD which is a major con.

Edits to the about:config

browser.cache.disk.enable value=false   -Will not use the hard disk for cache, only RAM.

browser.cache.offline.enable value=false  -Will not use the hard disk for offline cache, only RAM.

browser.sessionstore.interval value=300000  -Updates session in case of browser crash every 300000ms.

    I monitored the disk activity utilizing 'sudo iotop -p processPid' for firefox and there was virtually no disk activity... SUCCESS!

I did the same with my Netbook with a 16GB MicroSD Card, i will tell you, it was slaw ass hell

Curious, did you leave the install bone stock?

I should mention though, anything more than office and web, and your going to get a head ache, but, I leave my desktop for gaming with Windows 7 and a RAID 0.

I had Libre Office instaled, firefox, and a few networking tools

I have this kinda deal on one system, an old Toshiba Portege R100 with a 1 GHz ULV processor. It's a very small, light and super sturdy (magnesium chassis, not cheap aluminium, polycarb shell, not cheap plastic) formfactor and uses very little power, with the battery extension in GNU/Linux and power optimised with powertop it can run for over 12 hours and the batteries are still original (10 years old, from the time when quality hardware was still quality and there was a reason to buy high priced premium brand products). It's my portable pentest setup and it used to have a 1.8" IDE HDD in it and has an SD card reader with token function in BIOS (as in no SD card with the right encrypted key, no startup, very practical for a pentest box). The HDD broke and since IDE is the same as the connector for CompactFlash, I replaced the HDD with a 32 GB Sandisk Extreme CF card (which is much faster than an SD Card). It also has a PCMCIA port (which is again the same as an IDE connector), so I plugged a CF card adapter in there with another super fast CF card, this time a 16 GB one that has the system on it, so that I can easily switch between distros by changing the card (like a pentest distro or an electronics dev/robotics orientated distro). It's like running the system with 2 SSD's. I also use Slackware on it, for extra speed. It feels really fast for such modest old tech specs, and has no moving parts at all. It looks like it has been through hell and back, but it still works like a charm and weighs less than 1 kg.

There is hardly anything that can't be done with GNU/Linux for very little money and in very little time, and it always works well and efficient, that's what I love about it.

Like Zoltan hinted,

I think it would be wise to use a UHS Class 1 / Regular Class 10 SD if you want it to shine a bit better at doing stuff me thinks.

You can even set the swap on your VGA's RAM :D

At least with Arch

 

Hummm puppy linux will be massively faster if you whanted to run linux from a SD card or flash stick.

I wanted to have it running on crunchbang, but since I have bandwidth limits, I was not able to download a new copy. I did have on hand a small 1GB USB flash with a live copy of Ubuntu 12.04, so I used that instead.

Limiting the read/writes to the flash during use, even though I am only using a class 4 flash, it's running very smooth now. There are still some moments where the system will sort of hang waiting to grab some data off the flash, but if you were a windows user and never knew the typical speed of Linux, you would not know the difference :D

I am debating if I want to test out some minecraft on this setup, even though the intel integrated is absolutely horrid, it may seem as a simple (non-scientific) benchmark.

btw, I am running this on an Acer Aspire 5735, core 2 duo 2.00GHz, 4GB DDR2, intel integrated graphics... :(

 

Could be of use on my gaming rig since I have about 2GB of V-ram total with the SLi.

So UHS is a new type of Class rating for cards? Man I need to catch up!

I got lost in the text, but lost it when I saw the "Zombie: 0".   :-p  Gotta love creative programming.

Yeah I know right!

I recently bought this 64gb sandisk card class 10, and when I finally had it in my hands it said 'class 1'.

I was histerical for about 30 mins, until I decided to google 'UHS'.

Then I calmed down. Like alot.