Unraid VM shares?


Recommended Posts

On 8/4/2020 at 12:46 PM, cleggypdc said:

Thanks for the help in this post, works fantastically. TL;DR of original, here's a step by step guide for creating a mount on VM creation (as of unraid 6.8.3).

  1. In the "Unraid Share" section, select the unraid folder that you want to make mountable. This can be an individual share or a parent directory of the share for multiple. e.g `/mnt/user`
  2. In the "Unraid Mount tag" section, enter a tag name, this can be anything and will be passed to the VM. e.g `myMountTag`
  3. Complete VM setup, power on and install your VM OS or normal. The following steps require root/sudo user.
  4. Make a backup copy of fstab in case you mess up your configuration `sudo cp /etc/fstab /etc/fstab.orig` 
  5. Create a target mount directory where you want to mount your share e.g. `sudo mkdir /path/to/myMountedDir`
  6. Edit `/etc/fstab` config by adding the following line to the end of the file, (change tag & path to your needs)
  7. `myMountTag    /path/to/myMountedDir    9p    trans=virtio,version=9p2000.L,_netdev,rw    0    0`
  8. Save fstab file and run `sudo mount -a` to check your mount works (there should be no output for on success)
  9. You should now have a mounted share in your VM

Futher detail

For anyone new to unraid, looking for an explanation as to what the fstab values are, here is an explanation


<device>: myMountTag
<mount point>: /path/to/myMountedDir  
<file system type>: 9P (The protocol that QEMU uses for a VirtFS)
<options>: 
    trans=virtio,version=9p2000.L (our transport for this share will be over virtio, and we specify the 9P version (2000.L) because the default for QEMU is 2000.U. "L" has better support for ACLs, file locking and more efficient directory listing, deletion edge cases etc)
    _netdev (tells the system that this mount relies on the network, and to delay the mount until a network is enabled)
    rw (mount as read/write)
<dump>: 0 (disables backup via the dump command)
<pass num>: 0 (disable any error checking)

 

Cheers!

Is it normal that following this guide it asks me root permissions to delete or create files?

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.