View previous topic :: View next topic |
Author |
Message |
zakkcoetzee n00b
Joined: 23 Jan 2019 Posts: 8 Location: South Africa
|
Posted: Wed Jan 23, 2019 8:02 am Post subject: Restoring Gentoo from CloneZilla Backup - Please Help |
|
|
Hi,
Hope I am posting this in the correct section. My scenario is as follow:
My boss' friend has a Linux Gentoo server that died and there was nothing documented, the lady who did the setup would be 72 today and passed away 4 years ago.
Very old Gentoo (3.7.9) i686 that I have a CloneZilla image of before the server died.
The image has 4 partitions on sda - sda1, sda2, sda3 & sda4 :
sda1 ext2 /boot
sda2 linux-swap
sda3 reiserfs
sda4 lvm2 pv vg
Inside the lvm vg
/dev/vg/usr
/dev/vg/tmp
/dev/vg/opt
/dev/vg/var
/dev/vg/home
/dev/vg/data
/dev/vg/u
/dev/vg/x
/dev/vg/users
I use Ubuntu 16.04 on a daily basis, I don't have Gentoo experience.
The approaches I have tried is as follow -
1. Ran CloneZilla in a VM and had CloneZilla recreate all partitions
Result : VM doesn't boot, I suspect it's the initramfs that doesn't know what to mount upon booting.
2. Found the minimal installation that was used, tried to compile Gentoo but emerge-sources cannot find a kernel: sys-kernel/genkernel-3.4.49.2
I can try a P2V from their production Gentoo that is running 3.7.9 as well, though I am not at all experienced to build a initramfs.
Any approach, solution, suggestions would be highly appreciated.
If any info is required please say so, I will post additional information.
Thanks in advance. |
|
Back to top |
|
|
Dwosky Tux's lil' helper
Joined: 07 Nov 2018 Posts: 135
|
Posted: Wed Jan 23, 2019 10:29 am Post subject: |
|
|
Not sure if its the best approach, but I would restore the Clonezilla backup into a new VM, then use any LiveCD/USB to boot that VM, mount the partitions, chroot and check the following entries:
- /etc/fstab: To see if the partitions are defined with UUID, which might have changed due to the new "hardware".
- Any boot method, being that old it might be grub or lilo. Check the configuration and see if its the correct one or needs updating according the new VM.
- kernel & initramfs: Check kernel config for static routes that could contain UUID, like the option root=UUID=XXX and update them accordingly. Once this and the fstab its done, you might want to try to recreate the initramfs on the new VM.
Right now with the above things to check I believe you should be able to reach the boot loader and see something more (at least an error or something) in case the server its still not booting. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Wed Jan 23, 2019 9:07 pm Post subject: |
|
|
zakkcoetzee,
To boot, there is some code installed outside of any filesystem. If you only have partition images, that will be missing.
Well, it will need to be reinstalled.
How you do that depends on the boot loader you have. We need to look at your install to see which it is.
Boot your VM with any random distro - System Rescue CD is good.
Code: | mount -o ro /dev/sda3 /mnt/gentoo
mount -o ro /dev/sda1/ /mnt/gentoo/boot |
/mnt/gentoo must exist and you need to be root.
Now we can look around.
Does the file /mnt/gentoo/etc/lilo.conf exist?
If so, your boot loader is lilo.
Does the file /mnt/gentoo/boot/grub/grub.conf exist?
If so, your boot loader is grub.
There a few other other possible boot loaders but they all relay on code in the MBR and the unallocated space before the first partition.
Those two will cover 95% of installs.
Once we know the bootloader, we can tell you how to reinstate the missing code. Its in your install, just in the wrong place. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
zakkcoetzee n00b
Joined: 23 Jan 2019 Posts: 8 Location: South Africa
|
Posted: Wed Feb 06, 2019 1:05 pm Post subject: |
|
|
Thanks, I have gotten the restore to work with the help from NeddySeagoon
What I have now done is pretty much created a VM from a backup that was a physical.
My next issue is now upon booting eth0 failed and cannot be found.
I tried using the live cd to recompile and include the driver that I assume doesn't exist using this recompile guide.
https://pikedom.com/recompile-the-gentoo-linux-kernel/
Steps -
1. Boot Live Gentoo iso.
2. Open Terminal & execute sudo -i
3. Then I follow the guide, but during the compilation I get an error 'no space left on device'.
4. I use df -Th and see that tempfs & aufs is full.
From what I understand the compilation happens on these 'temp partitions' and then one copies the image to /boot.
How do I fix this to recompile to include the missing drivers?
Is this the only way to fix the eth0 driver that is missing?
Thanks in advance. |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
zakkcoetzee n00b
Joined: 23 Jan 2019 Posts: 8 Location: South Africa
|
Posted: Wed Feb 06, 2019 1:56 pm Post subject: |
|
|
I am using the live cd because I thought that is the only place I would be able to find the required networking driver.
So you are saying that I should instead not use the live cd at all and try recompiling in the Gentoo 3.7.9 and then in the make menuconfig see if I can find the network driver support?
Once again this approach is from reading online what I can find, what I have to do exactly I have no clue.
I read somewhere that if the kernel doesn't have the driver compiled insert the live cd and recompile to include the driver.
I am merely trying anything and everything to get networking to work due to the hardware change.
Please guide me in the right direction. |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Wed Feb 06, 2019 7:30 pm Post subject: |
|
|
zakkcoetzee,
Your VM will expose a simulated network device that will be quite different from the network device in the real hardware.
What network cards are offered by the VM varies between virtualisation tools.
VirtualBox offers a choice of Am79C970A, Am79C973, Intel 82540EM, Intel 82543GC, Intel 82545EM and virtio-net.
You cannot use virtio-net as your guest kernel will not have support.
virt-manager, for KVM with QEMU offers e1000 and rtl8139, the other two options won't be supported by your Gentoo kernel.
Boot your Gentoo install normally (with no network) and tell us the Ethernet line from your lspci output.
You will have access via the VM console.
Once we know your ethernet device, we can tell you how to fix your kernel. If its a complete Gentoo install, you will have complete kernel sources and the tools to build the kernel.
While you are poking about, look in /boot with It may be empty, in which case do and try again.
There should be at least one file with kernel or vmlinuz in its name. What are the full names of these files?
Do the names include genkernel ?
Genkernel is a Gentoo tool to help build and install your kernel. It would be good to know if its in use on your install or not. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
zakkcoetzee n00b
Joined: 23 Jan 2019 Posts: 8 Location: South Africa
|
Posted: Wed Feb 06, 2019 8:01 pm Post subject: |
|
|
Guys, I just want to say the support from your community is amazing.
I am starting to like Gentoo since I am starting to understand
Okay so lspci :
00:03.0 Ethernet controller [0200]: Intel Corporation 82540EM Gigabit Ethernet Controller [8086:100e] (rev02)
From what I gather the 100e should be the PCI ID?
-------------------------------------------------------------
/boot partition // Thanks for the mount /boot command I was still using mount /dev/sda3 /boot
ls -l /boot
Here is the full output
Config-3.7.9-gentoo
System.map-3.17.7-gentoo
System.map-3.17.8-gentoo-r1
config-3.17.7-gentoo
config-3.17.8-gentoo-r1
grub
initramfs-3.17.7-gentoo.img
initramfs-3.17.8-gentoo.img
kernel-3.17.7-gentoo
kernel-3.17.8-gentoo-r1
kernel-3.7.9-gentoo |
|
Back to top |
|
|
zakkcoetzee n00b
Joined: 23 Jan 2019 Posts: 8 Location: South Africa
|
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
Posted: Wed Feb 06, 2019 8:17 pm Post subject: |
|
|
I missed the fact it is inside of a VM. If this is the case you definitely need to run lspci inside of VM, the real hardware does not matter at all (unless the VM is given direct access to a piece of hardware).
Re: 100e support is not available in kernels older than 3.17, you are correct. _________________ My Gentoo installation notes.
Please learn how to denote units correctly! |
|
Back to top |
|
|
zakkcoetzee n00b
Joined: 23 Jan 2019 Posts: 8 Location: South Africa
|
Posted: Wed Feb 06, 2019 8:49 pm Post subject: |
|
|
Okay yay so now that I know my kernel 3.17.x can support the Intel Ethernet "card" that VirtualBox emulates.
Do I merely have to recompile the kernel ?
I did have a look around in the make menuconfig and didn't see anything that relates to the Intel Corporation 82540EM Gigabit Ethernet Controller?
Is there a general driver containing all of the supported cards or how do I go about installing the driver for the "card" ? |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Wed Feb 06, 2019 9:01 pm Post subject: |
|
|
zakkcoetzee,
There are two very similar kernel modules called e1000 and e1000e. Cards were moved between them.
I would build both of them.
Your reading of cateee.net is correct.
Lets check a few things before we try a new kernel.
First, the 'daft laddie' approach. What does tell.
A return to the prompt, with no output, means it worked.
Your network interface should appear in
The probability of that working is fairly minimal but if it did, Code: | /etc/init.d/net.eth0 restart | will get you on the net.
If modprobe failed, we need to find out how your kernel is configured
What does tell?
Its the name of the running kernel.
Next look al There may be several kernel source trees there. We are only interested in the one corresponding to uname -r.
cd to that kernel source tree.
What does tell?
No output tells that something it depends on is off. Quote: | #CONFIG_E1000 is not set | tells that its off.
Again, the simplistic approach ... we will attempt to make only the E1000 module. Its not always possible but it avoids learning to make and install the kernel if it works.
Run Thes is the kernels configuration utility.
Press / to do a search.
Enter e1000 (its case insensitive) and the help will list all of the kernel symbols containing E1000 and tell where in the menu system they are to be found.
Navigate to E1000 and set it to <M> because we want it to be a loadable module.
If E1000E is there, do the same for it too.
Exit, saving your changes.
Run Code: | make
make modules_install |
If that worked, e1000 and e1000e are now available to modprobe.
So back to above.
If there are errors about missing symbols during the build or at the end of dmesg as a result of the modprobe, its a whole kernel rebuild and reinstall.
is a command. It shows the kernel messages. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Wed Feb 06, 2019 10:25 pm Post subject: |
|
|
zakkcoetzee,
You only enabled
Code: | # CONFIG_E1000 is not set | means that its not avaiable as its configured to be off.
Do the process again but this time set CONFIG_E1000 as <M>
I intended you to do both at the same time.
When it works will return no output.
Try It should load but may not be the right module for your ethernet. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
zakkcoetzee n00b
Joined: 23 Jan 2019 Posts: 8 Location: South Africa
|
Posted: Wed Feb 06, 2019 10:25 pm Post subject: |
|
|
NeddySeagoon, Jaglover highly appreciated.
It worked ! Amazing thank you very much guys. I have no idea where all your knowledge comes from but it's spectacular and I learned a lot about Linux by digging deeper than ever before.
I have barely touched the internals but it feels great. |
|
Back to top |
|
|
zakkcoetzee n00b
Joined: 23 Jan 2019 Posts: 8 Location: South Africa
|
Posted: Wed Feb 06, 2019 10:53 pm Post subject: |
|
|
NeddySeagoon,
Sorry yes I had missed one since the names had looked basically the same the one just had PCI in the name and the other didn't.
Hence why I deleted the post once I realized. I redid the steps and added the one I missed and wham bam! Great success! |
|
Back to top |
|
|
|