old-www/LDP/LG/issue44/tag/38.html

311 lines
10 KiB
HTML

<!--startcut ======================================================= -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<META NAME="generator" CONTENT="lgazmail v1.2M.j">
<TITLE>The Answer Guy 44: Persistent LILO: Won't Start! Won't Go Away!</TITLE>
</HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000"
LINK="#3366FF" VLINK="#A000A0">
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<H4>"The Linux Gazette...<I>making Linux just a little more fun!</I>"</H4>
<P> <hr> <P>
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<center>
<H1><A NAME="answer">
<img src="../../gx/dennis/qbubble.gif" alt="(?)"
border="0" align="middle">
<font color="#B03060">The Answer Guy</font>
<img src="../../gx/dennis/bbubble.gif" alt="(!)"
border="0" align="middle">
</A></H1>
<BR>
<H4>By James T. Dennis,
<a href="mailto:linux-questions-only@ssc.com">linux-questions-only@ssc.com</a><BR>
LinuxCare,
<A HREF="http://www.linuxcare.com/">http://www.linuxcare.com/</A>
</H4>
</center>
<p><hr><p>
<!-- endcut ======================================================= -->
<!-- begin 38 -->
<H3 align="left"><img src="../../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>Persistent LILO: Won't Start! Won't Go Away!</H3>
<p><strong>From Teemu Pentinsaari on Wed, 28 Jul 1999
</strong></p>
<p><strong>
hi,
</strong></p>
<p><strong>
I'm having alot of trouble getting LILO off my MBR, it stays like
glued and I don't know what to do anymore.
</strong></p>
<p><strong>
I had fully workin Linux Redhat and everything was going fine, but
then I tryed to get lilo off the mbr and the sunshine stopped. My
computer hangs up in booting showing only first two letters of
lilo, then whatever you do, it hangs up. I have wiped out my hd
using Linux-fdisk, dos f-disk, partition magic 3 and NT40
installation partitioning tool, I have convertted my hd to ntfs
back to fat and again to ext2 but LILO is still sitting on my
MBR. I have spent last 26 hours trying to get it off the MBR from
running Linux , I have tryed to use lilo -param -param commands
but they wont resolve my poblem.
</strong></p>
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
The easiest way to <em>wipe</em> your MBR and partition table
on a Linux box is with a command like:
</blockquote>
<blockquote><code>
dd if=/dev/zero of=/dev/hda count=1 bs=512 && sync && echo done.
</code></blockquote>
<blockquote>
... if you see it echo "<tt>done</tt>" then you have successfully
wiped the partition table and MBR on your first IDE drive.
(Use <tt>/dev/sda</tt> to blow away your first SCSI drive).
</blockquote>
<blockquote>
Nota Bene: THIS WILL RENDER YOUR SYSTEM NON-BOOTABLE AND
MAKE ALL OF YOUR FILES AND FILESYSTEMS ON THAT DRIVE
INACCESSIBLE!
</blockquote>
<blockquote>
(I hope you knew that).
</blockquote>
<blockquote>
It would help quite a bit if you told me which <tt>-param -param</tt>
you were using. It would help even more if you issued a
command like:
</blockquote>
<blockquote><code>
lilo -v -v -v &> /tmp/lilo.out
</code></blockquote>
<blockquote>
... and included the <tt>lilo.out</tt> file in your next message.
The <tt>-v</tt> options will make the /sbin/lilo boot map updater
VERY verbose. (My simplest system generated about 70 lines
of output from this command).
</blockquote>
<P><STRONG><IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
what can I do ?
</strong></p>
<p><strong>
Is there a handy way to read MBR in binary ?
</strong></p>
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
><code>
dd if=/dev/hda count=1 bs=512 | od -x
</code></blockquote>
<blockquote>
... you can pipe the output from this dd command into
any number of utilities to render relatively readable
encodings of the data. For example you might use:
</blockquote>
<blockquote><code>
dd if=/dev/hda count=1 bs=512 | cat -v
</code></blockquote>
<blockquote>
... to look for ASCII strings embedded in the mix.
</blockquote>
<P><STRONG><IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Is there other commands than <tt>lilo -param</tt> to edit MBR ?
</strong></p>
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Any good disk/binary editor should do it. There are
several hex/binary editors for Linux. One way would be
to use dd to capture the data then run emacs on the
temporary file. You can use emacs and xemacs to
edit in hex using the command: M-x <tt>hexl-mode</tt>
</blockquote>
<blockquote>
(Note: if you use viper mode, the vi emulation package
that I use, then you'll want to use C-z to suspend your
viper keybindings while you use hexl-mode's bindings).
</blockquote>
<blockquote>
There's also '<tt>beav</tt>' (Binary editor and viewer), <tt>lde</tt>
(Linux Disk Editor), <tt>bvi</tt> (Binary vi) and a number of
others for Linux.
</blockquote>
<blockquote>
None of these has the features that I liked in the
old MS-DOS hex editors like Norton's DiskEdit and
Paul Mace's MUSE. It would be nice if lde were extended
with a set of templates that matched various C struct's
(data structure definitions) for things like partition
tables, superblocks, inodes, etc, and if you could easily
bounce from partition table to superblock to directory
and from directory entry, to inode, to corresponding
data blocks and extent (indirect) blocks, and through the
free list and bad blocks "file") (i.e. add extra navigation
commands).
</blockquote>
<blockquote>
However, I'm certainly not enough of a expert in low-level
Linux disk and data structures to write the code for any
of that. '<tt>lde</tt>' looked like the most promising of these that
I've see so far. It supports color ncurses and recognizes
some data structures (though it's a bit confusing and could
use quite a bit more documentation).
</blockquote>
<P><STRONG><IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
thanks a lot,
<br>Teemu Pentinsaari
</strong></p>
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
In the worst case (assuming you have a full backup) try:
</blockquote>
<blockquote><code>
dd if=/dev/zero of=/dev/hda
</code></blockquote>
<blockquote>
... to write a stream of ASCII NULs over the whole disk.
(This is presuming that you boot from a rescue/destroy
floppy, of course).
</blockquote>
<blockquote>
Fans of the old Norton "DiskWipe" utility could use
a simple shell script on their Tom's Root/Boot
(<a href="http://www.toms.net/rb/"
>http://www.toms.net/rb/</a>) which was just a for loop like:
</blockquote>
<blockquote><pre>
for i in 0 1 2 3 4 5 6 7 8 9 ; do
dd if=/dev/zero of=/dev/hda bs=1024k; sync
dd if=/dev/urandom of=/dev/hda bs=1024k; sync
done
dd if=/dev/zero of=/dev/hda; sync
</pre></blockquote>
<blockquote>
... which would make about ten passes over the disk
with ASCII NULs and random bits. It might take all night,
but I don't that even the super spooks with the forensic
micro-electron-magnetoscopy (or whatever it's called) would
get the goods on you when you were done.
</blockquote>
<blockquote>
Any way --- lilo's <tt>-v</tt> (verbose) is one of your friends.
'<tt>dd</tt>' (the UNIX data dumper) is another. Make their
aquaintance and SQUASH THAT BOOT RECORD!
</blockquote>
<!-- sig -->
<!-- end 38 -->
<!--startcut ======================================================= -->
<P> <hr> <P>
<H5 align="center"><a href="http://www.linuxgazette.com/copying.html"
>Copyright &copy;</a> 1999, James T. Dennis
<BR>Published in <I>The Linux Gazette</I> Issue 44 August 1999</H5>
<H6 ALIGN="center">HTML transformation by
<A HREF="mailto:star@starshine.org">Heather Stern</a> of
Starshine Techinical Services,
<A HREF="http://www.starshine.org/">http://www.starshine.org/</A>
</H6>
<P> <hr> <P>
<!-- begin tagnav ::::::::::::::::::::::::::::::::::::::::::::::::::-->
<TABLE WIDTH="98%"><TR VALIGN="center" ALIGN="center">
<TD ROWSPAN="2" COLSPAN="3" WIDTH="42%"><A
HREF="../lg_answer44.html"
><IMG SRC="../../gx/dennis/answernew.gif"
ALT="[ Answer Guy Index ]"></A></td>
<TD WIDTH="14%"><A HREF="1.html">1</A></TD>
<TD WIDTH="14%"><A HREF="4.html">4</A></TD>
<TD WIDTH="14%"><A HREF="7.html">7</A></TD>
<TD WIDTH="14%"><A HREF="9.html">9</A></TD>
</TR><TR VALIGN="center" ALIGN="center">
<TD WIDTH="14%"><A HREF="11.html">11</A></TD>
<TD WIDTH="14%"><A HREF="12.html">12</A></TD>
<TD WIDTH="14%"><A HREF="14.html">14</A></TD>
<TD WIDTH="14%"><A HREF="17.html">17</A></TD>
</TR><TR VALIGN="center" ALIGN="center">
<TD><A HREF="18.html">18</A></TD>
<TD><A HREF="19.html">19</A></TD>
<TD><A HREF="20.html">20</A></TD>
<TD><A HREF="21.html">21</A></TD>
<TD><A HREF="24.html">24</A></TD>
<TD><A HREF="25.html">25</A></TD>
<TD><A HREF="26.html">26</A></TD>
</TR><TR VALIGN="center" ALIGN="center">
<TD><A HREF="28.html">28</A></TD>
<TD><A HREF="29.html">29</A></TD>
<TD><A HREF="30.html">30</A></TD>
<TD><A HREF="31.html">31</A></TD>
<TD><A HREF="32.html">32</A></TD>
<TD><A HREF="33.html">33</A></TD>
<TD><A HREF="34.html">34</A></TD>
</TR><TR VALIGN="center" ALIGN="center">
<TD><A HREF="35.html">35</A></TD>
<TD><A HREF="36.html">36</A></TD>
<TD><A HREF="37.html">37</A></TD>
<TD><A HREF="38.html">38</A></TD>
<TD><A HREF="39.html">39</A></TD>
<TD><A HREF="40.html">40</A></TD>
<TD><A HREF="41.html">41</A></TD>
</TR><TR VALIGN="center" ALIGN="center">
<TD><A HREF="42.html">42</A></TD>
<TD><A HREF="43.html">43</A></TD>
<TD><A HREF="44.html">44</A></TD>
<TD><A HREF="45.html">45</A></TD>
<TD><A HREF="46.html">46</A></TD>
<TD><A HREF="47.html">47</A></TD>
<TD><A HREF="48.html">48</A></TD>
</TR></TABLE>
<!-- end tagnav ::::::::::::::::::::::::::::::::::::::::::::::::::::-->
<P> <hr> <P>
<!-- begin lgnav ::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<A HREF="../index.html"
><IMG SRC="../../gx/indexnew.gif" ALT="[ Table Of Contents ]"></A>
<A HREF="/index.html"
><IMG SRC="../../gx/homenew.gif" ALT="[ Front Page ]"></A>
<A HREF="../lg_bytes44.html"
><IMG SRC="../../gx/back2.gif" ALT="[ Previous Section ]"></A>
<A HREF="../lg_tips44.html"
><IMG SRC="../../gx/fwd.gif" ALT="[ Next Section ]"></A>
<!-- end lgnav ::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
</BODY></HTML>
<!--endcut ========================================================= -->