You are not logged in.

#1 2012-04-17 03:31:49

keen90
Member
From: Europe
Registered: 2010-04-07
Posts: 106

kernel issue on system clone

Hi,

I use a sync skript to mirror my machines which works fine as long as there are no kernel version differences. In case there are version differences it fails, since it does not treat the kernel loader in /boot. So I need to change the kernel which is loaded on boot.
Right now after the mirror-skript the new kernel exists on the filesystem but is not loaded. I don't know which file in /boot is responsible for grub to load the desired kernel.

Oh and might this even work what Im planning - I mean the the arch kernel is generic, isn't it? So I actually can just copy it to another machine, right?

BTW here the skript:
syncdev is a usb-stick which contains a copy of my system

#run checks
if [ ! -f /syncdev/syncdevice ]; then
	figlet "fail!"
	echo "no sync device found on /syncdev"
	exit
fi
#back up machine specific files
figlet <- machine files
cp /etc/rc.conf /etc/fstab /etc/hosts /syncdev/
figlet syncing /bin
rsync -avxHAXS --delete --progress /syncdev/bin /
figlet syncing /etc
rsync -avxHAXS --delete --progress /syncdev/etc /
figlet syncing /lib
rsync -avxHAXS --delete --progress /syncdev/lib /
figlet syncing /opt
rsync -avxHAXS --delete --progress /syncdev/opt /
figlet syncing /root
rsync -avxHAXS --delete --progress /syncdev/root /
figlet syncing /sbin
rsync -avxHAXS --delete --progress /syncdev/sbin /
figlet syncing /usr
rsync -avxHAXS --delete --progress /syncdev/usr /
figlet syncing pacman db
rsync -avxHAXS --delete --progress /syncdev/var/lib/pacman /var/lib
figlet syncing homedir
rsync -avxHAXS --delete --progress /syncdev/home /
figlet -> machine files
cp /syncdev/rc.conf /syncdev/fstab /syncdev/hosts /etc/
figlet system updated

Thanks in advance,
Keen

Offline

#2 2012-04-17 05:12:05

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: kernel issue on system clone

The kernel image is located at /boot/vmlinuz-linux. It's indeed generic, so you should be able to use it on different systems (given they're running the same architecture). The grub config file which points to which kernel is loaded is at /boot/grub/menu.lst.

Keep in mind though that if you have/need different includes in your initramfs for both boxes; you'll need to generate one against the new kernel.


Burninate!

Offline

#3 2012-04-18 06:50:44

keen90
Member
From: Europe
Registered: 2010-04-07
Posts: 106

Re: kernel issue on system clone

Ok i replaced the vmlinuz-linux but that did not work.
(My grub is referencing to vmlinuz26 which is a symlink pointing to vmlinuz-linux)

How can I find out if I am running the same architecture? Because although I think I used the i686 version in both cases but they did not end on the same kernel version when I did a full pacman update.
machine 1 has:

$ uname -a
Linux cobalt 3.3.2-1-ARCH
machine 2 has$ uname -a
Linux crimson 3.3.1-1-ARCH

So is there a command to find out the architecture?

And I did not understand the second part with the initramfs. I see, that I have an initramfs-linux.img lying in /boot. Is this the file which needs to be replaced? How do I generate a file against the kernel.


Oh and by the way the error I get by grub right now is that it does not find my hard drive (by UUID). But I don't understand this either, since I did not change the UUID entry in the menu.lst. Or does this just mean that he does not find a usable kernel on the harddrive with the specified UUID?

Offline

#4 2012-04-18 07:02:10

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: kernel issue on system clone

keen90 wrote:

So is there a command to find out the architecture?

/bin/arch

keen90 wrote:

And I did not understand the second part with the initramfs. I see, that I have an initramfs-linux.img lying in /boot. Is this the file which needs to be replaced? How do I generate a file against the kernel.

You can use mkinitcpio to generate a new image. Have a look at the wiki page, it has a decent explanation of how it all works. The fact that your root partition is not found can also be related to missing certain support in your initramfs.

Last edited by Gcool (2012-04-18 07:02:35)


Burninate!

Offline

#5 2012-04-18 07:09:14

keen90
Member
From: Europe
Registered: 2010-04-07
Posts: 106

Re: kernel issue on system clone

Thanks for the quick answer! I'll read your link and post when I know more.

Oh first thing:
I have nothing like "arch" in /bin/ . Are you sure its there?
I searched for "arch"
# find / -name "arch"
/lib/modules/3.3.2-1-ARCH/kernel/arch
is the ony result
in there is a folder "x86"  - is that my running architecture?

EDIT: sorry did'n recognize arch is a command, not a folder.
Nevertheless I don't have it.

Last edited by keen90 (2012-04-18 07:30:05)

Offline

#6 2012-04-18 07:27:19

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: kernel issue on system clone

Sorry, not enough coffee yet.

Just run "uname -a" and it'll display your architecture (either i686 or x86_64).

Last edited by Gcool (2012-04-18 07:53:52)


Burninate!

Offline

#7 2012-04-18 07:31:33

keen90
Member
From: Europe
Registered: 2010-04-07
Posts: 106

Re: kernel issue on system clone

are you sure?

$ uname -a
Linux cobalt 3.3.2-1-ARCH #1 SMP PREEMPT Sat Apr 14 10:08:43 UTC 2012 i686 Intel(R) Core(TM)2 Duo CPU P7550 @ 2.26GHz GenuineIntel GNU/Linux

Oh and I just found out, that it is NOT grub which does not find the partition, but something later. Don't know the name, it happens after Booting the kernel
.
.
.
Triggering uevents ... done
Waiting 10 seconds for device -> /dev/xxxxxxx(UUID)
ERROR: device '/dev/xxxxxxx' not found Skipping fsck
ERROR: Unable to find root device /dev/xxxxxxxxx
You are being dropped to a recovery shell

Last edited by keen90 (2012-04-18 07:35:50)

Offline

#8 2012-04-18 07:42:37

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: kernel issue on system clone

EDIT: really off my game today it seems.

$ uname -a
Linux cobalt 3.3.2-1-ARCH #1 SMP PREEMPT Sat Apr 14 10:08:43 UTC 2012 i686 Intel(R) Core(TM)2 Duo CPU P7550 @ 2.26GHz GenuineIntel GNU/Linux

It's in there (see highlighted part).

Or simply running "uname -m" should give you just that specific info.

Last edited by Gcool (2012-04-18 07:55:13)


Burninate!

Offline

#9 2012-04-18 07:55:35

keen90
Member
From: Europe
Registered: 2010-04-07
Posts: 106

Re: kernel issue on system clone

This might be a dumb question, but ist i686 the same as x86, the same as 32 bit?

$ grep CARCH /etc/makepkg.conf 
CARCH="i686"

Ok I guess I was looking for something like 32-bit

Ok then I am sure I am running the same architekture on both machines. (BTW, doing a netinstall on the second one now).
How can this happen that the result in differen kernel versions after a pacman -Suy on both machines? I mean the are using the same repo, right? So the should be running the same kernel.

EDIT:
Ok maybe i made a mistake last time because now they are both running exactly the same kernel after a
pacman -Suy
on both machines. Maybe I didn't set the same repos on both machines last time, that would be an explanation

Last edited by keen90 (2012-04-18 08:02:52)

Offline

#10 2012-04-18 08:04:56

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: kernel issue on system clone

You're running 32-bit, yes.

keen90 wrote:

How can this happen that the result in differen kernel versions after a pacman -Suy on both machines? I mean the are using the same repo, right? So the should be running the same kernel.

If both machines are using the same repos and mirror, this shouldn't happen. When using different mirrors, there's a chance that one is more up to date then the other and differences can occur. You can always consult the Mirror status page to have a look at which mirrors are up to date.


Burninate!

Offline

Board footer

Powered by FluxBB