Announcement

Collapse
No announcement yet.

fsck fails on boot, HELP!

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    fsck fails on boot, HELP!

    My partner rebooted my pc this morning after an unspecified problem with an application hanging (ktorrent I think). I wasn't awake yet so did not see what was happening before the reboot. Anyhow upon rebooting, it did not make it to x or kdm and this is what was on screen when I saw it:

    Code:
    * Setting kernel variables... [ok]
    * Activating swap [ok]
    * Checking root file system...
    1232
    fsck 1.40.8 (13-Mar-2008)
    /dev/sbd2 contains a file system with errors, check forced.
    Checking drive /dev/sbd2: 0% (stage 1/5, 2/195)
    Checking drive /dev/sbd2: 1% (stage 1/5, 3/195)
    Checking drive /dev/sbd2: 1% (stage 1/5, 4/195)
    Checking drive /dev/sbd2: 1% (stage 1/5, 5/195)
    Checking drive /dev/sbd2: 5% (stage 1/5, 14/195)
    Checking drive /dev/sbd2: 8% (stage 1/5, 23/195)
    Checking drive /dev/sbd2: 11% (stage 1/5, 32/195)
    /dev/sbd2: Inodes that were part of a corrupted orphan linked list found.
    
    /dev/sbd2: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
           (i.e., without -a or -p options)
    fsck died with exit status 4
    Checking drive /dev/sbd2: 12% (stage 1/5, 35/195)
                                                             [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 file system mounted in read-only mode.
    * The root filesystem is currently 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@POOT~#_
    The fsck check thing has run before as I have a dual boot (Windows XP/Kubuntu Hardy) system with a shared NTFS drive. Sometimes when XP locks up or needs a hard reset, upon booting Kubuntu, the fsck thing complains and will not mount the drive. That is usually easily fixed by rebooting windows, restarting again into Linux. But this time the reboot was as a result of some problem with a hanging application. My partner is not computer literate and did not realise you can simply kill the app itself rather than restarting the pc.

    I am not sure what to do about this error and unable to get into x or the desktop...

    Any ideas?
    • chris  m •

    #2
    Re: fsck fails on boot, HELP!

    I doubt he/she "rebooted", probably he nailed the power switch. If you think your Linux system is hung or "frozen" (which is unlikely to be the fact), then follow this guidance to avoid corrupting it:

    http://kubuntuforums.net/forums/inde...opic=3088251.0

    A manual filesystem check is done by unmounting the partition in question, and running fsck on it.

    Code:
    ~$ man fsck
    
    FSCK(8)                                                       FSCK(8)
    
    NAME
       fsck - check and repair a Linux file system
    
    SYNOPSIS
       fsck [ -sAVRTMNP ] [ -C [ fd ] ] [ -t fstype ] [filesys ... ] [--] [ fs-specific-options ]
    
    DESCRIPTION
       fsck is used to check and optionally repair one or more Linux file systems. filesys can be a device name (e.g.
       /dev/hdc1, /dev/sdb2), a mount point (e.g. /, /usr, /home), or an ext2 label or UUID specifier (e.g.
       UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or LABEL=root). Normally, the fsck program will try to handle filesystems
       on different physical disk drives in parallel to reduce the total amount of time needed to check all of the filesys‐
       tems.
    
    ... read on ...
    If running fsck on that partition does not fix the errors, then there is the possibility that the hard drive itself is degraded and gradually losing performance.

    Comment


      #3
      Re: fsck fails on boot, HELP!

      Originally posted by dibl
      I doubt he/she "rebooted", probably he nailed the power switch. If you think your Linux system is hung or "frozen" (which is unlikely to be the fact), then follow this guidance to avoid corrupting it:

      http://kubuntuforums.net/forums/inde...opic=3088251.0
      True. I am not sure whether or not the proper restart sequence was followed or the reset button was hit... As best I could determine from the description : "The pointer looked like this and the window was grey", and a rough drawing of the mouse pointer in the resize handle mode was drawn...

      Originally posted by dibl
      A manual filesystem check is done by unmounting the partition in question, and running fsck on it.

      Code:
      ~$ man fsck
      
      FSCK(8)                                                       FSCK(8)
      
      NAME
         fsck - check and repair a Linux file system
      
      SYNOPSIS
         fsck [ -sAVRTMNP ] [ -C [ fd ] ] [ -t fstype ] [filesys ... ] [--] [ fs-specific-options ]
      
      DESCRIPTION
         fsck is used to check and optionally repair one or more Linux file systems. filesys can be a device name (e.g.
         /dev/hdc1, /dev/sdb2), a mount point (e.g. /, /usr, /home), or an ext2 label or UUID specifier (e.g.
         UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or LABEL=root). Normally, the fsck program will try to handle filesystems
         on different physical disk drives in parallel to reduce the total amount of time needed to check all of the filesys‐
         tems.
      
      ... read on ...
      If running fsck on that partition does not fix the errors, then there is the possibility that the hard drive itself is degraded and gradually losing performance.
      Thanks for your suggestions. I will try this using a live cd and hope the files damaged are not critical o/s files...
      • chris  m •

      Comment


        #4
        Re: fsck fails on boot, HELP!

        I think perhaps I wasn't clear previously about this problem and it came to light once I tried yours, as well as another person's suggestions:

        The partition in question is actually from an NTFS formatted drive. The strange thing is, the live cd boots and mounts all the drives with no problem. When I tried the above commands from the live cd desktop environment in the terminal, I get the following errors (screenshot attached):

        [img width=400 height=265]http://chrisjmartini.googlepages.com/fsck_problem1.jpg[/img]

        I would imagine that is because the drive is NTFS formatted. Actually the device (sdb2) is a 1kb partition which i don't understand as well... So what to do now? When i test the drive in Windows, no errors are reported...


        http://chrisjmartini.googlepages.com/fsck_problem1.jpg
        • chris  m •

        Comment


          #5
          Re: fsck fails on boot, HELP!

          Hmmmmmm -- that is some odd partitioning! Each of your 3 hard drives has a 1kB partition on it -- what the heck are those for?

          The fact that one of them is NTFS formatted is irrelevant -- it's too small to use for anything, anyway. I'm not sure whether to tell you to start over with partitioning, or just ignore any error messages from 1kB partitions :P

          I guess if you are happy with the parts of your system that are working correctly, perhaps the easy thing to do is to edit /etc/fstab as root, and comment out those 1kB partitions so they don't even get mounted -- there is no reason to mount or fsck them, because they are too small to be useful. Just insert a "#" in front of the line that describes the partitions /dev/sdb2 and /dev/sdc2. I see you are using the one on /dev/sda2 as /tmp, so you need that one (you probably need more than 1kB, however) -- better leave it alone for now. With the other two commented out, the system won't try to mount them, and therefore won't fsck them either.

          Hope this helps.

          Comment


            #6
            Re: fsck fails on boot, HELP!

            Originally posted by dibl
            Hmmmmmm -- that is some odd partitioning! Each of your 3 hard drives has a 1kB partition on it -- what the heck are those for?
            Looks to me like extended partitions (containing one logical partitions each, which are the actual data partitions)

            @c_martini
            'Disk & Filesystems' is a bit buggy at times, you'll get better partition listing with 'sudo fdisk -l'

            If /dev/sdb2 is really an extended partition ('placeholder' for logical partitions), you can't run fsck on it. (well... you can try, but it contains no file system to check). On a side note, you might not want to run fsck on NTFS volumes anyway.

            You might want to check your /etc/fstab for (erroneous) references to /dev/sdb2...as extended partitions don't belong in fstab (which might explain why your system wants to check sdb2 at boot time)

            You can post both, the output of the command 'sudo fdisk -l' and the contents of /etc/fstab here so someone can take a look at them if you're unsure.

            Comment


              #7
              Re: fsck fails on boot, HELP!

              Originally posted by kubicle

              Looks to me like extended partitions (containing one logical partitions each, which are the actual data partitions)
              Ahhhhhhhhhhh -- good catch, kubicle!



              Comment


                #8
                Re: fsck fails on boot, HELP!

                Thanks for your suggestions, dibl and kubicle,
                I finally was able to fix the disk by moving all the data to another disk. I then used the gparted live cd to delete the partition (and the 1kb one), and created a new partition, formatting it as ext3. This fixed the problem with Kubuntu not making it through the disk check during boot. Now I have an fstab mess since there are probably some erroneous entries that I need to get rid of in fstab. I have tried removing some of the stuff I am sure is wrong but its all a bit confusing to me.. Is there a way to regenerate a clean fstab?

                running sudo fdisk -l gives me the following output:

                Code:
                Disk /dev/sda: 81.9 GB, 81964302336 bytes
                255 heads, 63 sectors/track, 9964 cylinders
                Units = cylinders of 16065 * 512 = 8225280 bytes
                Disk identifier: 0x807fe5f9
                
                 Device Boot   Start    End   Blocks Id System
                /dev/sda2 *     2    9964  80027797+ 5 Extended
                /dev/sda5       2    9964  80027766  7 HPFS/NTFS
                
                Disk /dev/sdb: 61.4 GB, 61492838400 bytes
                255 heads, 63 sectors/track, 7476 cylinders
                Units = cylinders of 16065 * 512 = 8225280 bytes
                Disk identifier: 0x1ab41ab3
                
                 Device Boot   Start    End   Blocks Id System
                /dev/sdb1 *     1    4169  33487461  7 HPFS/NTFS
                /dev/sdb2      4170    7337  25446960 83 Linux
                /dev/sdb3      7338    7476  1116517+ 5 Extended
                /dev/sdb5      7338    7476  1116486 82 Linux swap / Solaris
                
                Disk /dev/sdc: 80.0 GB, 80026361856 bytes
                255 heads, 63 sectors/track, 9729 cylinders
                Units = cylinders of 16065 * 512 = 8225280 bytes
                Disk identifier: 0xa4e736bb
                
                 Device Boot   Start    End   Blocks Id System
                /dev/sdc1       1    9729  78148161 83 Linux
                That last section/drive in the fdisk output is the drive that was re-partitioned and formatted. I use this drive as shared drive between Linux and windows, as well as a smb network share, so it should be mounted as /media/shared. My Windows installation has a driver for ext3 so it does not matter that the drive was reformatted as ext3.

                Can I somehow use the above output info to create a new fstab? Is there some tool in Kubuntu that will generate one for me so I don't mistakenly make a syntax or other error when trying to generate one manually?
                • chris  m •

                Comment


                  #9
                  Re: fsck fails on boot, HELP!

                  Sure, you can edit /etc/fstab manually and add that partition.

                  First open the Konsole and enter
                  Code:
                  sudo blkid
                  this will show the UUID number for the partitions. Then leave that open and run Kate in super user mode, via Alt-F2 "kdesu kate /etc/fstab" with no quote marks. This will open Kate and the /etc/fstab file in it.

                  You want to add a line that is formed like this, but with your UUID number, and your mount point, not mine:

                  Code:
                  UUID=e4a45430-1c4a-4432-91db-265cfe7dd645	/media/disk1	ext3	auto,users,exec,noatime,data=writeback 	0	2
                  Just copy the UUID number for /dev/sdc out of the Konsole and paste it into the /etc/fstab file below the existing hard drive partitions, and then make sure to delete the " ' " marks.

                  If you have not made a mount point for that drive/partition, you can do it manually, in the Konsole, as follows:

                  Code:
                  sudo mkdir /media/nameofmychoice
                  where "nameofmychoice" can be whatever pleases you (and isn't already being used). Then you use that name in your /etc/fstab line.

                  You can remount the drive without rebooting, by entering the following in the Konsole after you have saved your edits and exited Kate.

                  Code:
                  sudo mount -a
                  Now you should be able to access that partition with Konqueror or Dolphin.

                  Comment


                    #10
                    Re: fsck fails on boot, HELP!

                    Thanks. got all that done now but am unable to write anything to the drive. I get 'access denied' errors. I have now also tried opening dolphin as root (kdesu dolphin) and setting permissions by right clicking the folder for the mount point (/media/shared) and setting access permissions for owner, group and others as "can view & modify content", which does not help either
                    • chris  m •

                    Comment


                      #11
                      Re: fsck fails on boot, HELP!

                      Time then, to post your 'new' fstab file so we can see how you put it together.
                      Windows no longer obstructs my view.
                      Using Kubuntu Linux since March 23, 2007.
                      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                      Comment


                        #12
                        Re: fsck fails on boot, HELP!

                        This is my fstab:

                        Code:
                        # /etc/fstab: static file system information.
                        #
                        # <file system> <mount point>  <type> <options>    <dump> <pass>
                        proc /proc proc defaults 0 0
                        # /dev/hda2
                        UUID=afbdf77d-f3bf-4284-b109-e5bb0b3fc95f / ext3 nouser,defaults,errors=remount-ro,atime,auto,rw,dev,exec,suid 0 1
                        # /dev/hda1
                        UUID=2A40889E408871FD /media/hda1 ntfs defaults,umask=007,uid=0,gid=46,auto,rw,nouser 0 1
                        # /dev/sda5
                        UUID=E72295C793A24D03 /media/sda5 ntfs defaults,umask=007,uid=0,gid=46,auto,rw,nouser 0 1
                        # /dev/hda5
                        UUID=b441fbd0-fe20-431a-80cf-773caa05f358 none swap sw 0 0
                        /dev/hdd /media/cdrom0 udf,iso9660 user,atime,noauto,rw,dev,exec,suid 0 0
                        # /dev/sdb2
                        UUID=afbdf77d-f3bf-4284-b109-e5bb0b3fc95f /media/shared ext3 auto,users,exec,noatime,data=writeback 0 2
                        Besides the access denied message, I also noticed I cannot complete a boot again. efsck complains about the drive already being mounted and then will not allow the system to finish starting up. I must have configured the fstab incorrectly...
                        • chris&nbsp; m •

                        Comment


                          #13
                          Re: fsck fails on boot, HELP!

                          On the assumption that the UUID values for the partitions are correct, you need to make the two changes I've indicated below in bold red

                          # /etc/fstab: static file system information.
                          #
                          # <file system> <mount point> <type> <options> <dump> <pass>
                          proc /proc proc defaults 0 0
                          # /dev/hda2
                          UUID=afbdf77d-f3bf-4284-b109-e5bb0b3fc95f / ext3 errors=remount-ro 0 1
                          # /dev/hda1
                          UUID=2A40889E408871FD /media/hda1 ntfs defaults,umask=007,uid=0,gid=46,auto,rw,nouser 0 2
                          # /dev/sda5
                          UUID=E72295C793A24D03 /media/sda5 ntfs defaults,umask=007,uid=0,gid=46,auto,rw,nouser 0 2
                          # /dev/hda5
                          UUID=b441fbd0-fe20-431a-80cf-773caa05f358 none swap sw 0 0
                          /dev/hdd /media/cdrom0 udf,iso9660 user,atime,noauto,rw,dev,exec,suid 0 0
                          # /dev/sdb2
                          UUID=afbdf77d-f3bf-4284-b109-e5bb0b3fc95f /media/shared ext3 defaults 0 2
                          ONLY if you have the ntfs-3g package installed, you should also change ntfs to ntfs-3g

                          Also, you should either delete defaults on # /dev/hda1 and # /dev/sda5 or delete ,umask=007,uid=0,gid=46,auto,rw,nouser on both lines. You don't want both.
                          Windows no longer obstructs my view.
                          Using Kubuntu Linux since March 23, 2007.
                          "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                          Comment


                            #14
                            Re: fsck fails on boot, HELP!

                            Ok, have modified fstab as you suggested. Also changed ntfs to ntfs-3g as this is in fact installed. Now my system still won't finish booting. fsck is complaining that the disk is mounted for some reason:

                            Code:
                            1232
                            fsck 1.40.8 (13-Mar-2008)
                            /dev/sdb2 is mounted. e2fsck: Cannot continue, aborting.
                            
                            fsck died with exit status 8
                            
                            * File system check failed.
                            A log is being saved in /var/log/fsck/checkfs if that location is writable
                            Please repair the file system manually.
                            * A Maintenance shell will now be started.
                            CONTROL-D will terminate this shell and resume system boot.
                            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
                            • chris&nbsp; m •

                            Comment


                              #15
                              Re: fsck fails on boot, HELP!

                              Are you left at a prompt? I believe you are.

                              Type:
                              Code:
                              fsck
                              This will force a filesystem check on the entries in your fstab file. This should resolve the problem.
                              Windows no longer obstructs my view.
                              Using Kubuntu Linux since March 23, 2007.
                              "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                              Comment

                              Working...
                              X