aboutsummaryrefslogtreecommitdiff
path: root/partitions/creating_partitions.md
blob: 44d31202aa30f268a55e1d74f1e49c20d077c0e0 (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
**Partitions via fdisk**
Ensure adequate unallocated space is available by adding more physical volumes
or resizing in the case of virtual machines via something like below
```
qemu-img resize /path/to/image.qcow2 +size
```
where size can be +1G, +10G, +500M

Run fdisk on your device `fdisk /dev/vda` and use the following core options to
navigate
| flag | Description |
| p | lists all partitions currently on the device |
| n | starts prompts to create new partition |
| e | create extended partition applicable to mbr whose max is 4 primary|
| t | redesignates a partition as something else e.g. swap|
| L | while in t prompt lists all available labels you can apply to partition|
| w | syncs/writes all changes to disk |


`vim /etc/fstab` needs to be updated with the new partition information. You
can append something like the following to it:
```

/dev/vda3   /storage    vfat    defaults 0 0
/dev/vda5   none        swap    defaults 0 0

```
The first line will mount 3rd partition to `/storage` as a vfat partition. The
second line will mount 5th partition as a swap. Mount point is none here.
Make sure the mount points are created prior to force mounting like so

```
mkswap /dev/vda5   # writes metadata to /dev/vda5 as swap
mount -a           # mounts everything in /etc/fstab
swapon -a          # activates all partitions marked as swap for kernel to use
findmnt --verify   # verifies /etc/fstab 
```