Creating mounting and adding a zvol to lxc

c0mputerking

Member
Oct 5, 2011
172
3
18
Hello again all i am interested in Proxmox way of adding a mount point to a lxc container, using the GUI works, and i a can easily add a mount point but it always creates a new zvol and gets named something like /mypool/subvol-100-1

My question is what if i want to create a zvol called /mypool/share and have that added to the lxc container

I used to use a line like this in my conf file "mp0 /mypool/share,mp=/mnt/mypool/share" but i believe that is only a directory mount point, thinking that the new zvol mount points are better in may ways.

I have tried may ways; creating zvol manually, renaming zvols and cannot seem to achieve what the GUI does with the name i require however nothing seems to quite work could someone let me know how i can do this

Some other things i tried but did not quite work no zvol or mount point gets created should i be creating the zvol first?
pvesh set /nodes/localhost/lxc/<CTID>/config -mp0 "/srv/directory,mp=/srv/directory
 

wolfgang

Proxmox Staff Member
Staff member
Oct 1, 2014
4,976
332
83
Hi,

My question is what if i want to create a zvol called /mypool/share and have that added to the lxc container
I guess you will create a dataset and not Zvol.
Or why you want to name it like this?
What is the benefit
 

c0mputerking

Member
Oct 5, 2011
172
3
18
I guess i could create a dataset, and that would be alot easier as i used to do it that way, but i think zvol is superior for speed/overhead and versatility maybe im wrong there, thinking proxmox uses zvol for good reason.

The reason i would like to have it named mypool/share is i will be using it for several virtual machines as a file share, and having it named as a subvol of an lxc is doable but doesn't seem quite right for my setup. Also i would like another zvol called mypool/backups then i can upgrade/change the backup system without having to move things from one zvol to another.

Basically i would like to be able to share the zvol between lxc and kvms without having it tied to one lxc by a name, maybe i am wasting my time here?
 

wolfgang

Proxmox Staff Member
Staff member
Oct 1, 2014
4,976
332
83
but i think zvol is superior for speed/overhead and versatility maybe im wrong there, thinking proxmox uses zvol for good reason.
No zvol is the blkdevice emulation and this cost about 5-10% performance.
Proxmox VE uses zvols for Qemu guest because Qemu can only use blk devices as storage.
For LXC we use datasets.

The reason i would like to have it named mypool/share is i will be using it for several virtual machines as a file share,
This is only possible with a dataset.

Basically i would like to be able to share the zvol between lxc and kvms without having it tied to one lxc by a name, maybe i am wasting my time here?
This is not possible this way, but you can use a Network FS like SMB or NFS for this.
 

c0mputerking

Member
Oct 5, 2011
172
3
18
Ok thank you very much for the info guess i will keep using datasets then?
Just curious seems like Proxmox uses zvol when adding a mount point to LXC containers or does it?
Yes i plan to use a LXC and a mount point to do my SMB sharing was just trying to use zvol for mount point instead of dataset thinking that was the better/newer proxmox way.
 

wolfgang

Proxmox Staff Member
Staff member
Oct 1, 2014
4,976
332
83
Just curious seems like Proxmox uses zvol when adding a mount point to LXC containers or does it?
This is a dataset from type filesystem only the naming looks nearly the same.
you can see the type with this command.

Code:
zfs get type rpool/data/subvol-4203-disk-0
 

c0mputerking

Member
Oct 5, 2011
172
3
18
Ok thank you very much for helping me make matter is very clear as i can see below now. So i will continue to use datasets knowing it is the same a proxmox defaults as you described.

NAME PROPERTY VALUE SOURCE
apool/subvol-101-disk-1 type filesystem -
root@pve:~# zfs get type apool/share
NAME PROPERTY VALUE SOURCE
apool/share type filesystem -
root@pve:~# zfs get type apool/subvol-101-disk-0
NAME PROPERTY VALUE SOURCE
apool/subvol-101-disk-0 type filesystem -
 

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!