Creating mounting and adding a zvol to lxc

Discussion in 'Proxmox VE: Installation and configuration' started by c0mputerking, Jun 16, 2019.

  1. c0mputerking

    c0mputerking Member

    Joined:
    Oct 5, 2011
    Messages:
    172
    Likes Received:
    3
    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
     
  2. wolfgang

    wolfgang Proxmox Staff Member
    Staff Member

    Joined:
    Oct 1, 2014
    Messages:
    4,763
    Likes Received:
    315
    Hi,

    I guess you will create a dataset and not Zvol.
    Or why you want to name it like this?
    What is the benefit
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. c0mputerking

    c0mputerking Member

    Joined:
    Oct 5, 2011
    Messages:
    172
    Likes Received:
    3
    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?
     
  4. wolfgang

    wolfgang Proxmox Staff Member
    Staff Member

    Joined:
    Oct 1, 2014
    Messages:
    4,763
    Likes Received:
    315
    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.

    This is only possible with a dataset.

    This is not possible this way, but you can use a Network FS like SMB or NFS for this.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. c0mputerking

    c0mputerking Member

    Joined:
    Oct 5, 2011
    Messages:
    172
    Likes Received:
    3
    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.
     
  6. wolfgang

    wolfgang Proxmox Staff Member
    Staff Member

    Joined:
    Oct 1, 2014
    Messages:
    4,763
    Likes Received:
    315
    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
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. c0mputerking

    c0mputerking Member

    Joined:
    Oct 5, 2011
    Messages:
    172
    Likes Received:
    3
    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 -
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice