Running fsck on EC2, Part 2

Running fsck on EC2, Part 2

This post describes a quicker method for running fsck on an EC2 instance’s root filesystem.

Create a “/forcefsck” file in the root filesystem and configure appropriately.

colin@devcolin:~$ sudo su -
root@devcolin:~# echo y > /forcefsck

forcefsck_method

The “y” character placed in the /forcefsck file will respond to all fsck prompts with the default “yes.” This will avoid the reported hangs if/when fsck prompts for user input on EC2 instance startup.

Restart the EC2 Instance

Wait for the system to restart.

Confirm that fsck Ran

You can confirm by:

  1. Examining the EC2 System Log from the AWS Console. Look for the lines:
    fsck from util-linux 2.20.1
    Checking disk drives for errors. This may take several minutes.
  2. Examine the “Last checked” time shown by the tune2fs utility:
    colin@devcolin:~$ sudo tune2fs -l /dev/xvda1 | grep "Last checked"
    Last checked: Wed Mar 5 05:59:01 2014

forcefsck_last_checked

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s