Skip to content

Conversation

@afbjorklund
Copy link
Member

@afbjorklund afbjorklund commented Nov 14, 2025

This will call "mkswap" instead of mkfs.

And will call "swapon" instead of mount.

Improve message, without a bogus "/mnt/lima-swap" dir:

INFO[0020] [hostagent] Mounting disk "swap" on "swap"

Closes #965


limactl disk create swap --size 2g

additionalDisks:
- name: "swap"
  format: true
  fsType: swap
$ free -h
               total        used        free      shared  buff/cache   available
Mem:           3.8Gi       522Mi       2.7Gi       4.1Mi       868Mi       3.3Gi
Swap:          2.0Gi          0B       2.0Gi
$ cat /proc/swaps
Filename				Type		Size		Used		Priority
/dev/vdb1                               partition	2095100		0		-2

We can mention swapfile and compcache in a followup PR.

Since the user can add those themselves, after it has started.

This will call "mkswap" instead of mkfs.

And will call "swapon" instead of mount.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
Previous disk had hardcoded mountpoint.

But now it will not be used, for swap.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
@afbjorklund afbjorklund changed the title Allow using swap as a fstype for disks Allow using swap as a fsType for disks Nov 14, 2025
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

Successfully merging this pull request may close these issues.

Option to add swap space to vm

1 participant