Raspberry Pi cloud disk internal network penetration and expansion
1. External network access
First download the peanut shell software to your computer, then register an account to receive a free domain name, open the intranet penetration service (you should pay 6 yuan now to activate), after activation, open the intranet penetration to add the mapping, add according to the picture below
After adding the mapping, we will start to change the trust domain of the cloud disk. Follow the steps below on the Raspberry Pi terminal
cd /var/www/html/owncloud
sudo nano config/config.php
Change the original ip of the Raspberry Pi in the brackets to your Internet access address
After the change, you can test it on your phone
Enter "external network access address/owncloud" in the browser to enter your cloud disk
15239m665v.51mypc.cn:19358/owncloud
2. Expansion
1. First format your hard disk/U disk to ext4 format
Use MiniTool software, send "M" to WeChat public account to get
Find the hard disk/U disk you want to mount, click delete above
2. Mount the hard disk/U disk
Insert it into the Raspberry Pi and check the status with the following command
sudo fdisk -l
We mount it on /disk under /home
cd /home
sudo mkdir disk
sudo mount -o uid=pi,gid=pi /dev/sda1 /home/disk
sudo nano /etc/fstab
Add the following piece of code at the end
/dev/sda1 /home/disk ext4 defaults 0 0
3. After the mounting is complete, copy the /var/www/html/owncloud/data folder to /home/disk
(If you are not familiar with the command here, you can use the VNC graphical interface to complete it)
First give permission
sudo chmod 777 /var/www/html/owncloud/data
sudo chmod 777 /home/disk
sudo chmod 777 /var/www/html/owncloud/data/owncloud.log
Next, go to the graphical interface and copy the data folder to /home/disk
After copying, give the user permission for the path
sudo chown -R www-data:www-data /home/disk/data
4. Modify owncloud settings
cd /var/www/html/owncloud/config
sudo nano config.php
After opening the file, change the /var/www/html/owncloud/data inside to /home/disk/data
Save and exit
Successful expansion
Just upload a picture, you can see it is stored in /home/disk/data