2

I am working on a project where I have a small MiniITX PC running Debian Jessie (8.3)

When I installed the OS initially:

  • I chose the filesystem as btrfs.
  • I am not using LVM or any extra partitions except for swap.
  • No encryption on drive.

With everything I want/need installed, the entire space used by my system is about 4GB. I don't anticipate using much more than another gig.. ever.

Additionally, I have an empty 16GB flash drive formatted to btrfs.

With this being the setup: (tl;dr) How can I make backups (snapshots?) of my running Debian System, and store them on the flash drive?

Ideally, this is so that if something catastrophic happens to my main hard drive, I could restore it back to a good working condition by utilizing what was saved to the flash drive.

Can someone please spell this out for me?

Debian HDD:

  • /dev/sda1 is the mountpoint for / Format: BTRFS
  • /dev/sda2 is the extended partition
  • /dev/sda5 is the Linux Swap (6gb)

Flash Drive:

  • /dev/sdb1 Mounted to: /mnt/USB1 Format: BTRFS

btrfs-tools are installed.

I just want to know the commands to accomplish this:

  1. How to make a snapshot of my entire /
  2. How to back this up to my flash drive
  3. How to restore it if everything gets majorly screwed up.

Thank you very much in advance. My sanity is waning..

  • Take a look at Borg Backup. – Faheem Mitha Mar 1 '16 at 17:56
  • @FaheemMitha This is fantastic! Learning curve a bit, but it certainly does what I want! Thanks! I'd like to leave the question open for a bit though, as I am interested in BTRFS native functions. – Zapp Mar 2 '16 at 7:31
  • Good. Glad you found it of interest. – Faheem Mitha Mar 2 '16 at 9:48
  • @FaheemMitha yeah! I spent 4-5 hours playing with it and testing it out. This is absolutely off topic from question.. But I notice if I use sudo to backup and restore, the restored file permissions are all set to root:root. If I do everything from root console, it seems to retain normal properties. Is that normal? – Zapp Mar 2 '16 at 11:42
  • I think it should retain all the file properties that it originally had. If you want to chat, come to the main chat room chat.stackexchange.com/rooms/26/dev-chat. You can ping me there. I suggest asking questions about Borg Backup on IRC. The main dev, Thomas, is in the IRC channel most of the time. – Faheem Mitha Mar 2 '16 at 13:26

Your Answer

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

Browse other questions tagged or ask your own question.