3 ms·
> A few months ago, I copied my complete installation to a ThinkPad X13 Gen 2 using rsync How would something like this work? Is the target laptop running any
by JLCarveth 4y ago
> A few months ago, I copied my complete installation to a ThinkPad X13 Gen 2 using rsync
How would something like this work? Is the target laptop running any random linux distro, and rsync replaces all system files etc. effectively "swapping" operating systems? Can the laptop boot into the new system as if it was installed normally?
- prettyWise 4y agoI would boot from a live disk image, mount the built in hard disk, and then rsync the files to it from there and reboot I think.
- malermeister 4y agoI'm gonna guess you rsync onto a separate partition and then get rid of the "host" partition once you're done instead of replacing stuff on the fly.
- pseudoramble 4y agoInteresting question. Only other ideas I can think of is they pulled the drive out from the laptop to do the copy physically, or they booted the laptop from a live distro and did the copy. But those are simply guesses!
- trebbble 4y agoBoot from external media (USB disk, cd or dvd if you're kicking it old school, maybe even network) with no persistent storage (ramdisk or whatever only). Mount the hard drive. Format. Rsync the files over. That's pretty similar to what installation media does anyway, really. [EDIT] Oh you might need to install the bootloader too. But you can sort-of (your running kernel will still be the installation media's) do that from the rsync'd system once it's copied over, with some creative chrooting and mounting. Which, again, is something that Linux installers kinda do anyway, in ordinary operation, but you'd likely want to do it manually in this case. It's exactly what you used to do (probably still do?) installing Gentoo, even for a "stage 3" (least-painful) installation.
- traverseda 4y agoYou boot into a live cd (probably the arch install disc) and rsync on to a mounted partition, then you chroot into that partition and re-install the bootloader. This is pretty much how you install archlinux normally, except instead of rsync-ing the initial filesystem you make a new initial filesystem based on the "filesystem" package. https://archlinux.org/packages/core/x86_64/filesystem/ https://archlinux.org/packages/core/x86_64/filesystem/
- 5e92cb50239222b 4y agoI do that routinely. Boot from a liveUSB, rsync data from the main system, fix the bootloader and a couple of configs like /etc/fstab. Works like a charm every time.
- foepys 4y agoI did exactly this a few times, too. My Arch is from 2007 or so and had only a few hiccups. The last thing happened when MD5 was getting deprecated for /etc/passwd and the automatic migration to another hash algorithm was not working, which is obviously directly related to the age of the installation. It is running on its third mainboard/CPU/GPU combo with maybe the fifth HDD/SSD.
- gspr 4y ago> I do that routinely. Boot from a liveUSB, rsync data from the main system, fix the bootloader and a couple of configs like /etc/fstab. Works like a charm every time. Just be careful if you intend to keep the old system running. You probably don't want to clone /etc/machine-id and similar (see: the problems that come with exactly cloning VMs). But of course, if the old system is being destroyed, then no worries.
- qbasic_forever 4y agoCould be booted into a USB live CD and then manually mounted the internal harddrive to rsync the new root filesystem. They would need to make sure their boot partition is rebuilt/updated too with the kernel if necessary.
- csdvrx 4y ago> How would something like this work? Very well and very easily. You can do that even with Windows, even with different CPUs: I've ported my master Windows install from a Xeon to a regular Intel CPU on a laptop. This laptop still feels like downloading Xeon-specific updates time to time, but every system peripheral is recognized in the device manager, and everything has been working great for over a year now. For my next laptop, I'll do just the same: use bitlocker unlock, clone this Windows install into a larger SSD using Linux NTFS tools, plug the new SSD into the new laptop.
- sgtnoodle 4y agoThere's really not very much magic involved. The root filesystem is just a collection of directories and files. The kernel is just a binary blob, usually stored in /boot. You perhaps need an initial ramdisk tailored to your configuration, but that's usually just running a script. The only really arcane bit is bootloading the kernel. With modern x86 systems EFI does it, and so you just need a correctly formatted fat32 EFI partition.
- meribold 4y agoI booted a live system from a USB thumb drive and then pulled down a backup using rsync. After that, I adjusted my `/etc/fstab`, `chroot`ed into the new (old) system, ran `mkinitcpio -P`, and generated a new GRUB configuration file.