成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

虛擬機磁盤邏輯卷如何擴容

云計算 虛擬化
空間不太夠,所以在虛擬機上把分配磁盤空間擴大的20GB。在esx server上擴容磁盤空間的方法很簡單,在此不提,下面具體說說如何把該擴容的磁盤空間在虛擬機上應用上去。

在esx server上安裝虛擬機時,由于只分配了默認的8GB磁盤空間。空間不太夠,所以在虛擬機上把分配磁盤空間擴大的20GB。在esx server上擴容磁盤空間的方法很簡單,在此不提,下面具體說說如何把該擴容的磁盤空間在虛擬機上應用上去。

 以下是未擴容前的狀態(tài):

  1. [root@localhost ~]# fdisk -l 
  2.  
  3. Disk /dev/sda: 21.4 GB, 21474836480 bytes 
  4.  
  5. 255 heads, 63 sectors/track, 2610 cylinders 
  6.  
  7. Units = cylinders of 16065 * 512 = 8225280 bytes 
  8.  
  9.    Device Boot      Start         End      Blocks   Id  System 
  10.  
  11. /dev/sda1   *           1          13      104391   83  Linux 
  12.  
  13. /dev/sda2              14        1044     8281507+  8e  Linux LVM 
  14.  
  15.   
  16.  
  17. [root@localhost ~]# df -h 
  18.  
  19. Filesystem            Size  Used Avail Use% Mounted on 
  20.  
  21. /dev/mapper/VolGroup-LogVol00 
  22.  
  23.                       7.0G  4.8G  1.8G  73% / 
  24.  
  25. /dev/sda1              99M   12M   82M  13% /boot 
  26.  
  27. tmpfs                 187M     0  187M   0% /dev/shm 
  28.  
  29. /dev/hdc              183M  183M     0 100% /media/VMware Tools 

可以看到sda有21.4GB,但是只利用了sda1和sda2;根目錄掛載在/dev/mapper/VolGroup-LogVol00,我們要做的是,把sda上剩余的空間擴容到/dev/mapper/VolGroup-LogVol00。 

1)首先,通過fdisk /dev/sda命令將sda剩余空間創(chuàng)建一個分區(qū):

  1. [root@localhost ~]# fdisk /dev/sda 
  2.  
  3. The number of cylinders for this disk is set to 2610. 
  4.  
  5. There is nothing wrong with that, but this is larger than 1024, 
  6.  
  7. and could in certain setups cause problems with
  8.  
  9. 1) software that runs at boot time (e.g., old versions of LILO) 
  10.  
  11. 2) booting and partitioning software from other OSs 
  12.  
  13.    (e.g., DOS FDISK, OS/2 FDISK) 
  14.  
  15. Command (m for help): m 
  16.  
  17. Command action 
  18.  
  19.    a   toggle a bootable flag 
  20.  
  21.    b   edit bsd disklabel 
  22.  
  23.    c   toggle the dos compatibility flag 
  24.  
  25.    d   delete a partition 
  26.  
  27.    l   list known partition types 
  28.  
  29.    m   print this menu 
  30.  
  31.    n   add a new partition 
  32.  
  33.    o   create a new empty DOS partition table 
  34.  
  35.    p   print the partition table 
  36.  
  37.    q   quit without saving changes 
  38.  
  39.    s   create a new empty Sun disklabel 
  40.  
  41.    t   change a partition's system id 
  42.  
  43.    u   change display/entry units 
  44.  
  45.    v   verify the partition table 
  46.  
  47.    w   write table to disk and exit 
  48.  
  49.    x   extra functionality (experts only
  50.  
  51. Command (m for help): n 
  52.  
  53. Command action 
  54.  
  55.    e   extended 
  56.  
  57.    p   primary partition (1-4) 
  58.  
  59.  
  60. Partition number (1-4): 3 
  61.  
  62. First cylinder (1045-2610, default 1045): 
  63.  
  64. Using default value 1045 
  65.  
  66. Last cylinder or +size or +sizeM or +sizeK (1045-2610, default 2610): 
  67.  
  68. Using default value 2610 
  69.  
  70. Command (m for help): w 
  71.  
  72. The partition table has been altered! 
  73.  
  74. Calling ioctl() to re-read partition table
  75.  
  76. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. 
  77.  
  78. The kernel still uses the old table
  79.  
  80. The new table will be used at the next reboot. 
  81.  
  82. Syncing disks. 
  83.  
  84. [root@localhost ~]# 

此時可以看到多了一個sda3的分區(qū): 

  1. [root@localhost ~]# fdisk -l 
  2.  
  3. Disk /dev/sda: 21.4 GB, 21474836480 bytes 
  4.  
  5. 255 heads, 63 sectors/track, 2610 cylinders 
  6.  
  7. Units = cylinders of 16065 * 512 = 8225280 bytes 
  8.  
  9.    Device Boot      Start         End      Blocks   Id  System 
  10.  
  11. /dev/sda1   *           1          13      104391   83  Linux 
  12.  
  13. /dev/sda2              14        1044     8281507+  8e  Linux LVM 
  14.  
  15. /dev/sda3            1045        2610    12578895   83  Linux 

此時查看了一下/dev下,不知道為何沒有/dev/sda3,于是重啟了一下虛擬機RHEL,重啟完成后,出現了/dev/sda3.

一開始在這個地方折騰了一會,如果不重啟,在利用命令pvcreate /dev/sda3創(chuàng)建pv時,總是提示Device /dev/sda3 not found (or ignored by filtering).

重啟完成后,進入lvm模式,創(chuàng)建pv:

  1. lvm> pvcreate /dev/sda3 
  2.   Physical volume "/dev/sda3" successfully created 

擴容vg:vgextend vg_gcc /dev/sda3

  1. lvm> vgextend VolGroup /dev/sda3 
  2.   /dev/cdrom: open failed: Read-only file system 
  3.   Attempt to close device '/dev/cdrom' which is not open
  4.   Volume group "VolGroup" successfully extended 

把lv擴容到vg的剩余容量:lvextend /dev/vg_gcc/lv_root /dev/sda3

  1. lvm> lvextend /dev/VolGroup/LogVol00 /dev/sda3 
  2.   Extending logical volume LogVol01 to 12.72 GB 
  3.   Logical volume LogVol01 successfully resized 

***,通過resize2fs命令令新增的空間在線(on-line)生效:resize2fs /dev/vg_gcc/lv_root

  1. [root@localhost dev]# resize2fs /dev/VolGroup/LogVol00  
  2. resize2fs 1.39 (29-May-2006) 
  3. Filesystem at /dev/VolGroup/LogVol00 is mounted on /; on-line resizing required 
  4. Performing an on-line resize of /dev/VolGroup/LogVol00 to 5005312 (4k) blocks. 
  5. The filesystem on /dev/VolGroup/LogVol00 is now 5005312 blocks long. 

效果如下:

  1. [root@localhost dev]# df -h 
  2. Filesystem            Size  Used Avail Use% Mounted on 
  3. /dev/mapper/VolGroup-LogVol00 
  4.                        19G  4.8G   13G  28% / 
  5. /dev/sda1              99M   12M   82M  13% /boot 
  6. tmpfs                 187M     0  187M   0% /dev/shm 
  7. /dev/hdc              3.4G  3.4G     0 100% /media/RHEL_5.2 x86_64 DVD 

 至此,擴容已成功完成。

責任編輯:武曉燕 來源: 博客園
相關推薦

2021-12-28 07:47:26

ESXI虛擬機 添加新硬盤

2014-01-13 09:47:35

虛擬機

2010-12-23 14:05:12

虛擬機

2012-04-10 10:29:29

2020-11-29 17:00:51

VirtualBox虛擬硬盤Linux

2022-08-14 09:11:13

Kubernetes容器云原生

2012-05-18 10:22:23

2009-09-27 10:20:19

掛載虛擬機磁盤Xen環(huán)境

2010-07-26 09:02:38

2013-07-17 09:32:58

2009-06-29 19:36:07

虛擬機備份虛擬環(huán)境

2013-11-19 14:05:08

VDP虛擬機

2012-04-27 09:29:57

虛擬化虛擬機

2018-07-10 15:10:50

OpenStack虛擬機metadata

2010-02-26 15:28:15

Python虛擬機

2009-06-12 16:15:42

死鎖Java虛擬機

2013-04-07 09:52:40

Ubuntu虛擬機虛擬化軟件

2021-01-04 05:49:34

VMwareLinux虛擬機

2009-11-30 17:20:32

LINUX虛擬機磁盤

2009-11-10 11:02:20

VMwareLINUX虛擬機
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 久久99视频 | 毛片毛片毛片毛片毛片 | 久久精品一区二区三区四区 | 国产精品99久久久久久大便 | 亚洲欧美一区二区三区在线 | 亚洲成人精品久久 | 久久久久久影院 | 亚洲成av人片在线观看 | 日本精品一区 | 国产视频福利一区 | www.久久 | 伊人免费观看视频 | h视频免费在线观看 | 亚洲3级| 亚洲激精日韩激精欧美精品 | 亚州精品天堂中文字幕 | 欧美一区2区三区3区公司 | 成人天堂| 日日操夜夜操天天操 | 精品亚洲一区二区 | 日韩精品一区中文字幕 | 免费一看一级毛片 | 日韩在线小视频 | 午夜资源 | 亚洲精品成人 | 欧美日韩亚洲一区 | av天空| 亚洲第一在线 | 日本三级电影免费 | 日韩中文字幕在线观看视频 | 中文字幕一区二区三区在线观看 | 精品99久久久久久 | 91免费视频观看 | 日韩成人在线视频 | 狠狠操狠狠操 | 国产黄色av网站 | 在线一区 | 日本精品一区二区 | 欧美xxxx做受欧美 | 91社区在线观看高清 | 欧美午夜视频 |