mount

[root@host-192-0-11-183 isorepo]# more /etc/yum.repos.d/dvd.repo       //查看/etc/yum.repos.d/dvd.repo
/etc/yum.repos.d/dvd.repo: No such file or directory                                //发现没有这个文件
[root@host-192-0-11-183 isorepo]# touch /etc/yum.repos.d/dvd.repo      //使用touch命令创建这个文件dvd.repo
[root@host-192-0-11-183 isorepo]# vi /etc/yum.repos.d/dvd.repo            //用vi命令编辑该文件
[root@host-192-0-11-183 isorepo]#                                                                                                                                    [c7-media]                                                                                                                                                                                                      name=CGSL-$releasever - Media                                                                                                                                                                                                   baseurl=file:///isorepo/tmp                                                                                                                                                                                                     gpgcheck=0                                                                                                                                                                                                  enabled=1                                                                                                                                                                                                   gpgkey=file:///isorepo/tmp/RPM-GPG-KEY-CGSL-V5
[root@host-192-0-11-183 isorepo]#
[root@host-192-0-11-183 isorepo]#
[root@host-192-0-11-183 isorepo]#
[root@host-192-0-11-183 isorepo]# mount -o loop CGS-Linux-MAIN.V5.04.F1-x86_64.dvd.iso ./tmp        挂载点./tmp  
mount: mount point ./tmp does not exist                                                                                                                         挂载点不存在
[root@host-192-0-11-183 isorepo]# mkdir ./tmp                                                                                                           创建目录./tmp
[root@host-192-0-11-183 isorepo]# mount -o loop CGS-Linux-MAIN.V5.04.F1-x86_64.dvd.iso ./tmp      
mount: /dev/loop2 is write-protected, mounting read-only
[root@host-192-0-11-183 isorepo]# yum install git                                                                                                       安装git命令
Loaded plugins: fastestmirror
Repository c7-media is listed more than once in the configuration
file:///mnt/cdrom/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /mnt/cdrom/repodata/repomd.xml"
Trying other mirror.
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.8.3.1-12.el7_4 will be installed
--> Processing Dependency: perl-Git = 1.8.3.1-12.el7_4 for package: git-1.8.3.1-12.el7_4.x86_64
--> Processing Dependency: rsync for package: git-1.8.3.1-12.el7_4.x86_64
--> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.3.1-12.el7_4.x86_64
--> Processing Dependency: perl(Git) for package: git-1.8.3.1-12.el7_4.x86_64
--> Processing Dependency: perl(Error) for package: git-1.8.3.1-12.el7_4.x86_64
--> Processing Dependency: libgnome-keyring.so.0()(64bit) for package: git-1.8.3.1-12.el7_4.x86_64
--> Running transaction check
---> Package libgnome-keyring.x86_64 0:3.12.0-1.el7 will be installed
---> Package perl-Error.noarch 1:0.17020-2.el7 will be installed
---> Package perl-Git.noarch 0:1.8.3.1-12.el7_4 will be installed
---> Package perl-TermReadKey.x86_64 0:2.30-20.el7 will be installed
---> Package rsync.x86_64 0:3.0.9-18.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================
 Package                     Arch              Version                      Repository           Size
======================================================================================================
Installing:
 git                         x86_64            1.8.3.1-12.el7_4             c7-media            4.4 M
Installing for dependencies:
 libgnome-keyring            x86_64            3.12.0-1.el7                 c7-media            108 k
 perl-Error                  noarch            1:0.17020-2.el7              c7-media             31 k
 perl-Git                    noarch            1.8.3.1-12.el7_4             c7-media             52 k
 perl-TermReadKey            x86_64            2.30-20.el7                  c7-media             30 k
 rsync                       x86_64            3.0.9-18.el7                 c7-media            358 k

Transaction Summary
======================================================================================================
Install  1 Package (+5 Dependent packages)

Total download size: 5.0 M
Installed size: 23 M
Is this ok [y/d/N]: y
Downloading packages:


Error downloading packages:
  rsync-3.0.9-18.el7.x86_64: [Errno 256] No more mirrors to try.
  libgnome-keyring-3.12.0-1.el7.x86_64: [Errno 256] No more mirrors to try.
  perl-Git-1.8.3.1-12.el7_4.noarch: [Errno 256] No more mirrors to try.
  git-1.8.3.1-12.el7_4.x86_64: [Errno 256] No more mirrors to try.
  1:perl-Error-0.17020-2.el7.noarch: [Errno 256] No more mirrors to try.
  perl-TermReadKey-2.30-20.el7.x86_64: [Errno 256] No more mirrors to try.

[root@host-192-0-11-183 isorepo]# cd /etc/yum.repos.d/                                                                            进入目录/etc/yum.repos.d/
CGSL-Media.repo  dvd.repo         zte.repo
[root@host-192-0-11-183 isorepo]# cd /etc/yum.repos.d/
[root@host-192-0-11-183 yum.repos.d]# ll
total 12
-rw-r--r--. 1 root root 553 Mar 13 08:40 CGSL-Media.repo
-rw-r--r--. 1 root root 137 Jul  2 22:15 dvd.repo
-rw-r--r--. 1 root root 502 Mar 23 03:38 zte.repo
[root@host-192-0-11-183 yum.repos.d]# more zte.repo                                                                                  发现里面有三个文件,但是其中只有dvd.repo是我们创建的,现在查看zte.repo文件
# CGSL-Media.repo
#
# This repo is used to mount the default locations for a CDROM / DVD on
#  CGSL V4.  You can use this repo and yum to install items directly off the
#  DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
#  yum --enablerepo=c7-media [command]
#
# or for ONLY the media repo, do this:
#
#  yum --disablerepo=\* --enablerepo=c6-media [command]

[zterepo]
name=zterepo
baseurl=http://10.43.177.198/repo/yum/tecs/
gpgcheck=0
enabled=1
[root@host-192-0-11-183 yum.repos.d]# ^C
[root@host-192-0-11-183 yum.repos.d]#
[root@host-192-0-11-183 yum.repos.d]#
[root@host-192-0-11-183 yum.repos.d]#
[root@host-192-0-11-183 yum.repos.d]# ll
total 12
-rw-r--r--. 1 root root 553 Mar 13 08:40 CGSL-Media.repo
-rw-r--r--. 1 root root 137 Jul  2 22:15 dvd.repo
-rw-r--r--. 1 root root 502 Mar 23 03:38 zte.repo
[root@host-192-0-11-183 yum.repos.d]# mv zte.repo
mv: missing destination file operand after ‘zte.repo’
Try 'mv --help' for more information.
[root@host-192-0-11-183 yum.repos.d]# mv zte.repo zte.repo.bak                                                      使用mv命令给文件或文件夹重新命名,将zte.repo重新命名为zte.repo.bak
[root@host-192-0-11-183 yum.repos.d]# mv CGSL-Media.repo.bak                                                    
mv: missing destination file operand after ‘CGSL-Media.repo.bak’
Try 'mv --help' for more information.
[root@host-192-0-11-183 yum.repos.d]#
[root@host-192-0-11-183 yum.repos.d]#
[root@host-192-0-11-183 yum.repos.d]#
[root@host-192-0-11-183 yum.repos.d]# mv CGSL-Media.repo CGSL-Media.repo.bak                    使命mv命令给文件或文件夹重新命名,将CGSL-Media.repo重新命名为CGSL-Media.repo.bak
[root@host-192-0-11-183 yum.repos.d]#
[root@host-192-0-11-183 yum.repos.d]#
[root@host-192-0-11-183 yum.repos.d]#
[root@host-192-0-11-183 yum.repos.d]#
[root@host-192-0-11-183 yum.repos.d]#
[root@host-192-0-11-183 yum.repos.d]#
[root@host-192-0-11-183 yum.repos.d]#
[root@host-192-0-11-183 yum.repos.d]# yum install git                                                                               这样只能从本地寻找安装包并安装,也就是dvd.repo文件中寻找安装源





[root@host-192-0-11-183 V6]# git clone ssh://10239871@gerritro.zte.com.cn:29418/zxv6pf/v6/code/tulip && git config --global url."ssh://10239871@gerrit.zte.com.cn".pushInsteadOf ssh://10239871@gerritro.zte.com.cn && scp -p -P 29418 10239871@gerrit.zte.com.cn:hooks/commit-msg tulip/.git/hooks/
Cloning into 'tulip'...
ssh: Could not resolve hostname gerritro.zte.com.cn: Name or service not known                                                报错的原因是无法解析域名
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
[root@host-192-0-11-183 V6]# more /etc/resolv.conf                                                                                                   more命令跟cat一样,查看文件/etc/resolv.conf
; generated by /usr/sbin/dhclient-script
search openstacklocal
nameserver 192.0.11.107
nameserver 192.0.11.108
[root@host-192-0-11-183 V6]# vi /etc/resolv.conf                                                                                                       发现没有配虚拟机内网的DNS服务器,所以无法解析域名。添加nameserver 10.41.132.9


[root@host-192-0-11-183 V6]# git clone ssh://10239871@gerritro.zte.com.cn:29418/zxv6pf/v6/code/tulip && git config --global url."ssh://10239871@gerrit.zte.com.cn".pushInsteadOf ssh:/                                                                              /10239871@gerritro.zte.com.cn && scp -p -P 29418 10239871@gerrit.zte.com.cn:hooks/commit-ms                                                                              g tulip/.git/hooks/
Cloning into 'tulip'...
The authenticity of host '[gerritro.zte.com.cn]:29418 ([10.41.103.17]:29418)' can't be established.               意思是没有把本地生成的publickey添加到Gerrit上,此时本地还没有生成sshkey
RSA key fingerprint is SHA256:oEryy4r4kadgHC3fEOypCXrNeDvQAIRAVHGCQAFoB80.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[gerritro.zte.com.cn]:29418,[10.41.103.17]:29418' (RSA) to the list of known hosts.
10239871@gerritro.zte.com.cn: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
[root@host-192-0-11-183 V6]# find ~/.ssh
/root/.ssh
/root/.ssh/known_hosts
[root@host-192-0-11-183 V6]# cd root
-bash: cd: root: No such file or directory
[root@host-192-0-11-183 V6]# cd /root
[root@host-192-0-11-183 ~]# ll
total 4
-rw-------. 1 root root 1295 Mar 13 08:21 anaconda-ks.cfg
[root@host-192-0-11-183 ~]# ssh-keygen -t rsa -C"xia.yimin@zte.com.cn"                                                                   生成sshkey密钥对
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:JmxKylqE/QUPiVo5etzZMFbLMx8bsD5SDxgZKk6pY8A xia.yimin@zte.com.cn
The key's randomart image is:
+---[RSA 2048]----+
|    ooo          |
|. .+.* +         |
|oE* O O o        |
|=O + % * +       |
|*o= = X S        |
|.= + = +         |
|  + o            |
| o               |
|.                |
+----[SHA256]-----+
[root@host-192-0-11-183 ~]# cat /root/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7P45FVV5v7eUO258jhA6qVPTZt4Wt7zcgrMu5e+0u5tR9fGn5E2QMPwbkekvCmBuHa/Y6NwMYLH617uWEmO2YobWE30agcgc8+zykfqmheI+pTmn0hAbeWRQsXGD9eH8X2OcnP0AoP8+TFQKRUINdDo6c9Qd9+d+cQ7dwj/qnW1gHqhQl/i1uV5MhRwLp8zFCEYhU79rOaGXdpkIJUTlrfOySkid6U6ly9LLdnX9OKzp9JiJ9iYvHnleednd0UeJaUs68uSDR4YDCt1Tua68Ym7l4oBH9N0X2daJu+3hPPvyRA/x5boyqRkTtpT39gjhJWXAHdvWbpwE6zZd25HNR xia.yimin@zte.com.cn
[root@host-192-0-11-183 ~]# git clone ssh://10239871@gerritro.zte.com.cn:29418/zxv6pf/v6/code/tulip && git config --global url."ssh://10239871@gerrit.zte.com.cn".pushInsteadOf ssh://10239871@gerritro.zte.com.cn && scp -p -P 29418 10239871@gerrit.zte.com.cn:hooks/commit-msg tulip/.git/hooks/
Cloning into 'tulip'...
10239871@gerritro.zte.com.cn: Permission denied (publickey).                                                                                           //把本地生成的publickey添加到Gerrit上,还是不行,竟然是因为Gerrit上的key太多,删除所有以前的只留刚生成的,再试就可以了竟然。应该使用ssh-agent bash  ssh-add
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
[root@host-192-0-11-183 ~]# git clone ssh://10239871@gerritro.zte.com.cn:29418/zxv6pf/v6/code/tulip && git config --global url."ssh://10239871@gerrit.zte.com.cn".pushInsteadOf ssh://10239871@gerritro.zte.com.cn && scp -p -P 29418 10239871@gerrit.zte.com.cn:hooks/commit-msg tulip/.git/hooks/
Cloning into 'tulip'...
remote: Counting objects: 5499, done
remote: Finding sources: 100% (5499/5499)
remote: Total 5499 (delta 2218), reused 5162 (delta 2218)
Receiving objects: 100% (5499/5499), 17.59 MiB | 9.42 MiB/s, done.
Resolving deltas: 100% (2218/2218), done.
The authenticity of host '[gerrit.zte.com.cn]:29418 ([10.41.103.20]:29418)' can't be established.
RSA key fingerprint is SHA256:oEryy4r4kadgHC3fEOypCXrNeDvQAIRAVHGCQAFoB80.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[gerrit.zte.com.cn]:29418,[10.41.103.20]:29418' (RSA) to the list of known hosts.
commit-msg                                                                                                                             100% 4693   180.2KB/s   00:00
[root@host-192-0-11-183 ~]#
[root@host-192-0-11-183 ~]#
[root@host-192-0-11-183 ~]#
[root@host-192-0-11-183 ~]#
[root@host-192-0-11-183 ~]#

[root@host-192-0-11-183 tulip]# yum install ntpdate                                                                                                           //安装时间同步工具ntpdate
Loaded plugins: fastestmirror
file:///isorepo/tmp/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /isorepo/tmp/repodata/repomd.xml"
Trying other mirror.
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package ntpdate.x86_64 0:4.2.6p5-25.el7.centos.2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================
 Package                      Arch                        Version                                       Repository                     Size
============================================================================================================================================
Installing:
 ntpdate                      x86_64                      4.2.6p5-25.el7.centos.2                       c7-media                       84 k

Transaction Summary
============================================================================================================================================
Install  1 Package

Total download size: 84 k
Installed size: 121 k
Is this ok [y/d/N]: y
Downloading packages:


Error downloading packages:
  ntpdate-4.2.6p5-25.el7.centos.2.x86_64: [Errno 256] No more mirrors to try.

[root@host-192-0-11-183 tulip]# yum install ntp-date
Loaded plugins: fastestmirror
file:///isorepo/tmp/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /isorepo/tmp/repodata/repomd.xml"
Trying other mirror.
Loading mirror speeds from cached hostfile
No package ntp-date available.
Error: Nothing to do
[root@host-192-0-11-183 tulip]#
[root@host-192-0-11-183 tulip]#
[root@host-192-0-11-183 tulip]#
[root@host-192-0-11-183 tulip]# cd /isorep                                                                                                                                                  
isorepo/ isorepp/
[root@host-192-0-11-183 tulip]# cd /isorep
isorepo/ isorepp/
[root@host-192-0-11-183 tulip]# cd /isorepo                                                                                                                              进入 /isorepo文件夹
[root@host-192-0-11-183 isorepo]# ll
total 2572288
-rw-r--r--. 1 root root 2634022912 Jul  2 22:04 CGS-Linux-MAIN.V5.04.F1-x86_64.dvd.iso
drwxr-xr-x. 2 root root          6 Jul  2 22:16 tmp
[root@host-192-0-11-183 isorepo]# mount -o loop CGS-Linux-MAIN.V5.04.F1-x86_64.dvd.iso ./tmp/                    重启虚拟机之后iso需要重新挂载,才能打开目录结构,可以理解成需要重新解压
mount: /dev/loop2 is write-protected, mounting read-only
[root@host-192-0-11-183 isorepo]# yum install ntpdate                                                                                                          再次安装ntpdate时间同步工具,发现成功安装了。
Loaded plugins: fastestmirror
c7-media                                                                                                             | 3.6 kB  00:00:00
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package ntpdate.x86_64 0:4.2.6p5-25.el7.centos.2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================
 Package                      Arch                        Version                                       Repository                     Size
============================================================================================================================================
Installing:
 ntpdate                      x86_64                      4.2.6p5-25.el7.centos.2                       c7-media                       84 k

Transaction Summary
============================================================================================================================================
Install  1 Package

Total download size: 84 k
Installed size: 121 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : ntpdate-4.2.6p5-25.el7.centos.2.x86_64                                                                                   1/1
  Verifying  : ntpdate-4.2.6p5-25.el7.centos.2.x86_64                                                                                   1/1

Installed:
  ntpdate.x86_64 0:4.2.6p5-25.el7.centos.2

Complete!
[root@host-192-0-11-183 isorepo]# ntpdate 10.30.1.105
 3 Jul 05:16:55 ntpdate[1770]: adjust time server 10.30.1.105 offset 0.156463 sec
[root@host-192-0-11-183 isorepo]#


©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 216,125评论 6 498
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,293评论 3 392
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 162,054评论 0 351
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,077评论 1 291
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,096评论 6 388
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,062评论 1 295
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,988评论 3 417
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,817评论 0 273
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,266评论 1 310
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,486评论 2 331
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,646评论 1 347
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,375评论 5 342
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,974评论 3 325
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,621评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,796评论 1 268
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,642评论 2 368
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,538评论 2 352

推荐阅读更多精彩内容

  • Vue 中通过 $mount 实例方法挂载 vm,$mount 方法在多个文件中都有定义,比如: src/pla...
    阿畅_阅读 17,251评论 2 9
  • sudo mount --make-private /proc在主机上跑这个命令使主机和容器的目录隔离目录私有化这...
    七点水Plus阅读 98评论 0 0
  • Test on VMware machine unshare(CLONE_NEWNS)mount /dev/sda...
    七点水Plus阅读 190评论 0 0
  • Google提供了官方版本的Google Drive Stream,即将Google Drive映射为本地文件夹的...
    Solomon_Xie阅读 1,105评论 0 2
  • 父亲节的时候给老爸打电话,你一言我一语的聊了半个多小时。我比较奇怪的是,我与他平日都是不善言辞的人,竟然能在电话里...
    孤僧阅读 134评论 0 0