View previous topic :: View next topic |
Author |
Message |
Carnildo Guru
Joined: 17 Jun 2004 Posts: 594
|
Posted: Tue Jul 18, 2006 4:45 am Post subject: [solved] How to set up new hard drive to boot? |
|
|
I'm replacing the boot hard drive on my computer with a larger one. How do I set things up so the computer will boot off the new hard drive? My current setup:
/dev/hda is my current boot drive. I'll be removing it and replacing it with the new hard drive
/dev/hdd is the new hard drive as currently connected to my computer. I'll be putting it in place of /dev/hda once it's set up to boot.
/dev/hda1: Win98 boot partition
/dev/hda2: Leftover partition from an old Linux install
/dev/hda3: Gentoo boot partition
/dev/hda4: Win98 data partition
/dev/hdb1: Gentoo usr/data partition
/dev/hdc1: WinXP partition
/dev/hdc2: Shared data partition
/dev/hdd1: Win98 boot partition on new hard drive
/dev/hdd2: Gentoo boot partition on new hard drive
/dev/hdd3: Win98 boot partition on new hard drive
/dev/hdd4: New partition -- I don't know what I'll do with it yet.
My lilo.conf file:
Code: | prompt
delay=100
timeout=100
menu-scheme="Yb:by:Wb:Yb"
boot=/dev/hda
default=gentoo-2.6.14
menu-title=" Pick one "
image=/boot/kernel-2.6.14-r2c
label=gentoo-2.6.14
read-only
root=/dev/hda3
append="gentoo=nodevfs video=vesafb:ywrap,mtrr,800x600-24@60 splash=verbose,fadein,theme:emergence CONSOLE=/dev/tty1"
initrd=/boot/fbsplash-emergence-800x600
image=/boot/kernel-2.6.14-r2b
label=gentoo-2.6.14b
read-only
root=/dev/hda3
append="gentoo=nodevfs video=vesafb:ywrap,mtrr,800x600-24@60 splash=verbose,fadein,theme:emergence CONSOLE=/dev/tty1"
initrd=/boot/fbsplash-emergence-800x600
image=/boot/memtest86/memtest.bin
label = Memtest86
other=/dev/hda1
label="Windows98"
table=/dev/hda
other=/dev/hdc1
label="WinXP"
master-boot
table=/dev/hdc |
Last edited by Carnildo on Wed Jul 19, 2006 2:58 am; edited 1 time in total |
|
Back to top |
|
|
Dieter@be Guru
Joined: 03 Apr 2005 Posts: 314 Location: Wetteren, Belgium
|
Posted: Tue Jul 18, 2006 8:34 am Post subject: |
|
|
dd if=/dev/oldone of=/dev/newone (this copies everything, including your mbr)
then position the new drive on the same place as the old one (primary master)
after that you can resize partitions and filesystems to use the extra space _________________ Nothing beats a ride on the Gentoo learning curve.
2 Gentoo Linux boxes - 2 Arch Linux boxes - Love all four
Say no to i386 binaries! -- Adopt an unanswered topic |
|
Back to top |
|
|
Carnildo Guru
Joined: 17 Jun 2004 Posts: 594
|
Posted: Tue Jul 18, 2006 6:35 pm Post subject: |
|
|
Will that work right? The new hard drive is 140GB larger than the old one, and will have a different partition layout. |
|
Back to top |
|
|
Dieter@be Guru
Joined: 03 Apr 2005 Posts: 314 Location: Wetteren, Belgium
|
Posted: Tue Jul 18, 2006 9:37 pm Post subject: |
|
|
sure ... with some clever use of fdisk and/or resizereiserfs/... whatever FS you use. _________________ Nothing beats a ride on the Gentoo learning curve.
2 Gentoo Linux boxes - 2 Arch Linux boxes - Love all four
Say no to i386 binaries! -- Adopt an unanswered topic |
|
Back to top |
|
|
jd2066 Apprentice
Joined: 04 Jun 2006 Posts: 155
|
Posted: Tue Jul 18, 2006 9:57 pm Post subject: |
|
|
Carnildo wrote: | Will that work right? The new hard drive is 140GB larger than the old one, and will have a different partition layout. |
I think doing "dd if=/dev/olddrive of=/dev/newdrive" would overwrite the partition layout and data on the new hard drive with a copy of the exact partition layout and data of the old hard drive.
You will have to use something like the Gparted livecd to resize the partitions on the new hard drive to use the rest of the space.
If you then swap the positions of the hard drives so the new one is where the old one was (Probably Primary master) then the computer should boot off it and work fine.
Note 1: I would run dd on a livecd instead of on Gentoo booted off the old hard drive. Then you can be sure it was a consistant copy and nothing changed on the old hard drive while it was being copyed.
Note 2: I have not tryed this so I don't know if it works right though I have used the Maxtor copy tools and I think it does the same thing as dd and resizing with gparted would do.
Justin |
|
Back to top |
|
|
Carnildo Guru
Joined: 17 Jun 2004 Posts: 594
|
Posted: Wed Jul 19, 2006 1:06 am Post subject: |
|
|
jd2066 wrote: | Note 1: I would run dd on a livecd instead of on Gentoo booted off the old hard drive. Then you can be sure it was a consistant copy and nothing changed on the old hard drive while it was being copyed. |
I wish I could. With four hard drives, I've got nowhere to put an internal CD-ROM, and my computer doesn't support booting off USB. |
|
Back to top |
|
|
Carnildo Guru
Joined: 17 Jun 2004 Posts: 594
|
Posted: Wed Jul 19, 2006 1:54 am Post subject: |
|
|
Well, that didn't work. Using 'dd' to copy everything over one partition at a time went just fine. Problem is, the active boot partition on the old hard disk was the now-vanished /dev/hda2, so I couldn't boot up. I'm currently running one hard drive short, on a Ubuntu LiveCD I had lying around. Unfortunately, it won't let me run lilo to set up the hard drive for booting (something about "Warning: '/proc/partitions' does not match '/dev' directory structure." "Fatal: Sorry, don't know how to handle device 0xfe01", so I'm pretty much stuck. I can stick the old hard drive in and boot from that, but it rather defeats the point of buying a new hard drive. |
|
Back to top |
|
|
Carnildo Guru
Joined: 17 Jun 2004 Posts: 594
|
Posted: Wed Jul 19, 2006 2:37 am Post subject: |
|
|
Fixed it. I used the Ubuntu LiveCD to make a Gentoo install CD, booted off the install CD, and ran lilo. Then, after a bit of excitement involving /etc/fstab still referring to /dev/hda3 rather than /dev/hda2, I managed to boot off the new hard drive. Still need to see about resizing partitions. |
|
Back to top |
|
|
jd2066 Apprentice
Joined: 04 Jun 2006 Posts: 155
|
|
Back to top |
|
|
Carnildo Guru
Joined: 17 Jun 2004 Posts: 594
|
Posted: Wed Jul 19, 2006 4:13 am Post subject: |
|
|
I used the same install CD that I used to run lilo to resize the partition. |
|
Back to top |
|
|
Dieter@be Guru
Joined: 03 Apr 2005 Posts: 314 Location: Wetteren, Belgium
|
Posted: Wed Jul 19, 2006 9:21 am Post subject: |
|
|
Carnildo wrote: | Well, that didn't work. Using 'dd' to copy everything over one partition at a time went just fine. Problem is, the active boot partition on the old hard disk was the now-vanished /dev/hda2, so I couldn't boot up. I'm currently running one hard drive short, on a Ubuntu LiveCD I had lying around. Unfortunately, it won't let me run lilo to set up the hard drive for booting (something about "Warning: '/proc/partitions' does not match '/dev' directory structure." "Fatal: Sorry, don't know how to handle device 0xfe01", so I'm pretty much stuck. I can stick the old hard drive in and boot from that, but it rather defeats the point of buying a new hard drive. |
i told you to swap the drives.. _________________ Nothing beats a ride on the Gentoo learning curve.
2 Gentoo Linux boxes - 2 Arch Linux boxes - Love all four
Say no to i386 binaries! -- Adopt an unanswered topic |
|
Back to top |
|
|
Carnildo Guru
Joined: 17 Jun 2004 Posts: 594
|
Posted: Thu Jul 20, 2006 7:08 am Post subject: |
|
|
Dieter@be wrote: | Carnildo wrote: | Well, that didn't work. Using 'dd' to copy everything over one partition at a time went just fine. Problem is, the active boot partition on the old hard disk was the now-vanished /dev/hda2, so I couldn't boot up. I'm currently running one hard drive short, on a Ubuntu LiveCD I had lying around. Unfortunately, it won't let me run lilo to set up the hard drive for booting (something about "Warning: '/proc/partitions' does not match '/dev' directory structure." "Fatal: Sorry, don't know how to handle device 0xfe01", so I'm pretty much stuck. I can stick the old hard drive in and boot from that, but it rather defeats the point of buying a new hard drive. |
i told you to swap the drives.. |
I did. What happened was that "lilo" on the old drive was installed on the boot record for the second partition. That partition didn't get copied over to the new drive -- it was a leftover from an old installation of Sorcerer Linux, and was too small to be of any use. Thus, no "lilo" on the new drive, and no boot. I couldn't boot from the old hard drive in the secondary slave position, either: it just hung at the end of POST. |
|
Back to top |
|
|
Dieter@be Guru
Joined: 03 Apr 2005 Posts: 314 Location: Wetteren, Belgium
|
Posted: Thu Jul 20, 2006 7:44 am Post subject: |
|
|
if you did the dd , it should have copied it all _________________ Nothing beats a ride on the Gentoo learning curve.
2 Gentoo Linux boxes - 2 Arch Linux boxes - Love all four
Say no to i386 binaries! -- Adopt an unanswered topic |
|
Back to top |
|
|
|