Hello again,
first of all: I don’t know much about Nextcloud yet and have only been using it for half a year. I decided a few days ago to write a better FritzBox implementation than carddav2fb, so I registered here. I am NC-noob myself…
So maybe it’s better to wait for better answers.
This appliance is an official Nextcloud appliance? I have no idea what it’s all about. Where did you load it from?
I understand the line
ncdata ..... ..... .... 50% /mnt/ncdata
not. I don’t know any file system “ncdata”. At the place (first column) there is normally the device file, so something like /dev/sda1, /dev/mapper… or host:xx for remote hosts (nfs, sshfs). Or if there is no device (for virtual file systems like tmpfs or proc) just the name of the driver (I think). Accordingly, ncdata is a special virtual file system. But I haven’t heard anything about it (which means nothing. I’m an NC-noob).
You can do the following (read it completely, at the end is a simpler solution):
!!! Attention: Everything not tested, written down fast !!!
-
Stop the VM.
-
Make yourself a copy of the virtual machine as backup.
-
If you think not necessary, jump to 1.
-
Create a new disk for your VM.
-
Boot the VM and log in as root.
-
Find out which device file the new hard disk has. ls -l /dev/sd* /dev/hd*
Shows you possible disks. sda is the first sdb is the second, etc. If there is no SCSI emulation in the kernel it should be hda and hdb etc… Since your new disk is not partitioned yet, there are no more device files. Assuming the system is on the first partition of sda, then there is sda1 and so on. Your new one should be sdb and there is no sdb1! yet! Try gdisk -l /dev/sdb
. If you get a message that no partition table exists it is probably the right one. Compare the output also with gdisk -l /dev/sda
. There one should be displayed…
At this point you now know the device file of your new virtual hard disk. I now assume “/dev/sdb” for examples. Exchange it for your found device file. If you are not sure, stop here (and ask again)
-
Check if the directory ‘/data/’ exists. If not, create the directory /data/ with mkdir /data/
. If yes, report again or take another one (/data1) and remember it.
-
Partition your new hard drive with gdisk /dev/YOUR_NEW_HD
or see if you do it from the desktop. You only need one partition, take the whole disk.
-
Format the new partition with mkfs.ext4 (or mkfs.xfs) mkfs.ext4 /dev/YOUR_NEW_HD1
. Note the ‘1’, i.e. ‘/dev/sdb1’. sd = scsi-disk, b stands for second disk and 1 for first partition of the second disk.
-
Test it with mount /dev/YOUR_NEW_HD1 /data
and ls -l /data
. There should now be a lost+found directory.
-
unmounte them again umount /data
-
To automatically mount it at boot time, edit the file ‘/etc/fstab’ and insert the following line
(!!! Attention: With a defective fstab the VM will not be able to boot anymore !!!):
/dev/YOUR_NEW_HD1 /data ext4 data=ordered,nofail 0 2
- Test the automatic mount with
mount -a
df -h /data
should give something of ‘Mounted on /data’. If it didn’t work just ‘/’ instead of ‘/data’
If everything works out:
-
Stop the apache: service apache2 stop
(or with systemctl)
-
cp -a /mnt/ncdata /data/
This copies the ncdata directory from /mnt/ to /data/ including all file attributes, owner, etc…
-
In Nextcloud change the data directory to the new one. I have to see for myself how this works I did this once by link, but it’s suboptimal. The directory is somewhere in config.php…
Found: in your config.php
there is this line:
'datadirectory' => '/srv/www/htdocs/nextcloud/data',
change it to
'datadirectory' => '/data/ncdata',
My config is under '/srv/www/htdocs/nextcloud/config`. Possibly the Nextcloud installation is somewhere else with you.
-
restart the Apache: service apache2 start
-
test…
-
reboot
-
test…
If you use the VM only for Nextcloud you can skip that with the new disk and only create the directory /data.
Then you need to start at point 13. You still have 34GB free. Somewhere at Nextcloud I would set up a limit of 25-30 GB. So that the system doesn’t drive in front of the wall if you upload too much. With your own hard disk this (rather) can’t happen.
hth
Translated with www.DeepL.com/Translator