Re: writing to a partition



On 09/30/2007 09:28 AM, Allan Adler wrote:
[...]
Am I correct in concluding that I can take any bootable floppy, for example, and execute (in Linux):
cat /dev/fd0 > /dev/hda1
to make hda1 bootable and put in lilo.conf, say,


No.

other=/dev/hda1
optional
label=abf

get the same effect as booting the bootable floppy, except that I would boot from /dev/hda1?

I guess I can also use dd to copy just a few bytes at a time to /dev/hda1 to see what it does, one step at a time, when it boots.

No.

Install the Linux-HOWTOs and read the Bootdisk-HOWTO and Linux-i386-Boot-Code-HOWTO

Install the Linux Kernel source and examine it. When you build a kernel, its header seems to look like an x86 bootsector which you might examine with a decompiler.

In the olden days of Linux, it used to be possible to create a boot floppy this way:

cp /vmlinuz /dev/fd0
rdev /dev/fd0 /dev/fd0
rdev -R /dev/fd0 1

Since you don't mind blowing this computer away, you could experiment with this:

cp /vmlinuz /dev/hda1
rdev /dev/hda1 /dev/hda1
rdev -R /dev/hda1 1

The partition at /dev/hda1 will be destroyed, but it will boot then freeze because there won't be any partition to mount (and the kernel modules needed for mounting won't be available). /vmlinuz could instead be any valid Linux kernel--even one from /boot.
.



Relevant Pages

  • Re: Kernel Panic After Build, RH Linux 9 (Shrike)
    ... Got Linux on OK, and seemingly rtlinux; ... boot rtlinux, it died in the boot process with: ... Kernel panic VFS: Unable to mount root fs on 03:02. ... Here's the so-called base installation for rtlinux with RHL 9: ...
    (linux.redhat.misc)
  • Re: Linux distro request
    ... ZipSlack was my first introduction to Linux. ... Smart Boot Manager?? ... earlier kernel that will be easier on memory. ... more to gcc than gcc! ...
    (alt.lang.asm)
  • Kernel panic.. in 3.0 Enterprise Linux
    ... The kernel I have working is version 2.4.21-4.EL and I ... can still boot up to that. ... Red Hat Enterprise Linux AS ...
    (Linux-Kernel)
  • Aargh - All Kernels Panic
    ... I've got a dual boot Mandrake 10 / Win98 machine. ... where Linux was running fine before. ... Is there any way to read the gobbledigook the kernel panic message ... I've not changed any hardware or even any BIOS ...
    (comp.os.linux.hardware)
  • Re: Kernel Panic After Build, RH Linux 9 (Shrike)
    ... Got Linux on OK, and seemingly rtlinux; however, when I went to boot rtlinux, it died in the boot process with: ... Kernel panic VFS: Unable to mount root fs on 03:02. ... Here's the so-called base installation for rtlinux with RHL 9: ...
    (linux.redhat.misc)