3-4 Add New Partitions and Logical Volumes and Swap to a System Non-Destructively Flashcards

1
Q

free -m

A

shows available physical memory and available swap memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

how is swap used

A

new processes start with physical memory

idle memory from older processes will be allocated over to swap

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

For swap generally good to use 2x to 2.5x of physical memory ex: 1GB physical so assign 2G or 2.5GB to swap

A

Best practice to assign swap size as

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

fdisk
option: n for setting up whole disk
enter for all defaults, will default set size to full disk
option: l (lowercase L) to see labels
option: t to give it label found from l option output list ex: 8e for linux lvm to make swap space
option: w to write changes to disk and exit

pvcreate /dev/xvda
pvdisplay
vgcreate newVolumeGroup1 /dev/xvda (to assign it to new volume group as its made)
vgdisplay

lvcreate -n newNamedLV_Swap (ex Swap) -L 2GB newVolumeGroup1

lvdisplay

A

How to make an LVM to use to make swap on

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

format it with swap signature with mkswap command
mkswap /dev/newVolumeGroup1/newNamedLV_Swap
mkswap returns with UUID, which can be used to mount it in fstab

swapon /dev/newVolumeGroup1/newNamedLV_Swap
free -m
swapon does not make it persistent swap storage, it needs to be added to /etc/fstab (similar to mount)

to take off swap mount
swapoff /dev/newVolumeGroup1/newNamedLV_Swap

free -m

A

How to format LVM (partioned, vg, and lv made. Label added 8e Linux LVM) into swap

Mount it as swap,

check swap space and physical memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Swap in /etc/fstab
/dev/newVolumeGroup1/newNamedLV_Swap swap swap 0 0

Or

UUID=(UUID from mkswap command, and check blkid) swap swap 0 0

A

Set swap space mount as persistent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

swapon -a

A

mount all swap entries in /etc/fstab file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
fdisk to make mbr partition
fdisk /dev/xvda
option: n 
     size +2G
option: L to see labels, 82 for 'Linux swap / Solaris'
option: t to label, put 82
option: w to save and exit

to put swap signature on it
mkswap /dev/xvda
returns with UUID to use in /etc/fstab for persistence

swapon /dev/xvda
free -m

A

How to make disk into swap space

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

swapoff -a

A

Unmounts all swap entries in /etc/fstab

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

swapon -s

Or
cat /proc/swaps

A

two ways to check which partitions and files are make up swap

How well did you know this?
1
Not at all
2
3
4
5
Perfectly