https://blog.csdn.net/qq_42816766/article/details/90961252
文章写的好
注意:在配置yum源前,要保证虚拟机右下角光盘这个图标的连接
1.查看挂载源
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VG_ROOT-Vol01
9.7G 2.9G 6.4G 31% /
/dev/mapper/VG_ROOT-Vol03
3.0G 291M 2.5G 11% /tmp
/dev/mapper/VG_ROOT-Vol04
992M 34M 908M 4% /home
/dev/sda1 190M 13M 168M 7% /boot
tmpfs 1004M 0 1004M 0% /dev/shm
/dev/mapper/vg_orasoft-lv_orasoft_u01
15G 166M 14G 2% /u01
/dev/mapper/vg_orasoft-lv_orasoft
9.9G 3.4G 6.0G 37% /soft
/dev/scd0 3.5G 3.5G 0 100% /media/RHEL_5.5 x86_64 DVD
##使用/dev/scd0来作为挂载源
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2.挂载
[root@localhost ~]# mount /dev/scd0 /mnt/
mount: block device /dev/scd0 is write-protected, mounting read-only
1
2
3.编辑yum源的配置文件
[root@localhost ~]# vim /etc/yum.repos.d/base.repo
[base]
name=base
baseurl=file:///mnt/Server ##在5的版本中要在挂载目录后加/Server
enable=1
gpgcheck=0
1
2
3
4
5
6
4.测试yum源
[root@localhost ~]# yum -y install yum
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Package yum-3.2.22-26.el5.noarch already installed and latest version
Nothing to do
1
2
3
4
5
6
7
5.实现开机自动挂载系统镜像文件
查看文件系统类型
[root@localhost ~]# blkid | grep /dev/scd0
/dev/scd0: LABEL="RHEL/5.5 x86_64 DVD" TYPE="iso9660"
写入开机挂载文件中
[root@localhost ~]# vim /etc/fstab
/dev/scd0 /mnt iso9660 defaults 0 0
[root@localhost ~]# mount -a
1
2
3
4
5
6
7
6.配置完成后的文件系统
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VG_ROOT-Vol01
9.7G 2.9G 6.4G 31% /
/dev/mapper/VG_ROOT-Vol03
3.0G 291M 2.5G 11% /tmp
/dev/mapper/VG_ROOT-Vol04
992M 34M 908M 4% /home
/dev/sda1 190M 13M 168M 7% /boot
tmpfs 1004M 0 1004M 0% /dev/shm
/dev/mapper/vg_orasoft-lv_orasoft_u01
15G 166M 14G 2% /u01
/dev/mapper/vg_orasoft-lv_orasoft
9.9G 3.4G 6.0G 37% /soft
/dev/scd0 3.5G 3.5G 0 100% /media/RHEL_5.5 x86_64 DVD
/dev/scd0 3.5G 3.5G 0 100% /mnt
————————————————
版权声明:本文为CSDN博主「cat媛」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_42816766/article/details/90961252