JP Vossen on 21 Oct 2007 18:36:52 -0000


[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


Date: Sat, 20 Oct 2007 19:39:55 -0400
From: Mike Leone <turgon@mike-leone.com>
Subject: Re: [PLUG] How best to replace old drive with new drive -
	problems	installing grub

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

Cool. As a side note, the reason this worked is that you already had the right dir structure. The order of operations that I listed originally is required if you are doing it with empty partitions (i.e., prep for copy); since e.g., "./boot/" will not exist, you have to create it before you can mount that volume into it.



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.

I don't remember getting this error. Oops, but I do now vaguely recall occasionally having some kind of issue, and installing grub interactively via:
$ grub
root (hd0,0)
find /grub/stage1
setup (hd0)


If the above works it will probably produce some "can't find here but did find there" and successful install messages.

Otherwise, does /dev exist in the chroot? If not, create it. (Likewise /proc, /sys, and anything else missing.) If that doesn't help, try the mount commands Dan previously mentioned. IIRC you have to do that before you do the chroot (someone correct me?):
mount -o bind /dev /mnt/hda1/dev
mount -o bind /proc /mnt/hda1/proc



Thoughts?

(there's reasons why I dislike computers ... :-))

Yeah, tell me about it. I am long past the time when fooling with hardware or the OS was "fun." Now I want that stuff to Just Work, which is why I use Debian when possible, like Matthew. :-)



(/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)
]

FWIW, I usually just make everything ext3.

Later,
JP
----------------------------|:::======|-------------------------------
JP Vossen, CISSP            |:::======|        jp{at}jpsdomain{dot}org
My Account, My Opinions     |=========|      http://www.jpsdomain.org/
----------------------------|=========|-------------------------------
Microsoft has single-handedly nullified Moore's Law.
Innate design flaws of Windows make a personal firewall, anti-virus
and anti-malware software mandatory. The resulting software arms race
has effectively flattened Moore's Law on hardware running Windows.
___________________________________________________________________________
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