Serious/urgent Linux boot problem

Linux boots up and can not mount the root filesystem. When I boot in single user mode, it mounts okay, but only in read-only. How can I cure this? Networking doesn't work and I can't mount a floppy in read-only, so I am unable to transfer any data from the machine to recover it. (If only I can get the data from the machine I'll be okay).
Machine has a tape drive, but is not configured. I've tried mounting on st0, but this is not recognised.
Thanks in advance.
alanodAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

EatEmAndSmileCommented:
You can't mount a tape because it's not a block device. In order to use a tape, you have to use the streamer archiver (tar). Just do the following:

tar -cvf /dev/st0 /path/to/dir

Where ¨/path/to/dir¨ is the path to the directory or file you want to backup. If you have more than one directory you'd like to back-up, you could do:

tar -cvf /dev/st0 /dir1 /dir2 /file1 /file2

 Good luck!
--------------_4D4800F8A584BFFFEDD4
Content-Disposition: form-data; name="notify"

on
--------------_4D4800F8A584BFFFEDD4
Content-Disposition: form-data; name="Submit"

Submit
--------------_4D4800F8A584BFFFEDD4--
0
ResonanceCommented:
Which GNU/Linux distribution and kernel version are you using?
0
lp031097Commented:
You can't mount the root filesystem?  Do you have ext2 filesystem support compiled into your kernel?  If not, and you're using it as a module, the module auto-loader might not be working right.  Otherwise, your /etc/fstab might be screwed up.  

Two questions:
1- are you using the kernel that came with the distribution or a recompiled one?
2- did it ever work or is this a post-installation problem?
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

bdukCommented:
If you're using an ext2 filesystem as root, you can't compile the kernel to use ext2 as a module because it can't load the root filesystem to get the module to load the root filesystem, I think...?

Any chance you have a LILO misconfiguration giving the wrong root partition?
0
alanodAuthor Commented:
I'm using RedHat6.1 on an Intel machine using a SCSI drive. It's an ext2 filesystem and the setup is very basic:

/boot on /dev/sda1
/ on /dev/sda5
(and a swap aswell)

If I don't start in single user mode I get "Kernel Panic : unable to mount root on fs 08:05"

I get this even if I prompt LILO and enter root=/dev/sda5 - it still can't mount it.

The set up I have used to work for about a month and then yesterday I rebooted the machine and then this happened.

As far as the tape device goes, I can't get that to work because I have never set one up in the past and the /dev/st0 device doesn't even exist.

Now in single user mode, I can't change the configuration a bit because the system won't let me write to disk.

Thanks for your responses by the way.
0
EatEmAndSmileCommented:
Is the tape device recognized or boot-up? Or you just can't see it because you're using RedHat? RedHat? Oh, no, no, no... :)
--------------_4D4800820528BFFFEDD4
Content-Disposition: form-data; name="notify"

on
--------------_4D4800820528BFFFEDD4
Content-Disposition: form-data; name="Submit"

Submit
--------------_4D4800820528BFFFEDD4--
0
alanodAuthor Commented:
Well, not quite sure about this (I'm quite new to Linux - NT convert). When I issue the tar command that you gave me, it says that the device doesn't exist.
0
EatEmAndSmileCommented:
Try this:

cd /dev
ls -ld st*
ls -ld rmt*

See if you get any devices listed.

In Linux (Caldera, Debian, Slackware, etc...) you can see which devices your kernel is detecting at boot up, because it just shows it on the screen. On RedHat, this doesn't happen. You'll have to ¨guess¨ which device is your tape. You can do that by testing all devices, one by one with the tar command, like:

 tar -tvf /dev/st0
 tar -tvf /dev/st1
 tar -tvf /dev/st2
 ...

 Or,

 tar -tvf /dev/rmt0
 tar -tvf /dev/rmt1
 tar -tvf /dev/rmt2
 ...

 This won't be possible on your current damaged installation, but once you send RH to hell and re-install Linux you should make a symlink from your tape device to /dev/tape. Creating symlinks to I/O devices give you the benefit of buffers managed by Linux.

 Another idea would be mounting your HD in another machine (or as slave in your own, with a new HD as master), then you could back-up your data easily.

 Good luck!
--------------_4D480098BE58BFFFEDD4
Content-Disposition: form-data; name="notify"

on
--------------_4D480098BE58BFFFEDD4
Content-Disposition: form-data; name="Submit"

Submit
--------------_4D480098BE58BFFFEDD4--
0
ResonanceCommented:
You'll also get the "device does not exist" if the module supporting it (in this cape, the tape device) hasn't been loaded.

You may need to generate a boot/root pair of floppies (you can do this by downloading the images and then using rawrite from DOS box somewhere, if you can't find dd on a linux box somewhere else), and use those to get into your system, or boot from a CD-ROM.  If you can get a rescue image started, you can then do

mount /dev/sda8 /mnt

and see if that works.

If you do manage to get your system backed up, I would have to recommend wiping it and reinstalling it, preferably with something other than Redhat (I recommend Debian).  I can't be certain that it's Redhat's fault, but this wouldn't be the first time I've seen their distro have a complete meltdown.  The only other cause I can think of is a hardware failure.
0
babblegeek_Commented:
For this kind of troubleshooting, tom's root/boot is invaluable. Get it at:

http://www.toms.net/rb/home.html

Despite the fact that RedHat doesn't show devices loading at boot time, you should still see the dispostion of the devices when you execute:

dmesg

in single user mode (if you can).

In single user mode, try:

fsck /dev/sda5

Finally, this seems an odd layout in that the root partition is mounted on an extended partition rather than a "top level" partition. It's possible that the extended partition has been damaged by another OS on the system. tom's root/boot should allow you to boot from floppy and run fdisk and fsck to check the partitions.
0
tknayakCommented:
Get 2 floppies .
create an boot floppy and one rescue floppy
i assume u have the boot.img file and rescue.img file with u in ur CD or whatever .. go to the images/ dir ..
create boot floppy using
dd if=boot.img of=/dev/fd0

for creating rescue floppy

dd if=rescue.img of=/dev/fd0

then first use the boot floppy and
at the prompt boot: type rescue
and insert the rescue floppy when it asks u for the root floppy ..
now u will be given a shell to do whatever with ur system .. but be sure of what u do .. u can bring another harddisk and copy ur files to there .. or whatever ..
u make a temp dir in the / and mount ur root partition as
mount /dev/sda5 /temp
then check for the configurations .. if u have anything changed in /etc/lilo.conf file or /etc/fstab file ..correct it .. unmount the /temp dir after making necessary changes..dont worry u will have write permission .. well. good luck and I bet ur problem is solved . ..:)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.