Add custom fstab options

    • OMV 3.x

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Add custom fstab options

      Hi,

      I'm trying to use omv in order to make easy my life with home-nas.
      I have a simple question. Is a way in order to add a custom fstab option on filesystem mount?
      I cannot edit directly fstab because the omv-mkconf will change losing my additions.
      My problem is that the disks are born with btrfs filesystem (that I like) and I need to add a subvol=... option in order to keep the correct mounting schema.

      Thanks in advance

      luigi
    • You have to edit /etc/openmediavault/config.xml adding your options then run mkconf fstab and reboot or remount.
      Subvol options are very different for each disk so is not something that can be handled through environment variables like noexec or lzo or quota.
      So if the disks are gonna be permanently in there I recommend editing config.xml, for more subvolumes in the same disk add more mntent entries into the config.xml manually.
      chat support at #openmediavault@freenode IRC | Spanish & English | GMT+10
      telegram.me/openmediavault broadcast channel
      openmediavault discord server
    • Hi,

      I directly modifed the config.xml adding the following:

      Source Code

      1. ...
      2. <mntent>
      3. <uuid>c172e052-8e3f-4a2c-9530-bc903c6e4329</uuid>
      4. <fsname>2aef65ec-9a63-43e2-8455-81fae216a8f1</fsname>
      5. <dir>/media/2aef65ec-9a63-43e2-8455-81fae216a8f1</dir>
      6. <type>btrfs</type>
      7. <opts>subvol=@,defaults,nofail,autodefrag</opts>
      8. <freq>0</freq>
      9. <passno>2</passno>
      10. <hidden>0</hidden>
      11. </mntent>
      12. <mntent>
      13. <uuid>aa2ff79f-0cc4-49b3-ab2f-44825819d6ce</uuid>
      14. <fsname>2aef65ec-9a63-43e2-8455-81fae216a8f1</fsname>
      15. <dir>/media/2aef65ec-9a63-43e2-8455-81fae216a8f1/Documents</dir>
      16. <type>btrfs</type>
      17. <opts>subvol=@Documents,defaults,nofail,autodefrag</opts>
      18. <freq>0</freq>
      19. <passno>2</passno>
      20. <hidden>0</hidden>
      21. </mntent>
      22. ...
      Display All


      I have a btrfs subvolume @Documents mounted on the /Documents directory of the same fs. The filesystem is labeled as "Raid1".
      The (minor) problem is that filesystem (Raid1) is shon twice into the gui (e.g. volume combobox in Shared Folder).
      Is there a way to add custom mnt-entris into config.xml and at the same time avoid to show into the GUI?
      I cannot edit the fstab directly because I need to mount the Raid1 filesystem before to mount the subvolumes.
      I noticed that hidden semantic is not to "hide" the volume into the gui but instead to don't fill the fstab file.

      Thanks a lot for any suggestion.

      ciao

      luigi
    • subzero79 wrote:

      The multi device shown twice is expected behaviour. It won't be fixed at the moment. It has been fixed in 3.0


      Hi subzero79,

      the omv3 patch avoid to show the volumes member of a "btrfs-raid" but it doesn't resolve when more subvolumes on the same btrfs volume are mounted.
      You can look the attached images. I have a raid1 btrfs partition with a lot of subvolumes mounted on it.

      ciao

      luigi
      Images
      • fs_list.png

        201.91 kB, 1,920×1,080, viewed 229 times
      • shared_volmes_list.png

        228.78 kB, 1,920×1,080, viewed 227 times
    • Interesting problem! Unfortunately it looks quite difficult to solve without more advanced support for btrfs subvolumes in OMV.

      You could work around it though.
      What is the tree of subvolumes in your btrfs filesystem like?
      You wish to have:

      Source Code

      1. /media/uuid -> @
      2. /media/uuid/Documents -> @Documents

      Hence you must have a folder Documents in @, so presumably your subvolumes list looks something like:

      Source Code

      1. ID a gen b top level c path @
      2. ID x gen y top level z path @Documents​

      Why not just have the @Documents subvolume be a child of @? Like so:

      Source Code

      1. ID a gen b top level c path @
      2. ID x gen y top level z path @/@Documents

      Then you need only mount @ at /media/uuid to also have the @Documents subvolume accessible as /media/uuid/@Documents

      Only one volume will appear in OMV GUIs, to create shared folders in @, leave the path as automatically determined (e.g. shared folder with name 'sf1' fills in path as sf1/ and creates folder /media/uuid/sf1 (which is @/sf1). To create a shared folder for @Documents, type path as '@Documents/', OMV will use existing /media/uuid/@Documents folder (which is @Documents subvol).