在 Linux 操作系统下,如何在不使用 GUI 选项的情况下找到我的 CD-ROM 或 DVD 设备或蓝光设备的名称?
您可以键入以下命令来查看有关 Linux 操作系统下已安装和检测到的 CDROM 或 DVD 刻录机的当前信息:
- 该dmesg命令可用于检查 Linux 内核是否正确识别给定的硬件或设备。
- /proc/sys/dev/cdrom/info文件名。
- lsblk命令。
- blkid命令。
教程详情 | |
---|---|
难度级别 | 简单的 |
根权限 | 是的 |
要求 | Linux终端 |
类别 | 系统管理 |
操作系统兼容性 | Alma • Alpine • Arch • CentOS • Debian • Fedora • Linux • Mint • openSUSE • Pop!_OS • RHEL • Rocky • Stream • SUSE • Ubuntu |
美东时间。阅读时间 | 7分钟 |
使用 dmesg 命令查找 DVD / CD-ROM / 蓝光刻录机设备的名称
dmesg 命令用于检查 Linux 内核环形缓冲区,即在屏幕上显示启动消息。要查明是否检测到 cdrom,请运行:
示例输出:
$ dmesg | grep -E -i --color 'cdrom|dvd|cd/rw|writer'
[5.437164] sr0:scsi3-mmc驱动器:24x/24x刻录机dvd-ram cd/rw xa/form2 cdda托盘 [5.437307]cdrom:统一CD-ROM驱动程序修订版:3.20
在此输出中,sr0 是我的 cdrom / DVD 阅读器和写入器。您可以通过键入以下 less 命令或 more 命令
$ less /proc/sys/dev/cdrom/info
或
$ more /proc/sys/dev/cdrom/info
示例输出来查看更详细的信息:
光盘信息,Id:cdrom.c 3.20 2003/12/17 驱动器名称:sr0 驱动器速度: 24 驱动器插槽数量: 1可以 关闭 托盘: 1可以打开托盘: 1 可以锁定托盘: 1 可以更改速度: 1 可以选择磁盘: 0 可以读取多会话: 1 可以读取 MCN: 1 报告介质已更改: 1 可播放音频: 1 可写入 CD-R: 1 可写入 CD-RW: 1 可读取 DVD: 1 可写入 DVD-R: 1 可写入 DVD-RAM: 1 可读取 MRW: 1 可写入 MRW: 1 可写入内存: 1
要查看 CD-ROM 驱动器特征信息,请输入:
$ cd-drive
这是我在 Linux 桌面上看到的内容:
CD 驱动器版本0.81 x86_64-pc-linux-gnu Copyright (c) 2003, 2004, 2005, 2007, 2008 R. Bernstein This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The driver selected is GNU/Linux The default device for this driver is /dev/cdrom Drivers available... GNU/Linux ioctl and MMC driver cdrdao (TOC) disk image driver bin/cuesheet disk image driver Nero NRG disk image driver CD-ROM drive supports some nonstandard or degenerate set of MMC Drive: /dev/cdrom Vendor : MATSHITA Model : BD-RE UJ232A Revision : 1.10 Profile List Feature Unknown Profile 41 Unknown Profile 42 Unknown Profile 43 Unknown Profile 40 Re-writable DVD DVD+R - DVD Recordable DVD+RW - DVD ReWritable Re-recordable DVD using Restricted Overwrite Re-recordable DVD using Sequential recording Re-recordable DVD using Sequential recording Read only DVD CD-RW Re-writable Compact Disc capable Write once Compact Disc capable Read only Compact Disc capable Core Feature Morphing Feature Operational Change Request/Notification supported Synchronous GET EVENT/STATUS NOTIFICATION supported Removable Medium Feature Tray type loading mechanism can eject the medium or magazine via the normal START/STOP command can be locked into the Logical Unit Write Protect Feature Random Readable Feature Multi-Read Feature CD Read Feature C2 Error pointers are supported CD-Text is supported DVD Read Feature Random Writable Feature Incremental Streaming Writable Feature Formattable Feature Management Ability of the Logical Unit/media system to provide an apparently defect-free space. Feature Restricted Overwrite Feature DVD+RW Feature DVD+R Feature Rigid Restricted Overwrite Feature CD Track at Once Feature CD Mastering (Session at Once) Feature DVD-R/RW Write Feature Unknown code 34 Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Profile List Feature Hardware : CD-ROM or DVD Can eject : Yes Can close tray : Yes Can disable manual eject : Yes Can select juke-box disc : No Can set drive speed : No Can read multiple sessions (e.g. PhotoCD) : Yes Can hard reset device : Yes Reading.... Can read Mode 2 Form 1 : Yes Can read Mode 2 Form 2 : Yes Can read (S)VCD (i.e. Mode 2 Form 1/2) : Yes Can read C2 Errors : Yes Can read IRSC : Yes Can read Media Channel Number (or UPC) : Yes Can play audio : Yes Can read CD-DA : Yes Can read CD-R : Yes Can read CD-RW : Yes Can read DVD-ROM : Yes Writing.... Can write CD-RW : Yes Can write DVD-R : Yes Can write DVD-RAM : Yes Can write DVD-RW : No Can write DVD+RW : No CD-ROM drive supports some nonstandard or degenerate set of MMC Drive: /dev/sr0 Vendor : MATSHITA Model : BD-RE UJ232A Revision : 1.10 Profile List Feature Unknown Profile 41 Unknown Profile 42 Unknown Profile 43 Unknown Profile 40 Re-writable DVD DVD+R - DVD Recordable DVD+RW - DVD ReWritable Re-recordable DVD using Restricted Overwrite Re-recordable DVD using Sequential recording Re-recordable DVD using Sequential recording Read only DVD CD-RW Re-writable Compact Disc capable Write once Compact Disc capable Read only Compact Disc capable Core Feature Morphing Feature Operational Change Request/Notification supported Synchronous GET EVENT/STATUS NOTIFICATION supported Removable Medium Feature Tray type loading mechanism can eject the medium or magazine via the normal START/STOP command can be locked into the Logical Unit Write Protect Feature Random Readable Feature Multi-Read Feature CD Read Feature C2 Error pointers are supported CD-Text is supported DVD Read Feature Random Writable Feature Incremental Streaming Writable Feature Formattable Feature Management Ability of the Logical Unit/media system to provide an apparently defect-free space. Feature Restricted Overwrite Feature DVD+RW Feature DVD+R Feature Rigid Restricted Overwrite Feature CD Track at Once Feature CD Mastering (Session at Once) Feature DVD-R/RW Write Feature Unknown code 34 Feature Vendor-specific code f048 Feature Vendor-specific code 473e Feature Vendor-specific code eaff Feature Vendor-specific code a4ab Feature Vendor-specific code eaff Feature Hardware : CD-ROM or DVD Can eject : Yes Can close tray : Yes Can disable manual eject : Yes Can select juke-box disc : No Can set drive speed : No 可以读取多个会话(例如 PhotoCD ):是 可以硬重置设备:是 阅读.... 可以读取模式2表1 :是 可以读取模式2 Form 2 :是 可以读取( S ) VCD (即模式2 Form 1 / 2 ) :是 可以读取 C2 错误:是 可以读取 IRSC :是 可以读取媒体通道号(或UPC ) :是 是否可以播放音频:是 可以读取 CD-DA : 是 可以读取 CD-R : 是 可以读取 CD-RW : 是 可以读取 DVD-ROM : 是 写作.... 可以写入 CD-RW : 是 可以写入 DVD-R : 是 可以写入 DVD-RAM : 是 可以写入 DVD-RW : 否 可以写入 DVD+RW : 否
使用Linux lsblk命令列出DVD / CD-ROM /蓝光刻录机设备
要列出所有块设备,请键入 lsblk 命令:
# lsblk
示例输出:
名称 主要:最小 RM 尺寸 RO 类型 安装点
sda 8:0 1 558G 0盘
├─sda1 8:1 1 307M 0 部分 /boot
├─sda2 8:2 1 250G 0 部分 /datasql
├─sda3 8:3 1 6G 0 部分 [交换]
├─sda4 8:4 1 1K 0 部分
└─sda5 8:5 1 301.7G 0 份 /
sr0 11:0 1 1024M 0 ROM
在 Linux 上使用 blkid 命令查找 DVD / CD-ROM / Blu-ray 的名称
- 将 DVD / CD-ROM / Blu-ray 插入您的 Linux 计算机。
- 在 CLI 中键入以下命令以获取计算机上所有可用块设备的列表。例如:
$ blkid
- 查找 DVD/蓝光/CD-ROM 设备名称,例如 /dev/cdrom 或 /dev/sr0 等。
- 一旦您知道了 Linux DVD / CD-ROM / 蓝光驱动器的名称,您就可以使用它来安装光盘以访问其内容。例如,要从 DVD 挂载 ISO 映像,可以使用以下命令:
$ sudo mkdir /mnt/dvd-rom
$ sudo mount /dev/sr0 /mnt/dvd-rom
$ ls /mnt/dvd-rom
加起来
这就是您在 Linux 下列出或查找 DVD/CD-ROM 或蓝光设备名称的方法。使用 man 命令或 info 命令/help 命令阅读以下手册页以获取更多信息:
$ man dmesg
$ man lsblk
$ man blkid
$ man mount