How to allocate more disk space to default Nextcloud data location

NethServer Version: 7.9.2009
Module: Nextcloud

I know, I’m totally not with the program, but I’ve got an existing Nethserver 7 box with Nextcloud, that we share files with customers on. You can see below that my problem is I’ve run out of space at mount point /, but the SSD has 400GB available at mount point /home. Since Nextcloud data is stored at /var/lib/nethserver/nextcloud, my customer’s files are taking up a lot of space and we’ve capped it now. I have never reallocated space, so I don’t know how. Is there a way to reallocate that 400GB and give a bunch more space to /var/lib/nethserver/nextcloud? Thanks for any help you can offer. I plan on getting a new box going with the latest Nethserver and Nextcloud, in the new year, but that doesn’t help me now.

1 Like

You could resize the partitions using for example gparted but that will take time.

Just linking the files to the home partition would be faster.
Warning! This didn’t work here for new users (they start without template files) but here is a thread with different solutions for moving the NC data: HowTo: Change / Move data directory after installation - 📑 How to - Nextcloud community

Copy the Nextcloud files to /home:

\cp -a /var/lib/nethserver/nextcloud /home/

Rename the original Nextcloud folder to have a backup:

mv /var/lib/nethserver/nextcloud /var/lib/nethserver/nextcloud.old

Link the Nextcloud dir from /var/lib/nethserver/nextcloud to /home/nextcloud

ln -s /home/nextcloud /var/lib/nethserver/nextcloud

If everything is working you can remove the Nextcloud backup to free disk space:

rm -rf /var/lib/nethserver/nextcloud.old

If it doesn’t work remove the link and rename the nextcloud folder back.

Thank you, Markus. I think I’ll try that.

1 Like

I was reading your link, Markus, and it got me wondering…Do you think there will be a permissions issue with the data in the /home directory? That it could be an obstacle to users transferring files?

In my tests with the symlink newly created users had no example files but for existing users it worked. It was possible to create new files.
I recommend a backup before you try something.

That seems to have done the trick (for now). Thank you much, Markus.

1 Like

why not adding a volume to the VG and extend the LV to it ? That’s what I do usually.

1 Like

That would also be possible but the OP wanted to use the existing volume IIUC.

oh yes sorry didn’t noticed the empty /home. I don’t like that default partition setting in CentOS.

1 Like

Well, it’s working after doing Markus’ suggestions. If it ain’t broke…However, when I go to storage in NS7 Cockpit’s System config, then try to add an LV, the most it will let me add is 4MB.Would I need to get rid of the /Home volume to free up more, then add it to the / (root) volume? I plan on going to a Nextcloud install on an NS8 VM, on Proxmox, first part of ‘26, so I’m just needing to get by until then. That’s provided those installs go smoothly and I get them running sooner than later. I’d rather not mess things up in the meantime. Thanks for the input tho.

actually you need to add a volume to the volume group before (read : add storage). Then you can grow the LV which will span on the two volumes, and finally resize2fsor xfs_grow . That’s quite neat.

In your case I think you could simply remove the unused /home partition and affect the free space to the /root part using gparted as @mrmarkus said but that’s not a trivial task (did I mention the word backupS ?).

For Proxmox I would certainly choose ZFS. I at the blue pill this summer, it took me a lot of investment and experiments but that’s definitively worth it. I could help if you want and share my installation notes (bare metal, Debian, and proxmox on it from scratch - pretty exciting).

EDIT - It’s actually much more simple I think : simply remove the home LV (if empty) and then grow the other one (/root) and then grow_xfs.