Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Moving an existing system to a new computer

Need help with peripherals or devices?
Message
Author
Yaron
Posts: 13
Joined: 2018-10-26 09:38

Moving an existing system to a new computer

#1 Post by Yaron »

Hi,

Instead of installing Debian on a new computer, I copied the existing installation to the new computer. It works, but the hardware doesn't function properly. It's standard hardware, so I don't think it's anything Debian should have any trouble automatically detecting and configuring, however it doesn't seem to do so. Is there a way to tell Debian to automatically try to detect and configure new hardware, just as if I installed a fresh copy of Debian using the standard Debian installer? Is there an option to make Debian automatically try to detect and configure new hardware at boot time and whenever it detects anything new connected to the computer? My system is Debian 9. Thanks.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Moving an existing system to a new computer

#2 Post by p.H »

Yaron wrote:the hardware doesn't function properly
This is not very informative.
Yaron wrote:It's standard hardware
This is not very informative.

Yaron
Posts: 13
Joined: 2018-10-26 09:38

Re: Moving an existing system to a new computer

#3 Post by Yaron »

@p.H, this is by purpose, because I don't want this thread to be about how to configure some specific hardware. It's a general question. I eventually it turns out Debian can't automatically detect and configure the new hardware (which I don't think is the case), I'll try to manually configure the hardware, and if I can't I'll ask in a separate thread.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: Moving an existing system to a new computer

#4 Post by bw123 »

I think moving an existing installation is tricky, but it can be done. Hardware is automatically detected and configured, unless you copy or clone the system in a way that preserves incompatible settings.

A few potential problems that come to mind are graphics, network, hard drives and other media... the initramfs, firmware, X configuration.
resigned by AI ChatGPT

Yaron
Posts: 13
Joined: 2018-10-26 09:38

Re: Moving an existing system to a new computer

#5 Post by Yaron »

bw123: Why is it tricky, and how can I clone it "preserving incompatible things"? It's a single partition system, and I cloned it with "dd", and reinstalled grub, that's all. I think, though I haven't tried, that if I made a fresh installation all would work out of the box, therefore I think the Debian installer automatically detects and configures hardware in a way that doesn't happen automatically if I clone an existing system. I want to know what the installer uses, and imitate it, if possible.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: Moving an existing system to a new computer

#6 Post by bw123 »

I have found it tricky because there is some static config for devices under /boot, /etc and also under different places in /var along with the volatile places like /dev /sys /proc and that is why dd would probably not be my first choice to clone an installation.

The debian installer is a series of steps, and several of the steps create static configuration for hardware, that is one reason why we need an installer, isn't it? I had an os several yrs ago that claimed to be 'plug and pray' but I never had good luck moving it to another machine either...

Your claim that the devices that aren't working are "standard hardware," is really odd. I haven't really seen many devices that are standard, they are all idiosyncratic. Even the ordinary old mouse is rarely 'standard' between different manufacturers.

I don't know a simple answer to your very general question, but I'm interested in what you find out. If you want to imitate debian installer, then the steps are described in the installation manual. https://www.debian.org/releases/stable/ ... 06.html.en

Good Luck.
resigned by AI ChatGPT

CwF
Global Moderator
Global Moderator
Posts: 2638
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 192 times

Re: Moving an existing system to a new computer

#7 Post by CwF »

I mentioned this before and I do it this way, ie a generic install. I do a a basic install into a vm, a single partition with grub on the disk image. I clone the disk image, not just the partition. I use no specific configs or proprietary drivers in that image. Once it boots in its new home you can then tweak the specifics and expand the image to full size. It works fine for me.

A few times I have moved a system disk to a vm for fixing, that works too.

I make the base image with things like vdagent, qemu-utilities, many cli package versions, and unconfigured sensor-detect, base xorg, and aptitude. I preconfigure some command history and have it ready to drop to a VT so that re-configs and even uninstall/reinstall can happen without any WM, DM, DE complications. So startx goes to an xterm that can fire up a mouse driven, nice font'ed aptitude. Hardware sensors and net names will need re-tweaks, and from this point specifics added...

I've never had an issue or seen an issue that required a fresh install. Also, the domain, mailname, etc, can be changed also. Note that the uuid of the disk can be changed too, or note that an image can't mount its own clone on another disk... Keeping grub with the install in an image of small size (8.4 for me) makes it easy. Splitting multiboot images, or adding grub later is possible but a pain.

I've moved complete hypervisor images with vm's included to a newer machine without much issue.

Basically, un-configure specifics, move disc, reconfigure. Or use a vm with a capable image to begin with.

This lends itself to fixing those frankendebians so popular on this forum. I've fixed one and would like the challenge for more , but whatever. I fail to see the difficulty of dropping to the root VT and firing up aptitude, with a simplified and coherent sources.list, and striping the install clean and rebuilding it. Pop the disk in my dock, I configure the disk into a vm, get to the root VT, point to a local clean pool, and in 10-15 minutes it's clean. Personally I still haven't found any gotcha's...

Yaron
Posts: 13
Joined: 2018-10-26 09:38

Re: Moving an existing system to a new computer

#8 Post by Yaron »

@bw123: By "standard hardware" I mean hardware that I believe linux already has good support for, and I don't think would require any drivers other than what's included in the debian installer.

@CwF: Thanks for sharing your experiences... I believe I can fix the issues myself. However, if it can be done automatically, I'd certainly prefer it to be so, for 2 reasons: 1) to spare time. 2) To get a "clean", "perfect" install. If a system works it doesn't mean it's ideally configured - e.g. it might use a sub-optimal driver for some hardware, and maybe if I made a clean install a better driver would be installed. Btw, in my case too the 1st install was actually in a VM, but that doesn't change the original question really - it could just as well be from a real computer.

Update: I've come across https://wiki.debian.org/HardwareAutodetection. So maybe it's possible using those tools? I don't know how up to date that page anyway, as it mentions things like "Sarge", that unless I were so old I wouldn't know what it refers to.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Moving an existing system to a new computer

#9 Post by debiman »

Yaron wrote:I don't want this thread to be about how to configure some specific hardware. It's a general question.
ooookaaaayyy (i remain sceptical).
If eventually it turns out Debian can't automatically detect and configure the new hardware...
the vanilla kernel (not debian) definitely does that.
with a few notable exceptions:
  • /etc/fstab and grub etc use UUIDs, those will need to be adjusted to the new hardware UUIDs
  • proprietary Graphics drivers and/or Xorg graphics
esp. for the second point: there is no "standard hardware".

but if you do this between, say, 2 100% intel machines, and if moving the system means actually moving the hard drive from machine to the other, it should Just Work (tm).

Yaron
Posts: 13
Joined: 2018-10-26 09:38

Re: Moving an existing system to a new computer

#10 Post by Yaron »

Actually I didn't even have to change the UUID in "/etc/fstab", as "dd" seems to preserve the UUID. If I create a new partition and copy the files from the old one then I have to change the UUID.

I'm talking about hardware that doesn't require any proprietary drivers.

So, you're saying, the vanilla kernel automatically tries to detect and configure new hardware on boot, and that debian disabled that behavior? If so, any idea why debian disables it, and is there a way to re-enable it in debian?

v&n
Posts: 624
Joined: 2015-02-04 02:57

Re: Moving an existing system to a new computer

#11 Post by v&n »

debiman wrote:but if you do this between, say, 2 100% intel machines, and if moving the system means actually moving the hard drive from machine to the other, it should Just Work (tm).
+1 with personal experience.

Just about a week ago, I got my new laptop, an i3 7th generation based HP 14q-CS0006TU. Almost as soon as opening its box I also opened the laptop's body and immediately replaced its Win10 preinstalled 1TB harddisk with my Xubuntu installed 240GB Intel SSD, moved from my old Asus X54C laptop (an i3-2nd Gen based 6 years old laptop!). The only other thing that I (obviously) needed to do was to disable secure boot from the UEFI firmware. Worked like a charm except exactly ONE problem that I could immediately notice - the WiFi wasn't working. Why? Because it was an old kernel which didn't have the required driver in it. So I downloaded & compiled, installed it, and the laptop is all peachy since then.

Okay, so the OS was not exactly 'Debian' but since we are talking about 'general' :roll: cases here, I guess that shouldn't make much difference as I'm sure a vanilla installation of Debian, having the same or better kernel, should have done the same.

But without defining the hardware and the 'Problem' at least to some degree ("..it doesn't seem to do so.." is a bit too much of 'generalization', don't you think?), I think the question is on the border of being vague, and is therefore going to attract answers of similar nature - being nearly vague to the extent of being un-useful.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: Moving an existing system to a new computer

#12 Post by bw123 »

Another vague detail is whether all hardware on the target is "automatically detected", "automatically configured", or "automatically detected and configured". Configuration is not automatic for all hardware, but I think detection should be, depending on how contemporary the kernel release and the specific hardware. The new hardware might be not "...functioning properly" because it was not detected, or because it is misconfigured by copying an incompatible configuration.

So, let's be purposefully vague... it's a somewhat trollish, sort of non-sensical, possibly hypothetical thread describing a totally non specific general roundabout problem on "standard hardware," whatever that is. And it's specifically about a non-supported method of installation.

My hardware is not functioning, but I refuse to tell you what hardware it is, but I'd like to discuss it..., Give me a break.

For example, every system probably has a clock (standard hardware) that will be detected, but can it be automatically configured? No, the installer will try to determine if it is set to UTC by asking for input. If you later copy or clone that system, then it would be possible for the clock to not function correctly because you copied the incompatible configuration. Since the static TZ (that you copied) is based off of that, then who knows what time it is on the cloned system? since some fs checks and other system services like cron, etc. are based on date and time, then well, I would reckon that would have a little potential for improper behavior.
resigned by AI ChatGPT

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Moving an existing system to a new computer

#13 Post by debiman »

Yaron wrote:So, you're saying, the vanilla kernel automatically tries to detect and configure new hardware on boot, and that debian disabled that behavior?
no, i'm not saying that at all.

i'm just saying that hardware detection is not distro-specific, but kernel-specific.

but all binary distros use a kernel package that is fairly large to include as many hardwares as possible.

Yaron
Posts: 13
Joined: 2018-10-26 09:38

Re: Moving an existing system to a new computer

#14 Post by Yaron »

As no general solution has come up yet, and as some of you seem so curious, I'll give you info about my specific attempt. The system is Debian 9 with Mate. The original hardware was a VMWare Worksataion 14 with default options. The new hardware is Asus T102HA. At boot I got errors regarding firmware, plus the internet and sound didn't work. I don't care about the rest of the hardware like webcam etc, just graphics, sound and internet. I managed to improve things a bit by manually installing the packages "firmware-linux, firmware-atheros, firmware-intel-sound". At least now I get a DE with working internet. Some operations I try fail with "read only filesystem" kind of messages. The kernel log is here: https://pastebin.com/msCfTU2y . I'd like to emphasize, though, that despite some of you being skeptical, my main concern is whether those problems can be somehow automatically (or semi-automatically) solved, in a way that I can also use in the future if I try to copy a debian installation between different hardwares than in this case. If I were only interested in a working system I could simply install from scratch (shouldn't take long) and things would probably go much more smoothly.

CwF
Global Moderator
Global Moderator
Posts: 2638
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 192 times

Re: Moving an existing system to a new computer

#15 Post by CwF »

When I mentioned making an image on a vm, I didn't mean to suggest making it 'for' a vm. So, add all related firmwares you'd like to my vdagaent, things I want for a vm...to end up with a 'all-purpose' image. You didn't do that.

So the general summary here is clear.

Debian will autodetect and adapt to anything it has the information for. It will respect all prior manual configurations and either work because of similarity, or fail due to dissimilarity.

So, you should be able to configure for most anything before you move it...as I was saying.

Yaron
Posts: 13
Joined: 2018-10-26 09:38

Re: Moving an existing system to a new computer

#16 Post by Yaron »

@CwF: I'm not an advanced user, so I don't really know all I should do to configure the new hardware. If I knew, I would do it in the VM.

v&n
Posts: 624
Joined: 2015-02-04 02:57

Re: Moving an existing system to a new computer

#17 Post by v&n »

Yaron wrote:@CwF: I'm not an advanced user, so I don't really know all I should do to configure the new hardware. If I knew, I would do it in the VM.
A "general hardware" (from the point of view of a 'non-advanced' common user) nowadays ranges not only between AMD to Intel, but also includes the ARM CPU architecture (an average netbook buyer doesn't know the difference between an x86 or ARM based netbook, as for him, both seem to be running the same OS, same programs). Hope you know how big that difference is at the machine level. This is just an example. There are many components that just can't be controlled through 'one-size-fits-all' generic handles.

While it can certainly be made possible to create such a hyper-smart (and therefore super-huge too!) OS or kernel that automatically detects even such radical differences and loads the correct stuff to make the transition smooth, it would obviously be stupendously overkill for a product which will only be useful for 'non-general' users. Because an average user doesn't do the kind of moving/migration you are talking about, only the curious and tekky types do.

And those who do this kind of things are supposed to be either smart enough to figure out their way through the shift, or be ready to take responsibility for the breakage that may happen during the shift. If you are curious enough to try a jet propeller on a bicycle, obviously neither the bicycle nor the jet companies can take responsibility for what happens next.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Moving an existing system to a new computer

#18 Post by debiman »

v&n wrote:A "general hardware" (from the point of view of a 'non-advanced' common user) nowadays ranges not only between AMD to Intel, but also includes the ARM CPU architecture (an average netbook buyer doesn't know the difference between an x86 or ARM based netbook, as for him, both seem to be running the same OS, same programs). Hope you know how big that difference is at the machine level. This is just an example. There are many components that just can't be controlled through 'one-size-fits-all' generic handles.
like i said: there's no such thing as "standard" or "general" hardware anymore. well there is (e.g. PC architecture is still a thing), but not in a complete, all-encompassing sense.
While it can certainly be made possible to create such a hyper-smart (and therefore super-huge too!) OS or kernel that automatically detects even such radical differences and loads the correct stuff to make the transition smooth, it would obviously be stupendously overkill for a product which will only be useful for 'non-general' users. Because an average user doesn't do the kind of moving/migration you are talking about, only the curious and tekky types do.
well to be fair, the (arguably bloated) default linux kernel does most of that; it doesn't take much intelligence to just go through all options 1 by 1 until "it works" - just lots of different drivers.
and that's ok because compared to all the youtube videos an average user watches or images stored on their computer, that's still next to nothing.
and bootable live systems are even better at it.

thing is, people get so easily put off when it doesn't work once in a while. instead of rolling up their sleeves and starting to dig, they get all panicky and complainy.

tl;dr: maybe OP really wants "Live USB with persistence"???

Yaron
Posts: 13
Joined: 2018-10-26 09:38

Re: Moving an existing system to a new computer

#19 Post by Yaron »

well, @debiman, if a live system is better at it, that means it is possible? Why can't a standard system be as smart as a live system?

@v&n: Yes, I do realize that if I moved a system between different architectures then all binary packages would have to be reinstalled, however even in that case maybe there could be a tool that moves an installation preserving all your settings, other than those related to the hardware. But let's leave that aside now - assume I move a system between 2 computers with the same architecture, so even if there are differences like in firmware, I don't think it's something that big that a system can't adjust and have to be reinstalled from scratch or manually fixed.

Replacing some hardware in an existing computer (especially desktop computer) isn't something that bizarre, and expecting things so "just work" with "standard hardware" doesn't seem like a crazy expectation for me. In that sense, moving an installation from one computer to another isn't principally different to changing some of the hardware in an existing computer - it just means changing all your hardware components. You could just as well change them one by one. And while maybe changing the firmware in an existing computer isn't a typical use, changing things like Wi-Fi card or graphics card or HD or mouse or keybard etc in an existing computer are not rare scenarios. Adapting to such changes doesn't seem like a crazy expectation for me.

Actually I got curious and I'm now trying to do the same with another distribution. Let's see how it goes...

Yaron
Posts: 13
Joined: 2018-10-26 09:38

Re: Moving an existing system to a new computer

#20 Post by Yaron »

Ok, so I tried to do the same with Ubuntu MATE 18.04.1 LTS. I used the same hardware both in the original computer and in the new computer. The result: I rebooted, and everything just worked: DE, internet, sound. No errors. I had to do nothing.

Now, I'm not trying to say here this or that distribution is better, vice versa, I was wondering if there's somehow I can make debian do the same: maybe there's some package they use that does that magic, or maybe it's something specific to ubuntu or to ubuntu MATE? Either way, it *is* possible.

Post Reply