Problem serving USB volume over CIFS

  • I'm having trouble configuring OMV (I've tried both v4 and v5). I have a USB drive attached to the host that I need to serve across the network via CIFS. I have two users (say, User1 and User2) defined in OMV. They each have a group of the same names. BOTH of these users need to be able to mount the drive from the network.


    What I'm finding is that the USB drive can be mounted by the first user I created (User1), but not by User2. I've tried endless combinations of settings and permissions in OMV to no avail. Only User1 can access the share.


    I tried an experiment wherein I created user2 first and then user1 on a fresh OMV install. That reversed the situation - user1 was unable to mount the share, but user2 could.


    If I type "ls -la /sharedfolders/" from the OMV server, I notice that the owner of the volume is "User1". However, world read-write permissions are set.


    How do I set things up correctly?
    Thanks,
    Eric

  • Let OMV handle the USB disk. OMV can mount it by it self during boot.


    Use the GUI to add the disk and wipe it.
    Then create a new filesystem on it. EXT4. Not NTFS!
    Then mount the new empty filesystem.
    Then make some shared folders.
    Then configure smb shares.


    All of this is done in the OMV GUI.

    Be smart - be lazy. Clone your rootfs.
    OMV 5: 9 x Odroid HC2 + 1 x Odroid HC1 + 1 x Raspberry Pi 4

  • Thanks for the idea. Unfortunately, the disk has a lot of data that I can't afford to lose. And there are other disks as well.


    I did try various combinations of "privileges". The settings for user1 and user2 are identical. No luck there I'm afraid.


    I should have mentioned that OMV is virtualized. I'm using KVM now, but I used to use Xen and things were working fine in that setup. So, I'm wondering if it's an issue of OMV not getting along with KVM. Should I install ACPI or some other package on the OMV VM? (I've noticed that the OMV VM does not respond to power-down messages from the host).


    Again, I appreciate all the help. I'm not sure how to debug this.


    Eric

  • I'm afraid this is not a bug or an a idea. It is the normal way to add storage to OMV.


    Is the disk formatted as NTFS?


    OMV is not compatible with NTFS used for shared storage. You can, in a pinch, use NTFS for backups or for restoring data. But not for shared data shared by OMV.


    It is possible to add correctly formatted disks with existing compatible filesystems to OMV, and use them for shared folders. But then you STILL have to use the GUI to add the disks and mount the filesystems and create shares. After that you can manually move the files into the shared folders. And reset ownership and perms.


    No doubt it is possible to manually hack a disk in. Manually prepare disks and hack configuration files, but I sure don't know how to do it. The easiest fix would be some new disks, or at least disks with a compatible filesystem, and add them using the GUI the normal way.


    There is a plugin Reset Perms that sets owner and rights for shared folders. After install it is available in the GUI under Shared Folders. You might look at that.


    I just ran resetperms on one of my NAS. The output might be helpful:



    Changing owner to root:users ...
    Change directory permissions to 2775 ...
    Change file permissions to 664 ...
    Done...

    Be smart - be lazy. Clone your rootfs.
    OMV 5: 9 x Odroid HC2 + 1 x Odroid HC1 + 1 x Raspberry Pi 4

  • I'm afraid this is not a bug or an a idea. It is the normal way to add storage to OMV.


    My existing disk is EXT4. It was created by a system running Ubuntu 18.04 (with LVM, if that matters). Do I really have to reformat it in OMV? Why should OMV need that?


    Just to be clear, the exiting disk correctly appears in the "file systems" pane of OMV, and I have no problem mounting it nor creating SMB shares. All of that works as expected. It's just that one remote user can mount the SMB share and a second remote user can't. This seems so even when all the settings of the two users are identical. And which user can or can't mount seems to depend upon which of the users I create first in OMV. The first-created can mount, the second can't.


    As I said, it worked under Xen. Maybe KVM is presenting the USB device to the OMV server differently in some way?


    As you suggested, I will look at root:users for permissions. Maybe that will help.


    Eric

  • I have no idea if a HDD with LVM is usable with OMV. I doubt it. Not without running LVM. But I have never tried it. Just test it and see if it works. Perhaps you can create virtual volumes on the HDD that you can use in the VM?


    I have only done as I described above, added storage using the OMV GUI.


    I have the exact same users and passwords on all my servers and all my clients, created in exactly the same order so that UID match. All users in OMV are members of the group "user". Privileged users also are members of "ssh" and "sudo" so they can connect over SSH and use sudo. And everything just works perfectly. However I mainly use NFS, not SMB except to Android clients. I also run all my scripts on all my servers as the same user on all servers, never as root. I don't have a password set for root. I don't run OMV in any VM.


    Try to do things the simple obvious way, as the GUI seem to suggest that you do it, and typically everything works fine. Do it with convoluted manual hacks and typically nothing works, or perhaps only after a lot of experimenting. That is my experience with OMV. So I stay with the simple obvious way as much as possible.


    Obviously, almost anything is possible using Linux. You have full access to everything, including the source code for OMV and the kernel and so on, and can change or modify anything. But you will have to consider if the effort is worth it.


    If you don't do most of the basic things the simple OMV way, there is no real point in using OMV at all. You could just as well use Debian directly. I use OMV because it makes it fast, convenient and easy to add storage, manage users, create shares and configure services an so on. However I don't use OMV for backups or mounting remote shares. For that I use my own scripts and autofs. Mainly because that is how I did it before I started using OMV, and I think it is easier and simpler doing it my way than using OMV.

    Be smart - be lazy. Clone your rootfs.
    OMV 5: 9 x Odroid HC2 + 1 x Odroid HC1 + 1 x Raspberry Pi 4

    Edited once, last by Adoby ().

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!