LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   File system with errors (https://www.linuxquestions.org/questions/linux-newbie-8/file-system-with-errors-67031/)

naski666 06-21-2003 07:31 AM

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

acid_kewpie 06-21-2003 07:35 AM

you need to specify a partition, not the entire drive. e.g. "fsck /dev/hda1"

naski666 06-21-2003 07:41 AM

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

naski666 06-21-2003 07:43 AM

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

naski666 06-23-2003 04:44 AM

Sorry to bring this back to the top but i could still do with a hand of anyone has any ideas.

Thanks

Nask

JZL240I-U 06-23-2003 07:24 AM

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.?

naski666 06-24-2003 03:20 AM

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

moses 06-24-2003 12:19 PM

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.

naski666 06-24-2003 12:31 PM

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

JZL240I-U 06-25-2003 02:43 AM

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.

naski666 06-25-2003 04:05 AM

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

JZL240I-U 06-25-2003 04:19 AM

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).

naski666 06-25-2003 04:38 AM

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

naski666 06-25-2003 04:45 AM

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

JZL240I-U 06-25-2003 04:53 AM

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.


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