Moved zvol, different size afterwards

chuck32

Guru
Joined
Jan 14, 2023
Messages
623
I recently switched to trueNAS as my hypervisor. With some trouble I was able to install Home Assistant and that seems to be working too. Today I took two 2.5" SSDs (with my pci sata card) and created a mirror to store all my apps and VM data. I needed to move the home assistant zvol for that. I didn't want all the I/O on my storage pool, which consists of HDDs.

I followed this guide to install HA (write the raw HassOS image to zvol) and allocated 50 gb to the zvol. To move to the new SSD pool I used:

Code:
zfs snapshot -r pool1/homeassistant@relocate
zfs send pool1/homeassistant@relocate | zfs receive -v pool2/homeassistant


The new zvol has only 4 gb data written instead of 35 gb (also for some reason now 55 gb are allocated, I deleted the @relocate snapshot via the GUI).
1676300675693.png


1676300699319.png


Home assistant is working and recognizes the 50 gb allocation:
1676300713365.png


Can I safely delete the old zvol or is there still some dependency on it?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Provisioning type: Sparse means you won't necessarily be using all the blocks...

You'll see that the larger/original was Provisioning type: Thick (write/own all the blocks even if not used yet)

I think that mostly explains the difference.
 

chuck32

Guru
Joined
Jan 14, 2023
Messages
623
So basically I can ignore the difference in size then and delete the original zvol? I'll create a snapshort first anyway to just be sure.

I posted the commands I used, I didn't intentionally change the provisioning type. Nothing wrong with sparse I guess?

I didn't really catch that detail, thank you! Now that you pointed it out it's blatant though.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
It's highly unlikely that zfs send | recv only "partially worked"...

If it works at all, it's going to be a full and complete "copy" of what was on the original.

I would say safe to do what you want with the old one if you're running with the new one.

I also wanted to say that compression probably accounts for the other large difference... thick provisioned would be lots of blocks of all zero, so compresses well.
 
Last edited:

shoulders

Dabbler
Joined
Jul 3, 2021
Messages
14
I know this is an old thread.

When you copy the ZVol by using a snapshot, ZFS copies it as 'Thin' provisioned probably to save bandwidth. There might be a switch to change this, but I used the following to fix mine:

Correct Target ZVol disk usage
Code:
sudo zfs set refreservation=auto MyPoolA/Virtual_Disks/MyDatasetA


Altering the other related ZVol size settings did not have the desired effect if you are wondering, I only had partial success with them.
 
Top