Iāll start by explaining what Iām trying to do: I film and edit video with a group of people and need to have a way to share files between us. We arenāt close enough together to just share memory cards or drives. We have a Windows Server setup with about 100TB of SAN storage. Weāre committed to leaving the storage as a large volume shared by Windows. Whatās the best way to deal with this with Nextcloud?
This is where Iām at so far. Iāve set up Nextcloud in a VM, which worked well, and want to have it store its data file directory on a SMB network drive. I canāt have the files sealed away in a VM drive, I need access to them. Any duplication will cost us space we canāt afford, so having copies on the VM and copying them out to another share is out of the question, too. Moving them is also not an option, the group needs to access the files as well.
I installed Nextcloud from a Snap package and just realised I canāt even make use of the External Files app as SMB isnāt even supported via that method. Before I go on a trip down memory lane doing a manual LAMP stack install to try and get around this, can anyone please tell me if there is a better way to approach the problem?
Even if I can get the External Storage app working, itās not ideal. The āprivate files firstā design approach to storage is going to be confusing for the group who would have to make sure to upload everything into the shared folder and not their home directories, and if they get it wrong itāll be a hassle for me to help them fix - I donāt want to be logging into a Linux CLI ever, if I can help it. Itās probably great for sharing documents with strangers, but collaborate with a team seems really challenging with Nextcloud.
Is the way Nextcloud Enterprise works any different?
Personally, I think Windows SMB share option is the fastest & easiest way with your workflow.
Just for discussion purpose, you can very easily access external drive (Network or Host) out from VM (Ubuntu) and set that as NextCloud Snap Storage drive.
Step 1 - Network Prep
VM Network must be on external, where VM obtains IP or rather stays on your routers physical IP range (Subnet) ā VMWare calls it Bridge Mode, Hyper-V calls it External virtual Switch
Step 2 - Network Share Prep
Create a normal user in Windows with password. Share that big HDD of yours via that user account with a share name, like for ex. 100TB. Ensure the share is working by accessing it via other LAN connection system using that newly created network user account.
Step 3 - Network Drive Mount
In your Ubuntu VM, under home and your user directory (like /home/your_user, running following commands,
sudo mkdir pw then cd pw
sudo nano WinShare ā This will open up CLI text editor, there create two lines exactly like this,
username=Win_User-Name
password=your_password
press CTRL+X, then type Y, then press Enter ā This will save that file.
Run command, sudo apt install cifs-utils -y
Run command, sudo mkdir /media/100TB & sudo mkdir /media/100TB/ncdata ā Snap nextcloud can only access /mnt or /media for external drive mount points, so I prefer creating the mount point at /media location.
Run command, sudo nano /etc/fstab ā This will open up a system configuration file in CLI text editor, do not change anything, just add following line as the last line of that file ā //IP.Address.WinShare.Machine/share_name /media/100TB cifs vers=3.0,credentials=/home/your_ubuntu_usr_dir/pw/WinShare,file_mode=0777,dir_mode=0777 0 0
press CTRL+X, then type Y, then press Enter ā This will save that file.
Run command mount -a ā If you have done everything right, this should not generate any error and that 100TB share of yours is now accessible under /media/100TB directory in your Ubuntu VM
Step 4 - Changing the Snap NextCloud data dir
First step is obviously to install Snap NextCloud
Run command, sudo snap connect nextcloud:removable-media ā this is to grant nextcloud snap access to removable media.
Run command, sudo nano /var/snap/nextcloud/current/nextcloud/config/config.php ā This will open configuration file under CLI text editor, carefully locate and change only one line saying ādatadirectoryā ā there change the location to /media/100TB/ncdata
press CTRL+X, then type Y, then press Enter ā This will save that file.
run command, sudo mv /var/snap/nextcloud/common/nextcloud/data/. /media/100TB/ncdata/
Run command, sudo chown -R root:root /media/100TB/ncdata & then sudo chmod 0770 /media/100TB/ncdata
Restart the Ubuntu VM
If everything is done right, Ubuntu VM will host and run Snap Nextcloud but user data is going to be saved under ncdata folder of your host or even network Windows server 100TB drive.
I think the best way of accessing it is via a WebDAV Share mounted as network drive in each Windows client device. But somehow it is not working for me either.
Dude! Thank you so much, this was a brilliant set of instructions and worked perfectly.
One minor error in your cifs config - and I did actually try exactly what youāve done, but it failed, and I didnāt realise the error that time around hence why I was so frustrated - the share needs to be configured with file_mode=0770,dir_mode=0770 rather than file_mode=0777,dir_mode=0777, else you get an error:
Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.
That had me trying to chmod the ncdata and parent folders which of course has no effect on a Windows-hosted SMB share⦠Haha. Itās all working now, so again thankyou