LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Filesystem check failed. (https://www.linuxquestions.org/questions/linux-newbie-8/filesystem-check-failed-784278/)

samsom 01-23-2010 05:56 PM

Filesystem check failed.
 
Hi,
I have got arch Linux dual booting with Win XP on my laptop.
I have been getting a filesystem check error since yesterday and am unable to start Arch. Upon googling and searching the arch fora, I came upon some advice which I tried which has not worked yet. Hence the new post...

Basically, I was attempting to print something off and accidentally chose a printer that was not connected to my laptop. After half a minute or so, it repeatedly started giving me notifications that the printer was not connected...in excess of 200 messages that the printer was not working which continued to pop up despite me canceling the print job. The whole system got really sluggish (for the first time in the last year) and I had to restart the laptop upon which the boot messages appear.
It gets to the point where its loading the various filesystems. It mounts root and says it fine. Then it says




Code:

/dev/sda3: clean, 171642/915712 files, 1837167/3662820 blocks
/dev/sda2 is mounted.  /dev/sda5 is mounted.

Filesystem check failed.
Please repair manually and reboot. Note that the root file system is currently mounted readonly. To remount it read-write type: mount -n -o remount  ,rw /
When you exit the maintenance shell the system will reboot automatically.

In my system,
/dev/sda1 is Windows XP
/dev/sda3 is root
/dev/sda2 is boot
/dev/sda5 is home

I tried fsck which tells me that home and boot are still mounted.
So I booted up using an Ubuntu Live CD and checked and repaired each file system which it successfully did. Upon rebooting into Arch, I am getting the same message.
I have not installed anything new and had upgraded the whole system a few days before the problem started.
Not sure where to go from here.
Any help, please
Thanks

Samsom

slightlystoopid 01-23-2010 07:48 PM

I've never put /boot on a separate partition, but see if it'll let you "mount -n -o remount,ro /dev/sda2", and if so, "fsck -Ay".

samsom 01-24-2010 02:34 AM

Quote:

Originally Posted by slightlystoopid (Post 3838135)
I've never put /boot on a separate partition, but see if it'll let you "mount -n -o remount,ro /dev/sda2", and if so, "fsck -Ay".

I only put my boot on a separate instruction as per the recommendations on the Arch wiki.

fsck -Ay only checks root as it says that boot and home are still mounted. I hope I don't have to reinstall the whole OS again....

GrapefruiTgirl 01-24-2010 02:39 AM

I have had /boot on a separate partition on my Slackware system in the past, without trouble. Should work OK.

As for the fsck, if you can boot your Arch into init level 1, it should not mount the other filesystems, thereby allowing you to fsck them if needed.
Boot to init 1, log in as root, and fsck the other filesystems if you need to. If they are mounted for some reason, unmount them first.

FWIW, I usually do e2fsck -v -y /dev/blah rather than -Ay, though I am not currently reading the man page to compare the differences. -v -y means verbose + all-yes. PS - Like *stoopid wrote, if you want to fsck the / filesystem, remount it -ro first if it isn't already.

Sasha

slightlystoopid 01-24-2010 02:46 AM

hence the first part of my suggestion: try remounting them both readonly.

EDIT: Sasha beat me. Also, Arch boots into "maintenance mode" (i.e. single-user) on failed fscks, so you shouldn't have to switch to init 1 manually.

samsom 01-24-2010 12:18 PM

Hi,
I have tried using an Ubuntu Live CD again and checked and repaired root, home and boot partitions.
I can mount all the partitions while using the Live CD. I have to log in as root to access my Arch Home folder...I am not sure why. As I can access my Arch Root folder without logging in as root.
I still cannot run fsck on the home and boot folder. When I run fsck, I get the message that the partition is mounted and I risk damage to the filesystem. When I try to unmount the home or boot partition, I get the message
s
umount /dev/sda5: not mounted

I have rechecked my /etc/fstab file and it seems to be OK.
Also, when I run fsck from the Live CD, the filesystems seem OK. So why would it say in Arch that its failing the check?
Is it possible to boot my Arch system without the filesystem check?
Samsom

GrapefruiTgirl 01-24-2010 12:40 PM

If you look at the man page for the "shutdown" command (/sbin/shutdown) you should see a -f option, which means "Skip fsck upon reboot" so a command something like:

shell# sbin/shutdown -rf -t0 now

should shutdown the Arch and reboot it, skipping the fsck. Note that if the filesystem IS actually kinda borked, this risks making it more* borked, so keep that in mind.

Also, if it hasn't been mentioned and you haven't tried it yet, you might try booting from your bootloader with the argument init=/bin/bash which basically boots the kernel and then drops you at the shell prompt. From there, perhaps you can do all the fscks you need to do, and then reboot. NOTE: booting to bash doesn't set PATH variables or other helpful things, so you need to specify the absolute path to even the most mundane things, for example: `ls` might not work, but `/bin/ls` will work.

Sasha

samsom 01-24-2010 01:35 PM

Quote:

Originally Posted by GrapefruiTgirl (Post 3838860)
If you look at the man page for the "shutdown" command (/sbin/shutdown) you should see a -f option, which means "Skip fsck upon reboot" so a command something like:

shell# sbin/shutdown -rf -t0 now

should shutdown the Arch and reboot it, skipping the fsck. Note that if the filesystem IS actually kinda borked, this risks making it more* borked, so keep that in mind.

Also, if it hasn't been mentioned and you haven't tried it yet, you might try booting from your bootloader with the argument init=/bin/bash which basically boots the kernel and then drops you at the shell prompt. From there, perhaps you can do all the fscks you need to do, and then reboot. NOTE: booting to bash doesn't set PATH variables or other helpful things, so you need to specify the absolute path to even the most mundane things, for example: `ls` might not work, but `/bin/ls` will work.

Sasha

Thanks for your advice. But if fsck from Ubuntu Live CD said the filesystem was clean, does that mean that fsck from within Arch is going to be the same.
Samsom

GrapefruiTgirl 01-24-2010 02:02 PM

I would certainly think so. No clue why it would be otherwise :) since clean = clean = clean.

If you discover otherwise, definitely let us know. That would be worth investigating!

samsom 01-24-2010 03:07 PM

@grapefruitgirl
I tried your advice

shutdown -rf -t0 now


And on rebooting, it still gave me the same message.
Any other advice....
Cheers
Samsom

GrapefruiTgirl 01-24-2010 03:32 PM

I admit I'm somewhat at a loss here. From what I understand, all your filesystems are clean, according to Ubuntu LiveCD from where you fscked all filesystems. But when you boot the Arch, it tells you that there are unclean filesystems, but that they are mounted and/or are unclean?

Weird. I wonder, just as an experiment (extremely low-risk experiment, but an experiment nonetheless) can you go to init 1 in the Arch (or maintenance mode, whatever) and do (TYPE CAREFULLY!!!):

rm -Rf /tmp/*
rm -f /etc/mtab

This should clean out your /tmp directory, and delete the mtab file which keeps a list of mounted filesystems.
Now reboot.

Upon reboot, if weirdness still prevails, humor us and post for us the output of:

fdisk -l # <-- that is a lowercase "L"

and paste for us the contents of your /etc/fstab file.

:scratch:

samsom 01-24-2010 04:27 PM

Whoooooppppieeeeeeee........Fixed the bloody problem!!!

Thanks a lot for all your help, everyone.

Quote:

Weird. I wonder, just as an experiment (extremely low-risk experiment, but an experiment nonetheless) can you go to init 1 in the Arch (or maintenance mode, whatever) and do (TYPE CAREFULLY!!!):

rm -Rf /tmp/*
rm -f /etc/mtab

This should clean out your /tmp directory, and delete the mtab file which keeps a list of mounted filesystems.
Now reboot.
I tried it and the problem still persisted. However this time, when I ran fsck, I got a message that since mtab was gone, the system did not know if /home or /boot were mounted and it checked it anyway. Clean ...again.

Just to confirm, I ran the mount command which showed my home and boot partition were mounted in /media instead of /home and /boot.
To be specific, there were 5 new folders in my /media folder named
usbhd-sda1 to 5 which were automatically mounting the sda* to each folder and confusing the hell out of the boot process ( sorry...but I am not clever enough to be any more technical)

I deleted those directories and voila...I am up and running again.
I still don't know how those new folders got created....but fixed for now.
Thanks again Sasha for your help.
BTW Do I need to create another /etc/mtab file or is it automatically created?

Cheers
Samsom

GrapefruiTgirl 01-24-2010 04:32 PM

Wow, cool! Glad you have made some definite progress :)

You should not need to create an mtab file manually. Have a look in /etc and verify that a new one is there automatically.

Also, I think you should look closely into your HAL and/or UDEV (sorry, "UDEV" typo corrected) configuration and/or your fstab file, and examine your mount options to try to learn how this happened. I'd be 'guessing into the wind' if I were to start speculating on how those folders got created, and why and what was getting mounted there :) because you probably DO NOT want this to happen on any sort of regular basis!

If you have no mtab file, we'll deal with that next, so have a look first and make sure it is there (or not).

Sasha

samsom 01-24-2010 04:56 PM

Quote:

If you have no mtab file, we'll deal with that next, so have a look first and make sure it is there (or not).

Sasha
Yup...I have got an /etc/mtab file. Thanks

I suppose that it was a problem with HAL as when I plug in a USB device, it gets auto mounted in a folder in /media.

Code:

[sam@sony etc]$ cat /etc/fstab
#
# /etc/fstab: static file system information
#
# <file system>        <dir>        <type>    <options>          <dump> <pass>
none                  /dev/pts      devpts    defaults            0      0
none                  /dev/shm      tmpfs    defaults            0      0

/dev/cdrom            /media/cd  auto    user,noauto,unhide,exec  0      0
/dev/dvd              /media/dvd  auto    user,noauto,unhide  0      0
#/dev/fd0              /media/fl  auto    user,noauto            0      0
/dev/sda1              /mnt/winxp  ntfs-3g    user



UUID=097bb8f1-7102-4771-b9e1-ec2c320e2f91 /boot ext3 defaults 0 2
UUID=508fd896-693a-4b18-bace-33fdf21c5ebb /home ext3 defaults 0 2
UUID=67354fc4-b077-4436-8624-5122a4bba1e9 / ext3 defaults 0 1
UUID=b8f1730c-a75d-4a91-83d9-b7d11f84fced swap swap defaults 0 0

This is the output of the file for automounting usb devices

Code:

[sam@sony policy]$ cat 20-noatime-removable.fdi
<device>
  <match key="block.is_volume" bool="true">
    <match key="@block.storage_device:storage.hotpluggable" bool="true">
      <merge key="volume.policy.mount_option.noatime" type="bool">true</merge>
    </match>
    <match key="@block.storage_device:storage.removable" bool="true">
      <merge key="volume.policy.mount_option.noatime" type="bool">true</merge>
    </match>
  </match>
</device>

I have a feeling this might be the culprit file, but cannot be certain. if it persists, I might try deleting it and go back to mounting usb devices manually and see if it sorts things out.

Samsom


All times are GMT -5. The time now is 06:41 PM.