Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a small VIA Ubuntu server used as firewall and a second one with Ubuntu desktop for hosting different services (web, mail, ...).

For an unknown reason some errors occurred in the sda1 partition (boot partition) of both computers. I suspect it was caused by a power failure this summer although I have an APC UPS.

I only discovered the problems yesterday because the error caused an apt-get upgrade to abort. It is smart enough to put me in a state and give directives to repair the file system.

When booting the firewall server, the fsck phase then tells me the disks are ok. But just after logging, when I do a fsck -n -C /dev/sda1 it tells me there are errors. There are mismatch in the number of freeblocks.

Running an fsck on the other VIA with the same command, reports me many errors.

A quick search on the web how to repair the file systems returns me the suggestion to use a live CD. But the firewall server has no CD/DVD. I do have an USB DVD but would like to know if it is possible to repair the file systems without using it since I don't have a live CD around here.

EDIT: I was lucky enough that the automatic periodic check of the desktop ubuntu took place and checked my sda1 disk. Apparently it reported no errors. It could be that the errors show up because I run fsck on the mounted disk. But on the Ubuntu server, there must have been an error because the apt-get upgrade aborted because of the filesystem error.

I burned a Ubuntu server 10.04 LTS, but my USB CD driver is not taken in account in the boot process even though I can opt for it in the bios. Maybe I need a bios upgrade. If I could find the way to force the fsck at boot time on the Ubuntu server and rely on its result, then things would be ok.

Solution: Create an empty file as root in / named forcefsck and reboot using the command 'shutdown -rF now'. This will force a fsck at boot time and repair it if needed.

$ sudo touch /forcefsck
$ sudo shutdown -rF now

Apparently no errors where found. So the errors I saw initially could be caused by checking a mounted and used filesystem.

share|improve this question

2 Answers 2

generally the concept is to mount the filesystem read only (that's why a live cd is needed). for your case, since you have nothing you could start the system in single mode (add 1 in your boot parameters).

Another thing you could do is to make a usb bootable (unetbootin) and boot it (some idea as live cd)

You could also you another disk for temporal boot and just mount read only your actual disk.

And many many other things i cannot think this moment. But as i said before, just find a way to mount it as read only.

share|improve this answer
    
Could you be more explicit about adding 1 to the boot parameter ? –  chmike Oct 27 '10 at 17:59
    
Could you be more explicit about adding 1 to the boot parameter ? I don't type the boot command and don't see it in fact. –  chmike Oct 27 '10 at 18:00
    
generally you need to start in single mode. The way to do is ... when grub is starting and you see the OS choises, press 'e'. Then you 'll some parameters. append at the end '1' (without the quotes) –  Nikolaidis Fotis Oct 28 '10 at 9:18
    
I'm using Ubuntu 8.04 LTS and I have only one OS. So I never see Grub. I see the Ubuntu logo and the progress bar. –  chmike Oct 28 '10 at 10:31
    
it's an option in grub.cfg. anyway. you could also do it by modifying /boot/grub/grub.cfg. find the kernel and add 1 an the end of the line. Don't forget to remove it when it's your work done. –  Nikolaidis Fotis Oct 28 '10 at 12:13

If you can remove the drive from your firewall device, it might be simpler to just add it to another server, mount /dev/sda1 and run an fsck there.

share|improve this answer

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.