Exam EX200 All QuestionsBrowse all questions from this exam
Question 41

SIMULATION -

Create a 2G swap partition which take effect automatically at boot-start, and it should not affect the original swap partition.

    Correct Answer:

    To create a 2G swap partition that takes effect automatically at boot-start, without affecting the original swap partition, follow these steps: 1. Use 'fdisk' to create a new partition: '# fdisk /dev/sda' then 'n' for new partition, 'p' for primary partition, and input '+2G' for 2GB size. Set the partition type to swap with 't' and '82'. Write the changes with 'w'. 2. Refresh the partition table: 'partprobe' or reboot the system. 3. Format the new partition as swap: 'mkswap /dev/sdaX' (replace X with the actual partition number). 4. Get the UUID of the new swap partition using 'blkid /dev/sdaX'. 5. Update '/etc/fstab' to include the new swap partition with the line 'UUID=XXXXX swap swap defaults 0 0' (replace XXXXX with the actual UUID). 6. Enable the new swap space: 'swapon -a'. Verify the swap space with 'swapon -s' or 'free -m'. This ensures the 2G swap partition is recognized and activated on boot without affecting the existing swap partitions.

Discussion
lgu

fdisk /dev/sdX n (new) p (primary) enter +2G t 82 wq partprobe or reboot free -m mkswap /dev/sdX1 echo "/dev/sdX1 swap swap default 0 0" swapon -a free -m

kitkat

echo "/dev/sdX1 swap swap defaults 0 0" >> /etc/fstab

MichaelChapoco

free -m lsblk gdisk /dev/nvmxx n 1 (default) +2G 8e00 w partprobe mkswap /dev/nvmxx vim /etc/fstab /dev/nvmxx swap swap defaults 0 0 :wq swapon -a