Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] How to set up new hard drive to boot?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Carnildo
Guru
Guru


Joined: 17 Jun 2004
Posts: 594

PostPosted: Tue Jul 18, 2006 4:45 am    Post subject: [solved] How to set up new hard drive to boot? Reply with quote

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
View user's profile Send private message
Dieter@be
Guru
Guru


Joined: 03 Apr 2005
Posts: 314
Location: Wetteren, Belgium

PostPosted: Tue Jul 18, 2006 8:34 am    Post subject: Reply with quote

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
View user's profile Send private message
Carnildo
Guru
Guru


Joined: 17 Jun 2004
Posts: 594

PostPosted: Tue Jul 18, 2006 6:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
Dieter@be
Guru
Guru


Joined: 03 Apr 2005
Posts: 314
Location: Wetteren, Belgium

PostPosted: Tue Jul 18, 2006 9:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
jd2066
Apprentice
Apprentice


Joined: 04 Jun 2006
Posts: 155

PostPosted: Tue Jul 18, 2006 9:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
Carnildo
Guru
Guru


Joined: 17 Jun 2004
Posts: 594

PostPosted: Wed Jul 19, 2006 1:06 am    Post subject: Reply with quote

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
View user's profile Send private message
Carnildo
Guru
Guru


Joined: 17 Jun 2004
Posts: 594

PostPosted: Wed Jul 19, 2006 1:54 am    Post subject: Reply with quote

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
View user's profile Send private message
Carnildo
Guru
Guru


Joined: 17 Jun 2004
Posts: 594

PostPosted: Wed Jul 19, 2006 2:37 am    Post subject: Reply with quote

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
View user's profile Send private message
jd2066
Apprentice
Apprentice


Joined: 04 Jun 2006
Posts: 155

PostPosted: Wed Jul 19, 2006 3:01 am    Post subject: Reply with quote

You can use the gparted livecd at http://gparted.sourceforge.net/livecd.php to resize the partitions.
Justin
Back to top
View user's profile Send private message
Carnildo
Guru
Guru


Joined: 17 Jun 2004
Posts: 594

PostPosted: Wed Jul 19, 2006 4:13 am    Post subject: Reply with quote

I used the same install CD that I used to run lilo to resize the partition.
Back to top
View user's profile Send private message
Dieter@be
Guru
Guru


Joined: 03 Apr 2005
Posts: 314
Location: Wetteren, Belgium

PostPosted: Wed Jul 19, 2006 9:21 am    Post subject: Reply with quote

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
View user's profile Send private message
Carnildo
Guru
Guru


Joined: 17 Jun 2004
Posts: 594

PostPosted: Thu Jul 20, 2006 7:08 am    Post subject: Reply with quote

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
View user's profile Send private message
Dieter@be
Guru
Guru


Joined: 03 Apr 2005
Posts: 314
Location: Wetteren, Belgium

PostPosted: Thu Jul 20, 2006 7:44 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum