/ dev / sr0にすでに挿入されているCD-ROMを、root権限で発行されたときに既存のディレクトリ/ mnt / cdromにマウントするコマンドは次のうちどれですか
正解:B
Explanation
The mount command is used to attach a filesystem to a directory on the system, which is called a mount point.
The mount command requires the device name or the UUID of the filesystem as the first argument, and the mount point as the second argument. Optionally, the mount command can also take some options, such as the filesystem type, the mount options, and the label. The syntax of the mount command is:
mount [options] device mountpoint
In this question, the device name of the CD-ROM is /dev/sr0, and the mount point is /mnt/cdrom. Therefore, the correct command to mount the CD-ROM is:
mount /dev/sr0 /mnt/cdrom
This command will mount the CD-ROM as a read-only filesystem with the type iso9660, which is the standard format for optical discs. The mount command can automatically detect the filesystem type and the mount options, so there is no need to specify them explicitly. However, if you want to specify them, you can use the
-t and -o options, respectively. For example, the following command is equivalent to the previous one:
mount -t iso9660 -o ro /dev/sr0 /mnt/cdrom
The other options are not correct because:
* A. mount /dev/cdrom /mnt/cdrom: This command may work on some systems, but it is not guaranteed to be correct. The /dev/cdrom is usually a symbolic link to the actual device name of the CD-ROM, which can vary depending on the system. For example, on some systems, the /dev/cdrom may point to
/dev/sr0, but on others, it may point to /dev/scd0 or /dev/hdc. Therefore, it is better to use the actual device name of the CD-ROM, which can be found by using the lsblk or the dmesg command.
* C. mount -t cdrom /dev/sr0 /mnt/cdrom: This command is not valid because cdrom is not a valid filesystem type. The filesystem type for optical discs is iso9660, not cdrom. The mount command will fail with an error message saying:
mount: unknown filesystem type 'cdrom'
* D. mount -l cdrom /dev/sr0 /mnt/cdrom: This command is not valid because -l is not a valid option for the mount command. The -l option is used to list all the mounted filesystems, not to mount a filesystem.
The mount command will fail with an error message saying:
mount: can't find /dev/sr0 in /etc/fstab
* E. mount -f /dev/sr0/mnt/cdrom: This command is not valid because it is missing a space between the device name and the mount point. The mount command requires two separate arguments for the device name and the mount point, separated by a space. Also, the -f option is used to fake the mount operation, not to perform the actual mount. The mount command will fail with an error message saying:
mount: /dev/sr0/mnt/cdrom: mount point does not exist.
References:
* How to mount cdrom in Linux - Learn Linux Configuration
* Mount CD-ROM in Linux using Command Line - nixCraft
* Mounting the CD or DVD (Linux) - IBM