60 lines
1.7 KiB
Markdown
60 lines
1.7 KiB
Markdown
# Provisioning
|
|
|
|
After flasing the Alpine Extended Iso on a usbdrive, partition a disk. For this internet is required because `gptfdisk` is only available in the repositories and is not included on the extended Iso.
|
|
|
|
To set it up we'll use `setup-interfaces` and `setup-apkrepos`.
|
|
|
|
```
|
|
# setup-interfaces -ar
|
|
# setup-apkrepos -c1
|
|
```
|
|
|
|
Because the Alpine Linux Iso is pretty minimal a few packages will have to be installed first:
|
|
|
|
```
|
|
# apk add cryptsetup lvm2 lsblk e2fsprogs gptfdisk dosfstools
|
|
```
|
|
|
|
The drive should be partitioned using `gdisk` (or `cfdisk`). It should have atleast two partitions with one `EFI System` Partition and one `Linux filesystem` partition and look something like this:
|
|
|
|
| Number of partition | Size | Type |
|
|
|:-----:|:-----:|:-----:|
|
|
| 1 | 512 MB or more | EFI System |
|
|
| 2 | Rest of the drive | Linux filesystem |
|
|
|
|
Then to create the filesystem on the efi partition.
|
|
|
|
```
|
|
# mkfs.fat -F 32 -n efi /dev/<disk1>
|
|
```
|
|
|
|
And the encrypted filesystem on the root partition.
|
|
|
|
```
|
|
# cryptsetup luksFormat /dev/<disk2> --type luks2 --label luks
|
|
# cryptsetup open --type luks /dev/<disk2> pv0
|
|
```
|
|
|
|
Now to create a new LVM volume group:
|
|
|
|
```
|
|
# vgcreate vg0 /dev/mapper/pv0
|
|
```
|
|
|
|
To create partitions inside the volume group:
|
|
|
|
```
|
|
# lvcreate --name alproot -L 64G vg0
|
|
# lvcreate --name alphome -l 100%FREE vg0
|
|
```
|
|
|
|
Now the home partition fills the entirety of the volume group. These sizes should be changed depending on the needs of the user.
|
|
|
|
To create the filesystems on the logical partitions:
|
|
|
|
```
|
|
# mkfs.ext4 /dev/vg0/alproot
|
|
# mkfs.ext4 /dev/vg0/alphome
|
|
```
|
|
|
|
Other filesystems can also be used but `ext4` is the standard for most linux distrobutions.
|