Attach ext4 /dev/vgdata/lvdocs at /srv/docs for the current session.
Persistent boot-time configuration is a separate task.
Which command is appropriate?
mount SOURCE TARGET attaches a filesystem to the current namespace. A standalone mount command does not make the configuration persistent.
Detailed explanation
mkfs.ext4 /dev/vgdata/lvdocsIncorrect. mkfs.ext4 would recreate the filesystem and can destroy data.
Incorrect. mkfs.ext4 would recreate the filesystem and can destroy data.
umount /srv/docsIncorrect. umount detaches an existing mount.
Incorrect. umount detaches an existing mount.
swapon /dev/vgdata/lvdocsIncorrect. swapon enables swap, not a regular ext4 mount.
Incorrect. swapon enables swap, not a regular ext4 mount.
mount /dev/vgdata/lvdocs /srv/docsCorrect. mount /dev/vgdata/lvdocs /srv/docs attaches the filesystem.
Correct. mount /dev/vgdata/lvdocs /srv/docs attaches the filesystem.
Try it yourself
An example you can run in a temporary verification environment.
mount --help | sed -n '1,16p'Expected result
mount device directory形式の使用法Key points
- mount attaches
- A target directory is required
- Persistence needs fstab
Notes
- Environment: util-linux mount / ヘルプ表示のみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.