Create ext4 on the empty logical volume /dev/vgdata/lvdocs.
The target device has been verified.
Which command is appropriate?
mkfs.ext4 DEVICE creates ext4 metadata on the block device. It can overwrite existing content, so confirm the target and backups first.
Detailed explanation
mkfs.ext4 /dev/vgdata/lvdocsCorrect. mkfs.ext4 /dev/vgdata/lvdocs creates the filesystem.
Correct. mkfs.ext4 /dev/vgdata/lvdocs creates the filesystem.
mount /dev/vgdata/lvdocs /srv/docsIncorrect. mount attaches an existing filesystem and does not create ext4.
Incorrect. mount attaches an existing filesystem and does not create ext4.
fsck.ext4 /dev/vgdata/lvdocsIncorrect. fsck.ext4 checks an existing filesystem.
Incorrect. fsck.ext4 checks an existing filesystem.
mkswap /dev/vgdata/lvdocsIncorrect. mkswap creates swap metadata, not ext4.
Incorrect. mkswap creates swap metadata, not ext4.
Try it yourself
An example you can run in a temporary verification environment.
mkfs.ext4 -V 2>&1 | sed -n '1,3p'Expected result
mke2fsまたはext2fsライブラリのバージョンKey points
- mkfs.ext4 creates
- mount only attaches
- Existing data can be destroyed
Notes
- Environment: e2fsprogs 1.47 / バージョン表示のみ
- 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.