View previous topic :: View next topic |
Author |
Message |
Illiander Apprentice
Joined: 22 Feb 2011 Posts: 252
|
Posted: Wed Aug 30, 2017 2:59 pm Post subject: Migrating to new hardware [SOLVED] |
|
|
Short story:
My processor died, so I bought new hardware, plugged in my old hard drives, and tried to boot.
Got Segfault.
Booted to livecd. Livecd worked fine (typing this from there)
Tried to chroot into my old environment.
Code: | livecd ~ # chroot /mnt/gentoo /bin/bash
Illegal instruction |
Looked up chroot illegal instruction - got a bunch of old posts (2006 and earlier) saying that the stage-3 tarball was for the wrong architecture.
Old machine was a 7-year-old 8-core AMD, new machine is a new 8-core AMD.
I expected to have to chroot in and do a full rebuild, but I didn't expect to have to go back to a stage-3 tarball.
Is there some magic I can do to save me from grabbing my portage directory, wiping the drive and starting over?
And am I forgetting something other than /etc/portage that I'd need to grab to get my system back to where it was with minimum interaction?
Last edited by Illiander on Fri Sep 01, 2017 9:19 am; edited 1 time in total |
|
Back to top |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3664
|
Posted: Wed Aug 30, 2017 3:06 pm Post subject: Re: Migrating to new hardware |
|
|
Illiander wrote: | Short story:
My processor died, so I bought new hardware, plugged in my old hard drives, and tried to boot.
Got Segfault.
Booted to livecd. Livecd worked fine (typing this from there)
Tried to chroot into my old environment. |
FYI, sysresccd provides a boot option for »Boot an existing Linux system installed on the disk« ... (without chrooting), see http://www.system-rescue-cd.org/images/sysresccd-003-640x480.png
Last edited by charles17 on Wed Aug 30, 2017 3:12 pm; edited 1 time in total |
|
Back to top |
|
|
Illiander Apprentice
Joined: 22 Feb 2011 Posts: 252
|
Posted: Wed Aug 30, 2017 3:10 pm Post subject: |
|
|
Don't I need to chroot in to fix the system so it can boot without help? |
|
Back to top |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3664
|
Posted: Wed Aug 30, 2017 3:13 pm Post subject: |
|
|
Illiander wrote: | Don't I need to chroot in to fix the system so it can boot without help? |
Nope. You might need to activate other kernel options. This can be done with your system booted from sysresccd. |
|
Back to top |
|
|
Illiander Apprentice
Joined: 22 Feb 2011 Posts: 252
|
Posted: Wed Aug 30, 2017 3:57 pm Post subject: |
|
|
I'm not sure I have the ability to burn a boot disc atm. Only one CD drive and it's taken up with the gentoo livecd. |
|
Back to top |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3664
|
Posted: Wed Aug 30, 2017 4:05 pm Post subject: |
|
|
Illiander wrote: | I'm not sure I have the ability to burn a boot disc atm. Only one CD drive and it's taken up with the gentoo livecd. |
No chance booting from a USB stick? |
|
Back to top |
|
|
Illiander Apprentice
Joined: 22 Feb 2011 Posts: 252
|
Posted: Wed Aug 30, 2017 4:10 pm Post subject: |
|
|
Only if I can find a spare one - which is unlikely.
I need to get my system back up and running in as few days as possible, I can devote as many hours in a day as needed to get this done (time spent messing about failing to get stuff to work is very bad)
What is my fastest, simplest option that will work first time with no hiccups? |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Wed Aug 30, 2017 4:40 pm Post subject: Re: Migrating to new hardware |
|
|
Illiander wrote: | Old machine was a 7-year-old 8-core AMD, new machine is a new 8-core AMD. |
Is the new machine Ryzen? It chokes on Bulldozer instructions but instruction sets older than that are OK.
Assuming your old machine was optimized for native, you may have to use the stage3, but possibly you can just copy bash and a toolchain from sysrescuecd. "emerge -e world --keep-going" should run overnight on Ryzen 7 8-core. OTOH maybe you have the seg fault bug. |
|
Back to top |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3664
|
Posted: Wed Aug 30, 2017 4:50 pm Post subject: |
|
|
Illiander wrote: | What is my fastest, simplest option that will work first time with no hiccups? | Spending some hours for going somewhere to get a simple USB stick should be a good investment of time. Create a bootable sysresccd stick and boot the computer.
Otherwise you would in fact have to boot from your Livecd and chroot into your old system.
Then adjust kernel and bootloader.
Edit:
Sorry, just saw you were having problems with chrooting. Is it an older Livecd? |
|
Back to top |
|
|
Illiander Apprentice
Joined: 22 Feb 2011 Posts: 252
|
Posted: Wed Aug 30, 2017 5:59 pm Post subject: Re: Migrating to new hardware |
|
|
Tony0945 wrote: | Illiander wrote: | Old machine was a 7-year-old 8-core AMD, new machine is a new 8-core AMD. |
Is the new machine Ryzen? It chokes on Bulldozer instructions but instruction sets older than that are OK.
Assuming your old machine was optimized for native, you may have to use the stage3, but possibly you can just copy bash and a toolchain from sysrescuecd. "emerge -e world --keep-going" should run overnight on Ryzen 7 8-core. OTOH maybe you have the seg fault bug. |
seg fault bug?
Yeah, new machine is a ryzen 7 8-core, what bits do I need to copy from my livecd to get a complete toolchain? Would all of /lib, /bin, /usr/lib, /usr/bin and the 32/64 varients do it? Since the old machine was optimised for native I'm guessing I'll have to rebuild everything anyway, so I don't gain anything from finessing things, as long as I don't overwrite where portage keeps it's list of things I've done.
LiveCD is from 2014, so only 3 years old, and looks like it's working fine. I can grab a fresh stage-3 tarball and use that as a recovery copy.
If I was certain of the list of things to save, I'd have already done it. I just need to know either what not to replace, or what to replace.
If the answer is to grab /etc/* and /var/* (/home is on a seperate hdd) then redo from a stage-3 then I have no problem with doing that, but I don't want to mess up and miss something important.
---
Edit:
I went looking around, and found the list of packages needed to build for different architectures, and pretty much the same list for building a stage-1 tarball. Neither gave me the files/directories I need to copy/save to just make things work.
---
Edit2:
Went and looked up the seg fault bug - I'm getting issues with chroot, haven't even been able to get to the point of compiling anything yet.
---
Edit3:
Went ahead and moved my old install to /old_root and dropped a new stage3 tarball on the drive.
Moved over the relevent bits from my old /etc/portage folder, and I'm getting the following error on an "emerge --update --deep --newuse @system" (I know I'm going to need to get layman back to do a full world emerge, so I figured I'd start with system and work my way back to everything in stages):
Code: | emerge: there are no ebuilds to satisfy ">=dev-python/appdirs-1.4.0-r1[python_targets_pypy(-)?,python_targets_pypy3(-)?,python_targets_python2_7(-)?,python_targets_python3_4(-)?,python_targets_python3_5(-)?,python_targets_python3_6(-)?,-python_single_target_pypy(-),-python_single_target_pypy3(-),-python_single_target_python2_7(-),-python_single_target_python3_4(-),-python_single_target_python3_5(-),-python_single_target_python3_6(-)]".
(dependency required by "dev-python/setuptools-35.0.1::gentoo" [ebuild])
(dependency required by "dev-python/pyxattr-0.5.5::gentoo" [installed])
(dependency required by "sys-apps/portage-2.3.6::gentoo[python_targets_python2_7,xattr]" [installed])
(dependency required by "dev-java/java-config-2.2.0-r3::gentoo" [ebuild])
(dependency required by "sys-libs/db-5.3.28-r2::gentoo[java]" [ebuild])
(dependency required by "dev-lang/perl-5.24.1-r2::gentoo[berkdb]" [installed])
(dependency required by "app-admin/perl-cleaner-2.25::gentoo" [installed]) |
I always seem to get issues with things needing multiple different python versions, and they're always a pain for me to fix. |
|
Back to top |
|
|
Illiander Apprentice
Joined: 22 Feb 2011 Posts: 252
|
Posted: Thu Aug 31, 2017 5:51 pm Post subject: |
|
|
Made a lot of progress - documenting it here so that others can benefit (or so future me can benefit next time this happens, at the least)
Moved "/" to "/old_root"
Installed a fresh stage-3 tarball, handbook pages "installing stage 3", "installing base system", "configuring kernel", "configuring system" while referencing my old world file to let me make the same choices on system logger, etc...
Copied over my old kernel .config before building the kernel to keep nvidia/vmware stuff that I had to fix last time.
Also copied over most of /etc/portage/package.*/* and /etc/portage/make.conf (some of this is what gave my the python errors) before rebuilding the system.
Added dhpc daemon to default runlevel.
Copied over my old world file, giving it a manual prune for places I forgot to --oneshot.
Emerged layman.
Referenced old layman config file to re-add overlays.
Recreated my old user account - same name, referenced old groups file to make sure I didn't forget any groups. home directory will get hidden by the second hdd mount, so I won't have to do any user configuration once things are back up and running.
Ran emerge @world, found a few places I had to unmask for more recent updates (mostly due to systemd blocks, though also an overly braod vmware mask and rar needing the rar lisence accepting)
Currently running a full emerge @world, expecting to have to do things like sensors-detect and nvidia-xconfig along with adding a few more things to the default runlevel. Will probably have to look up where rc-update keeps it's configs. |
|
Back to top |
|
|
The Doctor Moderator
Joined: 27 Jul 2010 Posts: 2678
|
Posted: Fri Sep 01, 2017 5:24 am Post subject: |
|
|
This may be a bit late for you, but I would have done it like so:
1) create a dummy chroot in the install via the live CD.
2) installed the stage3 to that location.
4) copied make.conf
5) chroot and use the stage 3 to build packages but not to install them.
6) install the packages to the real install. Can be done by untaring them in your real / or using portage. For best results the packages should be the same version installed. This would probably be bash and maybe a few others to get a functional chroot. Once your entire @system works you can rebuild @world without any fear of a sigfault.
Alternatively you could simply copy the entire /etc/ over. That should be everything (except world) that gives your install its identity. /var gets a bit tricky since portage tracks some of its actions which won't be true anymore. _________________ First things first, but not necessarily in that order.
Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box. |
|
Back to top |
|
|
Illiander Apprentice
Joined: 22 Feb 2011 Posts: 252
|
Posted: Fri Sep 01, 2017 8:58 am Post subject: |
|
|
Yeah, that would have made a lot more sense - Especially if I'd kept my system more up to date.
But it's a little late now, I'm already back at my old user, just fighting nvida driver issues.
Future me will probably thank you in a few years time |
|
Back to top |
|
|
kakarot n00b
Joined: 02 Feb 2004 Posts: 10
|
Posted: Wed Nov 08, 2017 11:41 am Post subject: |
|
|
@The Doctor
I would like to do something similar...
Could you please explain the steps numbered 5 and 6?
I actually want to reinstall to get a multilib profile...
Thank you in advance. |
|
Back to top |
|
|
|