Skip to content

document how to increase disk size #3418

Open
@shenki

Description

@shenki

Description

I've been using a Debian vm under Lima on OSX as a development environment and it's been working fine for a few months. I've filled the disk, and needed more space.

I was confused when limactl disk didn't show any output:

$ limactl disk list
WARN[0000] No disk found. Run `limactl disk create DISK --size SIZE` to create a disk.
NAME    SIZE    FORMAT    DIR    IN-USE-BY

I have disks:

$ ls -lhSn
total 195864888
-rw-------@ 1 502  20   100G 10 Apr 11:01 diffdisk
-rw-r--r--@ 1 502  20   328M 23 Jan 16:29 basedisk
$ qemu-img info diffdisk
image: diffdisk
file format: raw
virtual size: 100 GiB (107374182400 bytes)
disk size: 92.8 GiB
Child node '/file':
    filename: diffdisk
    protocol type: file
    file length: 100 GiB (107374182400 bytes)
    disk size: 92.8 GiB

Looking around there's some discussion on the steps required #1446 #1448. I went ahead and stopped my VM, rewized it with qemu-img, and started it back up. All was well!

qemu-img resize diffdisk 200G
WARNING: Image format was not specified for '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.

(I assume if I'd use -t raw that wouldn't have warned me)

 kernel: virtio_blk virtio2: 1/0/0 default/read/poll queues
 kernel: virtio_blk virtio2: [vda] 419430400 512-byte logical blocks (215 GB/200 GiB)
 kernel: GPT:Primary header thinks Alt. header is not at the end of the disk.
 kernel: GPT:209715199 != 419430399
 kernel: GPT:Alternate GPT header not at the end of the disk.
 kernel: GPT:209715199 != 419430399
 kernel: GPT: Use GNU Parted to correct GPT errors.
 kernel:  vda: vda1 vda15

I didn't need to resize the partition, it was taken care of by systemd-growfs:

 systemd[1]: Starting systemd-growfs-root.service - Grow Root File System...
 kernel: EXT4-fs (vda1): resizing filesystem from 26181627 to 52396027 blocks
 kernel: EXT4-fs (vda1): resized filesystem to 52396027
 systemd-growfs[441]: Successfully resized "/" to 199.8G bytes (3584 bytes lost due to blocksize).
 systemd[1]: Finished systemd-growfs-root.service - Grow Root File System.

I wanted to clarify that this was the correct procedure for Lima on OSX?

If so, it would be great to have something in the docs about it.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions