After rebooting (LILO installed), I get as far as the message "Warning:
unable to open an initial console", then the system hangs.
Is this recoverable?
I intend to boot from the tomsrtbt floppy, then do
fdisk /dev/hda1
fdisk /dev/hda2
fdisk /dev/hda3
fdisk /dev/hda4
(No, I don't have a record of the partition table. I got the machine
with Linux already installed. I know it's very simply partitioned.)
Will this fix it? What else might I have to do?
I have read the HOWTOs and googled extensively, but can't find a way out
for this particular situation.
It's basically a single boot Debian (stable) system with kernel 2.2.19
on a Toshiba laptop.
Any help much appreciated.
> It's likely that I have deleted part or all of /proc while under the
> influence of midnight root madness.
You *can't* delete /proc - it's all generated dynamically by the kernel
>
> After rebooting (LILO installed), I get as far as the message "Warning:
> unable to open an initial console", then the system hangs.
>
IIRC you can tell the kernel which console to use by doing something like
linux console=/dev/tty at the lilo prompt (?)
Hmm. It sounds as it you've deleted something fairly major
> Is this recoverable?
>
> I intend to boot from the tomsrtbt floppy, then do
>
> fdisk /dev/hda1
> fdisk /dev/hda2
> fdisk /dev/hda3
> fdisk /dev/hda4
fdisk is for altering the partition table - you need to give it the whole
disk as an argument (i.e. fdisk /dev/hda) rather than individual
partitions.
> Will this fix it? What else might I have to do?
fsck ing the individual partitions may (or may not) help. Can you mount
the partitions from tomsrtbt?
If you can do this you could at least recover any data.
Depending on how broken it is, how bothered you are about restoring your
configuration and how much experience you have you can either try and fix
it or just reinstall.
HTH
Rob
--
______________________________________________________________
| o o ^ |Robert Horton --- ro...@informatics.bangor.ac.uk
| | / \ |School of Informatics
| \___/ / o \ |University of Wales, Bangor
| / o \|http://www.informatics.bangor.ac.uk/~robh
|_______/_______|______________________________________________|
> It's likely that I have deleted part or all of /proc while under the
> influence of midnight root madness.
>
> After rebooting (LILO installed), I get as far as the message "Warning:
> unable to open an initial console", then the system hangs.
It seems unlikely on the face of it that deleting /proc would cause
this kind of hassle; it's a virtual file system, and I don't think you
can delete entries in it anyway. One thought, though; each process'
directory has various symlinks to the CWD, root directory, executable,
etc. Perhaps an over-enthusiastic rm followed these links (I don't
know how you'd persuade it to do that, mind).
[ ... ]
> I intend to boot from the tomsrtbt floppy, then do
>
> fdisk /dev/hda1
> fdisk /dev/hda2
> fdisk /dev/hda3
> fdisk /dev/hda4
[ ... ]
> Will this fix it? What else might I have to do?
No. fdisk operates on devices, not partitions. If you want to
recreate the partition table, you'd need to do `fdisk /dev/hda' and
exactly recreate it. If you're lucky, there might be a backup
somewhere, though I dunno. I do know that there are backups of each
filesystem's superblock (see the mkfs manpage), which may or may not
help.
It sounds like your problem isn't caused by deleting /proc at all, but
possibly by some other kind of deletions. If I was in your shoes (or
at your keyboard), I'd boot from a rescue disk (possibly the Debian
CD, or tomsrtbt, or other bootable cd/floppy) and try to discover what
state the system is in, and what might have caused it.
Useful diagnostics might include trying to mount your partitions, with
various options for the location of the superblock, running fsck on
your partitions, and using `fdisk -l' to see what the system thinks
its partition table is. Probably not in that order, now I think of it
(I might try, fdisk -l first, then fscking, then mounting) None of
these should do any harm (only the fsck will change anything, and then
only to repair inconsistencies).
The failure to open the initial console indicates non-filesystem
related trouble (I think); perhaps trouble in /dev, or problems with
the kernel. More info on the boot messages would help here.
HTH,
Stephen
--
1017951100
>It's likely that I have deleted part or all of /proc while under the
>influence of midnight root madness.
Unlikely, since /proc is a virtual filesystem which is created at boot
time. However, if you did manage to corrupt it while the system was
running it may have made a mess of shutdown (among other things it can
lose te information about what is mounted).
>After rebooting (LILO installed), I get as far as the message "Warning:
>unable to open an initial console", then the system hangs.
I've had that, in my case it was something to do with the video card not
being properly supported (or being faulty). What comes up before it?
How far does it get before it says that?
>Is this recoverable?
Since you are running LILO, try booting with the command "linux s" to
bring it up in single-user mode.
See http://sdb.suse.de/en/sdb/html/initial_console.html for more
suggestions (they are based on SUSE but should mostly work).
Note that the permissions of /dev/tty1 (and the others) need to be 0622
(rw for root and w for everyone else). Doing ls -l should look like:
crw--w--w- 1 root root 4, 1 May 31 19:44 /dev/tty1
>I intend to boot from the tomsrtbt floppy, then do
Or do that...
>fdisk /dev/hda1
>fdisk /dev/hda2
>fdisk /dev/hda3
>fdisk /dev/hda4
Just fdisk /dev/hda, it will tell you the partitions on it. Personally,
I use PartitionMagic for partition management. Yes, it's Windoze, but I
have it on floppies so it can be used to boot any machine. It will even
copy, resize and move Linux ext2 partitions (I don't know about ext3
ones).
>Will this fix it? What else might I have to do?
In the extreme you might have to reinstall Linux. I'm pretty sure it
can be solved without such extreme measures, though.
>I have read the HOWTOs and googled extensively, but can't find a way out
>for this particular situation.
>
>It's basically a single boot Debian (stable) system with kernel 2.2.19
>on a Toshiba laptop.
That's the kernel I'm using on three of my machines (not my laptop,
though, that's still running Debian 2.0 hamm).
>Any help much appreciated.
Good luck...
Chris C
Thanks for the suggestions.
I got in using the floppy and found that, indeed, /dev/console was
missing. Unfortunately, everything in /etc, /bin and /boot is missing
and not backed up. I tried to use Tom Pycke's recover, but it crashed.
All the other stuff seems to be there.
Can I do a partial install that leaves the rest of the filesystem
intact? Or is a re-install the answer?
--
not a happy bunny
>I got in using the floppy and found that, indeed, /dev/console was
>missing. Unfortunately, everything in /etc, /bin and /boot is missing
>and not backed up. I tried to use Tom Pycke's recover, but it crashed.
>All the other stuff seems to be there.
Ouch!
>Can I do a partial install that leaves the rest of the filesystem
>intact? Or is a re-install the answer?
Assuming that you haven't got too much customised (and if you've lost
/etc then you've probably lost most of the customisations anyway), do a
re-install. Debian should just overwrite the existing files with the
ones from the install CD. Several points:
* Don't let it re-fdisk partitions. Tell it that you have existing
partitions and where to mount them (you'll need to do this several
times, and you may need to mount each partition using the recue disk
first to see what's in each one if you don't remember where they
were mounted).
* Let it install all the boot stuff, drivers, etc.
* When it comes to the "select packages" stuff, abort at that point.
Tell it you don't want anything, or when you get into dselect tell
it to exit without doing anything.
After that, let it boot and try to determine what (if anything) is
faulty. After /that/, you can run dselect again to select packages you
want, etc.
In the extreme, back up anything you want and re-install from scratch,
then copy the stuff back.
I'll tell you one thing which will be broken, and that's the X
configuration because that's mostly under /etc which you have lost. You
may have to re-install that, and sorry it's likely to be a pain on a
laptop (you may be lucky, I wasn't). Did you say you got it from a
friend? They may be able to help there.
Good luck!
Chris C
In the end I used the lnx-bbc mini-Linux/rescue CD
(http://www.lnx-bbc.org/ ). This allowed me to mount a zip drive, using
which I was able to save the old /usr and /home contents. I then (with
little regret, frankly) scrapped Debian and installed RedHat 7.2.
Luckily I had carefully logged the (rather limited) customisations I had
carried out on the Debian system, so after a few teething problems with
(surprise, surprise) XF86Config and ppp, I now have a restored system.
Importantly, the zip drive could now be mounted with ease, unlike with
Debian which had all sorts of problems in this area that eventually
precipitated the original munging.
Thanks for all the help.
--
MS Word: smart quotes, stupid program