summaryrefslogtreecommitdiff
path: root/bin/man/partition.7
blob: 840728ef582102dd13193cceb857c846a85d1c53 (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
.Dd September 27, 2026
.Dt PARTITION 7
.Os
.Sh NAME
.Nm partition
.Nd partitioning and formatting a disk for rawnix
.Sh DESCRIPTION
rawnix boots through UEFI, so the disk needs a GPT partition table with
an EFI system partition.
Everything else is free.
The file systems are then mounted under
.Pa /mnt
the way they will be at run time.
.Pp
.Sy Partitioning and formatting destroy what is on the disk.
The installer refuses nothing here; check the device name twice.
.Ss Finding the disk
.Dl # lsblk
lists the disks and their partitions.
SATA and USB disks are called
.Pa /dev/sd Ns Ar X ,
with partitions
.Pa /dev/sd Ns Ar X1 , Ar X2 ... ;
NVMe disks
.Pa /dev/nvme0n1 ,
with partitions
.Pa /dev/nvme0n1p1 , p2 ... .
The stick the installer runs from is one of them.
.Ss Partitioning
.Dl # fdisk /dev/sdX
.Pp
In
.Xr fdisk 8 :
.Bl -tag -width Ds
.It Ic g
create a new, empty GPT partition table;
.It Ic n
add a partition: first the EFI system partition, 1 GiB
.Pq Li +1G ,
then the rest as you like;
.It Ic t
set the type of partition 1 to
.Dq EFI System ;
.It Ic w
write the table and quit.
.El
.Pp
A simple layout:
.Bl -column "/dev/sdX1" "1 GiB" "EFI System" -offset indent
.It Pa /dev/sdX1 Ta 1 GiB Ta EFI System Ta Pa /boot/efi
.It Pa /dev/sdX2 Ta rest Ta Linux filesystem Ta Pa /
.El
.Pp
Separate partitions for
.Pa /home ,
.Pa /var
or swap are added the same way.
.Ss Formatting
The EFI system partition is always FAT32:
.Dl # mkfs.fat -F32 /dev/sdX1
.Pp
For an unencrypted system, make the file systems and mount them, root
first:
.Bd -literal -offset indent
# mkfs.ext4 /dev/sdX2
# mount /dev/sdX2 /mnt
.Ed
.Pp
ext4, xfs
.Pq Ic mkfs.xfs
and btrfs
.Pq Ic mkfs.btrfs
are available.
Further partitions are mounted below
.Pa /mnt ,
for example
.Pa /mnt/home .
A swap partition is prepared with
.Ic mkswap ;
.Xr genfstab 8
lists every swap partition it can see.
.Pp
For an encrypted system, use
.Xr genluks 8
instead, which formats and mounts everything in one go; see
.Xr encryption 7 .
.Ss The EFI system partition
Either way, mount it last, at
.Pa /mnt/boot/efi :
.Bd -literal -offset indent
# mkdir -p /mnt/boot/efi
# mount /dev/sdX1 /mnt/boot/efi
.Ed
.Pp
It must be mounted before the kernel is installed; see
.Xr bootloader 7 .
.Sh SEE ALSO
.Xr bootloader 7 ,
.Xr encryption 7 ,
.Xr installation 7 ,
.Xr fdisk 8 ,
.Xr genfstab 8 ,
.Xr genluks 8 ,
.Xr lsblk 8