Results 1 to 4 of 4

Thread: Copying partition table

  1. #1
    Join Date
    Jun 2010
    Location
    London
    Posts
    572

    Default Copying partition table

    I need to copy partition table for sda, I have 3 primary partitions and 1 extended partition on sda. I understand that fdisk cant copy extended partition table and I need to use sfdisk.

    Correct me if I am wrong -

    1. For primary partitions
    Code:
    dd if=sda-mbr.bin of=/dev/sdX bs=1 count=64 skip=446 seek=446
    2. For extended partition
    Code:
    sfdisk -d /dev/sda2 > backup-sdX.sf
    Where it will store the files after backing them up. I tried SUSE 11.2 DVD, it has back up partition table utility under repairs-advanced options but it suggests saving partition table to floppy. Why it doesnt offer to save it on a removable medium or to CD.

    Best,

    David

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Copying partition table

    You can use sfdisk to dump this info in a readable format which can be used as input to sfdisk again.

    Code:
           -d     Dump the partitions of a device in a format useful as  input  to
                  sfdisk. For example,
                      % sfdisk -d /dev/hda > hda.out
                      % sfdisk /dev/hda < hda.out
                  will correct the bad last extended partition that the OS/2 fdisk
                  creates.
    This option is particularly useful for duplicating the partition table of the working disk of a RAID1 pair to a replacement.

  3. #3
    Join Date
    Jun 2010
    Location
    London
    Posts
    572

    Default Re: Copying partition table

    Thanks, ken_yap; will try that soon.

    Secondly, I need to clone the hard disk, what tools i should use.

  4. #4
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Copying partition table

    On 2010-11-06 09:06, avenuemax wrote:
    >
    > Thanks, ken_yap; will try that soon.
    >
    > Secondly, I need to clone the hard disk, what tools i should use.


    Exact copy, dd. Otherwise, perhaps ghost for linux.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.2 x86_64 "Emerald" at Telcontar)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •