A Linux server is running with the default tmpfs mount on /dev/shm:
tmpfs /dev/shm tmpfs defaults 0 0
Several applications that rely on POSIX shared memory begin failing with the error "No space left on device". Organizational policy also requires that executable files and device nodes must not be allowed in that location.
While the system is online you need to perform all of the following in one step:
raise the tmpfs limit to 2 GiB,
preserve every file that is already in /dev/shm,
apply the required hardening options.
Which command meets all of these requirements?
mount -o remount,quota=2G,noexec,nodev /dev/shm
umount /dev/shm && mount -t tmpfs -o size=2G,noexec,nodev tmpfs /dev/shm
A tmpfs filesystem allows its size and mount options to be altered in place with a remount. Using mount -o remount keeps the existing instance active, so any shared-memory objects already present remain intact. The option size=2G raises the upper limit, while noexec and nodev enforce the security policy by forbidding executable binaries and device nodes.
A command that omits the remount flag would attempt to create a fresh mount and fail because the mount point is already in use. Commands that specify an invalid option such as quota= would be rejected, and unmounting /dev/shm before mounting again would destroy the data that must be preserved. Therefore, only the listed command satisfies every constraint.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is tmpfs, and how does it differ from other file systems?
Open an interactive chat with Bash
What do the noexec and nodev options do in the context of mounting a file system?
Open an interactive chat with Bash
Why is remounting with 'mount -o remount' necessary in this scenario?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
System Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access