Anybody Want my A4?

Posted by ryan
at 10:35 AM on Tuesday, April 26, 2005

The time has come when I must part with my 2000 Audi A4. If anybody’s in the area and is interested, let me know – I’m asking $12,500…

May 7th – Sold!

Mounting All Partitions in Read Only Mode - How to Recover

Posted by ryan
at 9:24 AM on Sunday, April 24, 2005

Thanks to the untimely crash of my work Dell Latitude D600’s hard drive (the 3rd or 4th time this has happened in our office in the last few months – what has happened to Dell?) – I’ve had to recover my Debian laptop. In the process of doing so (explained below), I ended up mounting all my drives in read only mode for the filesystem to be rebuilt. Great – now how do I get back so that they’re mounted read/write?

I first noticed that my machine my be on the fritz when it started freezing up on me a few times in the last few weeks. Joking to my coworker I said it must be faulty hardware b/c there’s no way it was Linux that was freezing. How true that was…

Friday night, I got home, fired up the machine and left it on my desk. I come back to it after about an hour and the damn thing was frozen. I hard shutdown the machine and when it starts up again it says something like:

/sbin/init - Permission denied
Kernel panic! Error XXXX

After googling around it was clear this wasn’t a recoverable error – and after seeing that filesystem checks were failing on startup I figured the hard drive had gone on me. Since I couldn’t even get to the prompt to run any commands I had to reinstall Debian and reformat my root partition to get the base install – and even then the files in my home partition weren’t accessible and all sorts of other weird errors. Enter reiserfsck.

Seeing these file errors prompted me to run fsck on my partitions (all reiserfs partitions) – and doing so mandates that your partitions are mounted in read only mode. Ok, no problem I think. I go into my /etc/fstab and change “default” to “ro” for all partitions so I can do the check on all partitions.

I boot into the command prompt and do the following to recover:

reiserfsck --check /dev/hda5
reiserfsck --fix-fixable /dev/hda5
reiserfsck --check /dev/hda6
reiserfsck --fix-fixable /dev/hda6
reiserfsck --check /dev/hda7
reiserfsck --rebuild-tree /dev/hda7

I had to “rebuild-tree” on my /home partition as it had errors that couldn’t be fixed with a simple “fix-fixable”. I lost a few files, but in general I was pretty pleased with the recovery. But now I had a system that could only be mounted in read only mode (b/c I couldn’t go back and edit /etc/fstab since it was on a read only partition). The command that saved me and allows you to remount an already mounted partition was:

mount -o remount,rw /dev/hda5

After that I was able to edit (and save) my read/write version of /etc/fstab and be on my way. Thanks to reiserfs for recovering my data and Dell for a crappy product – I will never doubt Linux again …