LINUX下為LVM磁碟增加硬碟空間

來源:互聯網
上載者:User

標籤:

總結:

~~~~~~~~~~~~~~~~~~~~

fdisk -l
pvcreate /dev/sdb
vgextend VolGroup /dev/sdb
lvextend -L +180G /dev/mapper/VolGroup-lv_root
resize2fs /dev/VolGroup/lv_root

~~~~~~~~~~~~~~~~~~~

 

1,  在VM WARE ESXI裡為客戶機增加一塊新的硬碟

2,  重啟客戶機

3,  用FDISK –L查看整個磁碟空間

#fdisk -l

 

Disk /dev/sda: 34.4 GB, 34359738368 bytes255 heads, 63 sectors/track, 4177 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x000b2d34    Device Boot      Start         End      Blocks   Id  System/dev/sda1   *           1          64      512000   83  LinuxPartition 1 does not end on cylinder boundary./dev/sda2              64        4178    33041408   8e  Linux LVM Disk /dev/sdb: 214.7 GB, 214748364800 bytes255 heads, 63 sectors/track, 26108 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000  Disk /dev/mapper/VolGroup-lv_root: 30.4 GB, 30396121088 bytes255 heads, 63 sectors/track, 3695 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000  Disk /dev/mapper/VolGroup-lv_swap: 3435 MB, 3435134976 bytes255 heads, 63 sectors/track, 417 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000

 

4,  用pvcreate /dev/sdb將新的硬碟加入物理卷

pvcreate /dev/sdb

       

 Physical volume "/dev/sdb" successfully created

 

5,  用vgextend VolGroup /dev/sdb將新硬碟加入卷組

vgextend VolGroup /dev/sdb

       

 Volume group "VolGroup" successfully extended

 

6,  為根分區擴散空間lvextend -L +200G /dev/mapper/VolGroup-lv_root

lvextend -L +180G /dev/mapper/VolGroup-lv_root

Extending logical volume lv_root to 208.31 GiBLogical volume lv_root successfully resized

 

7,  將之應用resize2fs /dev/VolGroup/lv_root

resize2fs /dev/VolGroup/lv_root

resize2fs 1.41.12 (17-May-2010)Filesystem at /dev/VolGroup/lv_root is mounted on /; on-line resizing requiredold desc_blocks = 2, new_desc_blocks = 14Performing an on-line resize of /dev/VolGroup/lv_root to 54606848 (4k) blocks.The filesystem on /dev/VolGroup/lv_root is now 54606848 blocks long.

 

8,  再用DF –H查看空間,已加入

df -h

Filesystem                    Size  Used Avail Use% Mounted on/dev/mapper/VolGroup-lv_root  206G  5.7G  189G   3% /tmpfs                         1.9G     0  1.9G   0% /dev/shm/dev/sda1                     485M   32M  428M   7% /boot

 

9,  其它細節

LINUX下為LVM磁碟增加硬碟空間

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.