You are not logged in.

#1 2006-10-31 00:05:55

nordlicht
Member
From: Hamburg/Germany
Registered: 2003-07-23
Posts: 62

kernel panic after moving fron hda to sda

Hi

I try to move my system from hda to sda.
The first Problem occoured is solved http://bbs.archlinux.org/viewtopic.php?t=26417. Thanx to Romashka and Penguin!

But now ther is the next Problem.

I copyed
hda1 to sda1
hda2 was swap
hda3 was root an is now sda6 for root and sda7 for /var

Problem 1:
sda is on SATA1 on the Mainboard (Asus A8N-SLI)
grub says it is hd0 but linux says it is sdb

Problem2:
my my menu.1st looks like:

root (hd0,5)
kernel (hd0,0)/vmlinuz26 root=/dev/sdb6 vga=791 ro
initrd (hd0,0)/kernel26.img

the bootprocess is normal while it is inside the initcpio
but then...

...
:: Initramfs Completed - control passing to kinit
IP-Config: no devices to configure
XFS mounting filesystem sdb6
kinit: Mounted root (xfs filesystem) readonly.
kinit: opening console: Read-only file system
Kernel panic - not syncing: Attempted to kill init!

whats going on there?

I tried to change the divice.map file but always the same wrong maping.
I tried to delete the device.map but nothing changes.

Any Ideas what I have to do to fix my system?

I can boot my system from The ata disk without any problems. BTW, sure I have changed my fstab.

thank you for helping me


Chris

Offline

#2 2006-10-31 01:22:56

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: kernel panic after moving fron hda to sda

did you try to regenerate your initcpio image? Can't remember the exact command for that off hand, something like mkinitcpio -g /boot/kernel26.img. You can reinstall your kernel and it will automatically do it. Be sure sata and auto(?) is listed in the hooks array. Remember there is a fallback image you can use which has everything included in it. kernel26-fallback.img or something like that.

Offline

#3 2006-10-31 08:01:51

nordlicht
Member
From: Hamburg/Germany
Registered: 2003-07-23
Posts: 62

Re: kernel panic after moving fron hda to sda

Hi

I regeneraeted the initcpio many times. Now I have everything inside the image I can imagine and the error occours aftersuccsessfull execution of the cpio image.

chris

Offline

#4 2006-10-31 08:03:10

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: kernel panic after moving fron hda to sda

Random guess - can you remove 'ro' from your kernel line and see if anything changes?

Offline

#5 2006-10-31 08:17:13

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: kernel panic after moving fron hda to sda

You didn't provide the commands that you used to copy the files, but I guess you broke something while copying it. Cloning a system has to be done VERY carefully. If you use the wrong commands, you end up with broken permissions (setuid and setgid bits lost) and device node being regular files. This is what happened to you:

Although udev creates most device nodes in a ramfs, there have to be some device nodes on your real filesystem. Most important of them is /dev/console:

kinit: opening console: Read-only file system

kinit tries to open /dev/console for writing, but as it is a regular file now, it claims that the filesystem is readonly.
You have to recreate the /dev/{console,null,zero} devices on your real root filesystem properly (using mknod). But I guess your system will be broken anyway, as you most likely also lost other special files and permissions that you need to run.

Offline

#6 2006-10-31 08:25:33

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,893
Website

Re: kernel panic after moving fron hda to sda

Did you keep your data on old drive hda1?

As has been said you cannot copy hda1 to sda1

Can you not put hda1 (old drive) into system and try again?

my2c


Mr Green

Offline

#7 2006-10-31 09:01:49

nordlicht
Member
From: Hamburg/Germany
Registered: 2003-07-23
Posts: 62

Re: kernel panic after moving fron hda to sda

Hi

sure, I still have my old data!
Thats a mistake thats I will never do again.

I now try to copy the data with cp -a with a cd linux.


chris

Offline

#8 2006-10-31 09:14:06

Mefju
Member
From: Poland
Registered: 2006-07-12
Posts: 104

Re: kernel panic after moving fron hda to sda

I'm using mc for copying data from one partition to another. It always works for me.

Offline

#9 2006-10-31 09:39:31

nordlicht
Member
From: Hamburg/Germany
Registered: 2003-07-23
Posts: 62

Re: kernel panic after moving fron hda to sda

mc was what I used first too :-)

Offline

#10 2006-10-31 10:35:07

nordlicht
Member
From: Hamburg/Germany
Registered: 2003-07-23
Posts: 62

Re: kernel panic after moving fron hda to sda

thank you!

It works!

Offline

#11 2006-10-31 11:55:37

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,893
Website

Re: kernel panic after moving fron hda to sda

Reiser4FShowto

It may help a bit


Mr Green

Offline

#12 2006-10-31 12:26:49

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: kernel panic after moving fron hda to sda

For future reference, the way to use cp to transfer data:
1) boot into a live cd or switch down to single user mode (telinit S)
2) mount it read-only: mount -o ro /dev/hdxy /mnt/hdxy or  mount -o remount,ro /dev/hdxy
3) use the cp command with the preserve switch to retain ownership and permissions with the recursive switch: cp -rp /mnt/hdxy /mnt/sdxy  or cp -rp / /mnt/sdxy

The best way is to use dd which will copy your data block for block. The only downside is that your target partion must be the same size or larger for it to work. In this case use a live cd and do not mount either partition. Issue the following command:
dd if=/dev/hdxy of=/dev/sdxy bs=4096 conv=noerror,notrunc
Be sure not to mess up the order of if and of - if is your source (input file) while of is your target (output file).

Offline

#13 2006-10-31 12:57:10

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,893
Website

Re: kernel panic after moving fron hda to sda

Am interested in this because I want to be able to back up my /home dir. but was getting those link errors using cp -ax

Got to add a partiton so I wanted to resize /home....

emmm


Mr Green

Offline

#14 2006-10-31 14:42:18

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: kernel panic after moving fron hda to sda

Nothing beats rsync on the file-level; if you want to be even more accurate it has to be block-level and dd.


1000

Offline

#15 2007-03-19 08:56:32

sandstorm
Member
From: Zurich [CH] & Mannheim [DE]
Registered: 2005-08-13
Posts: 169

Re: kernel panic after moving fron hda to sda

Easy: adapt your /etc/fstab to the new location big_smile

Martin

Offline

Board footer

Powered by FluxBB