2

On login to EC2 (Ubuntu) instance, I see

*** /dev/xvda1 should be checked for errors ***

I can't fsck /dev/xvda1 because it is mounted, and sudo umount /dev/xvda1 fails because it is in use. So I tried to use sudo touch /forcefsck as suggested here but it doesn't work, when I did it nothing happened on terminal. What to do?

dr house
  • 65
  • 1
  • 7
  • Did you actually reboot the instance after performing the `touch` command? The command by itself just makes a file, but you have to reboot the server for the actual check to take place. – zymhan Jan 20 '15 at 19:13
  • @WildVelociraptor I had reboot the instance but nothing happened...I don't know why, but after few hours without did anything, the message is not more displayed – dr house Jan 20 '15 at 22:54
  • If it says that it should be checked for errors, there may be actual errors on it. Make (have) backups. – Halfgaar Jan 20 '15 at 22:56

2 Answers2

4

as alternative to touch /forcefsck, one can attach dirty volume to another instance, run fsck on that dirty volume and reattach it back to original instance.

alexus
  • 12,342
  • 27
  • 115
  • 173
2

Simply edit the file /etc/default/rcS

Uncomment and set FSCKFIX=yes

/etc/default/rcS
# automatically repair filesystems with inconsistencies during boot
FSCKFIX=yes

and reboot!

Do remember to put it back afterwards.

gerky
  • 291
  • 1
  • 4
  • 13