When Ubuntu fails

I’ve been busy IRL so posting here has taken a backseat to other things, as well I haven’t had a lot of time to tinker. This is an old draft I had kicking around that I’ve cleaned up a bit.

Yes, I’m guilty of running for ‘weeks’ with a pending reboot required, this is probably not helping the situation.  I’ve probably also had several power fails etc with the system in a suspended state. Still, I didn’t expect my Ubuntu system to get to the state it did.

After rebooting my system, the system drive would no longer boot and I was dumped into the (initramfs) busybox

mount: mounting /dev on /root/dev failed: No such file or directory
mount: mounting /sys on /root/sys failed: No such file or directory
mount: mounting /proc on /root/proc failed: No such file or directory
Target Filesystem doesn't have /sbin/init.
No init found. Try passing init=bootarg.

BusyBox v1.10.2 (Ubuntu 1:1.10.2-2ubuntu7) built-in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs)

Ok I think, so there is some filesystem issue with my boot drive – booting a live CD version of Ubuntu should give me the tools to fix it. It turns out the answer was no – the live CD won’t help me either. Sigh, this is the type of thing I’d expect of Windows Vista but not Ubuntu.

Off the to forums and I turn up a post which shows others have had the same issue and the solution. From here it was a simple matter of booting the Ubuntu live CD to download a copy of SLAX to burn to CD then boot from the new SLAX CD to repair the ext4 filesystem. Good thing I had a Ubuntu live CD around.

Once your booted into SLAX, start a root shell and find the volume.

root@slax:~# fdisk -l

This will list all of the drives (if you have more than one) and the partitions on those drives. Next is simply a matter of issuing the filesystem check and repair command on the correct partition

root@slax:~# fsck /dev/sda2

You’ll want to say yes to fixing the problems obviously. Once this completes, simply reboot back to a working system.

Review: OCZ Vertex 3 120G SSD

I’m not entirely certain which event triggered my gear lust for a solid state drive (SSD), it was probably a mix of Jeff Atwood’s post, TechReport’s storage section, and the falling prices resulting in smaller SSDs down below the $100 price point. Whatever it was, I couldn’t really shake the idea of having a SSD in my work laptop – so I decided to get one.

Initially I had thought that a 60G-64G drive would fit the bill, being under the $100 price point and just big enough to hold the OS plus my Lotus Notes mail installation. After reviewing benchmarks, and reviews I decided to focus on the 120G size – in part due to a general recommendation that the 60G size is a bit small for most, and the benchmark numbers on the 120G are a bit better. The price was higher, but still within a very reasonable budget as SSDs are approaching $1 a Gig. The TechReport comparison of 120G-128G size helped me narrow my choice down to the OCZ Vertex 3.

While the Vertex 3 has been on the market a year, it still ranks as one of the fastest drives available. There were some issues with the SandForce SF-2881 controller, but firmware 2.15 is reported to be solid.

My laptop was running a 500G SATA2 Toshiba drive, configured as a single large partition running Windows 7. I had no interest in re-installing from scratch so my approach was to clone the working system onto the smaller drive. There are likely plenty of ways to do this, I was able to easily find a blog post describing how to do it – I roughly followed those steps but will document exactly what I did here.

Step 1) Reduce the partition on the big hard drive to be a bit less than the formatted capacity of the SSD. Initially after reading a bit I was hesitant to use GParted to do this as it seemed some folks had had problems with Windows 7 and GParted. Windows 7 also has a built in partition resize capability.

I ran into several issues trying to use the built in Windows 7 functionality. First up was some unmovable files causing issues. Even after turning off virtual memory and system restore, I still had issues. The Event Viewer was a help in identifying Chrome as holding onto some unmovable files, then I hit what I believe was an issue with NTFS Metafiles being unmovable and blocking my ability to shrink the partition smaller than 245G. At this point I threw my hands in the air and ran GParted from an Ubuntu Live USB key.

GParted ran to completion, but oddly gave me an error indicating something was wrong – but I couldn’t spot anything actually wrong. [Normally GParted should not give an error] The damage was done so I just rebooted and let Windows perform the necessary chkdsk activity. Things were fine, so either I mis-read that there was an error or it was something that was recoverable. Either way I was now happily running with a 100G partition.

Step 2) Use Clonezilla‘s “savepart” option to capture an image of the partition. Since I had a 500G drive which now had lots of empty space after the 100G system partition, I created a 2nd volume to store the captured image to. You can use a second USB mounted drive, or any number of other options including ssh with Clonezilla to store your image.

I will comment that Clonezilla is not for the timid, the user interface appear very complex and requires some careful reading to make sure you’re doing what you think you’re doing. Youtube has a number of walk throughs. For the 100G partition it took about 1:35 to backup.

Above you see the SSD attached to the ultra slim sled that the laptop hard disk was in, this is a very slim metal sleeve with a pull tab and some rubber bumpers. It fit nicely into my W520.

Step 3) Swap the drives. If you have a password on the drive, it’s a good idea to disable before removing it as USB enclosures and passworded drives don’t mix well. Install the new SSD, and place the existing drive into a USB enclosure. Boot the laptop into Ubuntu Live again and partition the new SSD drive, make sure to tag the new partition as with the ‘boot’ flag.

Step 4) Restore the image you saved with Clonezilla’s “restore part” option. In this case I was restoring from the 2nd partition on the original hard drive that is now mounted as a USB volume. Clonezilla warns you twice when restoring a partition to validate you’ve got the correct destination, a nice paranoid touch.

The restore ran nearly 3x faster taking about 37 minutes.

Step 5) Boot into windows, chkdsk may have run again but with the SSD it seemed to take no time at all. You might want to visit the OCZ site and grab the toolbox utility to validate you’ve got the latest firmware, I did this to verify I had 2.15.

Performance

After I did the clone, I ran some boot time tests on the hard drive. I tested immediately after I had completed step 5 with the SSD. For work I need Lotus Notes up and running to access my calendar etc, so that was a logical pattern to benchmark – how long to get back to key information? I used a stop watch, and the times include the time I spent typing in the two passwords and navigating to the icon to launch Notes. It’s not terribly scientific, but I think the results still speak for themselves.

Disk test 1 Disk test 2 Disk test 3 SSD test 1 SSD test 2 SSD test 3
Cold boot to Windows login 1:22 1:24 55 23 23 23
Login to launch of Notes 1:42 1:13 1:44 10 10 10
Lotus Notes ready 40 44 40 10 10 11
Total time 3:45 3:22 3:19 43 43 44

This is crazy hot – more than 3x faster, under a minute from a cold boot.

Now certain operations don’t seem any faster. Resuming from hibernation feels to be about the same speed. This makes sense as the performance difference for sequential reads isn’t much different. It seems in normal usage, lots of little things are more immediate too. Some of this is likely simply moving from a SATA2 to a SATA3 drive, but I’m convinced no spinning platter could keep up with the SSD.

Flour Tortillas

I’m a huge fan of Mexican food and while Fajitas are more Tex-Mex they are still yummy. The Lone Star is a local restaurant that is known for their Fajitas, and for me the shells really stand out. It turns out you can make as good (or arguably better) tortilla shells at home.

I tried several recipes until I came across this one. In all honesty they don’t vary that much, this is very basic cooking. With my thanks to the original authors, I’ll replicate it here with my notes:

3 cups unbleached flour
2 tsp. baking powder
1 tsp.  salt
4-6 Tbsp. vegetable shortening or lard
1 1/4 cups warm water (from the tap)

This should make a dozen tortillas, I often double the recipe and have loads of leftovers for the next day. In the batch I did for the photos I substituted one cup of the flour for whole wheat flour. I prefer just using unbleached flour, but this is a good way to make it a bit healthier. If you’re looking to replicate the Lone Star, make sure you go heavy on the shortening and skip the whole wheat flour.

Mix the dry ingredients in a large bowl. Cut in the shortening. Once this mixture is well mixed, add the water all at once.

I mix it by hand and consider that one of the secrets to getting this to work well. Overworking the dough mixture will result in them being hard to roll and tougher when you eat them. Initially it should be really sticky, as you work (knead) the dough it will blend more and the stick should mostly go away. Give the dough 10mins or so to rest.

Now’s a good time to put a large frying pan on the stove, you want it to be really hot. Make your 12 balls of dough.

I use a large rolling pin and work directly on our counter tops. You shouldn’t need any additional flour to keep things from sticking, but don’t be afraid to use a little if you’re having trouble. Remember that rolling is a lot like kneading, so you want to avoid over-rolling it but these dough balls need to be smashed paper flat. I find that a little bit of counter stick helps me roll it out. My pattern is roll in one direction, pick it up and flip + rotate 90 degrees and roll the other way. Don’t worry about them being perfectly round, just make sure they are really thin.

It does take a bit of getting used to, but you should be able to roll and cook at the same time. Nearly continuous as it’ll take you almost as much time to roll as it does cook.

If your tortillas are thin enough, and the pan is hot enough – you’ll be rewarded with bubbles forming in the tortilla after a brief time in the pan. That’s when you want to flip it.

The last photo is a nearly done tortilla. They will be a bit dry and stiff coming out of the pan, we have a tortilla warmer that I stick them into and once they sit covered for a little they get nice and soft. Any covered container will work for this.

It takes some practice to get the pan heat right. I often start with it too cold (I haven’t let it heat up properly) and end with it almost too hot (smoking). The recipe is very forgiving, I often have the kids help and even with that chaos things work. If you’re having trouble getting it to go right, try some brand new flour. I’ve used old flour and bread products in general never seem to work with old flour.