Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/docs/cli_parameters/config/disk_config.rst
blob: ed5f42c17b28dfb3bc9e8ebb7d6b81e38a8d12f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
.. _disk config:

Disk Configuration
==================

There are only three modes in the ``disk_config`` option. They are described in more detail below.

"Leave as is"
--------------

.. code-block:: json

   {
       "config_type": "pre_mounted_config",
       "mountpoint": "/mnt/archinstall"
   }

This mode will not perform any partitioning what so ever.
Instead it relies on what's mounted manually by the user under ``/mnt/archinstall``.

Given the following disk example:

.. code-block::

   /mnt/archinstall    (/dev/sda2)
        ├── boot       (/dev/sda1)
        └── home       (/dev/sda3)

Runing ``archinstall --conf your.json --silent`` where the above JSON is configured. The disk will be left alone — and a working system will be installed to the above folders and mountpoints will be translated into the installed system.

.. note::

   Some disk layouts can be too complicated to detect, such as RAID setups. Please do report those setups on the `Issue Tracker <https://github.com/archlinux/archinstall>`__ so we can support them.

Best Effort
-----------

.. warning::

   This mode will wipe data!

.. note::

   Note that this options is similar to the manual partitioning but is generated through the menu system! And the best effort layout might deviate slightly from some wiki guidelines in order to facilitate some optional configurations at a later stage.

.. code-block:: json

   {
       "disk_config": {
           "config_type": "default_layout",
           "device_modifications": [
               {
                   "device": "/dev/sda",
                   "wipe": true,
                   "partitions": "..."
               }
           ]
       }
   }

This mode will attempt to configure a sane default layout on the selected disks.
Based on the chosen filesystem, and potential optional settings for said filesystem — different default layouts will be provided.

Manual Partitioning
-------------------

.. code-block:: json

   {
        "disk_config": {
            "config_type": "manual_partitioning",
            "device_modifications": [
               "filesystem struct"
            ]
        }
    }

Manual partitioning is the most complex one of the three. It offers you near endless flexibility of how to partition your disk. It integrates against `pyparted <https://github.com/dcantrell/pyparted>`__ and some control logic in ``archinstall`` that deals with creating things like subvolumes and compression.

Sizes are by default ``sector`` units, but other units are supported.

The options supplied to ``manual_partitioning`` are dictionary definitions, where the following parameters must exist:

.. csv-table:: JSON options
   :file: ./manual_options.csv
   :widths: 15, 15, 65, 5
   :escape: !
   :header-rows: 1

Each partition definition heavily relies on what filesystem is used.
Below follow two of the more common filesystems, anything else will best be described by running ``archinstall`` to generate a desired configuration for the desired filesystem type — and copy the relevant parts for permanent configurations.

.. warning::

   Important to note that the units and positions in the examples below — are highly user specific!

FAT32
^^^^^

.. code-block:: json

	{
		"btrfs": [],
		"flags": [
		   "Boot"
		],
		"fs_type": "fat32",
		"length": {
		   "sector_size": null,
		   "total_size": null,
		   "unit": "B",
		   "value": 99982592
		},
		"mount_options": [],
		"mountpoint": "/boot",
		"obj_id": "369f31a8-2781-4d6b-96e7-75680552b7c9",
		"start": {
		   "sector_size": {
		       "sector_size": null,
		       "total_size": null,
		       "unit": "B",
		       "value": 512
		   },
		   "total_size": null,
		   "unit": "sectors",
		   "value": 34
		},
		"status": "create",
		"type": "primary"
	}

.. note::

   The ``Boot`` flag will make ``archinstall`` automatically set the correct ESP partition GUID if the system is booted with ``EFI`` support. The GUID will then be set to ``C12A7328-F81F-11D2-BA4B-00A0C93EC93B``.

EXT4
^^^^

.. code-block:: json

	{
      "btrfs": [],
      "flags": [],
      "fs_type": "ext4",
      "length": {
         "sector_size": null,
         "total_size": null,
         "unit": "B",
         "value": 15805127360
      },
      "mount_options": [],
      "mountpoint": "/",
      "obj_id": "3e75d045-21a4-429d-897e-8ec19a006e8b",
      "start": {
         "sector_size": {
            "sector_size": null,
            "total_size": null,
            "unit": "B",
            "value": 512
         },
         "total_size": {
            "sector_size": null,
            "total_size": null,
            "unit": "B",
            "value": 16106127360
         },
         "unit": "MB",
         "value": 301
      },
      "status": "create",
      "type": "primary"
   }

BTRFS
^^^^^

The BTRFS filesystem is inherently more complicated, thus the options are a bit more involved.
This example contains both subvolumes and compression.

.. note::

   Note that the ``"mountpoint": null`` is used for the overall partition, and instead individual subvolumes have mountpoints set.

.. code-block:: json

   {
      "btrfs": [
          {
              "compress": false,
              "mountpoint": "/",
              "name": "@",
              "nodatacow": false
          },
          {
              "compress": false,
              "mountpoint": "/home",
              "name": "@home",
              "nodatacow": false
          },
          {
              "compress": false,
              "mountpoint": "/var/log",
              "name": "@log",
              "nodatacow": false
          },
          {
              "compress": false,
              "mountpoint": "/var/cache/pacman/pkg",
              "name": "@pkg",
              "nodatacow": false
          },
          {
              "compress": false,
              "mountpoint": "/.snapshots",
              "name": "@.snapshots",
              "nodatacow": false
          }
      ],
      "dev_path": null,
      "flags": [],
      "fs_type": "btrfs",
      "mount_options": [
          "compress=zstd"
      ],
      "mountpoint": null,
      "obj_id": "d712357f-97cc-40f8-a095-24ff244d4539",
      "size": {
          "sector_size": {
              "unit": "B",
              "value": 512
          },
          "unit": "B",
          "value": 15568207872
      },
      "start": {
          "sector_size": {
              "unit": "B",
              "value": 512
          },
          "unit": "MiB",
          "value": 513
      },
      "status": "create",
      "type": "primary"
   }