Linux - NewbieThis 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.
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.
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?
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,620
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 ... ?
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.
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>?
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,620
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.
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.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,620
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).
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
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,620
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.