0

I just subscribed for a Ubuntu 18.04 server, it is advertised as 20 Gb disk space but my root LVM is only 3.9 Gb. As you can see below the sda3 actualy has 20 Gb but the root ubuntu--vg-ubuntu--lvm has only 3.9. Any chance I can resize it by myself from 3.9 to 20?

  `NAME                      MAJ:MIN RM  SIZE RO TYPE       MOUNTPOINT
  fd0                         2:0    1    4K  0 disk 
  loop0                       7:0    0  8.6M  1 loop /snap/nmap/823
  loop1                       7:1    0 86.9M  1 loop /snap/core/4917
  loop2                       7:2    0 54.7M  1 loop /snap/core18/1668
  loop3                       7:3    0 91.4M  1 loop /snap/core/8689
  sda                         8:0    0   32G  0 disk 
  ├─sda1                      8:1    0    1M  0 part 
  ├─sda2                      8:2    0    1G  0 part /boot
  └─sda3                      8:3    0   19G  0 part 
    └─ubuntu--vg-ubuntu--lv 253:0    0    4G  0 lvm  /
  sr0                        11:0    1 1024M  0 rom  
  root@sarvdata:~# df -h 
  Filesystem                         Size  Used Avail Use% Mounted on
  udev                               425M     0  425M   0% /dev
  tmpfs                               91M  1.1M   90M   2% /run
  /dev/mapper/ubuntu--vg-ubuntu--lv  3.9G  3.6G  105M  98% /
  tmpfs                              455M     0  455M   0% /dev/shm
  tmpfs                              5.0M     0  5.0M   0% /run/lock
  tmpfs                              455M     0  455M   0% /sys/fs/cgroup
  /dev/loop0                         8.7M  8.7M     0 100%       /snap/nmap/823
  /dev/loop1                          87M   87M     0 100%       /snap/core/4917
  /dev/loop2                          55M   55M     0 100% /snap/core18/1668
  /dev/loop3                          92M   92M     0 100% /snap/core/8689
  /dev/sda2                          976M   81M  828M   9% /boot
  tmpfs                               91M  8.0K   91M   1% /run/user/115
  tmpfs                               91M     0   91M   0% /run/user/0

`

davidgo
  • 6,222
  • 3
  • 23
  • 41

2 Answers2

0

If there is additional space in the volume group where this logical volume resides, you can grow it using the lvextend command. Output from lvs and vgs would be useful in determining specifically what you'd need to do.

A better solution, however, might be to create separate logical volumes for some of the large dynamic system subdirectories, particularly for /var/log, which can grow continuously if logrotate isn't configured properly for your environment, and easily fill whatever filesystem it resides on.

John
  • 28
  • 4
0

Basef on your output ny guess is that lvs has simply held back space to allocate as needed. You should be able to use

  lvextend /dev/ubuntu-vg/lv -L**X**g

To expand the partition by X gigs. My recommendation would be to leave space free in case you want to use snapshots or have an emergency buffer.

Once you gave expanded the block you will need to resize the filesystem. How you do this depends on the filesystem. If its ext try

  resize2fs /dev/ubuntu-vg/lv

Note some distris have the same tool called resiz4fs. Either should work on an ext? Filesystem.

davidgo
  • 6,222
  • 3
  • 23
  • 41