LinHES Forums
http://forum.linhes.org/

Boot failure on migration from PATA/IDE to SATA drive
http://forum.linhes.org/viewtopic.php?f=6&t=18729
Page 1 of 1

Author:  marc.aronson [ Sat Aug 09, 2008 5:59 pm ]
Post subject:  Boot failure on migration from PATA/IDE to SATA drive

I am attempting to migrate from a PATA boot drive to a SATA boot drive. I copy the image from the PATA drive to the SATA drive using driveimage 7, a technique I have used many times before with success. I boot the knoppmyth CD, choose quit and then:

0. mount /dev/sda1 so that it is writable, the chroot /mnt/sda1

1. edit lilo.conf and fstab so that the device names are changed from /devhda* to /dev/sda*

2. run lilo -v

3. reboot.

I get the following errors:

Code:
/linuxrc: Out of file descriptors
/etc/init: Out of file descriptors
Kernel panic - not syncing: Attempted to kill init!


I've done the forum searches and found various threads on this topic, but haven't found anything that solves the problem. Some additional info that I believe is important:

1. A clean install to the sata drive gives me a bootable system.

2. All use is Knoppmyth R5.5

3. There is no change of machine involved. I am using the same machine, which supports both PATA and SATA.

Any help would be greatly appreciated!

Marc

Author:  tjc [ Sun Aug 10, 2008 9:42 am ]
Post subject: 

Well I'm sure you can guess my recommendation so ...

What does bear repeating is that making an exact sector for sector copy of an existing HD image is often counter productive. Doing so tends to duplicate all sorts of suboptimal things (like fragmentation) even if the HDs are identical, and when they have different geometries the situation is even worse. You're far better off formatting and creating a FS appropriate for the new drive, doing a simple recursive copy in archive mode which will defrag the image while you're at it, and then reinstalling the boot loader.

Author:  marc.aronson [ Sun Aug 10, 2008 11:55 am ]
Post subject: 

tjc wrote:
Well I'm sure you can guess my recommendation so ...

What does bear repeating is that making an exact sector for sector copy of an existing HD image is often counter productive. Doing so tends to duplicate all sorts of suboptimal things (like fragmentation) even if the HDs are identical, and when they have different geometries the situation is even worse. You're far better off formatting and creating a FS appropriate for the new drive, doing a simple recursive copy in archive mode which will defrag the image while you're at it, and then reinstalling the boot loader.


Interesting.. Are you saying that the follow will work:

1. Boot system to be copied.

2. Attach new disk via USB connector.

3. Create ext3 file system in new disk.

4. Mount ext3 partition on new disk at /mnt/new-disk

5. cp -a / /mnt/new-disk

6. shutdown

7. Attached new disk to IDE or SATA chain.

8. Boot knoppmyth install CD. Choose "7-quit", do the usual "chroot" stuff and a "lilo -v".

That will do it?

In terms of image copy -- I've used driveimage to do this many times. You are correct that it preserves the fragmentation, but I suspect it deals with the geometry changes, as I haven't had a problem before and driveimage was designed to deal with migrating to a new disk. Based on what I've read, I suspect the current problem is that the SATA drivers aren't being loaded...

Marc

Author:  tjc [ Sun Aug 10, 2008 7:46 pm ]
Post subject: 

That's essentially what I meant. Other refinements... I'd connect the drive via SATA or eSATA if possible since it will speed the copies significantly. I'd also use cp -ax to copy each file system separately. This will avoid problems trying to copy the pseudo-filesystems such as /proc or the like.

You don't even need to reboot or use the CD to do the lilo install you can simply edit the /new/etc/lilo.conf (fix the "boot" and "root" settings) and use the -C flag to have it use that.

Author:  marc.aronson [ Sun Aug 10, 2008 9:43 pm ]
Post subject: 

tjc wrote:
You don't even need to reboot or use the CD to do the lilo install you can simply edit the /new/etc/lilo.conf (fix the "boot" and "root" settings) and use the -C flag to have it use that.


Just to be sure I understand -- Are you saying that I don't need to do the chroot stuff. Instead, if I've mounted the new root partition at "/new", I can simply "lilo -C /new/etc/lilo.conf", and lilo will update the boot sector of the new drive?

Marc

Author:  marc.aronson [ Mon Aug 11, 2008 12:39 am ]
Post subject: 

TJC, I gave it a try. When I run "lilo -v", I get the error
Code:
 "Fatal: raid_setup: ("/dev/sda")


Marc

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/