3

I am planning on giving btrfs a try soon, and what I want to know, and can't seem to find online is this:

Can you do a btrfs snapshot on a running system if the snapshot is not just of some small directory but of the entire system (/var, /usr, /bin, /sbin, ... everything), or do you need to boot into a live CD to do a btrfs snapshot while the system is offline?

If it is technically possible to do a snapshot of a running system, I assume you still need to shut the system down to use that snapshot. Would booting a snapshot (subvolume) of a system that was running at the time the snapshot was taken be very similar to a hard boot, since software is not aware when a snapshot is about to take place, so programs might be writing something to /var at the time, and next thing they know, the program is starting up again with data half written because the system restarted?

6

Yes, you can snapshot a live system. You don't need to do anything special.

With enough effort, you could then sort of boot a system off the snapshot without shutting down (say, using a container or virtualization). Of course, you'd likely have conflicts (e.g., same IP address, host name, etc.). Or you could copy the snapshot elsewhere, and boot it there.

Shutting down and booting off the snapshot should work. As you suspect, it'd not be a clean shutdown.

This is not entirely unheard of. E.g., sometimes people take a snapshot before installing updates just in case things break.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.