Dummy's guide to ZFS in Proxmox

moxfan

Active Member
Aug 28, 2013
69
3
28
Hello Forum

So let's say I want to create a ZFS pool on /dev/sda4 for containers, disk images, etc.. What are the quick and dirty steps (the ZFS commands) to create the pool, so that proxmox can use it to set up containers?

Regards.
 

Rhinox

Active Member
Sep 28, 2016
272
36
28
30
ZFS-pool on single partition of single disk??? That does not make much sense...
 

moxfan

Active Member
Aug 28, 2013
69
3
28
Well, it does if you want to have all the copy-on-write benefits like snapshots. Sure, it does not add redundancy or extra performance (besides zfs great caching).
zfs newbie here...can zfs do the caching inside the same partition where the data resides?
 

guletz

Renowned Member
Apr 19, 2017
1,163
167
68
Brasov, Romania
What are the quick and dirty steps (the ZFS commands) to create the pool, so that proxmox can use it to set up containers?
Even if you can do something because it is posible(zfs or whatever), this is not mean that is also desirable! ZFS is a very complex thing, and if you can not know at least some basics, then in the near future, zfs will bite you .... ;) So if you will take some time to read zfs documonetation, you will avoid many future problems

Festina Lente
 

morph027

Well-Known Member
Mar 22, 2013
434
54
48
Leipzig
morph027.gitlab.io
Jip. Better start with test systems, try to break it, then you know what common pitfalls to look after and how to recovery and to prevent. Of cource you're welcome to ask questions here ;)
 

LnxBil

Famous Member
Feb 21, 2015
4,674
471
103
Germany
Back to the question:

What are the quick and dirty steps (the ZFS commands) to create the pool, so that proxmox can use it to set up containers?
Should be this:

Code:
zpool create rpool /dev/sda4
zfs set compression=lz4 rpool
 

moxfan

Active Member
Aug 28, 2013
69
3
28
Back to the question:

Should be this:

Code:
zpool create rpool /dev/sda4
zfs set compression=lz4 rpool
Thanks LnxBil for making it look so simple, and to other members who have replied.

Do I need to lay a filesystem on the partition before (or after) creating the pool? If so, which filesystem would you advise to use? (Hmm, on second thought, this question doesn't make much sense as zfs itself is a filesystem on its own?)

Do I need to set the partition type to something other than linux 83 before creating the pool?
 
Last edited:

moxfan

Active Member
Aug 28, 2013
69
3
28
zfs is not a file-system. It is a storage manager. It can be used like a file-system and/or as block-device.
Thanks guletz for that warning.

I have just set up a zfs pool as directed by LnxBil, allocated the zfs storage in the gui and created a CT on the zfs storage and that seems to have all worked fine. Not only that, I can now view the whole rootfs directory tree directly from the subvol created. Isn't that magic? :)

I have some more newbie queries, though...

I had the partition on xfs before setting up the zfs pool. Does it matter what filesystem was on before creating the zfs pool? Does zfs overwrite the previous filesystem when creating the pool?

When adding the zfs storage, the gui choked when I tried to tick off the 'thin' checkbox. What does that option do, is it desirable to have it, and why would the gui not accept it?

Why was the "disk quota" option unavailable (dimmed) when setting up the CT on the zfs pool?
 

LnxBil

Famous Member
Feb 21, 2015
4,674
471
103
Germany
I had the partition on xfs before setting up the zfs pool. Does it matter what filesystem was on before creating the zfs pool? Does zfs overwrite the previous filesystem when creating the pool?
Yes, it's overwritten.
 

moxfan

Active Member
Aug 28, 2013
69
3
28
Thanks LnxBil. My final question in my quest to use zfs storage remains unanswered

Why was the "disk quota" option unavailable (dimmed) while setting up the CT on the zfs pool in the gui?
 

dcsapak

Proxmox Staff Member
Staff member
Feb 1, 2016
4,362
402
103
31
Vienna
Why was the "disk quota" option unavailable (dimmed) while setting up the CT on the zfs pool in the gui?
because zfs does not support ext4 style user quotas
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE 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 your own in 60 seconds.

Buy now!