Transferring Linux From PATA to SATA

Last week I picked up this Segate 320GB SATA hard drive for my MythTV box. I had a 120GB PATA drive I was replacing. Since SATA drives are treated as SCSI under linux, I knew it would be a little more involved than just copying the data and rebooting, so here’s what I did.

After physically installing the drive in the machine, I mainly followed this Hard Disk Upgrade Mini How-To. It provides the information you need to replace an existing PATA drive. It all also applies if you’re going from SATA to SATA or SCSI to SCSI.

After copying my data to the new drive and rebooting, it gets half way through and I get a kernel panic, which I expected. There was one line of the How-To that tipped me off to the right direction.

If you’re using a SCSI hard disk, you may have to add a line with initrd. See your existing file /etc/lilo.conf.

Well, I didn’t have to add a line, but I did have to rebuild my initrd image.

mkinitrd -d /new-disk/etc/mkinitrd
-o /new-disk/boot/initrd.gz -r /dev/sda2

I just used all of the existing settings in the mkinitrd.conf file. The -r parameter overrides the root partition setting.

Then just re-run lilo as shown in the How-To:

/sbin/lilo -C /new-disk/etc/lilo.conf

.. and that should do it. You can remove the old disk and reboot.

This entry was posted in Computers, Home Theatre PC. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s