大网数据广告活动
服务器运维问答

Missing disk half space on Ubuntu 18.04.5 LTS VPS

· 52CE 我爱测

My client has a problem with one server, plesk is throwing error 500, and the websites hosted there act weirdly. I found out it's because the system ran out of space, technically. My problem is that when i perform a lsblk command…

问题原文

原帖链接 · SebaSbs · CC BY-SA 4.0

My client has a problem with one server, plesk is throwing error 500, and the websites hosted there act weirdly. I found out it's because the system ran out of space, technically. My problem is that when i perform a lsblk command, something weird appears.

NAME          MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda             8:0    0   240G  0 disk 
├─sda1          8:1    0   487M  0 part /boot
└─sda2          8:2    0 119.5G  0 part 
  ├─vg00-lv00 253:0    0   1.9G  0 lvm  [SWAP]
  └─vg00-lv01 253:1    0 117.6G  0 lvm  /
sr0            11:0    1  1024M  0 rom  

As you can see, dev/sda has 240GB, which is how much he is paying for storage in the VPS. Looking down on the breakdown, there are just 120GB actually allocated to sda2 where the files are. Where are the other 120GB?

EDIT 1

More commands output

pvdisplay
--- Physical volume ---
  PV Name               /dev/sda2
  VG Name               vg00
  PV Size               119.52 GiB / not usable 3.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              30597
  Free PE               0
  Allocated PE          30597
  PV UUID               DMK49M-JflP-GBt9-0kJq-Kk1W-C7vO-x1nUZi

vgdisplay
--- Volume group ---
  VG Name               vg00
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  5
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               <119.52 GiB
  PE Size               4.00 MiB
  Total PE              30597
  Alloc PE / Size       30597 / <119.52 GiB
  Free  PE / Size       0 / 0   
  VG UUID               WqkIEh-ii6j-YPLK-5XHc-I26V-sAQI-XULRO0

lvdisplay
 --- Logical volume ---
  LV Path                /dev/vg00/lv00
  LV Name                lv00
  VG Name                vg00
  LV UUID                loEucb-0VGb-seQj-3Vs0-5oCC-HUdt-0rJfcp
  LV Write Access        read/write
  LV Creation host, time somehost, 2019-08-29 20:27:48 +0200
  LV Status              available
  # open                 2
  LV Size                <1.91 GiB
  Current LE             488
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0
   
  --- Logical volume ---
  LV Path                /dev/vg00/lv01
  LV Name                lv01
  VG Name                vg00
  LV UUID                o6JDyc-lKL9-simp-fDTm-Yhix-2K1U-qiKvc3
  LV Write Access        read/write
  LV Creation host, time somehost, 2019-08-29 20:27:48 +0200
  LV Status              available
  # open                 1
  LV Size                117.61 GiB
  Current LE             30109
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1

已采纳解答

原帖链接 · Tero Kilkanen · CC BY-SA 4.0

I guess the server originally had 120 GB disk space, and the original parittioning was made according to that. After expanding the VPS disk size to 240 GB, the partitioning was not updated, so the added disk space is not in use.

To fix this, one needs to expand /dev/sda2 partition, then expand the physical volume, volume group and logical volumes. Finally the filesystem needs to be resized.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-07-28)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。