Now that I have openSUSE setup the way I want it, what’s the best method to back this up? Images? Backup/restore methods?
Hi
Backup up what, user data? Personally I just backup some configs and user data, if it really goes pear shaped, easier/quicker to re-install and restore user data.
You will have to make some decisions on how you do that.
My personal choice: I backup only “/home”. My disaster recovery plan is to do a clean install, and then restore “/home”.
I do keep a record of changes that I make to system-wide configuration files. And I keep that record in a directory under “/home” so that it will be available to consult for a reinstall.
As to why? Restoring from a backup takes almost as long as a clean install. So I might as well save the effort of backup.
Backup for “/home”: I am currently using “dar” for that. It is not part of a standard install, but it is in the repo. I backup to an external drive.
Multimedia and shared stuff: I have a separate partition that I mount at “/shared”. I have bulky multimedia there rather than in “/home”. And I share that with Windows systems (via samba) and other linux systems (via NFS).
I regularly backup “/shared” to another computer, using “rsync”.
That’s about what I do. You will probably choose a different solution. But I hope you find it helpful to know what some other folk are doing.
My experience with data loss started in 1976. It’s really the data which matters. Thus I have plenty of disks, each with moderate usage:
Drives: Local Storage: total: 7.29 TiB used: 3.76 TiB (51.5%)
ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 950 PRO 512GB size: 476.94 GiB
ID-2: /dev/sda vendor: Western Digital model: WD40EZRX-22SPEB0 size: 3.64 TiB
ID-3: /dev/sdb vendor: Samsung model: SSD 850 EVO 500GB size: 465.76 GiB
ID-4: /dev/sdc vendor: Western Digital model: WD20NMVW-11EDZS3 size: 1.82 TiB
ID-5: /dev/sdd type: USB vendor: Western Digital model: WD Elements 1048 size: 931.51 GiB
erlangen:~ #
erlangen has two built in SSDs nvme0n1 and sdb and a HDD. I also use 2 USB HDDs sdc and sdd.
erlangen:~ # lsblk -f
NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
sda
├─sda2 swap 3bfe28c8-c708-4859-9222-94b0ea4bddca [SWAP]
├─sda3 ext4 Tumbleweed-HDD dbc33c75-0fbb-4619-add6-d204ecf63a43 20G 33% /Tumbleweed-HDD
└─sda4 ext4 Home-HDD f5177cae-4082-44ed-9471-b99030f06866 2.1T 40% /home-HDD
sdb
├─sdb1 vfat 4A24-B10D
├─sdb2 ext4 Xubuntu f3c36796-d1b7-426d-9bef-6c61c39db0b1 23.1G 16% /mnt
├─sdb3 ext4 Tumbleweed-SSD 083dd95e-4073-43b1-a213-ad3ed8dd9a33 10.8G 58% /Tumbleweed-SSD
└─sdb4 ext4 Home-SSD f4c5463f-f43d-420a-a0ea-4456cfbc54fa 163.8G 54% /home-SSD
sdc
└─sdc1 ext4 WD25 2f0030b8-7257-4cba-be3e-b33154cda052 554.3G 65% /run/media/karl/WD25
sdd
└─sdd2 ext4 Home-2009 c998256d-3cae-4057-a9a9-7e014c2dce75 121.9G 82% /run/media/karl/Home-2009
nvme0n1
├─nvme0n1p1 ext4 Fedora 047d4d83-a9a7-482e-8d15-a1c855a637ea 23.6G 19% /Fedora
├─nvme0n1p2 ext4 Tumbleweed 8b190950-c141-4351-9198-7a9592b4fb34 12.1G 56% /
├─nvme0n1p3 ext4 Home 704621ef-9b45-4e96-ba7f-1becd3924f08 204.6G 49% /home
└─nvme0n1p4 vfat 6DEC-64F9 87.3M 13% /boot/efi
erlangen:~ #
Backup of /home is done with rsync, The primary system partition is nvme0n1p2, which is updated frequently. A fully functional backup sits on sdb3. I update it quarterly. Both zypper dup and rsync work well.
Home partitions on USB-drives are mirrored to a distant box (300km). Functionality and integrity of backups is checked at regular intervals.
SSDs are now very affordable and prices are still dropping. A Crucial MX 500GB now starts at some 63€.
Hi nrickert,
Would you mind to let us know what you think are the relevant system-wide configuration files worth to keep backups of (for a PC owner)?
My personal collection of system data that I backup along with the /home directory are the complete directories /etc and /var plus the /root directory where I maintain a couple of scripts. I sometimes, however, wonder whether this selection is the most reasonable.
And to add to the backup tips already given here: I store the output of ‘rpm -qa --queryformat '%{NAME}
'’ along with ‘zypper lr -pu’ in text files to produce listings of installed packages and repositories within my /home directory prior to each backup. That, I think, might help me to amend a freshly installed default system if a new install ever becomes necessary.
Best regards,
Kallistos
Different people have different needs.
Here’s a rough list:
From “/etc/ssh”, the *_config files, the keys and ssh_known_hosts
From “/etc”: hosts, auto.master, auto.nfs, fstab, group, passwd, shadow
From “/etc/apcupsd”: apcupsd.conf
From “/etc/tmpfiles.d”: tmp.conf
From “/etc/grub.d”: 40_custom
From “/etc/NetworkManager/system-connections”: * (all files here)
I use “sendmail” for mail, so I keep a bunch of files related to sendmail configuration.
I do all of /etc. It isn’t that much and it does not change that often, thus using an rsync style of backup will not take much space and time.
You never know waht you want from /etc if need arises.
All I really need is my data. All else can be quickly taken care of with an install, if the need arises.
That is why I keep all my data on a separate partition.
BTW: I do back up the separate /home partition, as well, usefull, as nrickert points out, in many cases. But, I could get by without it, no major problem.
Some figures:
erlangen:~ # time rsync -a /etc/ /root/etc/
real 0m0.128s
user 0m0.080s
sys 0m0.132s
erlangen:~ # du -csh /root/etc/
29M /root/etc/
29M total
erlangen:~ #
Not realy IMHO. I do not backup /etc for a blind/stupid retore. I do this so I can consult files in there when I doubt during or after installation how things were configured. This backup of /etc is part of my documentation about what I did to the system, all things that will not automagicaly be done the same by an installation. As I said
You never know what you want from /etc if need arises.
One thing I’ve done much (old days where I would go out my kde comfort zone and looked for something “interesting”), was clean my local home config files, hoping fix odd DE problems.
Like :
rm .config .kde .gnome .xfce etc, etc.
To save me of losing my kmymoney and torrent settings, I use to do this:
cd
rsync -rtvu --relative --delete .kde4/share/config/kmymoneyrc /home/gilberto/E:/backup-config-kmymoney-kde/
rsync -rtvu --relative --delete .aqbanking/settings/apps/kmymoney.conf /home/gilberto/E:/backup-config-kmymoney-kde/
rsync -rtvu --relative --delete .config/kmymoney /home/gilberto/E:/backup-config-kmymoney-kde/
rsync -rtvu --relative --delete .local/share/kmymoney /home/gilberto/E:/backup-config-kmymoney-kde/
rsync -rtvu --relative --delete .local/share/data/kmymoney /home/gilberto/E:/backup-config-kmymoney-kde/
rsync -rtvu --relative --delete .cache/kmymoney /home/gilberto/E:/backup-config-kmymoney-kde/
#o inverso
#cd
#cp -Rp /home/gilberto/E:/backup-config-kmymoney-kde/* .