Skip to content

Instantly share code, notes, and snippets.

@rodfersou
Last active August 4, 2016 17:28
Show Gist options
  • Save rodfersou/081578d782cd2103e3d5cd3169c82562 to your computer and use it in GitHub Desktop.
Save rodfersou/081578d782cd2103e3d5cd3169c82562 to your computer and use it in GitHub Desktop.
# References:
# https://help.ubuntu.com/community/btrfs#Snapshots_.26_Subvolumes
# http://superuser.com/questions/795903/how-to-snapshot-a-btrfs-root-file-system-snapshot-of
# http://serverfault.com/questions/399894/does-btrfs-have-an-efficient-way-to-compare-snapshots
teste@teste-VirtualBox:~$ vi btrfs-diff
teste@teste-VirtualBox:~$ vi script.sh
teste@teste-VirtualBox:~$ chmod +x btrfs-diff script.sh
teste@teste-VirtualBox:~$ sudo btrfs subvolume snapshot / /snap/root -r
Create a readonly snapshot of '/' in '/snap/root'
teste@teste-VirtualBox:~$ sudo ./script.sh
dpkg-deb: error: '/tmp/agent.deb' is not a debian format archive
dpkg: error processing archive /tmp/agent.deb (--install):
subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
/tmp/agent.deb
./script.sh: line 5: /opt/ds_agent/dsa_control: No such file or directory
./script.sh: line 6: /opt/ds_agent/dsa_control: No such file or directory
teste@teste-VirtualBox:~$ sudo btrfs subvolume snapshot / /snap/root2 -r
Create a readonly snapshot of '/' in '/snap/root2'
teste@teste-VirtualBox:~$ sudo ./btrfs-diff /snap/root /snap/root2
var/lib/dpkg/status
var/lib/NetworkManager/dhclient-48f557f6-a60f-4a03-b4dd-94069326f476-enp0s3.lease
var/lib/NetworkManager/dhclient-enp0s3.conf
var/lib/NetworkManager/timestamps
var/log/auth.log
var/log/dpkg.log
var/log/kern.log
var/log/syslog
var/log/Xorg.0.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment