LXC resize ubuntu guest

gob

Renowned Member
Aug 4, 2011
69
2
73
Chesterfield, United Kingdom
Hi

I have been trying to resize an ubuntu 14.04 LXC for several hours now and it's getting a little frustrating.
The original container was set up as 64Gb and I have extended it to 320Gb on my 4.0-48 host.
The backend storage is LVM on a DELL iSCSI SAN.

In the proxmox Web gui if I browse my storage I can see:
Code:
vm-315-disk-1   raw   32.00GB

However if I run df -h in the container I get

Code:
Filesystem                       Size  Used Avail Use% Mounted on
/dev/MD3000iA-SAS/vm-315-disk-1   63G   38G   22G  64% /
none                             100K  4.0K   96K   4% /dev
cgroup                            12K     0   12K   0% /sys/fs/cgroup
tmpfs                            7.9G     0  7.9G   0% /sys/fs/cgroup/cgmanager
none                             1.6G  244K  1.6G   1% /run
none                             5.0M     0  5.0M   0% /run/lock
none                             7.9G  8.0K  7.9G   1% /run/shm
none                             100M     0  100M   0% /run/user

So as an attempt to extend the container I run:

Code:
# resize2fs /dev/MD3000iA-SAS/vm-315-disk-1
resize2fs 1.42.12 (29-Aug-2014)
resize2fs: Device or resource busy while trying to open /dev/MD3000iA-SAS/vm-315-disk-1
Couldn't find valid filesystem superblock.

Assuming this is because the container is running, I shutdown the container and try again however once the container is shut down, vm-315-disk-1 disappears from /dev/MD3000iA-SAS/

Any suggestions?

thanks
 
Thanks for your prompt reply Dietmar.

Running the following whilst the container is running has no effect:
Code:
pct resize 315 rootfs 320G

Running when the container is shutdown produces:

Code:
# pct resize 315 rootfs 320G
qemu-img: Could not open '/dev/MD3000iA-SAS/vm-315-disk-1': Could not open '/dev/MD3000iA-SAS/vm-315-disk-1': No such file or directory
  New size (81920 extents) matches existing size (81920 extents)
error resizing volume '/dev/MD3000iA-SAS/vm-315-disk-1':   Run `lvextend --help' for more information.

I am still getting this in the container:

Code:
# df -h
Filesystem                       Size  Used Avail Use% Mounted on
/dev/MD3000iA-SAS/vm-315-disk-1   63G   38G   22G  64% /
none                             100K  4.0K   96K   4% /dev
cgroup                            12K     0   12K   0% /sys/fs/cgroup
tmpfs                            7.9G     0  7.9G   0% /sys/fs/cgroup/cgmanager
none                             1.6G  244K  1.6G   1% /run
none                             5.0M     0  5.0M   0% /run/lock
none                             7.9G  8.0K  7.9G   1% /run/shm
none                             100M     0  100M   0% /run/user
 
it is lvm on an iSCSI target:
Code:
dir: local
        path /var/lib/vz
        content images,vztmpl,rootdir,backup,iso
        maxfiles 0

lvm: MD3000i-A-SAS
        vgname MD3000iA-SAS
        content images,rootdir
        nodes ms-200-prox01,ms-200-prox02
        shared

lvm: MD3000i-A-SATA
        vgname MD3000iA-SATA
        content rootdir,images
        nodes ms-200-prox02,ms-200-prox01
        shared

nfs: NFS-Bak
        path /mnt/pve/NFS-Bak
        export /raid0/data/Prox-Backup
        server 192.168.200.15
        maxfiles 2
        options vers=3
        content iso,backup,vztmpl
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!