Red Hat Linux 7.3+VMWare 虚拟机搭载ISO文件实战
版权声明:本文为笔记里的蹉跎出品,文章可共享,转载请声明。
本文主要内容:
Red Hat Linux 7.3+VMWare 虚拟机搭载ISO
1.首先,当然得按照文件目录创建文件夹:/root/Desktop/develop/user/system,利用XShell 5 把ISO文件上传到/root/Desktop/develop/user/system
2.打开终端,输入:mkdir /media/cdrom
[root@marklin ~]# mkdir /media/cdrom
[root@marklin ~]#
3.输入:ls
[root@marklin ~]# ls
anaconda-ks.cfg Documents initial-setup-ks.cfg Pictures Templates
Desktop Downloads Music Public Videos
[root@marklin ~]#
4.输入 : cd /root/Desktop/develop/user/system
[root@marklin ~]# cd /root/Desktop/develop/user/system
[root@marklin system]#
5.输入:ls
[root@marklin system]# ls
rhel-server-7.3-x86_64-dvd.iso
[root@marklin system]#
6.输入:mount -t iso9960 -o loop /root/Desktop/develop/user/system /rhel-server-7.3-x86_64-dvd.iso /media/cdrom
[root@marklin system]# mount -t iso9960 -o loop /root/Desktop/develop/user/system /rhel-server-7.3-x86_64-dvd.iso /media/cdrom
Usage:
mount [-lhV]
mount -a [options]
mount [options] [--source] <source> | [--target] <directory>
mount [options] <source> <directory>
mount <operation> <mountpoint> [<target>]
Options:
-a, --all mount all filesystems mentioned in fstab
-c, --no-canonicalize don't canonicalize paths
-f, --fake dry run; skip the mount(2) syscall
-F, --fork fork off for each device (use with -a)
-T, --fstab <path> alternative file to /etc/fstab
-h, --help display this help text and exit
-i, --internal-only don't call the mount.<type> helpers
-l, --show-labels lists all mounts with LABELs
-n, --no-mtab don't write to /etc/mtab
-o, --options <list> comma-separated list of mount options
-O, --test-opts <list> limit the set of filesystems (use with -a)
-r, --read-only mount the filesystem read-only (same as -o ro)
-t, --types <list> limit the set of filesystem types
--source <src> explicitly specifies source (path, label, uuid)
--target <target> explicitly specifies mountpoint
-v, --verbose say what is being done
-V, --version display version information and exit
-w, --rw, --read-write mount the filesystem read-write (default)
-h, --help display this help and exit
-V, --version output version information and exit
Source:
-L, --label <label> synonym for LABEL=<label>
-U, --uuid <uuid> synonym for UUID=<uuid>
LABEL=<label> specifies device by filesystem label
UUID=<uuid> specifies device by filesystem UUID
PARTLABEL=<label> specifies device by partition label
PARTUUID=<uuid> specifies device by partition UUID
<device> specifies device by path
<directory> mountpoint for bind mounts (see --bind/rbind)
<file> regular file for loopdev setup
Operations:
-B, --bind mount a subtree somewhere else (same as -o bind)
-M, --move move a subtree to some other place
-R, --rbind mount a subtree and all submounts somewhere else
--make-shared mark a subtree as shared
--make-slave mark a subtree as slave
--make-private mark a subtree as private
--make-unbindable mark a subtree as unbindable
--make-rshared recursively mark a whole subtree as shared
--make-rslave recursively mark a whole subtree as slave
--make-rprivate recursively mark a whole subtree as private
--make-runbindable recursively mark a whole subtree as unbindable
For more details see mount(8).
[root@marklin system]#
7. 输入:cd /media/cdrom
[root@marklin system]# cd /media/cdrom
[root@marklin cdrom]#
8.输入:ls
[root@marklin cdrom]# ls
[root@marklin cdrom]# ll
9.输入:ll
[root@marklin cdrom]# ll
total 0
[root@marklin cdrom]#
10.输入:pwd
[root@marklin cdrom]# pwd
/media/cdrom
[root@marklin cdrom]#
11.输入:vim /etc/fstab
[root@marklin cdrom]# vim /etc/fstab
[root@marklin cdrom]#
12.输入:df -H
[root@marklin cdrom]# df -H
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 39G 7.6G 31G 20% /
devtmpfs 2.1G 0 2.1G 0% /dev
tmpfs 2.1G 148k 2.1G 1% /dev/shm
tmpfs 2.1G 9.5M 2.1G 1% /run
tmpfs 2.1G 0 2.1G 0% /sys/fs/cgroup
/dev/sda1 259M 141M 118M 55% /boot
tmpfs 413M 25k 413M 1% /run/user/0
[root@marklin cdrom]#
13.输入:cd /etc/yum.repos.d/
[root@marklin cdrom]# cd /etc/yum.repos.d/
[root@marklin yum.repos.d]#
14.输入:
[root@marklin yum.repos.d]# touch rhel-media.repo
[root@marklin yum.repos.d]#
15.输入:vim rhel-media.repo
[root@marklin yum.repos.d]# vim rhel-media.repo
即将打开vim视图窗口,输入下列内容:
cd /etc/yum.repos.d/ #进入yum配置目录
touch rhel-media.repo #建立yum配置文件
vim rhel-media.repo #编辑配置文件,添加以下内容
[rhel-media]
name=Red Hat Enterprise Linux 7.3 #自定义名称
baseurl=file:///media/cdrom #本地光盘挂载路径
enabled=1 #启用yum源,0为不启用,1为启用
gpgcheck=0 #检查GPG-KEY,0为不检查,1为检查
键盘按下Esc,英文输入法输入[:],输入:wq!,Enter保存
[root@marklin yum.repos.d]#
16.输入:yum clean all
[root@marklin yum.repos.d]# yum clean all
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-
: manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
File contains no section headers.
file: file:///etc/yum.repos.d/rhel-media.repo, line: 1
'cd /etc/yum.repos.d/ #\xe8\xbf\x9b\xe5\x85\xa5yum\xe9\x85\x8d\xe7\xbd\xae\xe7\x9b\xae\xe5\xbd\x95\n'
[root@marklin yum.repos.d]#