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.
umount /srv/docsIncorrect. umount detaches an existing mount.
swapon /dev/vgdata/lvdocsIncorrect. swapon enables swap, not a regular ext4 mount.
mount /dev/vgdata/lvdocs /srv/docsCorrect. 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 / ヘルプ表示のみ
- Prefer help or version output and a disposable device when testing storage commands.
- Formatting, repair, and mount changes can affect data or availability.
Foundation review
Place the operation
mount changes the current namespace; fstab records how mounts can be recreated.
Check the side effect
Remember that files beneath a mount point are hidden while the filesystem is mounted.