How to disconnect a ZFS volume from LXC and PVE storage without deleting?

Sasha

Well-Known Member
Oct 18, 2018
88
1
48
Kazahstan
Hi, guys!
On my on local-zfs PVE-storage I created LXC 105 and storage mount point.
So, zfs list shows

Code:
NAME                           USED  AVAIL     REFER  MOUNTPOINT
rpool                          653G  1.12T      104K  /rpool
rpool/ROOT                     158G  1.12T       96K  /rpool/ROOT
rpool/ROOT/pve-1               158G  1.12T      158G  /
rpool/data                     453G  1.12T      112K  /rpool/data
rpool/data/subvol-105-disk-0    96K  8.00G       96K  /rpool/data/subvol-105-disk-0
rpool/data/subvol-105-disk-2   467M  7.54G      467M  /rpool/data/subvol-105-disk-2

After deleting mount point via PVE GUI zfs list shows the same, but PVE GUI shows
1674927060238.png
1674927142937.png

So ZFS volume /rpool/data/subvol-105-disk-0 is still in PVE-storage local-zfs and still somehow in LXC 105 context/
Would You advice how i can clear it to get a /rpool/data/subvol-105-disk-0 be freed as if after zfs create?
 
Would You advice how i can clear it to get a /rpool/data/subvol-105-disk-0 be freed as if after zfs create?
if you want to delete it, you can just do so from the gui.

if you dont want to delete it, the next step depends on what you want to do with it. If all you want is to not see it in the vm inventory, just rename it:

zfs rename rpool/data/subvol-105-disk-2 rpool/newname
 
I'm going to actively use that volume. I'll create in the same LXC 105 a bind mount point instead of deleted storage mount point.
That bind mount point will be pointed on the same host path /rpool/data/subvol-105-disk-0
Yes after renaming it will be path /rpool/data/newname
 
Last edited:
ah.

so bind mounts are different (and work differently) then zfs block devices (zvols.)

In order to accomplish what you're after, first create your new dataset for the bind mount:
zfs create /rpool/mydataset
also recommended to move the mountpoint somewhere in the filesystem, eg
zfs set mountpoint=/mnt/mydataset

then, reattach original zvol back to your container

lastly, add the bindmount to your container:
pct set 105 -mp0 mp=/mnt/dataset,/container/bindmount/point

then, inside your container, copy/move everything from /container/zvol/mountpoint to /container/bindmount/point.

Once complete, you can remove and destroy subvol-105-disk-0.

Be aware that there are UID/GID considerations as well as security concerns doing this. for more info, please see https://pve.proxmox.com/wiki/Linux_Container#_bind_mount_points
 
Last edited:
  • Like
Reactions: alafrosty and Sasha
Dear I alexskysilk, do appreciate You for sharing Your competency!

Just for my dummie's understanding and properly planning of migration (storage to bind mount point) would You help me to figure out several questions:
so bind mounts are different (and work differently) then zfs block devices (zvols.)
As I understand You mean here difference from viewpoint of PVE. But from ZFS viewpoint is this the same volumes? I mean initiated while creating storage bind point in PVE GUI and created via zfs create command?
The matter it's about 800G so i still think to rename /rpool/data/subvol-105-disk-0 and use it for bind mount point.
But i aware that renaming zfs rename is not so pure for PVE...

Be aware that there are UID/GID considerations
Would You clarify about it? The link https://pve.proxmox.com/wiki/Linux_Container#_bind_mount_points don't make it clearier for me...
 
Would You clarify about it? The link https://pve.proxmox.com/wiki/Linux_Container#_bind_mount_points don't make it clearier for me...
I think that the OG question has been answered at this point.

It sounds like you're asking for a tutorial on how to configure your specific system to your requirements and pointed out where this is explained and how you don't understand the explanation in general. You might need to do some more reading about system configuration in general. This forum is more for "I can't get this set up and I think that I'm following the instructions" or "where are the instructions for X" rather than "help me configure all the things because I don't know anything and when I try to read, I still can't understand." For instance, when alexskysilk wrote that accessing the bind mounts and block devices is different, he wasn't discussing philosophy; he was writing about the method of storing and getting to stored data (fs vs block level).
 
  • Like
Reactions: Sasha
I think that the OG question has been answered at this point.

It sounds like you're asking for a tutorial on how to configure your specific system to your requirements and pointed out where this is explained and how you don't understand the explanation in general. You might need to do some more reading about system configuration in general. This forum is more for "I can't get this set up and I think that I'm following the instructions" or "where are the instructions for X" rather than "help me configure all the things because I don't know anything and when I try to read, I still can't understand." For instance, when alexskysilk wrote that accessing the bind mounts and block devices is different, he wasn't discussing philosophy; he was writing about the method of storing and getting to stored data (fs vs block level).
Exacltly. You are right. I've been reading theory enough just to ask a question here, hoping to get experienced answers (i mean not theoretical).
Here You are (again) my concrete question:

1. Can i use for bind point the ZFS volume /rpool/data/subvol-105-disk-0 that was created in context of PVE GUI user's action "Add mount point" (storage point)?
Can i ignore zfs create /rpool/data/new_volume step? I didn't find out any explanation, that /rpool/data/subvol-105-disk-0 and /rpool/data/new_volume have ANY difference from viewpoint of ZFS.

As i understand after theory reading, that PVE can use the same ZFS-volume as for storage mount point
Code:
mp0: local-zfs:subvol-105-disk-0,mp=/mnt/mp0,replicate=0,size=8G
and for bind mount point
Code:
mp0: /rpool/data/subvol-105-disk-0,mp=/mnt/mp0,replicate=0,size=8G

All differences are in view of PVE: local-zfs:subvol-105-disk-0 or /rpool/data/subvol-105-disk-0 Right? I checked it and file system of that ZFS-volume is accessible in both cases. So i can't figure out what is "so bind mounts are different (and work differently) then zfs block devices (zvols.)" in that frase.

2. Is it correct (suitable) from viewpoint of PVE just to delete storage mount point from configuration of LXC and zfs rename /rpool/data/subvol-105-disk-0 /rpool/data/new_volume? In what *conf files that bind still stores after deleting storage mount point from configuration of LXC?
1674927060238-png.46112


and that bind also

1674927142937-png.46113


Appreciate for patiency.
 
Last edited:
I do appreciate You, guys, that You are spending Your time for novice!
I just have read that excellent article https://arstechnica.com/information...01-understanding-zfs-storage-and-performance/ and that manual https://illumos.org/books/zfs-admin/zfsover-1.html#zfsover-1

So. let me clarify Your "so bind mounts are different (and work differently) then zfs block devices (zvols.)"

root@hq:~# zfs list -o name,type

NAME TYPE
rpool filesystem
rpool/ROOT filesystem
rpool/ROOT/pve-1 filesystem
rpool/data filesystem
rpool/data/subvol-101-disk-0 filesystem
rpool/data/subvol-101-disk-3 filesystem
rpool/data/subvol-files filesystem

rpool/swap volume
rpool/swap32 volume

Here You are lxc101.conf:

rootfs: local-zfs:subvol-101-disk-0,size=100G
mp0: local-zfs:subvol-101-disk-3,mp=/mnt/files.local,replicate=0,size=700G
mp1: /rpool/data/subvol-files,mp=/mnt/files.local.mp

As i can see, PM uses the same type of datasets i.e. filesystem that i did with zfs create rpool/data/subvol-files command. AFAIK there are no any difference. Isn't it?
Wha't did You mean talking "zfs block devices (zvols.)"? Where does this appeares in our story with storage mount point and bind mount point?
What should i read more, guys?
 
Last edited:

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!