Differences
This shows you the differences between two versions of the page.
linux_wiki:add_new_partitions_and_logical_volumes_and_swap_to_a_system_non-destructively [2016/02/29 21:33] billdozor created |
linux_wiki:add_new_partitions_and_logical_volumes_and_swap_to_a_system_non-destructively [2019/05/25 23:50] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Add New Partitions And Logical Volumes And Swap To A System Non-destructively ====== | ||
- | |||
- | **General Information** | ||
- | |||
- | About this page/ | ||
- | |||
- | ---- | ||
- | |||
- | **Logical Volume Method** | ||
- | \\ | ||
- | Create new partition with the Logical Volume type | ||
- | <code bash> | ||
- | fdisk /dev/sdb | ||
- | n | ||
- | Partition type: primary | ||
- | Partition number: 1 | ||
- | First sector: default | ||
- | Last sector: +1G | ||
- | t | ||
- | Hex code: 8e | ||
- | w | ||
- | </ | ||
- | |||
- | Setup LVM physical volume, volume group, logical volume | ||
- | <code bash> | ||
- | pvcreate /dev/sdb1 | ||
- | vgcreate vglocal /dev/sdb1 | ||
- | lvcreate -n lvswap -L 1G vglocal | ||
- | </ | ||
- | |||
- | Format logical volume with swap, enable, and add to fstab | ||
- | <code bash> | ||
- | mkswap / | ||
- | swapon / | ||
- | |||
- | vim /etc/fstab | ||
- | |||
- | / | ||
- | </ | ||
- | |||
- | \\ | ||
- | **Physical Partition Method** | ||
- | \\ | ||
- | Create physical disk partition for swap | ||
- | <code bash> | ||
- | fdisk /dev/sdb | ||
- | n | ||
- | Partition type: primary | ||
- | Partition number: 2 | ||
- | First sector: default | ||
- | Last sector: +1G | ||
- | t | ||
- | Hex code: 82 | ||
- | w | ||
- | </ | ||
- | * Hex code 82 is Linux Swap | ||
- | |||
- | Create the swap filesystem | ||
- | <code bash> | ||
- | mkswap /dev/sdb2 | ||
- | swapon /dev/sdb2 | ||
- | </ | ||
- | * edit /etc/fstab if you want persistent changes | ||
- | |||
- | View swap space | ||
- | <code bash> | ||
- | swapon -s | ||
- | </ | ||
- | |||
- | Activate all swap on /etc/fstab | ||
- | <code bash> | ||
- | swapon -a | ||
- | </ | ||
- | * Turn off swap with: swapoff / | ||
- | |||
- | ---- | ||