Attach /dev/sdb1 at /mnt/check for inspection.
Prevent accidental writes by mounting it read-only from the start.
Which command is appropriate?
mount -o ro SOURCE TARGET connects a filesystem read-only. Device and filesystem state may impose additional restrictions.
Detailed explanation
mount -o rw /dev/sdb1 /mnt/checkIncorrect. rw explicitly requests read-write access.
Incorrect. rw explicitly requests read-write access.
mount -o ro /dev/sdb1 /mnt/checkCorrect. mount -o ro /dev/sdb1 /mnt/check requests read-only access.
Correct. mount -o ro /dev/sdb1 /mnt/check requests read-only access.
mount -o exec /dev/sdb1 /mnt/checkIncorrect. exec controls execution of binaries, not write access.
Incorrect. exec controls execution of binaries, not write access.
mount -o auto /dev/sdb1 /mnt/checkIncorrect. auto controls automatic mounting, not read-only access.
Incorrect. auto controls automatic mounting, not read-only access.
Try it yourself
An example you can run in a temporary verification environment.
mount --fake --verbose -o ro /dev/sdb1 /mnt/checkExpected result
fake指定により実際にはマウントせず、ro指定を含む予定処理を表示するKey points
- ro means read-only
- rw means read-write
- Useful during investigation
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.