Backup the whole drive? but how

Hi Guys,

I am really new to btrfs. It came into my mind to setup my whole system as it is nearly 4-5 years old.
And you know how this is… change browser, mailclient… and I also want to change my FS as I read a lot of good stuff 'bout btrfs. I am a bit familier with LVM and also worked with ZFS.
So my goal is to achieve having a snapshot of my system on another disk, and on failure (disk, or my stupidity to mess up the OS) simple boot from the other OS.
Till now I just did a ‘dd if=/dev/xxx of=/dev/yyy’

Now, I just created btrfs on on /dev/sdb without partitions. Installed all in / - no extra home and so on.
As its a fresh installation I can redoit and here is where i stucked.
Do some partitions?
Or doing the btrfs way with subdirs and do snapshots?

Could you guys point me in some direction?

Thanks a lot.
K.

@somboku Welcome to the Rockstor community.

This is not really a Rockstor related question from what I can tell. Could you clarify how this relates to Rockstor, are you proposing a Rockstor instance as a target for a desktop btrfs based backup arrangement?

This forum definitely has some btrfs knowledge given the Rockstor DIY NAS system is btrfs based but if you have generic btrfs questions there may be broader audiences available with wider knowledge than is available here.

Btrfs and it’s various permutations are extremely broad. And if you are new to it then I would advise adopting a desktop distro that defaults to btrfs, i.e. openSUSE/SuSE Leap for quite some time or more recently Fedora. But both have ‘arrangements’ to cope with certain booting restrictions imposed by grub etc re mult-device capabilities in btrfs that are less well supported in grub/systemd. Also openSUSE Leap at least carries a btrfs related patch for grub to work around some elements of this interplay.

Just a note on:

Don’t do this with a btrfs device/pool member. There is a very high likelihood that you will massively confuse the host system upon which you do this. and risk massive corruption. Unless all devices concerned are in now way active and are never going to be active, independently or collectively, on the same system. Each device has a unique id and doing this will replicate that id (at the filesystem level) and produce two instances of the exact same drive. Not good for device scans and very confusing for btrfs as it goes. There are moves to improve robustness in this regard but they are ongoing from my limited knowledge.

Do a default openSUSE Leap 15.2 or 15.2 install and take a look at what they have done. It’s quite interesting and you also get to see, in time, how they have enabled such magic as boot to snapshot. Quite mind bendy really as (almost) the entire root system is able to jump back in time via the auto created snapper snapshots. That is a tone of stuff to get working that is already field proven in a default openSUSE Leap install. But of note this facility is not yet available in a modern Fedora. As Rocstor v4 is now based on openSUSE Leap 15.2+ we also have this boot to snapshot capability. And snapper in the background, or rather a snapper plugin to the package management system, makes a snapshot before and after every package update event (group of packages I believe). One can then select a read-only snapshot from within grub and boot it. It will have limited function however, as it’s read-only but if turns out to be you intended roll-back then you can enable it as the new default and then reboot into it as read-write and be off to the past again. Take a look at the following for info on this.

System Recovery and Snapshot Management with Snapper:
https://doc.opensuse.org/documentation/leap/reference/html/book-reference/cha-snapper.html

and more specifically the subsection:
System rollback by booting from snapshots: https://doc.opensuse.org/documentation/leap/reference/html/book-reference/cha-snapper.html#sec-snapper-snapshot-boot

Hope that helps, at least in clarifying what your goal is here.

2 Likes

oh, stupid me. i am really sorry for this. well it was quite in the morning :slight_smile:
but thanks really for your detailed answer. really shame on me not read further bout rockstor.
i just saw 2 threads with btrfs backup, and was ready to spit out my problems.
anyway i will dive into the links you mentioned.

thanks and sorry.
please close this so that nobody can read bout my stupidity :slight_smile:

K.