Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynamic disk resize not supported for VZ driver, ignoring... #817

Open
ivang-orcl opened this issue Sep 27, 2023 · 2 comments
Open

dynamic disk resize not supported for VZ driver, ignoring... #817

ivang-orcl opened this issue Sep 27, 2023 · 2 comments

Comments

@ivang-orcl
Copy link

Description

Is there a way to resize the disk in rosetta or why it is not supported?

@jblotus
Copy link

jblotus commented Oct 11, 2023

I was running into disk space issues doing docker builds in colima. I tried the resize method in the FAQ but it only increase the size of the virtual disk not the partition allocated to docker data. I was able to achieve this by following bits of #398
I have no idea what I'm doing, but this seemed to fix.

colima stop
colima start --disk-500G
qemu-img resize ~/.lima/colima/diffdisk 500G
colima stop
colima start

Without the diffdisk resize the docker directory was stuck at 60GB for me, even though the virtual disk showed 500gb.

 % qemu-img info ~/.lima/colima/diffdisk
image: /Users/myname/.lima/colima/diffdisk
file format: raw
virtual size: 500 GiB (536870912000 bytes)
disk size: 55.2 GiB
Child node '/file':
    filename: /Users/myname/.lima/colima/diffdisk
    protocol type: file
    file length: 500 GiB (536870912000 bytes)
    disk size: 55.2 GiB


% qemu-img resize ~/.lima/colima/diffdisk 500G
WARNING: Image format was not specified for '/Users/myname/.lima/colima/diffdisk' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
Image resized.

After the resize it "seems" to work.

 colima ssh sudo su -
colima:~# df -h
Filesystem                Size      Used Available Use% Mounted on
devtmpfs                 10.0M         0     10.0M   0% /dev
shm                       3.9G         0      3.9G   0% /dev/shm
/dev/sda                297.4M    297.4M         0 100% /media/sda
tmpfs                     3.9G    555.6M      3.3G  14% /
tmpfs                     1.5G    732.0K      1.5G   0% /run
/dev/loop0               14.1M     14.1M         0 100% /.modloop
cgroup_root              10.0M         0     10.0M   0% /sys/fs/cgroup
/dev/disk/by-label/cidata
                         35.7M     35.7M         0 100% /mnt/lima-cidata
/dev/disk/by-label/data-volume
                        491.8G     54.8G    412.0G  12% /mnt/data
/dev/disk/by-label/data-volume
                        491.8G     54.8G    412.0G  12% /etc
/dev/disk/by-label/data-volume
                        491.8G     54.8G    412.0G  12% /home
/dev/disk/by-label/data-volume
                        491.8G     54.8G    412.0G  12% /root
/dev/disk/by-label/data-volume
                        491.8G     54.8G    412.0G  12% /tmp
/dev/disk/by-label/data-volume
                        491.8G     54.8G    412.0G  12% /usr/local
/dev/disk/by-label/data-volume
                        491.8G     54.8G    412.0G  12% /var/lib
mount1                    1.8T    457.0G      1.4T  25% /tmp/colima
vz-rosetta                1.8T    457.0G      1.4T  25% /mnt/lima-rosetta
mount0                    1.8T    457.0G      1.4T  25% /Users/myname
/dev/disk/by-label/data-volume
                        491.8G     54.8G    412.0G  12% /var/lib/docker
overlay                 491.8G     54.8G    412.0G  12% /var/lib/docker/overlay2/b6058d19852b31e55aaff637eba265684d13c880c5cf04d6c73e3a26de4e4d3b/merged
overlay                 491.8G     54.8G    412.0G  12% /var/lib/docker/overlay2/434c05112a3bb7510dcd5e638395fba67ce7502a9880952c7ef8e0753008c46f/merged
overlay                 491.8G     54.8G    412.0G  12% /var/lib/docker/overlay2/f6f612af35f9f0e3c3dae3be50dc4f9cf3e8496c13dba8057682bda3179bbb5e/merged
overlay                 491.8G     54.8G    412.0G  12% /var/lib/docker/overlay2/3b43c6592660b5ce1dbba75603b9485c59d9ac51decf654e3d214734c1ecf1e8/merged
overlay                 491.8G     54.8G    412.0G  12% /var/lib/docker/overlay2/7367a348454b7c2e1301b9f88606630cfee04d30b82f1d6411fb414bc5c41917/merged

@kbasarab
Copy link

Confirmed. Had this same problem and this fix also worked for me. My path was a little different and had to run via sudo.

colima ssh
df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        58G   53G  4.5G  93% /

colima stop
sudo qemu-img resize ~/.colima/_lima/colima/diffdisk 256G
WARNING: Image format was not specified for '~/.colima/_lima/colima/diffdisk' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
Image resized.
colima start


colima ssh
df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       247G   51G  197G  21% /

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants