1. adding new disk space or resizing swap partition
2. swap off
[root@testsvr ~]# swapon --show
NAME TYPE SIZE USED PRIO
/dev/sdb1 partition 16G 0B -1
[root@testsvr ~]# swapoff /dev/sdb1
[root@testsvr ~]# swapon --show
[root@testsvr ~]#
3. creating new swap partition
[root@testsvr ~]# fdisk /dev/sdb
Command (m for help): p
Command (m for help): d
Selected partition 1
Partition 1 is deleted
Command (m for help): p
Command (m for help): n
Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): 82
Changed type of partition ‘Linux’ to ‘Linux swap / Solaris’
Command (m for help): w
4. creating new swap on linux os
[root@testsvr ~]# mkswap /dev/sdb1
mkswap: /dev/sdb1: warning: wiping old swap signature.
Setting up swapspace version 1, size = 33553404 KiB
no label, UUID=c81510a8-b78a-449e-a214-ee5b46ccec23
5. activating and checking new swap
[root@testsvr ~]# swapon /dev/sdb1
[root@testsvr ~]# swapon --show
NAME TYPE SIZE USED PRIO
/dev/sdb1 partition 32G 0B -1
6. changing /etc/fstab (new UUID)
[root@testsvr ~]# ls -l /dev/disk/by-uuid/
lrwxrwxrwx. 1 root root 10 Jan 29 2020 c81510a8-b78a-449e-a214-ee5b46ccec23 -> ../../sdb1
[root@testsvr ~]# vi /etc/fstab
UUID=c81510a8-b78a-449e-a214-ee5b46ccec23 swap swap defaults 0 0
7. reboot and checking swap status
[root@testsvr ~]# swapon --show
NAME TYPE SIZE USED PRIO
/dev/sdb1 partition 32G 0B -1
'IT > linux' 카테고리의 다른 글
creating over 2TB partition on linux (0) | 2022.06.10 |
---|---|
alternatives 설정 (java 설치 후 기존 버전 선택 시) (0) | 2022.06.10 |
CentOS 6에 JBoss, NGINX 설치 및 기본 연동 (0) | 2015.09.12 |
RedHat에서 CentOS로 yum repository 변경하기 (0) | 2015.08.20 |
rpm의 32/64bit 확인하기 (0) | 2015.08.20 |