RHEL_8.1-挂载镜像
上传ISO到本地
mkdir /software
ll /software/
total 7667712
-rw-r--r--. 1 root root 7851737088 May 30 21:52 rhel-8.1-x86_64-dvd.iso
手动挂载
mkdir /media/cdrom -p
mount -t iso9660 -o loop /software/rhel-8.1-x86_64-dvd.iso /media/cdrom
自动挂载
vim /etc/fstab
/software/rhel-8.1-x86_64-dvd.iso /media/cdrom iso9660 defaults,ro,loop 0 0
#然后再mount -a 挂载
#但是或许会出现如下问题:
cat /etc/fstab |grep iso
#/root/rh401-pub.iso /mediaiso9660 defaults,ro,loop 0 0
mount -a
#mount: wrong fs type, bad option, bad superblock on /dev/loop0,missing codepage or other error
#In some cases useful info is found insyslog - try dmesg | tailor so
#提示错误的文件系统类型,so,可能iso镜像文件并不是一般的iso9660格式的,如何查看呢?
#1.手动挂载
#2.查看系统类型 udf
mount -o loop /software/rhel-8.1-x86_64-dvd.iso /media/cdrom
df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/sda2 ext3 135325776 55307840 73032876 44% /
/dev/sda1 ext3 194442 12027 172376 7% /boot
tmpfs tmpfs 2998992 0 2998992 0% /dev/shm
/root/rh401-pub.iso udf 31957342 31957342 0 100% /media
#在/etc/fstab中就知道怎么写了
[root@desktop2 ~]# grep udf /etc/fstab --color
/root/rh401-pub.iso/mediaudfdefaults,ro,loop0 0
[root@desktop2 ~]# mount -a
[root@desktop2 ~]# mount |grep udf --color
/root/rh401-pub.iso on /media type udf (rw,loop=/dev/loop0)