author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Sat, 10 Feb 2018 01:28:53 +0200 | |
changeset 2227 | 1e9323e7ec88 |
parent 2205 | 5b98c1476d30 |
permissions | -rw-r--r-- |
1888 | 1 |
.. -*- coding: utf-8; -*- |
2 |
||
3 |
====================== |
|
4 |
Storage partitioning |
|
5 |
====================== |
|
6 |
.. contents:: |
|
1905
fba288d59662
Include only local subsections into TOC. This prevent duplication of
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1888
diff
changeset
|
7 |
:local: |
1888 | 8 |
|
2205 | 9 |
List partitions |
10 |
=============== |
|
11 |
||
12 |
List partitions:: |
|
13 |
||
14 |
$ sfdisk -l |
|
15 |
$ fdisk -l |
|
16 |
$ { echo p; echo q; } | parted /dev/sda |
|
17 |
||
18 |
List active/mounted partitions:: |
|
19 |
||
20 |
$ mount |
|
21 |
$ df -H |
|
22 |
||
23 |
Backup and restore MBR |
|
24 |
====================== |
|
1888 | 25 |
|
26 |
Backup MBR:: |
|
27 |
||
28 |
$ dd if=/dev/hda of=boot.mbr bs=512 count=1 |
|
29 |
||
30 |
Restore backuped mbr:: |
|
31 |
||
32 |
$ sudo of=boot.mbr if=/dev/hda bs=512 count=1 |
|
33 |
||
34 |
Backup PC partition table:: |
|
35 |
||
36 |
$ sfdisk -d /dev/sda >partition.tbl |
|
37 |
||
38 |
Restore PC partition table:: |
|
39 |
||
40 |
$ sfdisk /dev/sdb <partition.tbl |
|
41 |
||
42 |
Move PC partition table from on dist to another:: |
|
43 |
||
44 |
$ sfdisk -d /dev/sda | sfdisk /dev/sdb |
|
45 |
||
2205 | 46 |
Resize partition |
1888 | 47 |
================ |