# Nextcloud Pi, wanting to add second HDD for backup

**URL:** <https://help.nextcloud.com/t/nextcloud-pi-wanting-to-add-second-hdd-for-backup/154249>\
**Category:** 📦 Appliances (Docker, Snappy, VM, NCP, AIO)\
**Tags:** backup, ncp\
**Created:** [January 23, 2023, 3:22pm UTC](https://help.nextcloud.com/t/nextcloud-pi-wanting-to-add-second-hdd-for-backup/154249 "2023-01-23T15:22:43Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![HeavyD](https://help.nextcloud.com/letter_avatar/heavyd/32/5_5575768a8748004e209b776fc1b2916d.png) [@HeavyD](https://help.nextcloud.com/u/HeavyD)\
**Post date:** [February 3, 2023, 4:42pm UTC](https://help.nextcloud.com/t/nextcloud-pi-wanting-to-add-second-hdd-for-backup/154249/8 "2023-02-03T16:42:14Z")

</div>

Hi Just,

Sorry for the long delay, work and family commitments leave little time for tinkering.

I have just had a go after watching / reading about the fstab file.

I fired up another pi and plugged in the USB HDD that I formatted with my nextcloudpi.

I used the df-Th command to list drives and formats and found it as sda1 in btrfs format.

I used ls -lh /dev/disk/by-uuid/ to find the UUID for the disk. Got that and then.

I used Sudo nano /etc/fstab to edit the mount point.

I put in UUID=myuuidlongcode /media/mybackup btrfs rw,users, 0 0

Saved the fstab file and ran df -Th again and could see the sda1 disc was mounted where I wanted it.

I had a permission error when I tried to write to it but that’s as expected and I didn’t want to change the permissions on it as this was just a test.

Hopefully that is the theory part done and I would be able to repeat it on my nextcloudpi install.

Previously I want getting the mount point thing (coming from windows) I had my disk partitioned and formatted with the name I wanted why isn’t it working? But I hadn’t grasped that unless I then tell the raspberry pi “hey this disk, please always mount it in this place” it wouldn’t. So when I insert a new USB HDD with automount on then the nextcloudpi just sees two USB HDD’s and doesn’t know where anything is.

So onto the real deal. I assume I should edit the fstab for both USB HDD’s, the existing one with the datadir etc on it and the new one I want to use as a backup. I will do the existing one before plugging the backup in.

Looking at my settings:  
NCP System info lists my datadir as /media/USBdrive/ncdata - this is the place it is automatically put.  
NC settings page shows it as /media/myCloudDrive - this is the place I want to set the mount point in fstab so that it carries on business as usual.

So assuming I have my head (somewhat) around this now. Once I have done the fstab magic on the original USB HDD with the datadir etc on it I follow Olivers guidance in post [Change path of datadir + dbdir from "USBdrive" to drive label - #2 by eehmke](https://help.nextcloud.com/t/change-path-of-datadir-dbdir-from-usbdrive-to-drive-label/59904/2) and edit the config file so that anything pointing at the old automount location /media/USBdrive/ncdata etc looks at the new set mount point of /media/myCloudDrive/ncdata etc.

Then I can plug in the new external USB HDD that I’m using as a backupdrive and edit fstab to mount it at /media/mybackup.

I will need to give user permissions for nextcloud sudo chown www-data:www-data /media/mybackup.

I can then use the nextcloudpi webUI or the commandline UI to set the backup tasks to look at the /media/mybackup folder.

I hope this is somewhat correct…

---

_[View the full topic](https://help.nextcloud.com/t/nextcloud-pi-wanting-to-add-second-hdd-for-backup/154249)._
