BTRFS volume with multiple subvolumes - how to setup shared folders

    • OMV 3.x
    • BTRFS volume with multiple subvolumes - how to setup shared folders

      Hi!

      I have a single disk formatted with BTRFS.
      I'm not using GPT, instead I have created several subvolumes, e.g. @pictures, @downloads, ...

      The question is now, what is the optimal configuration for defining shared folders?

      Normally I would mount the subvolume @pictures to a single directory, e.g. /home/pictures. But this is not feasible in the WebUI.
      In the WebUI I can select the device + the directory @pictures representing the relevant subvolume @pictures.

      Any advice?

      THX
    • Some time ago, i'll asked a similar question about the BTRFS features. As far i'm know OMV has only the stadart features implemented. The ohter features are requested and still in process.

      Maybe some one of the Mod's can give us an update what's the actually state?

      By the way is somebody using BTRFS and in what kind of config.

      @c.monty i'll hope you're ok with my question in your thread?
    • Hi everybody,
      I thought I guve a stab of this.

      c.monty, if I were you I would rethink your btrfs usage.
      I never use btrfs on raw devices. Even in version 4.0 there is a bug somewhere in the code that can lead to full data loss if device fails, a specially when using btrfs raid and disk pooling features. Had lost 2T of data like that. Now I usually partition disks and drop btrfs on partitions. Works exactly the same but at least I have a chance of recovery and raid works as expected.

      Now, I assume you are running a backport kernel since normal omv does not support btrfs.
      If so, than all feature of btrfs available to you but you need to do all on cli. But for what you want it probably can be done via webui. It works just as you want and same as with any other folder. Btrfs subvolume looks and behave just like any normal folder on file system except it has some special features. But this features are only accessible in cli so we can ignore them fir now.
      Fist mount the device in omv.filesystems. you should be seeing it as available there.
      This will give you a uuid mount point in /media.
      Omv mounts everything in /media using uuid. As your.volume already up and formated it have uuid.
      Now once you mount your volume, you can either do a little fancy setup by creating your own folder somewhere and drop simlink to the mounted vol. To make a friendly and short name for it, or just go on and creatr your shares straight from the mount. Just like you described.
      Go omv.samba or omv.nfs and create a share using mounted vol as device and your subvol as folder. It is exactly the same as you did before except the mount point is in different place. Just to add a little point of contention here but why use subvolume at all. As it stands now ,except for some fancy new features that mostly difficult to use as there is no ui for it, it is basically a normal folder in the fs. I stopped using then some time ago.
      I just build out a new server setup on omv 2.2.4 back kernel 3.16 specifically because I had several btrfs raid 1 pools with data.

      I just finish moving all data from my raid1 pools into new snapraid+mergefs volume and reusing the old disks by adding them to the new pool.
      AFAC all my disks in snap raid are btrfs volumes.




      Sent from my phone
      omv 3.0.56 erasmus | 64 bit | 4.7 backport kernel
      SM-SC846(24 bay)| H8DME-2 |2x AMD Opteron Hex Core 2431 @ 2.4Ghz |49GB RAM
      PSU: Silencer 760 Watt ATX Power Supply
      IPMI |3xSAT2-MV8 PCI-X |4 NIC : 2x Realteck + 1 Intel Pro Dual port PCI-e card
      OS on 2×120 SSD in RAID-1 |
      DATA: 3x3T| 4x2T | 2x1T
    • Hello!

      Can you please share the documentation of the bug with BTRFS on raw devices you are talking of?

      My understanding of a subvolume is that it appears as a folder in the "root" volume.
      However, I can use several mount options incl. compression which gives a difference to writing data into the folders directly.
      Can you confirm?

      What are these "little fancy setup" things you are talking about? Could you please specify?

      THX
    • Well I am by no means an expert, and I have no documentation on the bug. All I have is a bad experience and some data loss. That I could replicate using vm.
      I am not sure what is wrong with btrfs and raw devices, except that if you build raid1 for example using raw devices, ie. Not gpt or mbr, and one one of the disks fails, you can loose the while pool along with all the data on it. It does not happen all the time, but I was able to replicate it 5 times out of 10 times I trierd. It seams that you most likely to loose data if the first drive in the pool fails. By first drive I mean the drive you use first when creating the pool.
      You know, when you give commnad mkfs.btrfs sda, sdb, sdc. Etc.
      Well in my experience if any drive but sda fails on you, the data might still be available on degraded raid pool , but if sda dails, 5 out of 10 times the whole pool is gone and any data recovery software can mot even see any data. It like you are looking on a brand new disk, just off the factory.
      When you partition the disk first and use partitions like sda1, sdb1, sdc1 to build the pool this does not happen. I purposely corupted my vm drives and was still able to mount pool degraded and copy data off it. And recovery software was able to see the data and recover it as well. Granted there are times when nothing helps, but that is rare.

      You are right, subvolumes are basically folders with special features like snapshots, ability to mount like a separate file system. But essentially it is just a folder. I have moved from using any of fancy btrfs features to just use it as any other fs. I still get the cow, and but rot protection and not going crasy whith special stuff.
      I have just build out an new omv setup, 2x120gb ssd in raid1 for system , 2x3tb disks, 4x2tb using snapraid and mergerfs.
      All disks are partitioned with gpt and btrfs. Snapraded with 2 parity drives, and merged insingle volume pool.
      Best part, I can pull any data drive at any time and read it on any pc capable reading btrfs.
      I run sync via crone every night.
      So far do good. Looks good.
      Next step is build out couple of vms for media streaming and recording and I will be golden

      Sent from my phone
      omv 3.0.56 erasmus | 64 bit | 4.7 backport kernel
      SM-SC846(24 bay)| H8DME-2 |2x AMD Opteron Hex Core 2431 @ 2.4Ghz |49GB RAM
      PSU: Silencer 760 Watt ATX Power Supply
      IPMI |3xSAT2-MV8 PCI-X |4 NIC : 2x Realteck + 1 Intel Pro Dual port PCI-e card
      OS on 2×120 SSD in RAID-1 |
      DATA: 3x3T| 4x2T | 2x1T