Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: Snapper mounts by default old snapshot

  1. #1

    Default Snapper mounts by default old snapshot

    Hello,

    I noticed today that an old snapshot is mounted by default, despite
    subsequent updates with snapper. This is snapshot 108 which appears
    with a * with the command snapper ls

    # | Type | Pre # | Date | User | Used Space | Cleanup | Description | Userdata
    -----+--------+-------+---------------------------------+------+------------+---------+--------------+--------------
    0 | single | | | root | | | current |
    108* | post | 107 | Thu 07 Feb 2019 12:12:36 PM CET | root | 298.77 MiB | number | | important=yes
    124 | post | 123 | Tue 26 Feb 2019 04:24:19 PM CET | root | 275.57 MiB | number | | important=no
    125 | pre | | Mon 04 Mar 2019 02:47:10 PM CET | root | 40.83 MiB | number | zypp(zypper) | important=yes
    126 | post | 125 | Mon 04 Mar 2019 02:59:39 PM CET | root | 145.39 MiB | number | | important=yes

    I cannot remove this snapshot obviously:
    $ snapper -c root delete --sync 108
    Cannot delete snapshot 108 since it is the currently mounted snapshot

    I thought of rebooting manually on a later snapshot in order to erase the old one, but it does not seem safe.

    Is there a way to assign a later snapshot by default? Or would a rollback to a later snapshot work?

    Thanks!

    S.

  2. #2
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,128
    Blog Entries
    2

    Default Re: Snapper mounts by default old snapshot

    The way BTRFS snapshots work is that old snapshots are not removed whenever your system does a rollback which is what appears to have happened, so snapshots "more recently updated" than your current snapshot should still exist (unless manually removed or removed by scheduled maintenance).

    So, use snapper to inspect your snapshots, and if you wish "roll back" to a "more recent" image.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  3. #3
    Join Date
    Jan 2018
    Location
    Canada
    Posts
    122

    Default Re: Snapper mounts by default old snapshot

    I am fairly certain that the * indicates the root snapshot that all subsequent snapshots are derived from. You can't delete it because of this. If you ever do a rollback, a new root snapshot will be created and the old one can be deleted.

    My advice, don't do a rollback unless you absolutely have to, and let snapper look after deleting snapshots. If disk space is an issue then you can change the cleanup settings.

  4. #4
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,128
    Blog Entries
    2

    Default Re: Snapper mounts by default old snapshot

    Wouldn't that be the point of rolling back to a snapshot with missing updates and changes, to establish a new "default" root?
    If that proves to be not what actually is wanted, it's always possible to again roll back to before that rollback(or try another image but I've found if you don't return to a particular image it can get confusing what is what).

    Just musing...
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  5. #5
    Join Date
    Jan 2018
    Location
    Canada
    Posts
    122

    Default Re: Snapper mounts by default old snapshot

    If that was the case then it would fall under "absolutely have to", but rollbacks, from experience, are not foolproof.

  6. #6
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    19,788
    Blog Entries
    14

    Default Re: Snapper mounts by default old snapshot

    Quote Originally Posted by doscott View Post
    If that was the case then it would fall under "absolutely have to", but rollbacks, from experience, are not foolproof.
    eh, using rollbacks almost daily to undo experiments related to support attempts, and haven't noticed that.
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    https://en.opensuse.org/openSUSE:Board#Members
    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  7. #7
    Join Date
    Jan 2018
    Location
    Canada
    Posts
    122

    Default Re: Snapper mounts by default old snapshot

    Quote Originally Posted by Knurpht View Post
    eh, using rollbacks almost daily to undo experiments related to support attempts, and haven't noticed that.
    If a software package, docker for example, puts its data in a folder that gets snapshotted, rolling back can really screw things up. Typically you don’t discover things like this until they happen.

  8. #8
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,128
    Blog Entries
    2

    Default Re: Snapper mounts by default old snapshot

    Quote Originally Posted by doscott View Post
    If a software package, docker for example, puts its data in a folder that gets snapshotted, rolling back can really screw things up. Typically you don’t discover things like this until they happen.
    When you're talking about application data, particularly long running transactions that might stored in a large file like a database file, then you have to deal with atomicity. Since BTRFS snapshots are not "application aware" for these kinds of situations, you shouldn't count of snapshots to maintain the integrity of the data file. Or, you should carefully ensure your application isn't performing a write operation when you do your snapshot. If you are caught in this kind of situation, then depending on the application, there <may> be ways to recover (eg replaying database log files) but I wouldn't count on these kinds of extreme "I sure hope this works" procedures.

    This has nothing or little to do with docker, it has everything to do with understanding atomic transactions.

    I can't think of any other relevant situation, and ordinarily or with proper planning should not be an issue (If you know what you're doing).

    IMO,
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  9. #9
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    19,788
    Blog Entries
    14

    Default Re: Snapper mounts by default old snapshot

    Quote Originally Posted by doscott View Post
    If a software package, docker for example, puts its data in a folder that gets snapshotted, rolling back can really screw things up. Typically you don’t discover things like this until they happen.
    My experience here is that only what has changed gets rolled back. And it should. Could you provide a more specific example for me to test what you describe? It
    definitely would be worth a bug report.
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    https://en.opensuse.org/openSUSE:Board#Members
    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  10. #10
    Join Date
    Jan 2018
    Location
    Canada
    Posts
    122

    Default Re: Snapper mounts by default old snapshot

    It’s been over a year since I encountered the docker problem. Docker created its own btrfs subvolume inside of /var/lib/docker, something like
    .snapshots/1/snapshot/var/lib/docker/btrfs/subvolumes/d9f43fcb4e08e58d9828...
    Getting rid of the docker snapshots after a rollback was quite involved. To avoid it I mounted /var/lib/docker on another partition.

    A lot of rollback issues were resolved with the new btrfs layout for installs after January 2018. See https://en.opensuse.org/SDB:BTRFS

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •