Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Hello, I have recently installed Gentoo Linux on one of my computers. Everything worked without a hitch until yesterday. I was in the middle of an X-Windows session when my speakers began to ping, reaching down to adjust the sound cable I interrupted the power source of the computer by pulling the power cable. The machine turned off. I then said 'shit' and turned the computer back on. It booted with a good amount of error messages. I was able to login, however now all of my commands had gone missing, any command ls, cd, etc seemed to have not been found once entered at the command prompt. I then reset to see if it was just a temporary problem. After rebooting I found that there is now a kernel panic
is_tree_node: node level does not match to the expected one 1
vs-5150: search_by_key: invalid format found in block 8211. Fsck?
vs-13070: reiserfs_read_inode2: i/0 failure occurred trying to find stat data of [1 2 0x0 SD]
VFS: Cannot open root device "hda3" or 03:03
Please append a correct "root=" boot option
kernel panice: VFS: Unable to mount root fs on 03:03
My assumption is that during the power interruption, a few sectors on my hardrive could have been corrupted. I have never run into a problem as this. I am wondering if there is a way to fix this. I can obviously still use grub, is there a way in which I may use grub to remedy the situation? Should I prepare myself to learn again by installing Gentoo? Thank you for your help good kind sirs/siresses.
Boot a rescue CD. Then use fsck against each of your hard disk partitions:
Then boot Red Hat again. Anything that is still missing is lost. You can restore what you have lost from backup or by reinstalling individual rpms. If what is missing is a very big mess then save as much of you data as you can and reinstall.
"Do you have any clue as to what demons could have gotten inside of my computer and ruffed up my hardrive?"
Linux uses a disk cache to speed up access to your hard drives. When you power off abruptly then there are buffers in the cache that do not get written out to the hard drive and so the data on the hard drive is mangled. Normal the cache is all written out during normal shutdown.
There is some redundency in the information on the hard drive so fsck figures out the mess as best it can and puts everything back in place. fsck is remarkable successful. But fsck may find files or file fragments which it cannot figure out where they belong. It will put these files in a directory called lost+found. There is one lost+found on each of your partitions. You should look in all of your lost+found directories and see if fsck left any orphans there.
After performing a fsck on my root drive, I tried booting. The kernel or whatever tries to mount the root partition was sucessful, however it needed an init= option to be given to the kernel. I tried /sbin/bash, this did not seem to work, however this is undiscovered territory for me. Anyhow, I then booted my system with a CD using the Gentoo boot install disk, which takes me to a command prompt contained on the CD. I then proceeded to mount my hardrive and have found that the only directory on the drive is the lost+found directory. Does this mean that fsck did not know what to do with anything on my hardrive? Is there anyway to recover the information? Thank you again for your help
After reading your post I have the impression that you have /boot on a partition and that /boot is OK. You also have a root partition on /dev/hda3 and the only thing you can find in the root partition is lost+found.
When fsck examines a damaged partition if there is no lost+found directory then fsck will create one. Look at the creation date on lost+found to determine if lost+found was created when you installed Linux or if it was created by fsck. fsck cross checks your file sytem five different ways and tries to figure out what everything is and where it belongs. Things that fsck finds but does not know where they belong are given a number and placed in lost+found. If fsck put anything in lost+found it will be a file with a number for a name. You have to figure out what it is by examining its contents and either moving the numbered file to where it belongs or otherwise recreating that file.
If there are no files on the root partition, lost+found is empty, and lost+found was created by fsck then that means that fsck found a completely empty partition. The only way that I can see that happening from a power failure is if the partition table was clobbered.
Another possibility is that you may have your partition numbers mixed up and be working on recovering the swap partition instead of the root partition. Do you have a swap partition on /dev/hda2?
"Is there anyway to recover the information? "
If fsck cannot find your data then the data is lost.
But I would like to emphasize that a power failure causing a partition to completely disappear without leaving even a few fragments for fsck to find is very unlikely. So you should triple check /dev/hda3 (or wherever your root partition is) before you declare your system dead.
The lost+found directory was created by fsck, the date is set to yesterday (the day I ran fsck)
I have now moved all the directories with items which I knew their proper location. Which are the important directories:
/sbin, /bin, /etc, /lib, /dev, /mnt, /usr, and /home
(still in the lost+found directory are many lost files, mostly executables, 3 directories and some others)
It seems the important files within the known directories are still intact. I don't believe that my problem involves any of the many executables in lost+found. My problem is that when I boot I get this message:
Seeing this I think that the problem is with the /sbin/rc binary file, I check for it to see if it exists, it does. I then check to see if it is executable, and it is. Performing a 'ls -l /sbin/rc' reveals this:
-rwxr-xr-x 1 root root 16372 Nov 8 20:30 rc
To me this looks in order, however INIT seems to not be able to execute this program. I do not know why... I have renamed the numbered folder that contained the files native to sbin "sbin" and placed it in the root directory. I ran the rc file that was on the hardrive in the /sbin directory using my boot CD to get to a command prompt to make sure it is not curupt, and it ran(not doing anything worthwhile). I am totally lost on this one, any help would leave me with a smile as I slip into slumber this eve.
I chmod 755'ed /sbin, / and made sure that rc had permissions 755. This gave me the same error, so I tried placing the simple rc file from my Gentoo CD in the /sbin directory, saving a backup copy of the old rc file. The same error occurs again. What does this sound like? It seems that /sbin/rc should be able to be executed since the disk is mounted and the file is intact and in the proper location. I am using reiserFS if that makes any difference. Any ideas? Or should I begin the journey installing Gentoo again? Thanks for your help
" I am using reiserFS if that makes any difference."
Perhaps your rescue system and your desktop system disagree on what type of file system is mounted on /dev/hda3. Presumably your desktop system is getting the file type from /etc/fstab and presumably /etc/fstab says that /dev/hda3 is reiserfs.
When you mount /dev/hda3 from your rescue system are you specifying a file system type, i.e. are you using something like:
mount -t reiserfs /dev/hda3 /checkitout
or are you using something like:
mount /dev/hda3 /checkitout
If you are not specifying -t then you are mounting it as ext2. Whatever you are mounting it as is working.
Back when you first ran fsck against /dev/hda3 I did not think to have you run fsck.reiserfs. fsck is actually a front end for a whole lot of file system type dependent programs. The main fsck identifies the file system type from either the command name or by examining the file system. Suppose that the reiserfs file system was so corrupt that fsck did not recognize what it was and chose the default, ext2. Then it rebuilt an ext2 file system which it thought was completely scrambled because it was actually a reiserfs.
This is a whole lot of speculation on my part but it is easy to test. If you are mounting /dev/hda3 as ext2 on the rescue CD then try changing /etc/fstab to make /dev/hda3 ext2 and see what happens. This idea is somewhat farfetched but I am fast running out of reasonable guesses.