How I tricked my Ubuntu

My Ubunut was giving me problems starting up yesterday. After investigating for a while, I figured that it was due to corrupt reiserfs on /var So I set to fix the problem by running reiserfsch --check on my /var partition. I rebooted Ubuntu in Recovery Mode. To My surprise, I could not do fsck on my /var as it was mounted and some applications seemed to be using it. I always thought that Recovery Mode does not boot the installed kernel instead it boots an alternate image. This was merely a misconception.

Now with no Ubuntu live CD I could virtually not solve the problem! So I thought about tricking my Ubuntu. I edited my /var/fstab, commented out the mount /var and rebooted my machine. Now the /var was not mounted and I could run fsck on that partition. Some applications did complain about missing files etc. but it at least allowed me to run fsck on my /var partition. After fixing problems by doing reiserfsck --rebuild-tree I removed the commented line from fstab, mounted /var and switched to runlevel 5 and my Ubuntu is back fixed again