Step 1: Install samba client stuff on the PI
Code
sudo apt-get install samba-common smbclient samba-common-bin smbclient cifs-utils
sudo mkdir /mnt/samba_backup
sudo mount -t cifs //<your-server>/backup /mnt/samba_backup -o user=user,pass=password,dom=domain
to remove mount just use umount /mnt/samba_server
to mount permanently add somthing like
to your /etc/fstab. yourcredentialfile should look like
Step 2: Check if access works like
In my case the it looks like
Code
pi@octovoron:~ $ ls -lart /mnt/samba_backup/IOTBackup/
total 0
drwxr-xr-x 2 root root 0 Mar 13 08:55 ..
drwxr-xr-x 2 root root 0 Mar 13 08:56 PiHoles
drwxr-xr-x 2 root root 0 Mar 13 08:56 OctoPi
drwxr-xr-x 2 root root 0 Mar 13 08:56 TeslaLogger
drwxr-xr-x 2 root root 0 Mar 13 08:57 DMZ_Banana
drwxr-xr-x 2 root root 0 Mar 13 08:57 Cameras
drwxr-xr-x 2 root root 0 Mar 13 08:57 .
Step 3: Use DD to take the backup
check fstab for your shares if you forgot what you did in step 2
Code
pi@octovoron:~ $ cat /etc/fstab
#proc /proc proc defaults 0 0
PARTUUID=562352cc-01 /boot vfat defaults 0 2
PARTUUID=562352cc-02 / ext4 defaults,noatime 0 1
//server/backup /mnt/samba_backup cifs credentials=/home/pi/.smbcredentials 0 0
and lsblk for your drives
Code
pi@octovoron:~ $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk0 179:0 0 476.7G 0 disk
├─mmcblk0p1 179:1 0 256M 0 part /boot
└─mmcblk0p2 179:2 0 476.5G 0 part /
then you can execute something like
Code
sudo dd if=/dev/mmcblk0p2 of=/mnt/samba_backup/IOTBackup/OctoPi/octovoron_root_2021_03_13.img bs=1M
Depending on the size it might take a while!
Kommentare
Neu erstellte Kommentare unterliegen der Moderation und werden erst sichtbar, wenn sie durch einen Moderator geprüft und freigeschaltet wurden.
Neu erstellte Kommentare unterliegen der Moderation und werden erst sichtbar, wenn sie durch einen Moderator geprüft und freigeschaltet wurden.