windows 7 下安裝VMWARE 和 red-hat 7 64bit

按F2 進入BIOS:html

在inter virtualization technology 選擇YESnode

就能夠安裝linux 64bit 操做系統了python

 

https://blog.csdn.net/coco2d_x2014/article/details/54587134linux

https://jingyan.baidu.com/article/86112f135e584a273697876b.html、git

 

https://blog.csdn.net/lingdaz/article/details/40542537docker

yum 運行時提示There was a problem importing one of the Python modules required to run yum. The error lead

圖形化界面點擊 網卡標誌,啓動網卡數據庫

或者windows

ifup eth0緩存

 

[root@pythontest ~]# service iptables stop
[root@pythontest ~]# chkconfig iptables offbash

#####

https://blog.csdn.net/yxc2959/article/details/79097470

 

記一次Red Hat Linux手動搭建本地Yum倉庫

*感謝原做者的分享,這裏主要是記錄我操做的一些過程,我剛開始學習,因此若是有看到描述不太對的內容,麻煩評論告訴下我,鞠躬感謝啦~

(1)掛載光盤到mnt目錄下

[root@QCTest ~]# mount /dev/cdrom /mnt

mount: block device /dev/sr0 is write-protected, mounting read-only

[root@QCTest ~]# ls /mnt

 

(2)在根目錄下建立新文件夾QCTest_repo,將/mnt目錄中Packages文件夾拷貝到新建的文件夾中

[root@QCTest ~]# cd /

[root@QCTest /]# mkdir QCTest_repo    建立新文件夾QCTest_repo

[root@QCTest /]# cd /mnt

[root@QCTest mnt]#cp -rv Packages /QCTest_repo     將光盤中Packages文件夾拷貝到新建的文件夾中(cp -r:遞歸複製目錄及其子目錄內的全部內容;-v: 詳細顯示命令執行的操做)

(3)安裝必要工具包:包拷貝完成以後須要構建yum使用的數據庫,以xml文件形式存在,該數據庫會對全部包進行分類創建索引,方便yum程序快速搜索安裝包和檢查包之間的依賴關係。但建立數據庫要用到一個工具包createrepo-0.9.9-18.el6.noarch.rpm,默認是沒有的,先要對它進行安裝

[root@QCTest mnt]# cd  /QCTest_repo/Packages

[root@QCTest Packages]#  rpm -ivh createrepo-*                (*爲通配符)

回車運行後會提示,安裝這個包須要一個python-deltarpm的依賴關係包,加上去再次運行

[root@QCTest Packages]#  rpm -ivh createrepo-*  python-del*

回車運行後會提示python-deltarpm這個包也存在一個deltarpm = 3.5-0.5.20090913git.el6的依賴關係包,加上去再次運行

[root@QCTest Packages]#  rpm -ivh createrepo-* python-del* deltarpm-*

此次就會安裝成功了。

(4)建立yum數據庫:安裝完成後,就可以使用createrepo進行建立yum數據庫。建立以前注意在原光盤裏面repodata文件夾下,即/mnt/repodata目錄下有一個末尾爲comps.xml的分類文件(系統版本不同,實際狀況也不太同樣,本機顯示的是以下圖cda開頭comps-rhel6-Server.xml結尾)也要一併拷貝過來並重建。

 

[root@QCTest Packages]# createrepo -g /mnt/repodata/*comps-rhel6-Server.xml /QCTest_repo/Pack*

 or

createrepo -g /media/"RHEL-6.8 Server.x86_64"/repodata/*64.xml /QCTest_repo/Pack*

 

運行完成後,在/QCTest_repo/Packages目錄下就會生成一個repodata的文件夾,裏面存放着yum工做所須要的索引倉庫,保存了全部的軟件包索引信息。當使用yum進行安裝時,會直接讀取這些索引信息,而沒必要去逐一掃描軟件包。

(5)建立yum配置文件:單首創建本身的配置文件。進入yum.repos.d文件夾,建立QCTest.repo文件並進行編輯。文件名隨意起,但須要.repo結尾。

[root@QCTest Packages]# cd /etc/yum.repos.d

[root@QCTest yum.repos.d]# vi QCTest.repo        在這個目錄下新建QCTest.repo文件,並打開編輯,編輯內容以下

 

[repo] 爲yum倉庫名字,可任意起;

name=myrepo爲詳細名字,可任意起;

baseurl=file:///QCTest_repo/Packages/    baseurl爲關鍵字,file://告訴yum爲本地倉庫,/QCTest_repo/Packages/爲絕對路徑;

gpgcheck=0 關閉rpm包的gpg校驗功能。若是我的環境,建議關閉,參數值爲0,若是生產環境,建議打開,參數值爲1。
輸入以上內容後,保存並退出。

(6)清除yum緩存,並從新加載

[root@QCTest yum.repos.d]# yum clean all

[root@QCTest yum.repos.d]# yum repolist

 

如今就能夠經過yum進行安裝軟件包,程序將自動解決包依賴的問題。

[root@QCTest ~]# yum  install vnc-server

 

 


---------------------
做者:等晨光破曉
來源:CSDN
原文:https://blog.csdn.net/yxc2959/article/details/79097470
版權聲明:本文爲博主原創文章,轉載請附上博文連接!

 

 

############## linux 虛擬機擴充磁盤空間

https://my.oschina.net/u/876354/blog/967848

最近在VMware虛擬機上使用Centos,用着用着,發現虛擬機的磁盤空間不夠了。經過如下步驟成功擴展了根目錄的磁盤空間

一、Centos 關機,選擇編輯虛擬機設置,硬盤,在實用工具那裏選擇「擴展」

填寫擴展的磁盤容量

點擊擴展後,VMware會提示磁盤已成功擴展。您必須從客戶機操做系統內部對磁盤從新進行分區和擴展文件系統。也就是說,這裏擴展的磁盤空間,在操做系統裏面還不可用,還沒生效,須要在操做系統裏面進行設置後才能使用。

二、啓動客戶機操做系統Centos,查看磁盤狀況

輸入指令

fdisk -l

顯示結果以下

Disk /dev/loop0: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/loop1: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sda: 37.6 GB, 37580963840 bytes
255 heads, 63 sectors/track, 4568 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c8278

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64        1306     9972736   8e  Linux LVM

Disk /dev/mapper/vg_test001-lv_root: 9135 MB, 9135194112 bytes
255 heads, 63 sectors/track, 1110 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_test001-lv_swap: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/docker-253:0-264224-pool: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 65536 bytes
Disk identifier: 0x00000000

其中,能夠看到如今的分區狀況以下

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64        1306     9972736   8e  Linux LVM

三、建立分區 sda3

輸入指令

fdisk /dev/sda

而後根據命令提示建立分區,具體見如下 # 後面的註釋

WARNING: DOS-compatible mode is deprecated. It s strongly recommended to
         switch off the mode (command 'c') and change display units to sectors (command 'u'). Command (m for help): n # 輸入 n 表示建立新分區 Command action e extended p primary partition (1-4) p Partition number (1-4): 3 # 輸入 3 表示sda3,由於前面已經有兩個了 First cylinder (1306-4568, default 1306): # 回車,按默認值 Using default value 1306 Last cylinder, +cylinders or +size{K,M,G} (1306-4568, default 4568): # 回車,按默認值 Using default value 4568 Command (m for help): w # 輸入 w 保存退出 The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks.

再次查看分區狀況

fdisk -l

這時能夠看到

Disk /dev/loop0: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/loop1: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sda: 37.6 GB, 37580963840 bytes
255 heads, 63 sectors/track, 4568 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c8278

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64        1306     9972736   8e  Linux LVM
/dev/sda3            1306        4568    26206700   83  Linux

Disk /dev/mapper/vg_test001-lv_root: 9135 MB, 9135194112 bytes
255 heads, 63 sectors/track, 1110 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_test001-lv_swap: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/docker-253:0-264224-pool: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 65536 bytes
Disk identifier: 0x00000000

其中,分區已變爲3個了,但這時還沒掛載,還不能用

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64        1306     9972736   8e  Linux LVM
/dev/sda3            1306        4568    26206700   83  Linux

四、重啓操做系統

reboot

五、格式化新分區爲ext3

輸入指令

mkfs -t ext3 /dev/sda3

結果爲

mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 1638400 inodes, 6551675 blocks 327583 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 200 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 33 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.

六、將物理硬盤分區初始化爲物理卷,以便被LVM使用,輸入指令

lvs
pvcreate /dev/sda3

七、向卷組中添加物理捲來增長卷組的容量

查看lvm組名,輸入指令 df -h

[root@test001 ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_test001-lv_root 8.3G 5.4G 2.5G 69% / tmpfs 1001M 0 1001M 0% /dev/shm /dev/sda1 477M 54M 394M 12% /boot

其中,vg_test001 就是 根 所在的組名

輸入指令,增長卷組的容量

vgextend vg_test001 /dev/sda3

八、查看可擴展的空間大小

輸入指令,顯示LNM卷組的元數據信息

vgdisplay

結果爲

--- Volume group ---
  VG Name               vg_test001
  System ID             
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  4
  VG Access             read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 2 Act PV 2 VG Size 34.50 GiB PE Size 4.00 MiB Total PE 8831 Alloc PE / Size 2434 / 9.51 GiB Free PE / Size 6397 / 24.99 GiB VG UUID JuPKc8-Ydps-1bsN-0Wld-fbYS-0Hd2-NgvX1q

其中 Free PE / Size 就是可供分配的自由空間,最多有 24.99G,在擴展時輸入小於該值 

九、擴充磁盤空間

lvextend -L+24G /dev/mapper/vg_test001-lv_root /dev/sda3

十、使用e2fsck指令檢查文件系統錯誤

進入單用戶模式  (參考https://blog.csdn.net/qq_34556414/article/details/78689225)
umount /
e2fsck -a /dev/mapper/vg_pythontest-lv_root
reboot

e2fsck -a /dev/mapper/vg_test001-lv_root

十一、使用resize2fs指令來增大或者收縮未加載的「ext2/ext3」文件系統的大小

resize2fs /dev/mapper/vg_test001-lv_root

十二、查看擴展空間後的結果

[root@test001 ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_test001-lv_root 32G 5.4G 26G 18% / tmpfs 1001M 0 1001M 0% /dev/shm /dev/sda1 477M 54M 394M 12% /boot

能夠看出,在根目錄下磁盤空間已經擴容了,大功告成!

 

##############

https://jingyan.baidu.com/article/4ae03de3fa2ae93eff9e6bb0.html

怎麼解決VMware「該虛擬機彷佛正在使用中」問題

 

###網絡配置,windows 與 linux 互聯

https://blog.csdn.net/damishidai15/article/details/81368025

-》 網關配置

Vmnet1  局域網

Vmnet8 NAT 外部internet訪問

192.168.61.1

 

  1. 調整vmnet 8 屬性

NAT 網路 192.168.0.0 ( 原來192.168.61.0 )

勾選DHCP start/end ip服務 192.168.0.2 ~ 192.168.0.254       (原來192.168.61.128 ~ 192.168.61.254 )

NAT SETTING: 192.168.0.1        ( 原來192.168.61.2 )

 

 

 

 

 

 

 

-》linux 配置

虛擬機新建一個網卡eth2

Setup 新建一個網卡

 

linux下的網絡參數配置 
打開以下文件 /etc/sysconfig/network-scripts/ifcfg-eth2將裏面的參數設置爲:

DEVICE="eth2"

ONBOOT=yes

BOOTPROTO="static"

HWADDR="00:0C:29:AD:E5:3A"

ONBOOT="yes"

IPADDR=192.168.0.10

NETMASK=255.255.255.0

GATEWAY=192.168.0.1

---------------------

 

source ifcfg-eth2

 

 /etc/init.d/network restart

 

/etc/init.d/NetworkManager  restart

 

http://www.javashuo.com/article/p-tjciitey-hu.html

https://blog.csdn.net/damishidai15/article/details/81368025

相關文章
相關標籤/搜索