A systems engineer is adding a new 1GB XFS filesystem that should be temporarily mounted under /ops/app. Which of the following is the correct list of commands to achieve this goal?
Correct Answer: D
The list of commands in option D is the correct way to achieve the goal. The commands are as follows:
fallocate -l 1G /ops/app.img creates a 1GB file named app.img under the /ops directory.
mkfs.xfs /ops/app.img formats the file as an XFS filesystem.
mount -o loop /ops/app.img /ops/app mounts the file as a loop device under the /ops/app directory. The other options are incorrect because they either use the wrong commands (dd or truncate instead of fallocate), the wrong options (-t or -f instead of -o), or the wrong order of arguments (/ops/app.img /ops/app instead of /ops/app /ops/app.img). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 10: Managing Storage, pages 323-324.