This guide will help you configure an external USB drive.
Important note: If you are using only one USB drive, you can leave the default path /media/USBdrive for all configuration options, but if you are going to use more than one you need to reference them by label, or NCP will not be able to know which one is which. For instance, if the label of the drive is mylabel then use the path /media/mylabel for items such as nc-datadir, nc-database and so on.
Procedure
- Format USB drive (optional but check note).
- Enable
nc-automount. - Configure Nextcloud data to be on the USB drive.
- Configure Database data to be on the USB drive (optional).
- Configure Swap on the USB drive (optional).
Format USB drive (optional)
nc-format-USB will format your external USB drive to BTRFS, with the given Label.
Note 1: In order for you to be able to use an external USB drive, the USB drive must not be formatted as NTFS/FAT as these do not support the user/permission system.
Note 2: This will format all USB drives you have connected to the Raspberry Pi
- Navigate to
nc-format-USBin the TUI or the WebUI. - Change the LABEL to a label you like. This is also the name of the directory that the USB drive will mount to (e.x. /media/”myLabel”).
- Click Run or Start.
Enable nc-automount
To enable nc-automount follow the steps:
- Navigate to
nc-automountin the TUI or the WebUI. - Change
ACTIVEto yes. - Click Run or Start.
Configure Nextcloud data to be on the USB drive
To make Nextcloud data directory to be on the USB drive, follow the steps:
- Navigate to
nc-datadirin the TUI or the WebUI. - Change
DATADIRto your data location in the mount point. - Click Run or Start.
Configure Database data to be on the USB drive (optional).
To make Database data to be on the USB Drive, follow the steps:
- Navigate to
nc-databasein the TUI or the WebUI. - Change
DBDIRto your database location in the mount point. - Click Run or Start.
Configure Swap on the USB drive (optional).
Note: this is not supported in BTRFS, use ZRAM for that.
To configure Swap location and size, follow the steps:
- Navigate to
nc-swapfilein the TUI or the WebUI. - Change the
SWAPFILEto the desired location in the mount point. - Change the
SWAPSIZEto the desired size of Swap File (Default:1024MB).
Final Words
Now you have configured NextCloudPi to use an external USB drive for Nextcloud data, optionally Database data and Swap.