Re: A linux alternative to the "ghost" programs?

From: P.T. Breuer (ptb_at_oboe.it.uc3m.es)
Date: 06/30/04


Date: Wed, 30 Jun 2004 09:14:35 +0200

Cubic <cubic@fjomp.com> wrote:
> > You can't copy bootrecords just like that! They don't "make sense" out
> > of their context. You'll have to rewrite the bootrecord the way you
> > want it on the new medium. Nobody knows for example if you want the new
> > master boot record to point to the old partition records, or to the new
> > ones. Rerun lilo.
> That was what I was wondering, mostly. If there existed a way of
> preserving the bootrecord of the drive.

You can copy it. It's exactly the first few bytes of the drive. I don't
recall how many. About 150, I think I recall (not the whole of the
first sector, since the partiton table is in the first sector too). 512
bytes would do, if you don't mind maybe rewriting the partition table
too in case you copied that over too.

But the point is that you don't want to copy it! It doesn't make sense
to copy it, since it will be all wrong for the new drive.

> Well, I had the lilo part down, I
> will just have to boot into windows with a partition-magic resque disk or

Why?

> something(Oh, I know I could use knoppix or something, but I'd rather keep
> Bootmgic, I'm a luser, all I can say)

I don't understand - you should be using a generic bootloader like lilo
or grub in the mbr to boot to os-specific bootloaders on other partition
records.

> > What is wrong with using cp?

> Mostly, the fuss comes from me not knowing the full potentional of certain
> commands, like the oh-so holy cp command. I mean, I've read the man page
> at least three times, I still didn't suspect you could do something like
> "cp -a /dev/hda /dev/hdb".

You can't. Or rather, you can, but the effect would be the same as dd
/dev/hda /dev/hdb. I.e. "silly". You don't want to copy one disk to
another! They're not even the same size! And what's the point of
copying all the space between the files as well as the files themselves!
You want to copy FILE SYSTEMS, not DISKS. Don't invent difficulties.

Peter



Relevant Pages

  • Re: Minix 3 CD format
    ... > How does Minix decide whether to parse partitions? ... partition or on a sub-partition. ... a bootblock on the first sector instead of a master boot record. ... whether it's a Minix masterboot or a Microsoft MBR, ...
    (comp.os.minix)
  • Re: [RFC] PATCH to fix rescan_partitions to return errors properly - take 2
    ... Partition information doesn't need to be on the ... If the first sector is bad and the ... and prevent your checker from running. ... disable partition checking for drives we get for recovery). ...
    (Linux-Kernel)
  • Re: how to tell if a specific data block is sparse?
    ... | The MBR, the very first sector of the drive, is outside any filesystem. ... | The e2fs boot block is just the first two sectors of its partition. ... a boot loader, unless the boot loader is made to be part of the image ... that goes into a partition meant to hold the kernel. ...
    (comp.os.linux.development.system)
  • Re: Strange behaviour of active flag
    ... The boot loader is LILO. ... tries to read the first sector if the device is a hard disk (or looks ... The "standard" DOS MBR looks in the partition ...
    (comp.os.linux.misc)
  • Re: [OT] - how can i read the first sector of my disk?
    ... What the fuck is an "exadec rappresentation"? ... In the very first sector of your HD you will find the MBR only. ... partition of your interest from the partition table within the MBR, ...
    (de.comp.lang.assembler.x86)