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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
06-21-2003, 08:31 AM
|
#1
|
LQ Newbie
Registered: Jun 2003
Posts: 11
Rep:
|
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
|
|
|
06-21-2003, 08:35 AM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
you need to specify a partition, not the entire drive. e.g. "fsck /dev/hda1"
|
|
|
06-21-2003, 08:41 AM
|
#3
|
LQ Newbie
Registered: Jun 2003
Posts: 11
Original Poster
Rep:
|
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
|
|
|
06-21-2003, 08:43 AM
|
#4
|
LQ Newbie
Registered: Jun 2003
Posts: 11
Original Poster
Rep:
|
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 10:54 AM.
|
|
|
06-23-2003, 05:44 AM
|
#5
|
LQ Newbie
Registered: Jun 2003
Posts: 11
Original Poster
Rep:
|
Sorry to bring this back to the top but i could still do with a hand of anyone has any ideas.
Thanks
Nask
|
|
|
06-23-2003, 08:24 AM
|
#6
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637
Rep:
|
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.?
|
|
|
06-24-2003, 04:20 AM
|
#7
|
LQ Newbie
Registered: Jun 2003
Posts: 11
Original Poster
Rep:
|
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
|
|
|
06-24-2003, 01:19 PM
|
#8
|
Senior Member
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152
Rep:
|
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.
|
|
|
06-24-2003, 01:31 PM
|
#9
|
LQ Newbie
Registered: Jun 2003
Posts: 11
Original Poster
Rep:
|
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
|
|
|
06-25-2003, 03:43 AM
|
#10
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637
Rep:
|
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.
|
|
|
06-25-2003, 05:05 AM
|
#11
|
LQ Newbie
Registered: Jun 2003
Posts: 11
Original Poster
Rep:
|
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
|
|
|
06-25-2003, 05:19 AM
|
#12
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637
Rep:
|
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).
|
|
|
06-25-2003, 05:38 AM
|
#13
|
LQ Newbie
Registered: Jun 2003
Posts: 11
Original Poster
Rep:
|
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
|
|
|
06-25-2003, 05:45 AM
|
#14
|
LQ Newbie
Registered: Jun 2003
Posts: 11
Original Poster
Rep:
|
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
|
|
|
06-25-2003, 05:53 AM
|
#15
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637
Rep:
|
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 07:23 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|