Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
    
Out of curiosity why will you need to run fsck interactively on the root partition ? fsck runs automatically (when required), and only requires interaction when there is a serious problem. –  João Pinto Dec 15 '10 at 10:17
    
Well, sometimes there is a serious problem. It just so happened that yesterday I got the message unexpected inconsistency, run fsck manually (i.e without -a or -p option). It's what prompted me to ask this question. –  itsadok Dec 15 '10 at 10:58
add comment

3 Answers

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.

share|improve this answer
add comment

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.

share|improve this answer
    
It's an option, definitely, but I've had occasions where automatic fsck fails, and it demands I do a manual run. Also, scary. –  itsadok Dec 15 '10 at 9:49
add comment

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.

share|improve this answer
    
Unless I misunderstand, this is only useful if you have physical access to the machine. –  itsadok Dec 16 '10 at 14:30
    
No, this should work if you have an ip-KVM or an ILO that gives you remote console access. –  poolie Dec 20 '10 at 0:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.