LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-21-2003, 07:31 AM   #1
naski666
LQ Newbie
 
Registered: Jun 2003
Posts: 11

Rep: Reputation: 0
File system with errors


Hi everyone,

I am very new to linux and am therefore getting rather worried when i get this message

Checking root filesystem
/ contains a file system with errors, check forced.

Inode 98658 has imagic flag set

/: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY
(i.e., without -a or -p options)

Then some stuff about an error and dropping me into a shell.
SO i type fsck as it asks and it asks for a device to be checked

so which one do i pick? i randomlly picked (well after a bit of internet seraching) hda

so i type (i'm that new i'd better write this otherwise i might just be getting my command wrong!)

fsck /dev/hda
it says
Paralleling fsck version 1.23 (15-Aug-2001)
e2fsck 1.23, 15-Aug_2001, trying for backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open dev/hda

The superblock could not be read or does not describle a correct ext2 filesystem. If the device is valid and it really contains an ext2 filesystem (and not swap or ufs or something else) then the superblock is corrupt, and you might try running e2fsck with an alternative superblock: e2fsck -b 8193 <device>

Bugger i say and try e2fsck -b 8193 /dev/hda

It then returns with this

e2fsck: Bad magic number in super-block while trying to open /dev/hda

then the same message about ext2 filesystems that i mentioned above.

I'm somewhat lost and scared (I won't mention as yet what data is on this linux box as yet but lets say it's fairly important to me). Can anyone help?

Cheers

Nask
 
Old 06-21-2003, 07:35 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966
you need to specify a partition, not the entire drive. e.g. "fsck /dev/hda1"
 
Old 06-21-2003, 07:41 AM   #3
naski666
LQ Newbie
 
Registered: Jun 2003
Posts: 11

Original Poster
Rep: Reputation: 0
OK

tried hda1with both the fcsk and e2fsck -b 8193 /dev/hda1 commands

Same superblock error i'm afriad (Bad magic number in super-block while trying to open /dev/hda1).

Thanks for the swift reposnse anyway!

Nask
 
Old 06-21-2003, 07:43 AM   #4
naski666
LQ Newbie
 
Registered: Jun 2003
Posts: 11

Original Poster
Rep: Reputation: 0
tried again with hda3 as my harddrive is hda3 (that would have been a better place to start probably). but now it says

e2fsck: Attempt to read block from filesystem resulted in short real while trying to open /dev/hda3
could this be a zero length partition?

Can anybody out there give me their thoughts please (well if relavent i don't want pages and pages about surreal ramblings!)

Nask

Last edited by naski666; 06-21-2003 at 09:54 AM.
 
Old 06-23-2003, 04:44 AM   #5
naski666
LQ Newbie
 
Registered: Jun 2003
Posts: 11

Original Poster
Rep: Reputation: 0
Sorry to bring this back to the top but i could still do with a hand of anyone has any ideas.

Thanks

Nask
 
Old 06-23-2003, 07:24 AM   #6
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,675

Rep: Reputation: Disabled
Last post first: Your drive is hda, not hda3 <- that's the third partition on hda (first IDE-master on system bus). I don't think zero-length-partitions are useful, but maybe somebody knows their use ... ?

Your file-system is ext2?!?

Have you checked /etc/fstab? Is it o.k.?
 
Old 06-24-2003, 03:20 AM   #7
naski666
LQ Newbie
 
Registered: Jun 2003
Posts: 11

Original Poster
Rep: Reputation: 0
yeah it is ext2, I'll check etc/fstab as i type on the other pc.

How do i check etc/fstab though, the same as fsck /etc/fstab

Right tried that and is says :
Attempt to read block from filesystem resulted in short read while trying to open /etc/fstab

Bugger!

ANy more clues out there please people?

Nask
 
Old 06-24-2003, 12:19 PM   #8
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 46
The /etc/fstab is the filesystem table that tells mount which file systems to mount at boot time (among other things). This will only tell you which filesystems are mounted where.
What you want to watch for is during boot, just before the filesystem with errors message it will say something about checking the filesystem /dev/hda# where # is the number you are interested in. If this message scrolls off of the screen, you can use Shift-PgUp key combination to page up half a page at a time.
Once you figure out which filesystem to check, use the command:
Code:
/sbin/e2fsck /dev/hda#
or
/sbin/e2fsck -v -y /dev/hda#
where # is the number you get from reading the warning messages before the error message. The -v -y options tell fsck to assume you want the "yes" answer to every question and to tell you what is going on. The yes answer can be dangerous, but it is also sometimes the only way to fix a filesystem without going through 10000 inodes by hand. You need to read the e2fsck man page (available on LQ) before you start blithely messing with filesystems.
 
Old 06-24-2003, 12:31 PM   #9
naski666
LQ Newbie
 
Registered: Jun 2003
Posts: 11

Original Poster
Rep: Reputation: 0
right on the bootup it says to me

actvating swap partitions: swapon /dev/hda5 invalid argument

so i tried the

/sbin/e2fsck /dev/hda5

It then returns with the message

The filesystem size (according to the superblock) is 4096543 blocks
The phsyical size of the device is 514048 blocks
Either the supblock or the partition table is likely to be corrupt!
Abort<y>?

I type no it says

/dev/hda5: clean 11/1026048 files, 137789/4096543 blocks

What now??

Cheers

Nask
 
Old 06-25-2003, 02:43 AM   #10
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,675

Rep: Reputation: Disabled
Can you start fdisk? If so, what does it tell you about your hda5? If you are sure that hda5 is your swap, then simply delete it and create it again with the correct / desired parameters.
 
Old 06-25-2003, 04:05 AM   #11
naski666
LQ Newbie
 
Registered: Jun 2003
Posts: 11

Original Poster
Rep: Reputation: 0
ok then i did fdisk /dev/hda5 and it now says the following

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memopry only until you decide to write them. After that, of course, the previuos content won't be recoverable

Command (m for help)

NOW WHAT??! I've quit out of it as i don't want to break anything but some (more, thank you) help is required.

Cheers

Nask
 
Old 06-25-2003, 04:19 AM   #12
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,675

Rep: Reputation: Disabled
Quote:
Originally posted by naski666
ok then i did fdisk /dev/hda5 and it now says the following
...
NOW WHAT??!
Well, /etc/fstab should tell whether your hda5 is swap or something else. If it is swap, according to /etc/fstab, you can safely delete it (assuming you don't just run important swapping applications ) and recreate it. It will then be swap == type 83 in fdisk (I think).
 
Old 06-25-2003, 04:38 AM   #13
naski666
LQ Newbie
 
Registered: Jun 2003
Posts: 11

Original Poster
Rep: Reputation: 0
apologies for being dumb but i've having [probelms with fstab as well now

WHat do i type? I've tried

/etc/fstab and it says premission denied (I'm logged in as root).

ALso i tried to look at fdisk /dev/hda5 what specifically do i press (i know i'm being soft here nto trying something but there is data onthis machine that i'd like to keep!). The linux swap file is type 82 by the way

Nask
 
Old 06-25-2003, 04:45 AM   #14
naski666
LQ Newbie
 
Registered: Jun 2003
Posts: 11

Original Poster
Rep: Reputation: 0
anyway looked at fdisk /etc/hda and printed out what it saw

hda1 Win95 FAT32
hda2 Win95 EEXTENDED
hda5 Linux swap
hda6 Linux
hda7 Win95 FAT32

So hda5 is defo my swap partition, all i need to do now is delete it and remake it? WIll i be able to do this without losing data from hda6.

Cheers Nask
 
Old 06-25-2003, 04:53 AM   #15
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,675

Rep: Reputation: Disabled
cat /etc/fstab lists the contents of /etc/fstab. You should find ount from them, where your swap is supposed to reside (hda5??).

Use fdisk -- help or fdisk m (?) for the options.

Oops you posted another one. Yes, you can delete partitions without danger to other parts of your hd. But: recreate it at once, without rebooting, else your partitions won't match /etc/fstab and then God help any beginners (I did it once...).

Oh yes, best recreate it like it was / should have been, fstab will help you there.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Root file system errors - won't boot shan Linux - General 4 12-24-2005 01:20 PM
file system errors mandrake 10.1 tewaru Mandriva 7 07-22-2005 05:22 PM
Errors on Boot: Read-Only file system DrJones Linux - General 1 02-15-2004 04:03 AM
How to check file system for errors? subzero0 Mandriva 19 09-02-2003 07:52 PM
file system errors in RH7.0 Nellie Linux - Newbie 1 08-12-2001 12:47 PM


All times are GMT -5. The time now is 02:24 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration