|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
|
Re: [PLUG] How best to replace old drive with new drive - problems installing grub
|
Hi
Ok this is an old thread but I also decided to clone a disk tonight.
Writing most of the stuff down that I can remember. Could have some
ideas useful to somebody later. In no particular order and might have
some errors and i wont be really sure until i yank the old drive out.
My target -- I decided to replace an IDE drive (/dev/hda) with a SATA
drive (/dev/sda). I really didnt like the way two drives are chained on
the one channel that the motherboard had.
so..
with /dev/sda still fresh,
1. create /dev/sda1 that is exacly the same size as /dev/hda1
2. reboot in single user
3. mount -o ro,remount /
4. dd from hda1 to sda1
5. fsck /dev/sda1
Now the tricky part (here is where I had to reboot many many times, so
this is a summary of what i think should have been done if i had only
one try)
mount /dev/sda1 /mnt/tmp/
edit /mnt/tmp/etc/fstab so that root points to /dev/sda1
edit /mnt/boot/grub/device.map # change /dev/hda to /dev/sda
edit /mnt/boot/grub/menu.lst # change kernel params root=whatever to
root=/dev/sda1
grub command line (this is where i googled the stuff and wrote it down
on my cellphone because it is so useful) (I think what this does is
pretend that /dev/sda is the first disk):
device(hd0) /dev/sda
root (hd0,0)
setup (hd0)
set bios to boot on the sata disk
now the machine is booting with root on /dev/sda1 and with the rest of
them still in /dev/hda. Usually i clone a filesystem one by one with
occasional /etc/fstab editing and reboots. For example i am
cloning /usr right now. I do not clone bit-by-bit for anything other
that root, what i do is
fdisk /dev/sda # create partition for /xyz
mkfs.ext3 # rarely used very fun to use command
mount /dev/sda2 /mnt/tmp/xyz
cd /
tar cvfp - xyz | ( cd /mnt/tmp/ && tar xvfp - ) # VERY DANGEROUS
I am now in a situation where update-grub and grub-install is not yet
clean (there is a UUID attribute of the partition that gets in the way
which i dont care about). Plus, there is the possibility of the machine
actually booting off the original disk still. Should be resolved when
i remove the original /dev/hda.
jondz
On Sat, 2007-10-20 at 19:39 -0400, Mike Leone wrote:
> So here's what I did:
>
> installed new HD
> booted knoppix in command line only (knoppix 2)
> mkdir /mnt/oldhd
> mkdir /mnt/oldhd/boot
> mkdir /mnt/oldhd/usr
> mkdir /mnt/oldhd/var
>
> mount /dev/hda5 /mnt/oldhd
> mount /dev/hda1 /mnt/oldhd/boot
> mount /dev/hda7 /mnt/oldhd/usr
> mount /dev/hda8 /mnt/oldhd/var
>
> chroot /mnt/oldhd
> /usr/sbin/grub-install hd0
>
> It said:
>
> Could not find device for /boot: not found or not a block device
>
> Had no errors mounting it; if I changed to it, I saw all the proper
> files in /boot.
>
> Thoughts?
>
> (there's reasons why I dislike computers ... :-))
>
>
> (/boot is ext2; all others are ext3. Not that it should matter; mount
> auto-figured out what the format was, else I wouldn't have seen anything)
> ]
> ___________________________________________________________________________
> Philadelphia Linux Users Group -- http://www.phillylinux.org
> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug
___________________________________________________________________________
Philadelphia Linux Users Group -- http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug
|
|