温馨提示×

centos mount光驱怎样实现

小樊
40
2026-09-27 05:47:55
栏目: 智能运维

在 CentOS 中挂载光驱(CD/DVD)通常步骤如下:

1. 确认光驱设备

一般光驱设备为:

/dev/cdrom
# 或
/dev/sr0

查看是否存在:

ls -l /dev/cdrom
lsblk

2. 创建挂载目录

mkdir -p /mnt/cdrom

3. 挂载光驱

mount /dev/cdrom /mnt/cdrom

或

mount /dev/sr0 /mnt/cdrom

如果是 ISO 文件:

mount -o loop CentOS.iso /mnt/cdrom

4. 查看是否挂载成功

df -h
ls /mnt/cdrom

5. 卸载光驱

umount /mnt/cdrom

6. 开机自动挂载(可选)

编辑 /etc/fstab:

/dev/cdrom  /mnt/cdrom  iso9660  defaults  0 0

注意:CentOS 7+ 默认使用 systemd,物理光驱插入后也可能自动出现在 /run/media/用户名/ 下。

如果你是 CentOS 用作 yum 源(挂载后配置本地仓库),我也可以继续帮你写 repo 文件。

0 踩