Forum › Forums › New users › New Users and General Questions › Restoring a backup of my home directory
Tagged: backup folder
- This topic has 4 replies, 3 voices, and was last updated Mar 27-7:05 pm by sybok.
-
AuthorPosts
-
March 27, 2022 at 2:41 pm #79925Member
ronqual
Last week I accidentally wiped my Windows installation attempting to install PopOS. What has followed has been a nightmare, but antiX made it better. Thank you to all the contributors.
I have now settled on what I believe will be my final install of antiX; at least for a while. I need an operating system I can actually use, I’ve spent way too much time fixing my installations before.
I used a broken installation of antiX for a few days this week; by broken I mean it would only boot when using the legacy kernel. Long story that I’d rather not get in to now. If I had asked here for help earlier I imagine I would have fixed my problems much quicker. Regardless, I created a backup of my /home/ and I would now like to restore this (if feasible) in order to save me some time re-installing packages and re-configuring things.
I ran
inxi -zv7and decided not to post the contents since I feel it is a bit too identifying, given that I was unable to use an anonymous email to register on this site. A bit strange, I know. I’m not sure what I hope to gain from keeping my computer details a secret ;P. Here is what I am comfortable sharing about my install:System:
Kernel: 5.10.57-antix.1-amd64-smp x86_64 bits: 64 compiler: gcc v: 10.2.1
Desktop: IceWM 2.9.6 vt: 7 dm: N/A
Distro: antiX-21_x64-full Grup Yorum 31 October 2021
base: Debian GNU/Linux 11 (bullseye)Please do ask for more information if you feel it would help you in answering me.
A bit about me, to help understand how to best help: I’m a programmer who’s used Windows for my entire life. My Linux experience prior to this week was headless Ubuntu and occasionally CentOS or whatever distro the VPS provider used. The outcome of this is that I thought I knew a lot about computers, but my command-line experience is limited to navigating directories and quitting vim.
TL;DR how should I restore packages and settings from my /home/ backup?
- This topic was modified 1 year, 1 month ago by ronqual.
March 27, 2022 at 4:35 pm #79939Member
sybok
::1) Home: I would simply backup current /home/ and overwrite the /home/ content with the original backup.
2) Packages: You should know which packages you have installed, preferably stored in a TXT file.
The packages are installed system-wide (in root ‘/’) and system reinstall overwrote this part.
If you do not have such a list, I have good experience with GUI ‘synaptic’ package manager; it allows to browse packages, contains split into categories.
If it is not present in your system, you can install it:
sudo apt install synapticIf you have downloaded and installed some packages manually (e.g. ‘zoom’ and others not present in the repositories = standardly offered pool of packages), you need to install them again.
General suggestion(s) for easy/easier recovery:
1) A general recommendation is to: backup ‘/home/’ and ‘/etc/’.
2) My experience:
2.A) I usually install antiX with a separate ‘/home/’ partition.
2.B) I keep a list of packages I have manually installed in a TXT file, e.g.:
sudo apt install lynx mc sudoku vim
This is basically an installation command with the list of packages.
2.C) I keep a list of customisations (e.g. how to disable ping response, sudo modifications etc.)
2.D) I occasionally back-up configuration files/folders in my home directory (‘~/.*’).Then I can reinstall the system while preserving ‘/home/’ (2.A), easily install packages I am used to (2.B) and relatively quickly apply the changes of system-wide settings (2.C).
Also, it allows for a relatively easy transfer among different PCs (alternatively, one can use a Live USB and keep it fresh/up-to-date using remastering).- This reply was modified 1 year, 1 month ago by sybok. Reason: Expand the item 2) Packages
March 27, 2022 at 4:57 pm #79945MemberPPC
::antiX includes a very nice way to list all your installed .deb packages.
Try this:
antiX menu > Run > and type “my_installed_debs” (without the quotation marks)
A list of all installed .deb files in your system is generated, Save it (under the default name, my_installed_deb.txt) anywhere you want (and make a backup copy anywhere, the cloud, a pen drive, etc).Make a backup of your home folder, and of the list of your installed deb files.
When you want to restore from that backup:
-You can restore your home folder (and more folders) just like sybok suggested and also…
-You can install every single package in the text file that lists your .deb files…
To reinstall the packages in that list of files using the procedure shown here: https://askubuntu.com/questions/252734/apt-get-mass-install-packages-from-a-file (not worry, you won’t reinstall everything, just the non installed packages will be installed)ex:
Make sure that the text file “my_installed_debs.txt” is in your home folder and then:
antiX menu > Terminal:sudo apt-get install $(grep -vE "^\s*#" ~/my_installed_debs.txt | tr "\n" " ")Probably the best procedure is FIRST installing all the packages and then restoring the home folder, so the configuration of all your installed applications is the one from the backup copy of your home folder!
P.
- This reply was modified 1 year, 1 month ago by PPC.
- This reply was modified 1 year, 1 month ago by PPC.
March 27, 2022 at 6:27 pm #79968Memberronqual
::Thank you both very much for the assistance, sybok and PPC.
Okay, that makes sense that applications are installed in the root now that I think about it. I guess I will consider keeping a list of applications that I install.
Perhaps there is some way for me to record changes I make to the installed packages. Naively: I imagine there’s a command to list all installed packages, and I could “simply” output that once on a clean install and then again after a few days in order to find the difference. Although I imagine if I ever need to reinstall antiX again I’ll just do as you two suggested and create a list of packages, given that apt-get can simply install them all at once.I just re-read what PPC wrote, “antiX includes a very nice way to list all your installed .deb packages”, and considered that all pre-installed packages are probably .deb. In addition to “not worry, you won’t reinstall everything, just the non installed packages will be installed” I think that covers my entire (potential) use case.While we’re on the subject: does anyone have a suggestion for how to create a backup of my /home directory? I believe I simply used rsync last time. I see that there’s a program called “luckyBackup” installed by default, perhaps I’ll take a look at that. Ideally I would clone the entire partition, since I do have a separate home partition, but I only have a single USB drive which is currently filled with antiX Live. And my experience this last week has made me want to steer clear of attempting to boot multiple “things” from one physical device. But that’s a topic for another thread.
I think I’ll attempt a persistent Live USB if I ever want to try antiX on another computer. Once I get in the swing of things I imagine I’ll want to use the same “system” (operating system/distribution of an OS), or at least Linux, on my other computer as well.
March 27, 2022 at 7:05 pm #79976Member
sybok
::Backup of home:
– Do you want to make a full backup or only selected directories?
– Do you wish to compress it?I do not use backup programs, I guess simple copy recursively (‘-r’) complemented by update-only (‘-u’) switch could do the job.
cp -r -u <source> <target> -
AuthorPosts
- You must be logged in to reply to this topic.