dolorosus / RaspiBackup

Backup your raspi
GNU General Public License v3.0
13 stars 4 forks source link

Should exclude /boot from rootfs rsync? #12

Closed ephestione closed 5 years ago

ephestione commented 5 years ago

Had this thought just now... shouldn't /boot be excluded by the rsync command on rootfs? Wouldn't it otherwise create a duplicate of the boot partition inside an unmounted target folder? Or otherwise... for reasons?

dolorosus commented 5 years ago

I can't agree :-)

Try RaspiBackup.sh mount short check with dfree will give you two mounts one for <imgfile> and one for <imgfile>/boot

Now umount <imgfile>/boot finally: check the content <imgfile>/boot and you will notice that it's is empty now.

root@raspberrypi(54)/home/pi/scripts_#./RaspiBackup.sh mount /mnt/USB64/BACKUPS/MyRaspi-191004_062515.img Attaching /mnt/USB64/BACKUPS/MyRaspi-191004_062515.img to /dev/loop0 Mounting /dev/loop0p1 and /dev/loop0p2 to /mnt/MyRaspi-191004_062515.img/ SD Image has been mounted and can be accessed at: /mnt/MyRaspi-191004_062515.img/

root@raspberrypi(53)/home/pi/scripts_#lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT loop0 7:0 0 5.9G 0 loop ├─loop0p1 259:0 0 246M 0 part /mnt/MyRaspi-191004_062515.img/boot └─loop0p2 259:1 0 5.6G 0 part /mnt/MyRaspi-191004_062515.img

root@raspberrypi(53)/home/pi/scripts_#df Filesystem 1K-blocks Used Available Use% Mounted on /dev/loop0p2 5729880 3808276 1610820 71% /mnt/MyRaspi-191004_062515.img /dev/loop0p1 248012 40049 207964 17% /mnt/MyRaspi-191004_062515.img/boot

ls -l /mnt/MyRaspi-191004_062515.img/boot total 39576 -rwxr-xr-x 1 root root 23946 Aug 21 20:59 bcm2708-rpi-b.dtb* -rwxr-xr-x 1 root root 24205 Aug 21 20:59 bcm2708-rpi-b-plus.dtb* ...

umount /mnt/MyRaspi-191004_062515.img/boot root@raspberrypi(53)/home/pi/scripts_#ll /mnt/MyRaspi-191004_062515.img/boot total 0

dolorosus commented 5 years ago

And I forgot to mention the x option of the rsync options...

ephestione commented 5 years ago

Oh okay, I'm not fluent in rsync so I thought that either it was creating a duplicate, or it was copying the files twice. But alright ;)

dolorosus commented 5 years ago

Don't worry the files are not copied only the directory /boot and this is needed as mountpoint ;-)