Announcement

Collapse
No announcement yet.

A question about partimage

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    A question about partimage

    I am on Feisty and running a dual boot with win2000 being the first partition and booting managed by grub. I am also running Virtual box with a win2000 VM. I want to clone both the win2000 partition and the Feisty partition and be sure I get the grub bootloader. The partitions are:
    sda1 win2000 8gb
    sda2 ntfs data 160gb
    sda3 Feisty 20gb
    sda4 extended 1.9gb
    sda5 swap 1.9gb

    Do I need only clone sda1 (hopefully capturing the grub loader) and sda3?

    #2
    Re: A question about partimage

    I haven't used Partimage (but know it's a blue-chip program), so I don't know the naming conventions used in it.

    In Linux and in GRUB, sda1 is partition 1, and that includes, of course, the first sector of partition 1, which is the boot sector, which contains the bootloader for Windows.
    However, the notation sda1 does NOT include the Master Boot record (MBR) of the drive.
    The MBR of that drive (512 bytes) contains:
    GRUB bootloader code that points at some other Linux partition (446 bytes)
    A partition table specifying where the 4 primary partitions are (4x16 = 64 bytes).
    And a 2-byte EOF AA identifier.

    You need that MBR.
    In Linux, to get it, I would write that as hda (which gets the WHOLE drive).
    In GRUB, the MBR would be (hd0) (or in general, (hdx)). The first partition would be sda1 = (hd0,0).

    Maybe the docs/FAQs on Partimage would spell this out -- how exactly to ensure you get those first 512 bytes of MBR?

    EDIT, added:

    To print the MBR to the screen (the default of=target_file):
    dd if=/dev/sda count=1 | hexdump -C

    Copy MBR to a file mbr.backup:
    dd if=/dev/sda of=/home/your_name/mbr.backup bs=446 count=1
    The dd copies the IPL (initial program loader) of the bootloader code, the first 446 bytes of sector 1 of the HDD. Restore the backup by reversing if and of:
    dd if=/home/your_name/mbr.backup of=/dev/sda bs=446 count=1
    This omits the partition table—a useful thing to do sometimes, especially when transferring MBR from a large drive to a smaller drive, or from a smaller drive to a larger drive (reason: the target drive will get an inaccurate picture of its true size from its “new” MBR). To include the full MBR (with partition table and AA signature):
    dd if=/dev/sda of=/home/your_name/mbr.backup bs=512 count=1

    From my How-To on using the dd command
    http://kubuntuforums.net/forums/inde...opic=3090824.0

    (Partimage does not copy un-used blocks of disk, whereas dd does copy everything—used and un-used.)
    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

    Comment


      #3
      Re: A question about partimage

      Many thanks for that.

      Comment

      Working...
      X