News for hackers. Stuff that matters.
Re:Using the same Arch Linux installation for a decade by JLCarveth on Tuesday August 16, 2022 @12:29PM (#32485093)
> 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?

Re:Using the same Arch Linux installation for a decade by traverseda on Tuesday August 16, 2022 @12:33PM (#32485149)
You 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/

Re:Using the same Arch Linux installation for a decade by 5e92cb50239222b on Tuesday August 16, 2022 @12:33PM (#32485151)
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.
Re:Using the same Arch Linux installation for a decade by gspr on Tuesday August 16, 2022 @02:15PM (#32486610)
> 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.

Re:Using the same Arch Linux installation for a decade by foepys on Tuesday August 16, 2022 @01:08PM (#32485730)
I 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.

Re:Using the same Arch Linux installation for a decade by trebbble on Tuesday August 16, 2022 @12:32PM (#32485133)
Boot 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.

Re:Using the same Arch Linux installation for a decade by csdvrx on Tuesday August 16, 2022 @12:40PM (#32485279)
> 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.

Re:Using the same Arch Linux installation for a decade by sgtnoodle on Tuesday August 16, 2022 @12:57PM (#32485583)
There'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.
Re:Using the same Arch Linux installation for a decade by prettyWise on Tuesday August 16, 2022 @12:30PM (#32485113)
I 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.
Re:Using the same Arch Linux installation for a decade by meribold on Tuesday August 16, 2022 @12:58PM (#32485608)
I 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.
Re:Using the same Arch Linux installation for a decade by qbasic_forever on Tuesday August 16, 2022 @12:36PM (#32485212)
Could 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.
Re:Using the same Arch Linux installation for a decade by pseudoramble on Tuesday August 16, 2022 @12:32PM (#32485129)
Interesting 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!
Re:Using the same Arch Linux installation for a decade by malermeister on Tuesday August 16, 2022 @12:31PM (#32485115)
I'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.