SIMULATION -
Which world-writable directory should be placed on a separate partition in order to prevent users from being able to fill up the / filesystem? (Specify the full path to the directory.)
/tmp -or- tmp -or- /var/tmp -or- /tmp/ -or- /var/tmp/
In Linux, the root directory ("/") is the top-level directory of the filesystem hierarchy. This directory contains all other directories and files on the system. When the root filesystem fills up, the system can become unstable or even crash, so it's important to prevent users from filling it up.
One way to prevent users from filling up the root filesystem is to create a separate partition for a world-writable directory that users can use to store their data. By creating a separate partition, the amount of space available to users is limited, and the root filesystem is protected from being filled up.
The directory that should be placed on a separate partition is the "/tmp" directory. This directory is used by applications and users to store temporary files, and it is world-writable by default. By creating a separate partition for "/tmp", the amount of space available to users is limited, and the root filesystem is protected from being filled up by temporary files.
To create a separate partition for "/tmp", you can use the "fdisk" or "parted" command to create a new partition on the disk. Once the partition is created, you can format it with a filesystem such as ext4, and then mount it to the "/tmp" directory using the "mount" command. Finally, you can modify the "/etc/fstab" file to ensure that the partition is mounted automatically at boot time.
Here is an example of the steps to create a separate partition for "/tmp":
Use "fdisk" or "parted" to create a new partition on the disk:
Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): p Partition number (1-4, default 1): First sector (2048-20971519, default 2048): Last sector, +sectors or +size{K,M,G} (2048-20971519, default 20971519): Command (m for help): w
Format the partition with a filesystem:
Mount the partition to the "/tmp" directory:
Modify the "/etc/fstab" file to ensure that the partition is mounted automatically at boot time:
After completing these steps, the "/tmp" directory will be mounted on a separate partition, and users will be limited in the amount of space they can use for temporary files.