[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Serious/urgent Linux boot problem

Posted on 1999-12-06
11
Medium Priority
?
270 Views
Last Modified: 2010-04-20
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.
0
Comment
Question by:alanod
  • 3
  • 2
  • 2
  • +4
11 Comments
 
LVL 2

Expert Comment

by:EatEmAndSmile
ID: 2259466
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
 
LVL 2

Expert Comment

by:Resonance
ID: 2259758
Which GNU/Linux distribution and kernel version are you using?
0
 

Expert Comment

by:lp031097
ID: 2260179
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 new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 

Expert Comment

by:bduk
ID: 2261210
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
 

Author Comment

by:alanod
ID: 2261321
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
 
LVL 2

Expert Comment

by:EatEmAndSmile
ID: 2261402
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
 

Author Comment

by:alanod
ID: 2261485
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
 
LVL 2

Expert Comment

by:EatEmAndSmile
ID: 2261539
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
 
LVL 2

Expert Comment

by:Resonance
ID: 2262593
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
 

Expert Comment

by:babblegeek_
ID: 2263313
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
 
LVL 1

Accepted Solution

by:
tknayak earned 1000 total points
ID: 2264779
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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This installment of Make It Better gives Media Temple customers the latest news, plugins, and tutorials to make their Grid shared hosting experience that much smoother.
Can you run Linux on a Windows system?  Yep.  Here's how.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month8 days, 19 hours left to enroll

590 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question