CentOS中光盘的表示
在CentOS中 CD 或 DVD 在 CentOS 文件系统中的代表文件为:
- /dev/sr[0-1]:这是光盘在系统中的文件表示
- /dev/cdrom:表示当前的 CD-ROM
lrwxrwxrwx. 1 root root 3 11月 17 09:45 cdrom -> sr0
brw-rw----+ 1 root cdrom 11, 0 11月 17 09:45 sr0
使用命令查看存储设备
[root@practice dev]# lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sda
├─sda1
├─sda2 xfs 591735ce-ab17-4382-bc96-80a4312eadf8 /boot
├─sda3 LVM2_member JdaqxG-wWPf-BTuU-plKm-ZIAo-uSK0-dgamh3
│ ├─centos-root xfs 91c5ad80-991b-4d11-8b47-cb81f0856cba /
│ └─centos-home xfs 6da0131a-3e4a-489b-8851-7d91bfbf8092 /home
└─sda4 swap 7e968c4f-dcd2-4b22-a169-e2eb1f4c7d56 [SWAP]
sr0 iso9660 CentOS 7 x86_64 2015-03-31-23-50-00-00
[root@practice ~]# blkid
/dev/sda2: UUID="591735ce-ab17-4382-bc96-80a4312eadf8" TYPE="xfs" PARTUUID="7c820576-f8c4-4918-a74a-811ba70c225e"
/dev/sda3: UUID="JdaqxG-wWPf-BTuU-plKm-ZIAo-uSK0-dgamh3" TYPE="LVM2_member" PARTUUID="65ac9bee-a5a1-4bfa-a7f6-eccf195a41ce"
/dev/sda4: UUID="7e968c4f-dcd2-4b22-a169-e2eb1f4c7d56" TYPE="swap" PARTUUID="122022db-b8bb-41c1-8e05-8c5d23719711"
/dev/sr0: UUID="2015-03-31-23-50-00-00" LABEL="CentOS 7 x86_64" TYPE="iso9660" PTTYPE="dos"
/dev/mapper/centos-root: UUID="91c5ad80-991b-4d11-8b47-cb81f0856cba" TYPE="xfs"
/dev/mapper/centos-home: UUID="6da0131a-3e4a-489b-8851-7d91bfbf8092" TYPE="xfs"
光盘进行挂载
将用来安装 CentOS7 的光盘挂载到 /mnt/cdrom 中
[root@practice mnt]# mkdir -p /mnt/cdrom
[root@practice mnt]# mount /dev/sr0 /mnt/cdrom
mount: /dev/sr0 写保护,将以只读方式挂载
[root@practice mnt]# cd /mnt/cdrom/
[root@practice cdrom]# ll
总用量 614
-rw-r--r--. 1 root root 16 4月 1 2015 CentOS_BuildTag
drwxr-xr-x. 3 root root 2048 3月 28 2015 EFI
-rw-r--r--. 1 root root 215 3月 28 2015 EULA
-rw-r--r--. 1 root root 18009 3月 28 2015 GPL
drwxr-xr-x. 3 root root 2048 3月 28 2015 images
drwxr-xr-x. 2 root root 2048 3月 28 2015 isolinux
drwxr-xr-x. 2 root root 2048 3月 28 2015 LiveOS
drwxr-xr-x. 2 root root 589824 4月 1 2015 Packages
drwxr-xr-x. 2 root root 4096 4月 1 2015 repodata
-rw-r--r--. 1 root root 1690 3月 28 2015 RPM-GPG-KEY-CentOS-7
-rw-r--r--. 1 root root 1690 3月 28 2015 RPM-GPG-KEY-CentOS-Testing-7
-r--r--r--. 1 root root 2883 4月 1 2015 TRANS.TBL
[root@practice mnt]# umount /dev/sr0 #卸载光盘
设置开机自动挂载
[root@practice mnt]# vim /etc/fstab
UUID="2015-03-31-23-50-00-00" /mnt/cdrom iso9660 defaults 0 0