如何通过从 /dev/sda3 添加来增加根目录大小

如何通过从 /dev/sda3 添加来增加根目录大小

我买了一个虚拟数字系统服务器正在100GB SSD and Ubuntu 18.04其中运行。之后我安装了docker and nginx.但一天后,我的 docker 容器没有运行,并且 nginx 也返回502 Bad Gateway响应,因为 nginx 错误日志显示No space left on device错误。然后我检查了df -H命令。它就像下面这样:

Filesystem                         Size  Used Avail Use% Mounted on
udev                               1.6G     0  1.6G   0% /dev
tmpfs                              313M   37M  276M  12% /run
/dev/mapper/ubuntu--vg-ubuntu--lv  4.2G  4.2G     0 100% /
tmpfs                              1.6G     0  1.6G   0% /dev/shm
tmpfs                              5.3M     0  5.3M   0% /run/lock
tmpfs                              1.6G     0  1.6G   0% /sys/fs/cgroup
/dev/sda2                          1.1G  156M  798M  17% /boot
tmpfs                              313M     0  313M   0% /run/user/1000
/dev/loop1                         105M  105M     0 100% /snap/core/11316
/dev/loop2                         2.1M  2.1M     0 100% /snap/fast/4
/dev/loop3                         105M  105M     0 100% /snap/core/11420

lsblk结果:

NAME                      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop1                       7:1    0 99.4M  1 loop /snap/core/11316
loop2                       7:2    0    2M  1 loop /snap/fast/4
loop3                       7:3    0 99.4M  1 loop /snap/core/11420
sda                         8:0    0  100G  0 disk
├─sda1                      8:1    0    1M  0 part
├─sda2                      8:2    0    1G  0 part /boot
└─sda3                      8:3    0   99G  0 part
  └─ubuntu--vg-ubuntu--lv 253:0    0    4G  0 lvm  /
sr0                        11:0    1 1024M  0 rom

fdisk -l结果:


Disk /dev/sda: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: FSE23SFG-FR21-4A89-A826-DFASDASD

Device       Start       End   Sectors Size Type
/dev/sda1     2048      4095      2048   1M BIOS boot
/dev/sda2     4096   2101247   2097152   1G Linux filesystem
/dev/sda3  2101248 209713151 207611904  99G Linux filesystem

我应该怎么做才能使/根目录更大。这样我的其他程序就可以像docker and nginx.我该如何解决这个问题?

相关内容