Red_Hat
EX200 · Question #25
25. Add Swap Partition Add an additional swap partition of 512 MiB to your system. The swap partition should be automatically mounted at system startup. Do not delete or modify any existing swap…
A new partition is created, formatted as swap, and then configured for automatic activation during system boot by adding an entry to /etc/fstab.
Submitted by viktor_hu· Apr 18, 2026Configure Local Storage
Question
- Add Swap Partition Add an additional swap partition of 512 MiB to your system. The swap partition should be automatically mounted at system startup. Do not delete or modify any existing swap partitions on the system. Correct Answer: See the below explanation Explanation Explanation/Reference: Solution: [root@node2 ~]# lsblk [root@node2 ~]# fdisk /dev/vdb Welcome to fdisk (util-linux 2.37.4). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. This disk is currently in use - repartitioning is probably a bad idea. It's recommended to umount all file systems, and swapoff all swap partitions on this disk. Command (m for help): n Partition number (3-128, default 3): First sector (1476608-10485726, default 1476608): Last sector, +/-sectors or +/-size{K,M,G,T,P} (1476608-10485726, default 10485726): +512M Created a new partition 3 of type 'Linux filesystem' and of size 512 MiB. Command (m for help): w The partition table has been altered. Syncing disks. [root@node2 ~]# mkswap /dev/vdb3 [root@node2 ~]# vim /etc/fstab /dev/vdb3 swap swap defaults 0 0 [root@node2 ~]# swapon -a [root@node2 ~]# swapon NAME TYPE SIZE USED PRIO /dev/vdb2 partition 243M 0B -2 /dev/vdb3 partition 512M 0B -3
Explanation
A new partition is created, formatted as swap, and then configured for automatic activation during system boot by adding an entry to /etc/fstab.
Concept tested. Creating and configuring swap partitions
Reference. https://man7.org/linux/man-pages/man8/mkswap.8.html
Topics
#Swap partition#Disk partitioning#fstab#mkswap
Community Discussion
No community discussion yet for this question.