Results 1 to 3 of 3

Thread: snapper, grub , and booting from an old snapshot

  1. #1

    Default snapper, grub , and booting from an old snapshot

    I noticed that there is basic support for booting from an old snapper snapshot, according to http://snapper.io/2014/04/29/rollback.html

    rootflags=subvol=.snapshots/42/snapshot
    However, this relies on my knowledge of that particular snapshot. I noticed that there seems to be some infrastructure put into place, but I'm not sure what's missing in my setup

    Code:
    # cat /etc/grub.d/80_suse_btrfs_snapshot                                                                                                                                                                          
    #! /bin/sh                                                                                                                                                                                                                                                                     
    set -e                                                                                                                                                                                                                                                                         
    if [ "x${SUSE_BTRFS_SNAPSHOT_BOOTING}" = "xtrue" ] &&                                                                                                                                                                                                                          
       [ "x${GRUB_FS}" = "xbtrfs" ] ; then                                                                                                                                                                                                                                         
        cat <<EOF                                                                                                                                                                                                                                                                  
    if [ -f "/.snapshots/grub-snapshot.cfg" ]; then                                                                                                                                                                                                                                
      source "/.snapshots/grub-snapshot.cfg"                                                                                                                                                                                                                                       
    fi                                                                                                                                                                                                                                                                             
    EOF                                                                                                                                                                                                                                                                            
    fi
    Code:
    sudo cat /.snapshots/grub-snapshot.cfg
    if [ -z "$extra_cmdline" ]; then                                                                                                                                                                                                                                               
      submenu  "Start bootloader from a read-only snapshot" {                                                                                                                                                                                                                      
        if [ x$snapshot_found != xtrue ]; then                                                                                                                                                                                                                                     
          submenu "Not Found" { true; }                                                                                                                                                                                                                                            
        fi                                                                                                                                                                                                                                                                         
      }                                                                                                                                                                                                                                                                            
    fi
    Code:
    $ cat /etc/default/grub | grep BTRFS
    SUSE_BTRFS_SNAPSHOT_BOOTING=true
    Code:
    #snapper list
    # Type   | #   | Pre # | Date                     | User | Cleanup | Description           | Userdata     
    -------+-----+-------+--------------------------+------+---------+-----------------------+--------------
    single | 0   |       |                          | root |         | current               |              
    single | 1   |       | Thu Apr 16 12:46:48 2015 | root |         | first root filesystem |              
    pre    | 62  |       | Fri Apr 17 14:07:13 2015 | root | number  | zypp(zypper)          | important=yes
    post   | 63  | 62    | Fri Apr 17 14:09:57 2015 | root | number  |                       | important=yes
    pre    | 80  |       | Tue Apr 21 11:52:38 2015 | root | number  | zypp(zypper)          | important=yes
    post   | 81  | 80    | Tue Apr 21 11:56:00 2015 | root | number  |                       | important=yes
    pre    | 92  |       | Mon Apr 27 13:31:11 2015 | root | number  | zypp(zypper)          | important=yes
    post   | 93  | 92    | Mon Apr 27 13:35:11 2015 | root | number  |                       | important=yes
    pre    | 104 |       | Fri May  1 23:19:29 2015 | root | number  | zypp(zypper)          | important=yes
    post   | 105 | 104   | Fri May  1 23:23:27 2015 | root | number  |                       | important=yes
    pre    | 106 |       | Fri May  1 23:26:06 2015 | root | number  | zypp(zypper)          | important=yes
    post   | 107 | 106   | Fri May  1 23:27:04 2015 | root | number  |                       | important=yes
    pre    | 108 |       | Sat May  2 01:35:53 2015 | root | number  | zypp(zypper)          | important=no 
    post   | 109 | 108   | Sat May  2 01:35:57 2015 | root | number  |                       | important=no 
    pre    | 110 |       | Sat May  2 22:28:38 2015 | root | number  | zypp(zypper)          | important=no 
    post   | 111 | 110   | Sat May  2 22:28:46 2015 | root | number  |                       | important=no 
    pre    | 112 |       | Wed May  6 11:24:39 2015 | root | number  | zypp(zypper)          | important=no 
    post   | 113 | 112   | Wed May  6 11:24:49 2015 | root | number  |                       | important=no
    What's missing here to allow booting from a snapshot?

  2. #2

    Default Re: snapper, grub , and booting from an old snapshot

    Quote Originally Posted by robert_munteanu View Post
    What's missing here to allow booting from a snapshot?
    The only thing that could be missing I suppose is /.snapshots/grub-snapshot.cfg.
    If that is there, you should be able to select a snapshot to boot in grub2.

    But, selecting a snapshot in the bootmenu and booting a snapshot is only supported and possible when /boot is on your btrfs partition.
    If you have a separate /boot you are out of luck I'm afraid:
    https://bugzilla.opensuse.org/show_bug.cgi?id=911496

  3. #3

    Default Re: snapper, grub , and booting from an old snapshot

    Quote Originally Posted by wolfi323 View Post
    The only thing that could be missing I suppose is /.snapshots/grub-snapshot.cfg.
    If that is there, you should be able to select a snapshot to boot in grub2.

    But, selecting a snapshot in the bootmenu and booting a snapshot is only supported and possible when /boot is on your btrfs partition.
    If you have a separate /boot you are out of luck I'm afraid:
    https://bugzilla.opensuse.org/show_bug.cgi?id=911496
    Ah, I see. I do have a separate ext4 /boot partition since I'm using dm-crypt . I guess I'm out of luck then.

    Thanks,

    Robert

Tags for this Thread

Posting Permissions

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