解決Linux擴容問題

問題描述:掛載點 “/dev/xx” 的使用率達100%,空間不夠,所以要對其進行分區。

 

解決:

1、通過vmware、vsphere等虛擬機設置,調整增大磁盤空間

2、輸入命令: fdisk -l 查看現有情況

3、增加分區

$> 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): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)

輸入p,默認回車,然後w退出。

 

4、創建、查詢物理卷

$> pvcreate /dev/sda4
  dev_is_mpath: failed to get device for 8:4
  Physical volume "/dev/sda4" successfully created

$> vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "vg_root" using metadata type lvm2

5、新增物理卷擴展,“vg_root”

$> vgextend vg_sddb02 /dev/sda4
  Volume group "vg_root" successfully extended

$> lvextend -L +1024G /dev/vg_root
  Extending logical volume lv_root to 1.48 TiB
  Logical volume lv_root successfully resized

6、執行重設

$> resize2fs /dev/vg_root
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/vg_root is mounted on /; on-line resizing required
old desc_blocks = 31, new_desc_blocks = 95
Performing an on-line resize of /dev/vg_root to 396230656 (4k) blocks.
The filesystem on /dev/vg_root is now 396230656 blocks long.

7、成功,輸入命令 df -lh 查看

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章