partition.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sat, 20 Feb 2016 02:00:25 +0200
changeset 1888 5a71256a6315
child 1905 fba288d59662
permissions -rw-r--r--
List partitions.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1888
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     1
.. -*- coding: utf-8; -*-
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     2
.. include:: HEADER.rst
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
======================
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
 Storage partitioning
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
======================
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     7
.. contents::
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     9
MBR
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    10
===
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    12
Backup MBR::
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    14
  $ dd if=/dev/hda of=boot.mbr bs=512 count=1
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    15
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    16
Restore backuped mbr::
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    17
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    18
  $ sudo of=boot.mbr if=/dev/hda bs=512 count=1
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    19
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    20
Backup PC partition
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    21
===================
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    22
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    23
Backup PC partition table::
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    24
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    25
  $ sfdisk -d /dev/sda >partition.tbl
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    26
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    27
Restore PC partition table::
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    28
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    29
  $ sfdisk /dev/sdb <partition.tbl
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    30
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    31
Move PC partition table from on dist to another::
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    32
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    33
  $ sfdisk -d /dev/sda | sfdisk /dev/sdb
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    34
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    35
List partitions.
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    36
================
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    37
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    38
Active / maunted partitions::
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    39
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    40
  $ mount
5a71256a6315 List partitions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    41