扩展分区上的分区6

我有一个虚拟主机,似乎缺乏一些空间的地方。 它应该是150GB,但只有50GB。 我一直试图扩大分区,但我似乎无法find如何甚至在指南的帮助下。

这是在CentOS 6上安装了Plesk 11的VPS。

任何指导将不胜感激。 我想使用剩下的所有空间到vda2分区。

[root@www ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT vda 252:0 0 150G 0 disk ├─vda1 252:1 0 500M 0 part /boot └─vda2 252:2 0 49.5G 0 part ├─vg_plesk-lv_root (dm-0) 253:0 0 48G 0 lvm / ├─vg_plesk-lv_swap (dm-1) 253:1 0 1G 0 lvm [SWAP] └─vg_plesk-lv_tmp (dm-2) 253:2 0 512M 0 lvm /tmp [root@www ~]# vgscan Reading all physical volumes. This may take a while... Found volume group "vg_plesk" using metadata type lvm2 [root@www ~]# lvm vgdisplay --- Volume group --- VG Name vg_plesk System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 6 VG Access read/write VG Status resizable MAX LV 0 Cur LV 3 Open LV 3 Max PV 0 Cur PV 1 Act PV 1 VG Size 49.51 GiB PE Size 4.00 MiB Total PE 12674 Alloc PE / Size 12674 / 49.51 GiB Free PE / Size 0 / 0 VG UUID 8Hsz6T-yQVv-GerB-32Qe-ZvIQ-BQvA-uYqft5 (parted) print all Model: Linux device-mapper (linear) (dm) Disk /dev/mapper/vg_plesk-lv_tmp: 537MB Sector size (logical/physical): 512B/512B Partition Table: loop Number Start End Size File system Flags 1 0.00B 537MB 537MB ext4 Model: Linux device-mapper (linear) (dm) Disk /dev/mapper/vg_plesk-lv_swap: 1074MB Sector size (logical/physical): 512B/512B Partition Table: loop Number Start End Size File system Flags 1 0.00B 1074MB 1074MB linux-swap(v1) Model: Linux device-mapper (linear) (dm) Disk /dev/mapper/vg_plesk-lv_root: 51.5GB Sector size (logical/physical): 512B/512B Partition Table: loop Number Start End Size File system Flags 1 0.00B 51.5GB 51.5GB ext4 Model: Virtio Block Device (virtblk) Disk /dev/vda: 161GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 1049kB 525MB 524MB primary ext4 boot 2 525MB 53.7GB 53.2GB primary lvm 

新增输出:

 [root@www ~]# fdisk -l Disk /dev/vda: 161.1 GB, 161061273600 bytes 16 heads, 63 sectors/track, 312076 cylinders Units = cylinders of 1008 * 512 = 516096 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00034f7d Device Boot Start End Blocks Id System /dev/vda1 * 3 1018 512000 83 Linux Partition 1 does not end on cylinder boundary. /dev/vda2 1018 104026 51915776 8e Linux LVM Partition 2 does not end on cylinder boundary. Disk /dev/mapper/vg_plesk-lv_root: 51.5 GB, 51547996160 bytes 255 heads, 63 sectors/track, 6267 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_plesk-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/vg_plesk-lv_tmp: 536 MB, 536870912 bytes 255 heads, 63 sectors/track, 65 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 [root@www ~]# pvdisplay --- Physical volume --- PV Name /dev/vda2 VG Name vg_plesk PV Size 49.51 GiB / not usable 2.00 MiB Allocatable yes (but full) PE Size 4.00 MiB Total PE 12674 Free PE 0 Allocated PE 12674 PV UUID oFD1tJ-wJt1-MlBK-NKfq-4MMF-ZUCG-kZQZVx 

我似乎无法找出这个免费的100GB的空间在哪里,或者如何分配它。

好的,有重要的命令;

首先做一个'fdisk -l',看看列出了什么,然后做一个'pvdisplay'看看你的PV是如何布置的,有可能是磁盘上有未分区的空间(在这种情况下只需创build一个新的分区,然后将其添加到PV,延伸VG然后延伸LV),或者它在PV而不是VG,在这种情况下,只扩展VG,然后延长LV。

编辑 – 基于你的输出你需要做的是这个,所有的根/ sudo,types;

 fdisk /dev/fda 

fdisk应用程序将启动,input'n'并input,你会看到;

 Command action e extended p primary partition (1-4) 

键入'p'

然后你会被要求你的分区号,这将是3(三),按回车

 Partition number (1-4): 3 

然后你会被要求提供第一个柱面,接受你的系统popup的任何东西(不是下面的值,这只是为了告诉你看起来像什么);

 First cylinder (197-621, default 197):<RETURN> Using default value 197 

然后它会要求最后一个气缸,再次接受它抛出的不是我下面的例子

 Last cylinder or +size or +sizeM or +sizeK (197-621, default 621): +128M 

现在input“p”并input以显示分区表,它应该看起来像这样;

  Device Boot Start End Blocks Id System /dev/vda1 1 196 395104 8e LVM /dev/vda2 197 262 133056 8e LVM /dev/vda3 197 262 133056 8e Linux 

现在input't'进入,你会被要求input分区号,你的是3(3),按回车键,你将被要求input分区types代码,你的是'8e'(这意味着LVM ),按回车,它应该看起来像这样;

 Command (m for help): t Partition number (1-4): 3 Hex code (type L to list codes): 8e Changed system type of partition 2 to 8e (LVM) 

现在input“p”并再次input,输出应该是这样的;

  Device Boot Start End Blocks Id System /dev/vda1 1 196 395104 8e LVM /dev/vda2 197 262 133056 8e LVM /dev/vda3 197 262 133056 8e LVM 

现在input'w'写出这个configuration,你将回到你的shell提示符,然后像往常一样扩展PV,VG和LV。