Temporarily attach the ext4 filesystem on /dev/sdb1 to the existing directory /mnt/data.
Do not edit /etc/fstab.
Which command is appropriate?
mount SOURCE TARGET attaches a filesystem to the single directory tree. The target directory should normally already exist.
Detailed explanation
mount /dev/sdb1 /mnt/dataCorrect. mount /dev/sdb1 /mnt/data attaches the filesystem at the target.
Correct. mount /dev/sdb1 /mnt/data attaches the filesystem at the target.
umount /dev/sdb1 /mnt/dataIncorrect. umount detaches a filesystem.
Incorrect. umount detaches a filesystem.
mkfs.ext4 /dev/sdb1 /mnt/dataIncorrect. mkfs creates a filesystem and does not mount it.
Incorrect. mkfs creates a filesystem and does not mount it.
blkid /dev/sdb1 /mnt/dataIncorrect. blkid displays device attributes and does not mount it.
Incorrect. blkid displays device attributes and does not mount it.
Try it yourself
An example you can run in a temporary verification environment.
mount --fake --verbose /dev/sdb1 /mnt/dataExpected result
fake指定により実際にはマウントせず、予定処理を表示するKey points
- The source is a device
- The target is a directory
- This is a temporary mount
Notes
- Environment: util-linux mount 2.39以降
- 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.