Which sequence correctly creates an XFS filesystem on /dev/battlestar/galactica, creates the mount point, and mounts it at /mnt/mydir?

Prepare for the Red Hat Certified Systems Admin Exam EX200. Enhance your skills with interactive quizzes, flashcards, and detailed explanations. Ace your certification exam today!

Multiple Choice

Which sequence correctly creates an XFS filesystem on /dev/battlestar/galactica, creates the mount point, and mounts it at /mnt/mydir?

Explanation:
The essential idea is to format the device before mounting it, and to ensure a mount point exists before you mount. You create an XFS filesystem on the device, then create the directory that will serve as the mount point, and finally mount the device to that directory. In this sequence, you run: - mkfs -t xfs /dev/battlestar/galactica to create the XFS filesystem - mkdir /mnt/mydir to make the mount point - mount /dev/battlestar/galactica /mnt/mydir to attach the filesystem to the mount point This order works because the filesystem must exist on the device prior to mounting, and the mount point directory must exist before the mount operation. If you try to mount before the filesystem exists, the mount would fail or show as a raw device. If you try to mount to a directory that hasn’t been created yet, the mount will fail for missing mount point. Formatting after mounting would be impractical and could require unmounting first to apply the filesystem.

The essential idea is to format the device before mounting it, and to ensure a mount point exists before you mount. You create an XFS filesystem on the device, then create the directory that will serve as the mount point, and finally mount the device to that directory. In this sequence, you run:

  • mkfs -t xfs /dev/battlestar/galactica to create the XFS filesystem
  • mkdir /mnt/mydir to make the mount point

  • mount /dev/battlestar/galactica /mnt/mydir to attach the filesystem to the mount point

This order works because the filesystem must exist on the device prior to mounting, and the mount point directory must exist before the mount operation.

If you try to mount before the filesystem exists, the mount would fail or show as a raw device. If you try to mount to a directory that hasn’t been created yet, the mount will fail for missing mount point. Formatting after mounting would be impractical and could require unmounting first to apply the filesystem.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy