proxmox 5 - change from ZFS RPOOL/SWAP to standard linux swap partition

krystofr

Member
Dec 30, 2016
20
1
23
churchweb.uk
Hi there,

I'm testing a proxmox 5 installation, and have installed it on ZFS.
I also have a standard linux swap partition configured on the SSD.

I'm concious of the reported problems with using swap on ZFS, so would like to move the swap from the ZFS partition to the standard linux swap partition.

How would I go about this?

Thanks in advance!
 
In a bit of a muddle here.

Is zd0 below using the standard linux-swap Partition that was created in the OVH proxmox 5 installer (not native proxmox installer), or is it on the ZFS partition. I'm a bit confused as to why #zfs list shows rpool/swap, but #df -h makes no mention of rpool/swap

Is the swap currently on the ZFS partition or linux-swap partition.
If it's on the ZFS partition, how can I move it to the linux-swap partition?

Thanks so much for your help! :)

#lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 447.1G 0 disk
├─sda1 8:1 0 512M 0 part
├─sda2 8:2 0 446.6G 0 part
└─sda9 8:9 0 8M 0 part
sdb 8:16 0 447.1G 0 disk
├─sdb1 8:17 0 512M 0 part
├─sdb2 8:18 0 446.6G 0 part
└─sdb9 8:25 0 8M 0 part
zd0 230:0 0 4G 0 disk [SWAP]
zd16 230:16 0 32G 0 disk​

#zfs list
NAME USED AVAIL REFER MOUNTPOINT
rpool 5.40G 425G 96K /rpool
rpool/ROOT 1.15G 425G 96K /rpool/ROOT
rpool/ROOT/pve-1 1.15G 425G 1.15G /
rpool/data 160K 425G 96K /rpool/data
rpool/data/vm-101-disk-1 64K 425G 64K -
rpool/swap 4.25G 429G 64K -​

#df -h
Filesystem Size Used Avail Use% Mounted on
udev 16G 0 16G 0% /dev
tmpfs 3.2G 14M 3.1G 1% /run
rpool/ROOT/pve-1 426G 1.2G 425G 1% /
tmpfs 16G 25M 16G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 16G 0 16G 0% /sys/fs/cgroup
rpool 425G 0 425G 0% /rpool
rpool/ROOT 425G 0 425G 0% /rpool/ROOT
rpool/data 425G 0 425G 0% /rpool/data
/dev/fuse 30M 16K 30M 1% /etc/pve​
 
There is absolutely no problem with swap on ZFS if you modify these settings. Most important is disabling ARC caching back the swap volume, but the other tweaks are important as well (and endorsed by the ZFS on Linux community):
https://github.com/zfsonlinux/zfs/wiki/FAQ

Execute these commands in your shell:
Code:
zfs set primarycache=metadata rpool/swap
zfs set secondarycache=metadata rpool/swap
zfs set compression=zle rpool/swap
zfs set checksum=off rpool/swap
zfs set sync=always rpool/swap
zfs set logbias=throughput rpool/swap

You can verify these settings by running:
Code:
zfs get all rpool/swap

I wonder why does Proxmox still install on ZFS without setting these to the above recommended values.
 
  • Like
Reactions: flotho
There is absolutely no problem with swap on ZFS if you modify these settings. Most important is disabling ARC caching back the swap volume, but the other tweaks are important as well (and endorsed by the ZFS on Linux community):
https://github.com/zfsonlinux/zfs/wiki/FAQ

Execute these commands in your shell:
Code:
zfs set primarycache=metadata rpool/swap
zfs set secondarycache=metadata rpool/swap
zfs set compression=zle rpool/swap
zfs set checksum=off rpool/swap
zfs set sync=always rpool/swap
zfs set logbias=throughput rpool/swap

You can verify these settings by running:
Code:
zfs get all rpool/swap

I wonder why does Proxmox still install on ZFS without setting these to the above recommended values.

PVE 5.0 already sets all of those except for the checksumming (which should not be a problem/bottleneck).
 
  • Like
Reactions: gkovacs

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!