Reparing the file system

Asked by chintalvaady

Hi folks,
There was an unscheduled power cut yesterday and the computer was switched off without proper shut down process coz of low UPS battery.when i switched the computer after the power was restored,It said,UNCLEN UNMOUNTING of drives..So it was scanning the drives SDA4,SDA8 for errors,once the scanning was over,It said,REPAIR THE FILE SYSTEM MANUALLY USING 'FSCK'...press ctrl+d to resume normal boot...Hi friends....pls help me to solve this problem..

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Andy Ruddock
Solved:
Last query:
Last reply:
Revision history for this message
Andy Ruddock (andy-ruddock) said :
#1

I'd recommend booting into your live CD, when it's running open a terminal and run fsck on the hard drives from there.

Run :

fsck -fv /dev/sda4
fsck -fv /dev/sda8

(f is to check the filesystem even if's marked as clean, v is to be verbose)

If you want to be paranoid you can run "fsck -fvn /dev/sda4" first, which will check the drives without making any changes.

Revision history for this message
chintalvaady (cmraghavendran) said :
#2

I did what u said....But After typing The command u gave...Nothing Happened...

Revision history for this message
Andy Ruddock (andy-ruddock) said :
#3

Sorry, you do need to be root :

sudo fsck -fv /dev/sda4
sudo fsck -fv /dev/sda8

Please report back exactly what you see on the screen, with the -v flag as given here you'll see the program names reported as an absolute minimum.

Revision history for this message
chintalvaady (cmraghavendran) said :
#4

this i what happened....

krishna@krishna-desktop:~$ sudo fsck -fv /dev/sda4
fsck 1.41.3 (12-Oct-2008)
e2fsck 1.41.3 (12-Oct-2008)
/dev/sda4 is mounted.

WARNING!!! Running e2fsck on a mounted filesystem may cause
SEVERE filesystem damage.

Do you really want to continue (y/n)? yes

Pass 1: Checking inodes, blocks, and sizes
Inode 130228, i_size is 19763200, should be 19808256. Fix<y>? yes

Inode 130228, i_blocks is 38648, should be 38736. Fix<y>? yes

Inode 276376, i_size is 58740, should be 69632. Fix<y>? yes

Inode 276376, i_blocks is 128, should be 144. Fix<y>? yes

Pass 2: Checking directory structure
Entry 'prefs.xml' in /krishna/.purple (130251) has deleted/unused inode 130794. Clear<y>? yes

Entry 'saved_state' in /krishna/.gconfd (130077) has deleted/unused inode 131067. Clear<y>? yes

Entry 'FEEE61D7d01' in /krishna/.mozilla/firefox/n9ggupyb.default/Cache (276372) has deleted/unused inode 276377. Clear<y>? yes

Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Unattached inode 131023
Connect to /lost+found<y>? yes

WARNING: PROGRAMMING BUG IN E2FSCK!
 OR SOME BONEHEAD (YOU) IS CHECKING A MOUNTED (LIVE) FILESYSTEM.
inode_link_info[131023] is 2, inode.i_links_count is 1. They should be the same!
Inode 131023 ref count is 1, should be 1. Fix<y>? yes

Unattached inode 167845
Connect to /lost+found<y>? yes

Inode 167845 ref count is 2, should be 1. Fix<y>? yes

Unattached inode 167846
Connect to /lost+found<y>? yes

Inode 167846 ref count is 2, should be 1. Fix<y>? yes

Unattached inode 167892
Connect to /lost+found<y>? yes

Inode 167892 ref count is 2, should be 1. Fix<y>? yes

Pass 5: Checking group summary information
Block bitmap differences: +268502 -268503 -(268709--268725) -(268728--268729) -(268731--268733) -268739 +270344 +272410 +272414 +(272418--272419) -277124 -277130 -(277134--277136) -285376 -286242 -293006 -293010 -293032 -293035 -293038 -(293047--293049) -(293081--293099) -293340 -(293343--293344) -293346 -293348 -(315325--315337) -328192 -362766 -(362776--362778) -(561212--561215) -(567307--567312)
Fix<y>? yes

Free blocks count wrong for group #8 (7913, counted=7970).
Fix<y>? yes

Free blocks count wrong for group #10 (20007, counted=20008).
Fix<y>? yes

Free blocks count wrong for group #11 (15205, counted=15209).
Fix<y>? yes

Free blocks count wrong for group #17 (27161, counted=27167).
Fix<y>? yes

Free blocks count wrong (599974, counted=600042).
Fix<y>? yes

Inode bitmap differences: -130093 -130794 -130951 -130975 -130982 +131023 -131034 -131064 -131067 -167818 -167840 -167882 -276377
Fix<y>? yes

Free inodes count wrong for group #8 (15092, counted=15099).
Fix<y>? yes

Free inodes count wrong for group #10 (10911, counted=10914).
Fix<y>? yes

Directories count wrong for group #10 (446, counted=445).
Fix<y>? yes

Free inodes count wrong for group #17 (16226, counted=16227).
Fix<y>? yes

Free inodes count wrong (360950, counted=360961).
Fix<y>? yes

/dev/sda4: ***** FILE SYSTEM WAS MODIFIED *****

   29183 inodes used (7.48%)
     185 non-contiguous inodes (0.6%)
         # of inodes with ind/dind/tind blocks: 1342/10/0
  179110 blocks used (22.99%)
       0 bad blocks
       0 large files

   26877 regular files
    2280 directories
       0 character device files
       0 block device files
       0 fifos
       0 links
      17 symbolic links (17 fast symbolic links)
       0 sockets
--------
   29170 files
krishna@krishna-desktop:~$
krishna@krishna-desktop:~$
krishna@krishna-desktop:~$

Revision history for this message
Best Andy Ruddock (andy-ruddock) said :
#5

Well, you might be lucky - you really shouldn't run fsck on mounted filesystems (as per the warnings), which is why you were advised to run fsck after booting from your live CD.
Hopefully your problem is now fixed.

Revision history for this message
chintalvaady (cmraghavendran) said :
#6

Thanks Andy Ruddock, that solved my question.