[opensuse] Can't boot btrfs snapshot sent to then received from an external disk
Hello, I have the following usecase: I'd like to be able to put my Btrfs snapshots taken with snapper on an external disk and then send them back to the origin disk when needed to do a snapper rollback. The problem is I can't boot a snapshot received from the external disk. The snapshot entry appears in grub in the list of bootable snapshots but I can't enter it. Note that I've no problem to send a Btrfs snapshot on an external disk then to send it back to the origin disk using 'btrfs send' and 'btrfs receive' commands. Here are the steps I've done: 1. Install openSUSE Tumbleweed on a vm, default partitioning settings, except I didn't create a separate XFS /home partition, it's just another Btrfs subvolume. 2. Create a snapshot with snapper, it gets id #2. 3. Send the snapshot to an external disk (not really an external disk, just another virtual disk I added to the vm and mounted at /mnt):
mkdir -p /mnt/2 cp /.snapshots/2/info.xml /mnt/2 btrfs send /.snapshots/2/snapshot | btrfs receive /mnt/2
4. Delete the snapshot from the origin disk (snapper delete 2). 5. Send the snapshot from the external disk back to the origin:
mkdir -p /.snapshots/2 cp /mnt/2/info.xml /.snapshots/2 btrfs send /mnt/2/snapshot | btrfs receive /.snapshots/2
6. Regenerate grub-snapshot.cfg with '/usr/lib/snapper/plugins/grub --refresh' 7. Reboot 8. On grub, select "boot from read-only snapshot" then select snapshot 2. Nothing happens. I stay on the list of bootable snapshots. No error message. I don't know how grub handles snapshots. As far as I understand, there is openSUSE-specific code that enables grub to boot Btrfs snaphshots (such as https://build.opensuse.org/package/view_file/openSUSE:Factory/grub2/grub2-bt...). Do you see the reason why I can't enter the snapshot entry in grub? I think it may be related to subvolumes' UUIDs somehow because when the snapshot is sent with btrfs send, the received snapshot: - has no parent UUID; I guess it's the reason why it's not seen as a snapshot (not listed with option -s of btrfs subvolume list). - gets a received UUID, which is the UUID (or the received UUID if any) of the sent snapshot - gets a new UUID Whereas snapshots that are not sent keep their parent UUID (which is the one from snapshot 1, "first root filesystem"). PS: I've also created a thread on forums.opensuse.org: https://forums.opensuse.org/showthread.php/525877-Can-t-boot-btrfs-snapshot-... but not much answers. -- Antoine -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
16.07.2017 15:24, Antoine Belvire пишет:
PS: I've also created a thread on forums.opensuse.org: https://forums.opensuse.org/showthread.php/525877-Can-t-boot-btrfs-snapshot-... but not much answers.
Well, btrfs is complex ... I continued discussion there. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (2)
-
Andrei Borzenkov
-
Antoine Belvire