Replies: 10 comments 4 replies
-
You have to use either tar or rsync. Then you can use option IGNORE_ADDITIONAL_PARTITIONS to backup the first two partitions only |
Beta Was this translation helpful? Give feedback.
-
I already use an rsync backup. This also works very well. So I'm expanding my question into a feature request. I just tried out whether this could be done with dd.
So i get the End-Sector from the second partition: 26511359 /backup was mounted to /dev/sda3 I have now restored the backup to an other SSD and it works. Only the /dev/sda3 had to be formatted again. |
Beta Was this translation helpful? Give feedback.
-
Are you sure your rsync backup is correct? According the debug log you have only the boot partition but no root partition in the backup (/dev/mmcblk0p2 is missing).
|
Beta Was this translation helpful? Give feedback.
-
The script can use a rsync or tar backup as input and creates a dd backup. A normal backup hast two partitions defined in the sfdisk file. You only have the boot partition defined. That's why I think the backup is somewhere incorrect and caues the issue. Do you have the backup creation debug log handy? |
Beta Was this translation helpful? Give feedback.
-
Thank you for the support and pointing me in the right direction! The raspberry pi 3 b+ does not need this SD card. Because this was present, the SD card was mounted under /boot. Now that I have removed the SD card and created a new backup, it now works with this script. The sfdisk file now also contains 2 partitions. The only drawback with the script... there must be as much memory (temporarily) free on the backup path as the size of the entire SSD. Thank you. |
Beta Was this translation helpful? Give feedback.
-
Yes, That's right. You're the first one who uses the script with more than 2 partitions. The size of all partitions is accumulated right now. Just update the script accordingly and accumulate the first two partitions only 😉 |
Beta Was this translation helpful? Give feedback.
-
I just created the required update for the script for your convenience. But please note: It's untested.
Please let me know whether it works for you. |
Beta Was this translation helpful? Give feedback.
-
The sfdisk file created by raspiBackup includes all partitions of the system which was saved. The unmodified script calculates the required dd image size thus with all partitions and allocates the dd file with this size. Later on pishrink reduces the size. The fix I provided will allocate the dd file only by the size of the first two partitions and ignores any other following partitions. It's up to you to apply my fix. The script is provided as is and not supported. I had some spare time and thought you may be interested in the fix. Just use it or forget the fix 😃 |
Beta Was this translation helpful? Give feedback.
-
But that's not the case for me?
The sfdisk file::
And it doesn't matter which file system I have as the third partition. I tested it with both NTFS and ext4
I am very interested in a good and, above all, generic solution that also works on multiple systems.
This is also logical for me, since loop0:
The unmodified script works for me without any problems 😃 |
Beta Was this translation helpful? Give feedback.
-
Hm ... that's interesting. I thought you will get all partitions in the sfdisk file.
Ok. Then enjoy the script 😃 |
Beta Was this translation helpful? Give feedback.
-
I just switched from an SD card to an SSD.
So far I have always carried out my backups on the PC as an image backup. I like this type of backup because a restore can be done in just a few minutes.
However, with a 500GB SSD this is no longer so easy. You can shrink the image with pishrink, but you have to save the entire image first. With a slightly weaker WiFi connection, this takes many hours ore days.
With the option
DEFAULT_DD_BACKUP_SAVE_USED_PARTITIONS_ONLY
https://www.linux-tips-and-tricks.de/en/faq/#a16
I could shrink the partition and create smaller images. It's also great for home automation on my Raspberry.
However, I still have a Raspberry running as a surveillance camera. Here I would like to create 3 partitions:
boot
root (8GB)
data (240GB)
I don't need an extra backup of the data partition.
Is it possible to back up only the first two partitions with dd?
Did I perhaps miss an option?
Many thanks for your great work on this project!
Best Regards!
Beta Was this translation helpful? Give feedback.
All reactions