Dummy's guide to ZFS in Proxmox

moxfan

Active Member
Aug 28, 2013
104
5
38
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.
 
ZFS-pool on single partition of single disk??? That does not make much sense...
 
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?
 
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
 
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 ;)
 
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:
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?
 
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?
 
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, 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!