When this happens the NC login page says it canāt access the data folder. Itās because the mount doesnāt mount before NC I guess.
Now I have it, you are doing different things at the mount command and the line in fstab. You are mounting the drive sdb to mnt/cloud by the mount command, but the line in fstab is totally different.
this in fstab should work
/dev/sdb /mnt/cloud ext4 defaults 0 1
So I donāt have to do the UUID thing in fstab? Instead do it like you did it?
The UUID is looking like this 6a12a4d5-e9e6-4568-afcc-34c70b24a668.
ls -l /dev/disk/by-uuid
that will show the UUID of your drives but as mentioned above that should work also.
maybe this command is more helpfull
sudo lsblk -o NAME,UUID,FSTYPE,SIZE,LABEL,MOUNTPOINT
Iām sorry for being so difficult, it just shows how this confuses me. I do have NC installed successfully thanks to your help. Itās now just getting this mounted for the data. Below are the steps that I do to add the second HDD for the mount:
mkdir /mnt/cloud
mount /dev/sdb /mnt/cloud
gedit /etc/fstab
add line:
UUID=c42fe6ea-8529-4f05-9b79-f72cafcfb88c /mnt/data ext4 defaults, noatime 0 0
Is there a setting Iām missing for this to mount before NC runs?
chown -R www-data:www-data /mnt/cloud
chmod 775 /mnt/cloud
chmod u+rw -R /mnt/cloud
What do I need to change? The mounting part is confusing to me. Do I just put it in fstab and not mount it earlier like I do? I know you have better stuff to do than help a stranger but I am really grateful for your help with this.
I donāt know why the lines are huge above, lol.
fstab is enough (and reboot), if you got no error during booting (red letters, may be to fast to read) the drive is available. Simply move to that mnt/cloud and try to make a folder if that works, everything is fine. The next part is to use the external app (as mentioned above) inside Nextcloud to make it available.
Try the midnight-commander as mentioned in private mail, it is much easier to use.
BTW I am also a beginner at linux. I have started in last December and have to google and read a lot.
A bid clarification:
-
mount /dev/sdb /mnt/cloud
just mounts the drive by itās current /dev/ path and just for the current session (until reboot).- Mostly using the /dev/ path works fine, but theoretically it can change, if you unplug/plug other drives. The drive available via
/dev/sdb
first might be available via/dev/sdc
another time. For this reason the UUID method is more secure, as every drive has itās own unique UUID. Possible would be e.g.mount UUID=c42fe6ea-8529-4f05-9b79-f72cafcfb88c /mnt/cloud
- As mentioned, the mount command just mounts a drive temporary until reboot.
/etc/fstab
will be read on boot and automounts the entries. Thus yes it is enough to do the fstab entry and reboot. If you want to avoid the reboot, themount
command is needed as well.
- Mostly using the /dev/ path works fine, but theoretically it can change, if you unplug/plug other drives. The drive available via
- Within the commands you provide you used
/mnt/data
as well as/mnt/cloud
? I guess this should be the same . - If you use a default Ubuntu installation (no VM, docker, snap or something), then I would not use the external storage app mentioned by 3Dscrewer, but using the drive directly as Nextcloud data location. If your Nextcloud is already installed, thus data folder is already set, there are possibilities to switch it afterwards: Howto: Change / Move data directory after installation However if you did not yet actively use your Nextcloud, I would recommend to just install it fresh:
- As far as I understood you installed a LAMP server now according to one of the guides? Then it would be something like:
-
rm /path/to/nextcloud/config/config.php
//remove config.php to reset Nextcloud install stage. -
mysqladmin -uroot -p<password> drop nextcloud
//remove existing nextcloud mysql database -
mysql -uroot -p<password> "drop user 'ncuser'@'localhost'"
//remove existing nextcloud mysql user -
sudo -u www-data php /path/to/nextcloud/occ maintenance:install --database "mysql" --database-name "nextcloud" --database-user "root" --database-pass "<password>" --admin-user "Coyote" --admin-pass "<Coyotes_password>" --data-dir "/mnt/cloud"
//This command automatically creates the database user and password and the data directory, configures config.php accordingly and creates the Nextcloud admin user with chosen password. Thus afterwards you can directly log into your Nextcloud without web ui installation.
About NextcloudPi / DietPi:
- NextcloudPi was created for Raspberry Pi first, thatās true. But you can (now) install it on any Debian based system: https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/ It is officially supported by Nextcloud for a while and therefore the only official ready-to-use non container/vitalized solution, as far as I know. It automates many of the recommended settings, also security wise, and/or allow easy setup via web interface.
- DietPi on the other hand provides images for a wide range of SBCs, as well as x86_64 and VMs: http://dietpi.com/#download But it is not for Nextcloud only, thus does not make it as easy as NextcloudPi to setup a proper Nextcloud instance with HTTPS etc enabled. But on the other hand it provides easy installation scripts for a wide range of additional software titles, thus is more flexible from that point of view and starting with a small efficient base image. I myself implemented and maintain a proper Nextcloud (and ownCloud) installation via DietPiās UI .
- If you just need Nextcloud, nothing else, I guess NextcloudPi is the more specialized and complete solution for this and provides great support via this forum. If you think about doing some more stuff later on with your machine, then DietPi might be worth looking at, providing a highly efficient base image with easy to use automated installation and configuration scripts (via UI) for a wide range of software titles.
Thank you for explaining how it works. I canāt seem to get the concept but
this helps a bunch. In windows itās so much easier because I know it fairly
well. Great catch on the data and cloud. I have changed the name a few
times so I guess I missed that and didnāt update the document. Maybe that
was my issue?? I had set everything up in OC 9 and had no issue with it.
There were some changes on the new one and I couldnāt figure it out. That
is why Iām installing NC. I know theyāre very similar but NC has a much
better community and options.
I keep all of this in a text document and I forgot to change it. I
will try this tonight when I get home and see what happens. I have
everything installed up to this point. Once this is done I can go to the NC
setup and see if it works. Yāall are awesome for helping others out with
this stuff.
As far as I understand, he used the Tech and Me script. The script is originally written for an VM using Ubuntu 16.04 LTS, but he is using it on a standard PC, so he wasted some space for the VM Utils.
I have suggested this script because I know that it is working, I have used it a lot ā¦
I think he is happy enough that the Cloud is now running. So keep it simple ā¦
He has an 500GB BootDrive, thats imho enough storage for syncing Files (I have only 100), using the 2nd Drive as Filestorage by the External APP should be the easiest way.
Since his other PC('s) are Windows based (so far I understand), I see the next problem coming ā¦
Jep, sorry for interfering in case, since you guys already talked via PM?
If itās working now, or after fixing the /mnt/cloud
/mnt/data
typo, then itās properly not worth it to reinstall again. And as said, my installation advice is just valid for non-VM/container installations, where in these cases thinks might be very different due to special pre-configurations.
No, he is using normal hardware with an Ubuntu installation, but he is using this script which is intended for an VM ā¦ or with other words, enoch85 is selling a ready VM and in this VM he is using this script ā¦
My opinion was that the script must also work in normal configuration and yes it is.
https://raw.githubusercontent.com/nextcloud/vm/master/nextcloud_install_production.sh
The PM was because Midnight Commander. Iām this year 60 and I know the Norton Commander very well. It is usefull to examine a non GUI System without typing a lot ā¦
Coyote_Hunter wrote that he has a personal issue, he has to write down a lot to remember it and so my idea was the script to get the cloud running ā¦
any help is appreciated and welcome because I am also a beginner, Thanks
Iāve read a lot on Linux but I canāt remember the information well. If I do anything I have to keep track because I wonāt remember 10 minutes later if I did it or not. I had a bad head injury in 2006 so itās something I have to deal with. Changes arenāt good for me, lol.
Itās working now!!! I really appreciate everything you did for me. I also appreciate your patience too. Hopefully they wonāt change it anytime soon. One of these days I will try to get the SSL working but Iām happy that it just works now. I have it all noted so if I mess it up I can always fix it easily. It would be nice to just run a script and it will be set up but this will do just fine. Again, thank you for all of your help.
Just for the record, the script can be used on a barebone server/PC and inside a VM. There is no difference between a VM and a baremetal machine really, the only thing I can think of now is that we use additional cloud kernels in the scripts to adapt to the virtual environment. But, as I said, it will work to use the scripts on a regular PC as well, or even a laptop if you feel like it. As long as itās running Ubuntu Server 16.04.