Announcement

Collapse
No announcement yet.

Here's what NOT to do with snapshots

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Here's what NOT to do with snapshots

    So I was helping a guy debug some stuff and I thought I'd build up a VM with all the prep work needed to start the debug. This took a couple of hours. Then I manually took a snapshot of @ and @home. I thought that was smart. I could revert back to the post-prep work starting point at anytime.

    So the first time I need to revert I did the following:
    Code:
    sudo su -
    mount /dev/sda2 /mnt
    cd /mnt
    mv @ @_bad
    mv @home @home_bad
    mv @snapshots/root/prep-work-finished @
    mv @snapshots/home/prep-work-finished @home
    reboot
    This worked great the first time, but when I needed to revert the second time, I found I had no prep-work-finished snapshots. Duh! I had moved them out the first time.

    What I should have done was:
    Code:
    sudo su -
    mount /dev/sda2 /mnt
    cd /mnt
    mv @ @_bad
    mv @home @home_bad
    btrfs su sn @snapshots/root/prep-work-finished @
    btrfs su sn @snapshots/home/prep-work-finished @home
    reboot

    #2
    Yup.
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Guilty as well.

      That's why I create a snapshot every night and store it in /mnt/snapshots/@yyyymmddhhmm
      My script is designed to keep the last 5 snapshots and delete older ones.
      I also move my daily snapshot to /backup (an external removable drive) with the "btrfs send -p /mnt/snapshots/@yyyymmdd-1hhmm /mnt/snapshots/@yyyymmddhhmm | btrfs receive /backup"

      My backup is a 1TB SSD and with 215GB allocated I am able to save about 30 daily snapshots, so I have plenty of room left.
      Code:
      sudo btrfs fi usage /
      Overall:
      Device size: 463.51GiB
      Device allocated: 215.07GiB
      Device unallocated: 248.44GiB
      Device missing: 0.00B
      Used: 201.45GiB
      Free (estimated): 257.46GiB (min: 133.24GiB)
      Free (statfs, df): 257.46GiB
      Data ratio: 1.00
      Metadata ratio: 2.00
      Global reserve: 338.69MiB (used: 0.00B)
      Multiple profiles: no
      
      Data,single: Size:207.01GiB, Used:197.98GiB (95.64%)
      /dev/sda3 207.01GiB
      
      Metadata,DUP: Size:4.00GiB, Used:1.73GiB (43.36%)
      /dev/sda3 8.00GiB
      
      System,DUP: Size:32.00MiB, Used:48.00KiB (0.15%)
      /dev/sda3 64.00MiB
      
      Unallocated:
      /dev/sda3 248.44GiB[/FONT]
      Last edited by GreyGeek; Jun 01, 2023, 03:31 PM.
      "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
      – John F. Kennedy, February 26, 1962.

      Comment


        #4
        The workstation I'm running my test on is using timeshift. But on the VM that contains the actual test I'm using manual snapshots I mention in the first post. I didn't want anything on a timed bases. I have them at different stages of the build so I don't have to start over from the OS install every time it's dies. I just need to remember to snapshot back instead of mv.

        Comment

        Working...
        X