Exam EX200 All QuestionsBrowse all questions from this exam
Question 81

SIMULATION -

Create a swap space, set the size is 600 MB, and make it be mounted automatically after rebooting the system (permanent mount).

    Correct Answer:

    To create a swap space and ensure it is mounted automatically after rebooting the system, you can follow these steps: 1. Create a swap file of size 600 MB: 'dd if=/dev/zero of=/swapfile bs=1M count=600'. 2. Secure the swap file permissions: 'chmod 600 /swapfile'. 3. Set up the swap space: 'mkswap /swapfile'. 4. Enable the swap space: 'swapon /swapfile'. 5. To make the swap space persistent across reboots, add the following line to '/etc/fstab': '/swapfile swap swap defaults 0 0'. This ensures that the swap file is automatically mounted each time the system reboots.

Discussion
hareshrajpara

# fdisk /dev/sda (create a swap partition with swap type) #mkswap /dev/sda1 #vim /etc/fstab :- UUID=1328c481-4b04-4245-a3ee-36c42f47eea5 swap swap defaults 0 0 #swapon -a #swapon -s

adolfoale

# Create swap partition with fdisk of 600MB # mkswap -c /dev/sdb3 # echo "UUID=bb4b75dc-cb78-4dd9-82e3-ccc13530aca4 swap swap defaults 0 0" >> /etc/fstab

ly01

from the fstab man page: "The second field (fs_file). This field describes the mount point (target) for the filesystem. For swap partitions, this field should be specified as `none'." So the correct fstab line is: UUID=bbfc561b-ff49-415c-9148-aec8e6169599 none swap defaults 0 0