Mount the ntfs hard disk on the Raspberry Pi 4 and use syncthing to build a private cloud disk

I usually use Baidu disk to synchronize the photos of my mobile phone. I accidentally deleted the backup of my computer a few days ago. Recovering data from the Baidu network disk was slow. Later I bought diskgenius to restore the data. So I decided to use the raspberry pie at home and DIY a private network disk. I checked the information online and found that it was compatible with private network penetration. There were more recommending syncthing across multiple platforms, so I used syncting to share data.

1 First mount the ntfs format hard disk on the Raspberry Pi. Taobao buys a usb3.0 sports hard drive box with a 2.5-inch 1T sata mechanical hard drive, and local tyrants can buy solid state hard drives.
1.1 Use one of pqmagic, diskgenius, fdisk and other tools to partition the hard disk and format it into ntfs format on the windows machine.

2 By default, the Raspberry Pi only has read-only permission when mounting an ntfs hard disk. You need to install NTFS-3g to increase the read-write permission. Refer to " Raspberry Pi 3B+Automatically Mount Mobile Hard Drive or U Disk "

2.1 Install ntfs-3g
sudo apt-get install ntfs-3g
modprobe fuse
2.2 Check if the hard disk is recognized.
sudo fdisk -l
2.3 View the hard disk mounting location
df -h
output is: (may not be /dev/sda1, sda1 depends on your actual situation, a means the first hard disk, 1 means the first partition.)
/ dev/sda1 112G 114M 112G 1% /media/pi/ newly added volume
2.4 Unmount the hard disk
sudo umount /dev/sda1
2.5 Create the mount directory
sudo mkdir /mnt/myusbdrive
2.6 Remount the hard disk to the /mnt/myusbdrive directory
mount --t ntfs /dev/sda1 /mnt/myusbdrive
2.7 to automatically mount
sudo vim /etc/fstab #Add the
following content in the last line
/dev/sda1 /mnt/myusbdrive ntfs-3g defaults,noatime,umask=0000 0 0
Description:
sda1 depends on your actual situation, a means the first hard disk, and 1 means the first partition.
umask=0000 0 0 The
first four 0s are for everyone, readable, writable and executable, the next
two 0s, the first one represents dump, and 0 means no backup
The second one represents the order of fsck check, 0 means no check.
Unmount: sudo umount /mnt/myusbdrive to
view the mounting situation, you can use the following command.
cd /mnt/myusbdrive
ls

3 Install syncthing on the Raspberry Pi, refer to " Deploying syncthing on the Raspberry Pi to achieve a private cloud | Raspberry Pi Small
Phaseless Series " 3.1 Official website syncthing.net, download the arm version of syncthing under the download page linux.
syncthing official website download page, right-click arm, copy link
cd ~
sudo wget https://github.com/syncthing/syncthing/releases/download/v1.7.1/syncthing-linux-arm-v1.7.1.tar.gz
3.2 Unzip
sudo tar -zxvf syncthing-linux-arm-v1 .7.1.tar.gz

mv syncthing-linux-arm-v1.7.1 syncthing
chmod +x ~/syncthing/syncthing

3.3 执行syncthing
cd syncthing
./syncthing

3.4 Modify the configuration file, use the LAN to access the website
sudo vim ~/.config/syncthing/config.xml and
find the following:

127.0.0.1:8384
XXXXXX modify 127.0.0.0 to 0.0.0.0

4 Install syncthing
on the mobile phone. Find syncthing in the mobile phone market and install it.
4.1 The configuration is very simple, just use the web page configuration on the mobile phone and Raspberry Pi. It uses a particularly long device id to authenticate each other. Just add the mobile phone folder that needs to be synchronized to the Raspberry Pi.

5 Install syncthing on your windows computer.
Download address:
https://github.com/syncthing/syncthing/releases/download/v1.7.1/syncthing-windows-amd64-v1.7.1.zip
But the strange thing is, download it from this address It was very slow. Finally, the download was successful after logging into the mobile phone hotspot with a laptop. It is a green software, just find the executable file syncthing.exe or synctrayzor.exe to run and configure it. There is no difference between the configuration and the mobile phone and the Raspberry Pi.

Syncthing is a cross-platform and equal data synchronization software between hosts. It is not restricted by private network penetration and is very easy to use.

Guess you like

Origin blog.csdn.net/m0_49212388/article/details/107613418