I manage several ubuntu servers remotely, and occasionally, there will be a need to run fsck on the root partition.
From what I've read, the best way to achieve this without physical access to the machine is to have another OS installed, and tweak grub to boot into that OS after reboot. I have done that on some of the servers, and it did prove useful once or twice.
However, installing the two OSes was a pain, since I couldn't use simple "Guided - use entire disk" options, and had to manually craft the partition sizes and define the boot/swap/root etc, which made the installation less pleasant.
So my question is: is there a simple way that I'm missing to just install a second ubuntu server on the same machine, where I can just tell it "use 5 GB of the hard drive, and don't bother me with questions"?
Alternatively, is there a better way to enable fsck-ing of the root partition without physical access?
Update: after looking around some more, it seems that it might make more sense to install SystemRescueCD on the hard drive, rather than a full-fledged ubuntu. As long as I'm behind a firewall this might be acceptable. Still not an easy solution.
I don't think there is an easy way.
And really, you don't know that you need this at install time.. its something that comes up much later when things are really broken.
Leaving a little bit (1G maybe) of the "whole disk" unpartitioned on the guided partitioning install would be a very simple way to make this a lot easier without giving up too much space. brainstorm.ubuntu.com would be a pretty good place to suggest this.
For your alternative question: You could force an automated
fsck
on the next boot?shutdown -rF now
Depending on your access to a/the recovery console this might cause trouble if
fsck
runs into some real problems.Boot up with
init=/bin/sh
as a parameter in grub, and assuming at least the inintrd image is still ok, you should be in a place where you can fsck the root partition.