partition.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Fri, 10 Dec 2010 14:34:29 +0200
changeset 753 052ba865b3dc
child 899 7b4265c8d324
permissions -rwxr-xr-x
Backup/restore mbr/partition table.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
753
052ba865b3dc Backup/restore mbr/partition table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     1
-*- mode: outline; coding: utf-8; fill-column: 80 -*-
052ba865b3dc Backup/restore mbr/partition table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     2
052ba865b3dc Backup/restore mbr/partition table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
* Backup mbr.
052ba865b3dc Backup/restore mbr/partition table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
052ba865b3dc Backup/restore mbr/partition table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
  $ dd if=/dev/hda of=boot.mbr bs=512 count=1
052ba865b3dc Backup/restore mbr/partition table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
052ba865b3dc Backup/restore mbr/partition table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     7
* Restore backuped mbr:
052ba865b3dc Backup/restore mbr/partition table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
052ba865b3dc Backup/restore mbr/partition table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     9
  $ sudo of=boot.mbr if=/dev/hda bs=512 count=1
052ba865b3dc Backup/restore mbr/partition table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    10
052ba865b3dc Backup/restore mbr/partition table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
* Backup PC partition table.
052ba865b3dc Backup/restore mbr/partition table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    12
052ba865b3dc Backup/restore mbr/partition table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
  $ sfdisk -d /dev/sda >partition.tbl
052ba865b3dc Backup/restore mbr/partition table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    14
052ba865b3dc Backup/restore mbr/partition table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    15
* Restore PC partition table.
052ba865b3dc Backup/restore mbr/partition table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    16
052ba865b3dc Backup/restore mbr/partition table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    17
  $ sfdisk /dev/sdb <partition.tbl
052ba865b3dc Backup/restore mbr/partition table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    18
052ba865b3dc Backup/restore mbr/partition table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    19
* Move PC partition table from on dist to another.
052ba865b3dc Backup/restore mbr/partition table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    20
052ba865b3dc Backup/restore mbr/partition table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    21
  $ sfdisk -d /dev/sda | sfdisk /dev/sdb
052ba865b3dc Backup/restore mbr/partition table.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    22