diff options
author | Ibrahim Mkusa <ibrahimmkusa@gmail.com> | 2024-08-11 12:07:45 -0400 |
---|---|---|
committer | Ibrahim Mkusa <ibrahimmkusa@gmail.com> | 2024-08-11 12:07:45 -0400 |
commit | d3478ddfc778ad5ad64e161f1017af765b243d3d (patch) | |
tree | 0786900e421dfdafe5b010deb2abfaa55cc74bc9 /partitions/creating_partitions.md | |
parent | 6dfbd4e4a050ec1ba0f7604861ea86f6be9064be (diff) |
Creating partitions using fdisk, mkswap, swapon
Diffstat (limited to 'partitions/creating_partitions.md')
-rw-r--r-- | partitions/creating_partitions.md | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/partitions/creating_partitions.md b/partitions/creating_partitions.md new file mode 100644 index 0000000..44d3120 --- /dev/null +++ b/partitions/creating_partitions.md @@ -0,0 +1,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 +``` + |