0

The result of df -h is like this:

Filesystem               Size  Used Avail Use% Mounted on
udev                     3.9G     0  3.9G   0% /dev
tmpfs                    797M   88M  710M  11% /run
/dev/mapper/vgroot-root   25G   18G  5.8G  76% /
tmpfs                    3.9G  106M  3.8G   3% /dev/shm
tmpfs                    5.0M  4.0K  5.0M   1% /run/lock
tmpfs                    3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda1                945M   75M  806M   9% /boot
/dev/mapper/vgroot-home   15G   14G   56K 100% /home
vmhgfs-fuse              239G  200G   40G  84% /mnt/hgfs
tmpfs                    797M     0  797M   0% /run/user/999
tmpfs                    797M   64K  797M   1% /run/user/500

I see /home directory is 100% full, but don't know how can I enlarge it?

I tried resize2fs /home 50G and got

open: Is a directory while opening /home

Then I tried mount -o remount,size=50G /home but I got

mount: /home not mounted or bad option

Then I run gparted in the ubuntu client, the info is like this:

/dev/sda1   ext4        /boot  976MB
/dev/sda2   extended           299GB
  /dev/sda5 lvm2 pv     vgroot 299GB
unallocated unallocated        1MB

This is for my vmware disk, in vmware, the Ubuntu's disk is set to 300G as the max size.

Should /home be listed here? Do I need to mount it?

sudo lvdisplay is:

--- Logical volume ---
  LV Path                /dev/vgroot/root
  LV Name                root
  VG Name                vgroot
  LV Status              available
  # open                 1
  LV Size                25.00 GiB
  - currently set to     256
  Block device           253:0

  --- Logical volume ---
  LV Path                /dev/vgroot/swap
  LV Name                swap
  VG Name                vgroot
  LV Status              available
  # open                 2
  LV Size                4.00 GiB
  - currently set to     256
  Block device           253:1

  --- Logical volume ---
  LV Path                /dev/vgroot/home
  LV Name                home
  VG Name                vgroot
  LV Status              available
  # open                 1
  LV Size                15.00 GiB
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2

LV size is 15GB.

sudo pvdisplay:

PV Name               /dev/sda5
  VG Name               vgroot
  PV Size               299.04 GiB / not usable 0   
  Allocatable           yes 
  PE Size               4.00 MiB
  Total PE              76555
  Free PE               65291
  Allocated PE          11264

pvscan is:

PV /dev/sda5   VG vgroot          lvm2 [299.04 GiB / 255.04 GiB free]
  Total: 1 [299.04 GiB] / in use: 1 [299.04 GiB] / in no VG: 0 [0   ]

I need to increase the size of /home, but how?

  • 1
    can you add the output of sudo lvdisplay to your question? – Simon Sudler Apr 18 '19 at 13:28
  • I think you're going about this the wrong way. You need to increase the overall size of the virtual machine then use the logical volume commands to increase the size. – George Udosen Apr 18 '19 at 14:09
  • the values shown by gparted, are they for your host or guest? – George Udosen Apr 18 '19 at 14:20
  • sorry make that sudo pvscan! – George Udosen Apr 18 '19 at 14:58
0

Resize will not work on a mounted partition, you need un-mount the /home before you can resize it.

Try the following:

  1. Set a root password, you need to login as root user

    $ sudo passwd
    
  2. Login as root user on e.g. tty3 (via STRG+ALT+F3

    Ubuntu 18.04.2 LTS somehost tty3
    
    somehost: root
    Password:
    
  3. Make sure, all other user have logged out, then you can un-mount the /home folder

    $ umount /home
    
  4. When the umount was successful, you can resize the file system on the partition /dev/mapper/vgroot-home and mount the folder again

    $ resize2fs /dev/mapper/vgroot-home
    $ mount /home
    
0

It's all about lvm. This link https://askubuntu.com/a/868632/926232 fixed my problem, I don't need a live iso or any GUI.

Not the answer you're looking for? Browse other questions tagged or ask your own question.