File system with errors, error reading block 1139021 help?

Asked by Jake Gordula on 2009-04-13

I am currently running Ubuntu 8.04 on my laptop. I am having a problem when my system boots up that I used to be able to fix, or at least it seemed fix, by following the instructions on the screen. I will display my current problem here on the screen:

*Reading files needed to boot... [OK]
*Preparing restricted drivers... [OK]
*Setting system clock
Cannot access the Hardware Clock via any known method
Use the --debug option to see the details of our search for an access method.
*Unable to set the system clock to: Mon April 13 15:53:42 UTC 2009
*Starting basic networking [OK]
*Starting kernel event manager [OK]
*Loading hardware drivers...
[ 65.729718] ALSA/build/buildd/linux-ubuntu-modules-2.6.24-2.26.24/debian/build/build-386/sound/alsa-driver/pci/atiixp_modem.c:503: atiixp-modem: codec reset timeout
                                                                 [OK]
*Setting the system clock
*Loading kernel modules...
*Loading manual drivers... [OK]
*Setting kernel variables... [OK]
*Activating swap... [OK]
fsck 1.40.8 (13-Mar-2008)
/dev/hda1 contains a file system with errors, check forced
[ 611.107747] Buffer I/O error on device hda1, logical block 1139021 94% Error reading block 1139021 (Attempt to read block from filesystem resulted in short read) while reading directory block. /dev/hda1: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY
 (i.e., without -a or -p options)
fsck died with exit status 4 [fail]
*an automatic file system check (fsck) of the root file system failed. A manual fsck must be performed, then the system restarted. The fsck should be performed in maintenance mode with the root filesystem mounted in read only mode.
*The root filesystem is currentl mounted in read-only mode.
A maintenance shell will now be started.
After performing system maintenance, press CONTROL-D
to terminate the maintenance shell and restart the system
bash: no job control in this shell
bash: groups: command not found
bash: lesspipe: command not found
bash: Command: command not found
bash: The: command not found
bash: dircolors: command not found
bash: Command: command not found
bash: The: command not found
root@jake-laptop:~#

(I tried to make the text as correct as possible, but there may be differences in spacing and other stuff, my apologies) It is at this point that the past two times this has happened, I just pressed Control-D and the laptop restarted and booted as normal. I only got as far as 94% on the fsck by letting the maintenance shell run, restarting, and doing the maintenance shell again. I did this quite a few times and I just can't seem to get past 94%. When I boot, it does not always go straight to this screen with the text. I am posting on the internet right now because it went to the Ubuntu screen with the load bar and it seemed to be runing some kind of check. I remember seeing the word routine in it. Last time I let it go like that, I had to restart, but this time I just pressed escape and I was able to get to login. If anyone could help me fix this or point me in the direction to fix this, I would appreciate it greatly. Thanks in advance.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Sam_
Solved:
2009-04-13
Last query:
2009-04-13
Last reply:
2009-04-13
Sam_ (and-sam) said : #1

Hi,
options:
https://help.ubuntu.com/community/SystemAdministration/Fsck

Manual fix on the next boot:
sudo touch /forcefsck

##Mount count will be reseted

If you wish that errors get always corrected automatically you may edit:
/etc/default/rcS

change
FSCKFIX=no
to
FSCKFIX=yes

Actually not really recommended, because of missing what's going on.

Sam_ (and-sam) said : #2

If the issue maintains consider to check your harddrive e.g.
http://www.ultimatebootcd.com/
also manufacturer of hd provide disks for testing.

Jake Gordula (gordulajh) said : #3

Hi Sam,

Thanks for the help. I tried running the command you game me. I restarted my laptop and came back to the same screen with all of the text that I entered earlier. When I was able to enter a command after the filesystem check and all that bash stuff, I entered:

sudo touch /forcefsck

In return I got:

Command 'sudo' is available in '/usr/bin/sudo'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
bash: sudo: command not found
root@jake-laptop:~#

Did I do something wrong? Was there another point at which I should have entered this command? Can I do this in a normal command line interface. (I hope I am using correct terminology, hehe.) You also mentioned checking my harddrive. Is my harddrive possibly just really messed up? My laptop is almost six years old. If you need any other informtation just let me know. Thanks again.

Please tell do you have an Ubuntu live install cd to boot your pc from it...?
If yes you can perform the filesystem check using that cd... by open a terminal from Applications → Accessories → Terminal
and typing:

sudo fdisk -l

to get your partitions list

Then you can make a filesystem check typing this command:

sudo fsck /dev/sdxx

replace /dev/sdxx with the previous returned by the "sudo fdisk -l" command ext3 partition name

Please answer y to correct partition error

Then reboot your pc

Hope this helps

Jake Gordula (gordulajh) said : #5

Hello marcobra,

I found my ubuntu live install disk. I did the command "sudo fdisk -l" and this is what I got:

Disk /dev/hda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x955e1016

   Device Boot Start End Blocks Id System
/dev/hda1 * 1 7132 57287758+ 83 Linux
/dev/hda2 7133 7296 1317330 5 Extended
/dev/hda5 7133 7296 1317298+ 82 Linux swap / Solaris

I am not entirely sure what information to replace /dev/sdxx with. Could you let me know? Thanks for the help.

Sam_ (and-sam) said : #6

Sorry for the misconception.
After login normally, you open a terminal and type:
sudo touch /forcefsck

then you restart your computer via GUI or:
sudo reboot

Depends on the usage of hd if it's broken, that's what analyze tools are for.
You'll get information what to do from the system itself.
As you already kindly did, you'll provide any error messages.

sudo fsck /dev/hda1

Best Sam_ (and-sam) said : #8

From LiveCD:
sudo fsck.ext3 -v -f /dev/hda1

If there are to many questions to answer you can stop with ctrl+C
and restart again with:
sudo fsck.ext3 -y /dev/hda1

###
note:
man fsck.ext3

Jake Gordula (gordulajh) said : #9

Whoa, the "sudo fsck.ext3 -v -f /dev/hda1" command was a long and interesting event. I am not entirely sure if everything is fixed. Here is the output:

jake@jake-laptop:~$ sudo fsck.ext3 -v -f /dev/hda1
[sudo] password for jake:
e2fsck 1.40.8 (13-Mar-2008)
/dev/hda1 is mounted.

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

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

/dev/hda1: recovering journal
Pass 1: Checking inodes, blocks, and sizes
Deleted inode 2828906 has zero dtime. Fix<y>? yes

Inodes that were part of a corrupted orphan linked list found. Fix<y>? yes

Inode 2845639 was part of the orphaned inode list. FIXED.
Inode 2845844 was part of the orphaned inode list. FIXED.
Inode 2845930 was part of the orphaned inode list. FIXED.
Pass 2: Checking directory structure
Entry '%gconf.xml' in /home/jake/.gconf/apps/gnome-screensaver (5134843) has deleted/unused inode 5135801. Clear<y>? yes

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

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

Unattached zero-length inode 5135798. Clear<y>? yes

Pass 5: Checking group summary information
Block bitmap differences: -5715971 -(5716298--5716300) -5716303 -5716306 -5716314 +10318069 -10318091
Fix<y>? yes

Free blocks count wrong for group #174 (3915, counted=3922).
Fix<y>? yes

Free blocks count wrong for group #314 (16278, counted=16279).
Fix<y>? yes

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

Inode bitmap differences: -(2828905--2828906) -2845639 -2845844 -2845930 -5135801
Fix<y>? yes

Free inodes count wrong for group #173 (16301, counted=16303).
Fix<y>? yes

Free inodes count wrong for group #174 (13800, counted=13803).
Fix<y>? yes

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

/dev/hda1: ***** FILE SYSTEM WAS MODIFIED *****
/dev/hda1: ***** REBOOT LINUX *****

  221819 inodes used (3.10%)
    4737 non-contiguous inodes (2.1%)
         # of inodes with ind/dind/tind blocks: 9988/254/0
 1843881 blocks used (12.87%)
       0 bad blocks
       0 large files

  169338 regular files
   25599 directories
     364 character device files
      59 block device files
       4 fifos
     517 links
   26416 symbolic links (24304 fast symbolic links)
      31 sockets
--------
  222326 files
jake@jake-laptop:~$

I really don't know how to read this stuff. As you can tell, anytime I was prompted, I just hit y. Does it look like this did the job? If anyone could tell me I would really appreciate it. Big thanks to Sam and Marcobra for your assistance.

Sam_ (and-sam) said : #10

We'll see if it's fixed and I certainly hope you didn't mess up your system. Why?
Because you ignored this:
/dev/hda1 is mounted.
WARNING!!! Running e2fsck on a mounted filesystem may cause SEVERE filesystem damage.

At any attempt of fsck the concerned hd should NOT be mounted, means read only mode.
When using LiveCD it shouldn't be mounted automatically.
When rebooting after 'touch command' it's also in read only mode.

So I don't understand why it was mounted in the first place.
Next time before you check from a LiveCD please unmount hda1 first:
sudo umount /dev/hda1

Sam_ (and-sam) said : #11

Quote:
#0 bad blocks

I guess you're lucky.

Jake Gordula (gordulajh) said : #12

Oh shoot, I didn't realize that I needed to unmount hda1. I hope nothing is too messed up. I guess we will find out soon enough. I will call this solved I suppose and if anything is damaged I'll be back. Thanks for the help again.

Jake Gordula (gordulajh) said : #13

Thanks Sam, that solved my question.