Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DietPi-Backup | Sync RootFS from temporary mount point #2558

Closed
MichaIng opened this issue Feb 16, 2019 · 2 comments
Closed

DietPi-Backup | Sync RootFS from temporary mount point #2558

MichaIng opened this issue Feb 16, 2019 · 2 comments

Comments

@MichaIng
Copy link
Owner

MichaIng commented Feb 16, 2019

Just derived that method from: https://github.com/raspberrypi-ui/piclone/blob/master/src/backup

I didn't know that mounting the same drive/partition to two mount points is possible. df does not show the second mount point, but one can access it.

Mounting RootFS to a temporary mount point has the advantage that only the actual partitions content is synced, not the content of kernel or user mounts, like /proc /sys /dev /run /tmp and /mnt/*. So we don't need to exclude them manually.

As well this allows to clean tmpfs mount points, if somehow content was created on the actual drive there. I was always annoyed by boot messages like "/tmp mount point is not empty, mounting anyway" and alike 😉. And my /dev and /run had some content as well, however this happened 😄.

/boot should be mounted and backed up as well, but everything else should be skipped anyway?

@MichaIng MichaIng changed the title DietPi-Backup | Sync RootFS from an tmp mount point DietPi-Backup | Sync RootFS from temporary mount point Feb 16, 2019
@MichaIng MichaIng added this to the v6.29 milestone Mar 13, 2020
@MichaIng
Copy link
Owner Author

MichaIng commented Mar 20, 2020

Not as simple as one might think: https://dietpi.com/phpbb/viewtopic.php?p=18437#p18437
Also: If we do not exclude tmpfs locations, when restoring the backup, those would be cleared on the system, breaking current session => havoc, failure in the middle, broken system most likely 💥.
Would be only possible if we'd restore to a temporary mount point as well. Still the possibility stay that we override dietpi_userdata dir with a symlink.

Probably best:

  • Backup and restore the way we do it now, excluding known tmpfs locations. So also /boot, /boot/efi, /usr and other dirs, which can be external mounts but are part of the core system, are included.
  • Exclude /mnt/ completely on first loop.
  • Then do a second loop to sync /mnt/dietpi_userdata/ only. This assures that, regardless were it was located and where it is located now, it is synced correctly.
  • As well, when restoring, either keep current fstab or run dietpi-drive_manager 3 dummy run, to re-add currently active mounts. This assures that on reboot, if UUIDs, actual dietpi_userdata mount point (+symlink target), or mounts outside of /mnt/ have changed, where files might have been restored to, are not missing on next reboot.
  • And: When restoring, allow user to skip either downloads/Video/Music/Pictures or dietpi_userdata completely?

@MichaIng MichaIng modified the milestones: v6.29, v6.30 Mar 20, 2020
@MichaIng MichaIng modified the milestones: v6.30, v6.31 May 10, 2020
@MichaIng MichaIng modified the milestones: v6.31, v6.32 Jun 24, 2020
@MichaIng MichaIng modified the milestones: v6.32, v6.33 Aug 27, 2020
@MichaIng MichaIng modified the milestones: v6.33, v6.34 Oct 2, 2020
@MichaIng MichaIng modified the milestones: v6.34, v6.35 Nov 28, 2020
@MichaIng MichaIng modified the milestones: v7.0, v7.1 Feb 14, 2021
@MichaIng MichaIng mentioned this issue Feb 27, 2021
@MichaIng MichaIng modified the milestones: v7.1, v7.2 Apr 14, 2021
@MichaIng MichaIng modified the milestones: v7.2, Planned for implementation Apr 29, 2021
@MichaIng MichaIng removed this from the Planned for implementation milestone May 27, 2021
@MichaIng
Copy link
Owner Author

MichaIng commented Nov 7, 2021

I'll mark this as closed. We have a more flexible implementation which gives more power to the user: /mnt is excluded by default, /mnt/dietpi_userdata included (if a directory), but both can be adjusted via the Filter menu option, with the default file containing detailed explanation about how it works. If we tried to do anything assumption, it would become a much too complicated logic or would be a wrong assumption in too many cases.

Also the original idea to sync from a temporary root filesystem mount doesn't make sense as of the above mentioned points that other filesystems may contain important system files as well, most notably the /boot mount.

@MichaIng MichaIng closed this as completed Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant