Hello,
I just installed FreeBSD 14.1 on UFS and used the following command to take a snapshot of the /var folder. This snapshot gets created as a file named "mysnapshot":
Then I used the following two commands to mount the snapshot into /mnt:
Now I can use rsync to restore the entire /var in case it changed. /var will be restored to how it was when the snapshot was created.
What I noticed is that even though I specified only /var when creating the snapshot with mksnap_ffs, when I mount the snapshot in /mnt, I can see all the other folders on the system. How is this possible?
Also, is there a way to take a snapshot of the entire / root partition in one single command? Or should I just create separate snapshots for important folders like /usr, /home, and /var?
I just installed FreeBSD 14.1 on UFS and used the following command to take a snapshot of the /var folder. This snapshot gets created as a file named "mysnapshot":
sh:
# mksnap_ffs /var /home/zoltan/mysnaphot
Then I used the following two commands to mount the snapshot into /mnt:
sh:
# mdconfig -a -t vnode -o readonly -f /home/zoltan/mysnaphot
# mount -o ro /dev/md0 /mnt
Now I can use rsync to restore the entire /var in case it changed. /var will be restored to how it was when the snapshot was created.
sh:
# rsync -av --delete --progress --dry-run /mnt/var/ /var/
What I noticed is that even though I specified only /var when creating the snapshot with mksnap_ffs, when I mount the snapshot in /mnt, I can see all the other folders on the system. How is this possible?
Also, is there a way to take a snapshot of the entire / root partition in one single command? Or should I just create separate snapshots for important folders like /usr, /home, and /var?