Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Monday, December 08, 2008

fstab repair

Sometimes, bad things happen to good people. That's sorta unfortunate.

Sometimes, bad things happen to me, and that's really bad.

Today, I managed to make a typo in an entry in /etc/fstab. So, when I rebooted, the filesystem check failed (since I had spelled the path to the filesystem wrong and apparently the boot scripts aren't smart enough to recognize the difference between a non-existent device and a bad superblock). I needed to fix the typo in /etc/fstab, but the root filesystem was mounted read-only.

So, if you've got a busted /etc/fstab with a root filesystem that is an LVM partition, here's what you do.

First, you're going to need some sort of boot media, I use NimbleX-2008 for helping me through screwups like this. It's a 200 MB download from: NimbleX.net.

Boot to a command prompt or X and open a terminal window. If you don't use LVM for your root partition, you will probably already have your root partition mounted for you under /mnt/something-or-other. However, if you do use LVM, you need to know the name of your volume group. Mine is 'thump'.

Activate the volume group with (this is the step you won't remember if you're me):
lvchange -ay thump

Use lvscan to make sure it's now active:
lvscan

Then create a mount point for it and mount it. For me, that looked like:
mkdir /mnt/thump.root
mount /dev/mapper/thump.root /mnt/thump.root

Next, fix the silly typo in the fstab -- making sure to fix the one on your real disk, not the NimbeX instance's.
vi /mnt/thump.root/etc/fstab

Reboot, and you have your computer back. And now, I don't have to hunt through google to remember to use vgchange -ay to be able to see my root partition the next time I make this goof.

We now return you to your regularly scheduled economics and policy musings. :)

Tuesday, June 03, 2008

They're called "man pages" Red Hat, use them

I like Linux systems. Given a choice, they're what I use for computers. Sometimes though, I'd like to get to make the rules... Here's the first one I'd probably make (and I'm looking at YOU Red Hat)!


If you install a program in /bin, /sbin, /usr/bin, or /usr/sbin it had better have a man page.


Otherwise, I'm gonna be stuck doing things like this...

man virt-install

rpm -qf `which virt-install`

rpm -qd `python-virtinst` # I sorta doubt anybody ever guessed this one right.

Discover that I should have just gone to google because there is precisely zero useful-to-a-sysad (or a programmer pretending to be a sysad) documentation included with the package.

Even a lousy man page is better than none at all.

I almost don't care if the man page is just a template that lists the usage output the command itself prints out. At least then I don't need to guess at what the option to get the help information is. Is it -h or -H or --help or -help, or -u or -U or --usage or --Usage? Does one of those wipe my boot partition or add an account named 'sage' to my system, or who knows what -- just randomly running commands is stupid.

Grr.

Oh, and one other thing Red Hat... If virtualization is so important, why on earth is it so poorly documented in RHEL5?

There is no closing rant tag since I highly doubt that this will ever be fixed. Maybe if I were to write the man pages myself for all of the gnome-* and system-* utilities then they'd actually exist. I'm pretty sure I'm not that ambitious. *sigh*