Mount the ext4 filesystem with UUID 1111-2222 at /srv/data during boot.
Use an /etc/fstab entry that is less dependent on the device node name.
Which line is appropriate?
An fstab line has source, mount point, filesystem type, options, dump, and fsck-pass fields. UUID= is used as the source tag.
Detailed explanation
/srv/data UUID=1111-2222 ext4 defaults 0 2Incorrect. The source and mount-point fields are reversed.
Incorrect. The source and mount-point fields are reversed.
UUID=1111-2222 /srv/data ext4 defaults 0 2Correct. UUID=1111-2222 /srv/data ext4 defaults 0 2 has the standard field order.
Correct. UUID=1111-2222 /srv/data ext4 defaults 0 2 has the standard field order.
UUID=1111-2222 ext4 /srv/data defaults 2 0Incorrect. The filesystem type and mount-point fields are out of order.
Incorrect. The filesystem type and mount-point fields are out of order.
ext4 /srv/data UUID=1111-2222 defaults 0 2Incorrect. This line does not follow the fstab field order.
Incorrect. This line does not follow the fstab field order.
Try it yourself
An example you can run in a temporary verification environment.
findmnt --verify --tab-file /etc/fstabExpected result
現在のfstab構文検証結果。問題の例行は実環境へ追加しないKey points
- UUID= is the source
- There are six fields
- A non-root ext filesystem commonly uses pass 2
Notes
- Environment: util-linux/fstab 5
- 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.