Really basic backup and restore question

New to Debian (Or Linux in general)? Ask your questions here!

Really basic backup and restore question

Postby FOSS-15-Great » 2020-04-18 10:01

Hello all,

Here is where I am at:
I have two Lenovo laptops which are dual booting Windows 10 and Debian Buster/Gnome: T440p and W541. They both share the same CPU generation (Haswell mobile) including Intel iGPU. The only potential bump in the road is that the W541 has Optimus graphics but so far there have not been any issues regarding that.

However, having tinkered with various settings and partition arrangements I have got the T440p in pretty good shape with the only thing left to do adding family users and figuring out the best arrangement of creating a shared partition to make common storage of photos and videos as easy as possible.

I may need to re-install the system because I have a few problems such as
Code: Select all
The repository 'http://deb.debian.org/debian buster/updates Release' does not have a Release file.


    1) My plan is to rsync my root partition and then restore my home folder. I would also like to keep some extra software and configs I have since installed. Is this safe to do without the risk of carrying the things that are not working back into my system?

    2) Once I have the T440p working the way I like I would love to copy and restore that system to the W541. Could there be caveats? And what is the best way to go about it? Do a fresh install of Debian Buster and then rsync home (and applications in /opt/) into / ? Do I do this immediately after installing (before rebooting) or should I do this by booting back into the installer and restoring then (via rsync)?

I have searched online but not found answers to this specific question and will greatly appreciate any help or pointers provided here. Thank you.

The blurb:
I am a new Linux user and am coming off the back of 20+ years on macOS. Having always wanted to transition to Linux for day to day computing I have used the lockdown to set up a couple of old-ish but capable laptops. My goal is to bring my children up on FOSS and replace proprietary software with Linux alternatives where possible in my life. I am a keen learner and happy to work things out by myself but having children and working freelance means I cannot dedicate as much time to becoming confident on Linux as I might have been able to twenty years ago. With that in mind I do not like the idea of "diffusion line" distributions (Ubuntu, etc.) and have deliberately chosen Debian. But it is becoming clear to me that I am reliant, to a greater extent than I'd like to admit, on solutions that work for "ordinary users". I am loving it though, am not scared of using the terminal, etc but I am running into issues quite regularly.
FOSS-15-Great
 
Posts: 30
Joined: 2020-04-18 08:11

Re: Really basic backup and restore question

Postby p.H » 2020-04-18 10:36

Reinstall just because you have a wrong sources.list file is a waste of time. It is easy to fix.
p.H
 
Posts: 1363
Joined: 2017-09-17 07:12

Re: Really basic backup and restore question

Postby Head_on_a_Stick » 2020-04-18 11:02

FOSS-15-Great wrote:
Code: Select all
The repository 'http://deb.debian.org/debian buster/updates Release' does not have a Release file.

There is no "buster/updates", that's for deb.debian.org/debian-security. Use "buster-updates" instead.

FOSS-15-Great wrote:Once I have the T440p working the way I like I would love to copy and restore that system to the W541. Could there be caveats? And what is the best way to go about it? Do a fresh install of Debian Buster and then rsync home (and applications in /opt/) into / ? Do I do this immediately after installing (before rebooting) or should I do this by booting back into the installer and restoring then (via rsync)?

If you use rsync then /etc/fstab and /boot/grub/grub.cfg will need correcting afterwards. Perhaps other things as well.
User avatar
Head_on_a_Stick
 
Posts: 12129
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Really basic backup and restore question

Postby FOSS-15-Great » 2020-04-18 13:19

Head_on_a_Stick wrote:
FOSS-15-Great wrote:
Code: Select all
The repository 'http://deb.debian.org/debian buster/updates Release' does not have a Release file.

There is no "buster/updates", that's for deb.debian.org/debian-security. Use "buster-updates" instead.

FOSS-15-Great wrote:Once I have the T440p working the way I like I would love to copy and restore that system to the W541. Could there be caveats? And what is the best way to go about it? Do a fresh install of Debian Buster and then rsync home (and applications in /opt/) into / ? Do I do this immediately after installing (before rebooting) or should I do this by booting back into the installer and restoring then (via rsync)?

If you use rsync then /etc/fstab and /boot/grub/grub.cfg will need correcting afterwards. Perhaps other things as well.


Thank you. I copied the items from the Debian Sources List after coming across the problem of Software & Updates getting stuck infinitely on updating caches. I copied all of them and now I have some duplicates when running sudo apt update but the problem above has been fixed. However, Software & Updates is still getting stuck indefinitely on Updating caches.
FOSS-15-Great
 
Posts: 30
Joined: 2020-04-18 08:11

Re: Really basic backup and restore question

Postby FOSS-15-Great » 2020-04-18 13:21

p.H wrote:Reinstall just because you have a wrong sources.list file is a waste of time. It is easy to fix.

I was planning to create a shared media partition for all users and seeing it might be trouble to resize my encrypted / partition to make space for it I thought perhaps I should re-format > re-install and then restore from backup. I am a bit scared of having to re-created fstab entries and grub configs so perhaps I'll find another way of creating extra storage.
FOSS-15-Great
 
Posts: 30
Joined: 2020-04-18 08:11

Re: Really basic backup and restore question

Postby Head_on_a_Stick » 2020-04-18 16:35

FOSS-15-Great wrote:Software & Updates is still getting stuck indefinitely on Updating caches

That is off-topic for this thread.

Tip: use 'apt update' from a terminal to get an actual error message that can be entered into a search engine to find any potential solutions.
User avatar
Head_on_a_Stick
 
Posts: 12129
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Really basic backup and restore question

Postby FOSS-15-Great » 2020-04-18 19:06

Head_on_a_Stick wrote:
FOSS-15-Great wrote:Software & Updates is still getting stuck indefinitely on Updating caches

That is off-topic for this thread.

Good point, so back to the topic:
Is it safe to restore /home and configs from T440p to W541 if I first install all system fresh, then all extra packages manually to match both systems?
I would love to find a way to get this to work to save time.

Head_on_a_Stick wrote:[Tip: use 'apt update' from a terminal to get an actual error message that can be entered into a search engine to find any potential solutions.

Thank you, I managed to fix the problem and learned about SourcesList along the way.
FOSS-15-Great
 
Posts: 30
Joined: 2020-04-18 08:11

Re: Really basic backup and restore question

Postby Head_on_a_Stick » 2020-04-19 10:16

FOSS-15-Great wrote:Is it safe to restore /home and configs from T440p to W541 if I first install all system fresh, then all extra packages manually to match both systems?

Only if you create a new user on the W541 with the same GID & UID as the user on the T440p.
User avatar
Head_on_a_Stick
 
Posts: 12129
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Really basic backup and restore question

Postby FOSS-15-Great » 2020-04-19 13:37

Head_on_a_Stick wrote:
FOSS-15-Great wrote:Is it safe to restore /home and configs from T440p to W541 if I first install all system fresh, then all extra packages manually to match both systems?

Only if you create a new user on the W541 with the same GID & UID as the user on the T440p.

Would that happen automatically on a fresh install if I chose the same user name?
FOSS-15-Great
 
Posts: 30
Joined: 2020-04-18 08:11

Re: Really basic backup and restore question

Postby arzgi » 2020-04-19 13:41

FOSS-15-Great wrote:Would that happen automatically on a fresh install if I chose the same user name?


No, don't know how they are assigned, but UID and GID are not same even for same user and group. I had this issue once, to resolve had to chown /home to new 'old' user.
arzgi
 
Posts: 635
Joined: 2008-02-21 17:03
Location: Finland

Re: Really basic backup and restore question

Postby CwF » 2020-04-19 14:14

Since the hardware is so close, I would have simply imaged the whole OS from one machine to the other. Actually, I would have anyway. All my images can run on many hardware setups. Most config can be embedded so that various hardware is converted to friendly names and utilized so that no user config needs altered.

Anyway, why move just user config when the entirety is an option. Intel and nvidia drivers do muck up the magic and are not easily conditional. All other variances can be dynamic. You could have an image that runs on both. The question is do you need to run both at the same time? That I don't do, even though it works.
CwF
 
Posts: 689
Joined: 2018-06-20 15:16

Re: Really basic backup and restore question

Postby FOSS-15-Great » 2020-04-20 09:37

CwF wrote:Since the hardware is so close, I would have simply imaged the whole OS from one machine to the other. Actually, I would have anyway. All my images can run on many hardware setups. Most config can be embedded so that various hardware is converted to friendly names and utilized so that no user config needs altered.

Anyway, why move just user config when the entirety is an option. Intel and nvidia drivers do muck up the magic and are not easily conditional. All other variances can be dynamic. You could have an image that runs on both. The question is do you need to run both at the same time? That I don't do, even though it works.


Thank you for your reply. To clarify: The idea is to simply move one setup to the other machine. It saves a lot of time restoring an image rather than having to configure Firefox (with all extensions) Thunderbird, Gnome Shell, etc to my liking.

What I don't know: Are there any OS or Kernel related things happening during install which are specific to one machine and which could cause me grief when copied to the other? As you say both laptops are nearly identical with the only difference being Optimus (and one having a Swedish keyboard layout). I have already installed Debian on the W541 and it works great OTB so I won't be needing to look into Optimus until further down the line.

As for the procedure:
The W541 now has a fresh install on its own drive, partitioned as LVM. Is it simply a case of booting from the installer USB and restoring the T440p image onto the root partition of the W541? Can I leave /boot alone?
FOSS-15-Great
 
Posts: 30
Joined: 2020-04-18 08:11

Re: Really basic backup and restore question

Postby Dai_trying » 2020-04-20 10:51

I have simply swapped HDD's on older laptops (MBR boot) without too much issue, my biggest hurdle was if a machine required a specific graphic configuration (Nvidia is my recurring problem, often requiring a specific xorg tweak). If the systems both have UEFI it might be a little more tricky but I haven't had to try that yet...
Dai_trying
 
Posts: 924
Joined: 2016-01-07 12:25

Re: Really basic backup and restore question

Postby Head_on_a_Stick » 2020-04-20 12:44

FOSS-15-Great wrote:
Head_on_a_Stick wrote:Only if you create a new user on the W541 with the same GID & UID as the user on the T440p.

Would that happen automatically on a fresh install if I chose the same user name?

As long as the user on the T440p was the first created then yes, I think it would. Both would have a GID of 1000 in that case.
User avatar
Head_on_a_Stick
 
Posts: 12129
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Really basic backup and restore question

Postby sunrat » 2020-04-20 23:21

Head_on_a_Stick wrote:
FOSS-15-Great wrote:
Head_on_a_Stick wrote:Only if you create a new user on the W541 with the same GID & UID as the user on the T440p.

Would that happen automatically on a fresh install if I chose the same user name?

As long as the user on the T440p was the first created then yes, I think it would. Both would have a GID of 1000 in that case.


A tangential note here - I recently had ownership clashes with rsync and Syncthing between Buster and siduction. Turned out siduction usually allocates GID 1000 to fuse and first user is 1004 although UID is 1000. (I blame Calamares). After reallocating fuse to 1005 and making user 1000, then changing group ownership of all user files to 1000, all was sweet again.
This shouldn't be an issue as 2 installs of Debian should both have GID 1000 for 1st user. If you installed from the live image it would be worth double checking though.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 3086
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Next

Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable