Maximum PC - USA (2022-01)

(Maropa) #1
1

EXTERNAL STORAGE


The Raspberry Pi 3 and Pi 4 boot from the SD card. While this
can be changed in favor of a more reliable USB device, SD is
the default option. This has obvious advantages, from speed and
convenience to simplicity. However, there is a key disadvantage,
which is the longevity of the card: regular reading and writing of
data to the SD card will shorten its lifespan.
>> Throw into the mix the fact that your NextCloudPi storage
installation is limited to the size of the microSD card in your
Raspberry Pi and you have an obvious problem. It’s just not big
enough to compete with Dropbox or OneDrive or Google Drive,
and you’re limited to the maximum supported capacity of 1TB.
>> Adding an external disk drive to Nextcloud requires only a
device with USB connectivity (unless you’re using a case with a
SATA adapter). For faster data transfer, use USB 3 .0+ devices,
and for the optimum, rely on SSD or NVME/M. 2 flash.
>> First, connect the USB device and then set up an SSH
terminal to your Nextcloud and enter
sudo mkdir /media/USBstorage
>> In your computer’s web browser visit the NextCloudPi web
panel (using the 4443 port, so https://[IP ADDRESS]:44 43 ). If it
doesn’t launch automatically, start the wizard by clicking the
wand icon in the toolbar. Select USB Configuration, input Yes,
then Continue, and Format USB.

RUNNING YOUROWN CLOUD STORAGE SERVER saves money, allows you to expand storage as
necessary, and can be done with a device as small as a Raspberry Pi. In our previous guides
on the Raspberry Pi, we have covered everything you need to know about installing and setting
up NextCloudPi and the Nextcloud Ubuntu Appliance, as well as the manual installation of
Nextcloud on Raspberry Pi OS.
But even when the software is installed and connected to your network, the job is still only
half-finished. You will need to configure it for your specific use-case, enable external storage
to reduce wear and tear on the Pi’s SD card and make the Nextcloud server accessible from
beyond your home network.
The most straightforward way to set up external access to Nextcloud and to add external
storage is to do it with the NextCloudPi installation. – CHRISTIAN CAWLEY

YOU’LL NEED THIS


RASPBERRY PI 3 OR 4


NextCloudPi
USB 3.0 HDD
Internet connection

>> When this completes, select ‘Move data to USB’. You
now have a Raspberry Pi-powered Nextcloud server that
can store as much data as you need without wearing out
the microSD card.

2

STATIC ACCESS


Configuring Nextcloud to be accessed from
devices beyond your network (such as your
mobile device while shopping) is possible with a static IP
address. But before setting this up for external access,
it’s smart to configure the Raspberry Pi with a static
IP address for access within your network and, more
crucially, your router first.
>> To confirm the Pi’s IP address and how it was
assigned, open a terminal or SSH connection and enter
ip r | grep default
>> If you see the letters dhcp the IP address is assigned
dynamically by the router. Make a note of the IP address,
then check the nameserver or DNS IP:
sudo nano /etc/resolv.conf
>> Make a note of the IP address listed here for the
nameserver before proceeding. Setting a static IP
address can be achieved by editing the dhcpcd.conf file
in nano:
sudo nano /etc/dhcpcd.conf
>> Add the following lines to the end of the file, changing
the capitalized text with the information you have
to hand:
interface NETWORK
staticip_address=STATIC_IP/2 4
staticrouters=ROUTER_IP
staticdomain_name_servers=DNS_IP
>> Change NETWORK to eth0 or wlan 0 , depending
on the network type (Ethernet or Wi-Fi).
>> For STATIC_IP enter the IP address you wish to use
for the Pi. It’s smart to use the one already assigned to
maintain connectivity.
>> For ROUTER_IP, use the gateway IP for the router
on your network. This is usually printed on the router.
>> Finally, set DNS_IP to the IP address you made
a note of after checking the resolv.conf file. Finish by
rebooting with
sudo reboot

>> Connect a USB drive or full-size external hard disk drive to your
Raspberry Pi for storage with Nextcloud—USB 3.0 preferred!

60 MAXIMUMPC JAN 2022


R&D

Free download pdf