linux_wiki:add_new_partitions_and_logical_volumes_and_swap_to_a_system_non-destructively

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

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/how-to/script.  
- 
----- 
- 
-**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 
-</code> 
- 
-Setup LVM physical volume, volume group, logical volume 
-<code bash> 
-pvcreate /dev/sdb1 
-vgcreate vglocal /dev/sdb1 
-lvcreate -n lvswap -L 1G vglocal 
-</code> 
- 
-Format logical volume with swap, enable, and add to fstab 
-<code bash> 
-mkswap /dev/mapper/vglocal-lvswap 
-swapon /dev/mapper/vglocal-lvswap 
- 
-vim /etc/fstab 
- 
-/dev/mapper/vglocal-lvswap  swap  swap  sw  0 0 
-</code> 
- 
-\\ 
-**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 
-</code> 
-  * Hex code 82 is Linux Swap 
- 
-Create the swap filesystem 
-<code bash> 
-mkswap /dev/sdb2 
-swapon /dev/sdb2 
-</code> 
-  * edit /etc/fstab if you want persistent changes 
- 
-View swap space 
-<code bash> 
-swapon -s 
-</code> 
- 
-Activate all swap on /etc/fstab 
-<code bash> 
-swapon -a 
-</code> 
-  * Turn off swap with: swapoff /dev/<devname> or swapoff -a 
- 
----- 
  
  • linux_wiki/add_new_partitions_and_logical_volumes_and_swap_to_a_system_non-destructively.txt
  • Last modified: 2019/05/25 23:50
  • (external edit)