[Techtalk] Installing XP without affectin Linux

Wim De Smet kromagg at gmail.com
Sat Apr 4 13:30:53 UTC 2009


On Sat, Apr 4, 2009 at 2:27 AM, David Sumbler <david at aeolia.co.uk> wrote:
> On 4 Apr 2009, at 12:48 AM, David Sumbler <david at aeolia.co.uk> wrote:
>> Help!
>> I got WinXP installed OK, booted from a Knoppix CD, then chroot-ed to
>> my Ubuntu root partition.
>> But when I run 'grub-install hd0' I get an error: "/dev/sda7: Not
>> found or not a block device."
>> After some experimenting, I found that the problem is that when I use
>> chroot the /dev/hda partitions can no longer be seen.
>> How can I get round this problem?
>> Incidentally, under Ubuntu the drive appears as /dev/sda, although in
>> grub's menu.lst it is hd0, as expected.
> Further to the above, I think I got around the problem by doing
> 'mknod /dev/hda7 b 3 7'.
> I then had a problem with /dev/null, but I seem to have got round that
> with 'rm /dev/null' which then allows grub to recreate it.
> I say "think" and "seem" because I'm not sure if it has really worked
> yet.  That is because I am now getting an error message: "The file /
> boot/grub/stage1 not read correctly."  That has me really stumped!
> Any ideas?  I really want my Ubuntu back!

Right, sorry, didn't think it all through and forgot about all that
when replying. You can mount procfs and your /dev inside the chroot,
making it easier to just plain run grub.

Suppose you've got hda7 mounted to /mnt/hda7 (I wouldn't mount it to
/mnt, personally). Just mount the procfs and /dev dir like this (as
mount -t procfs none /mnt/hda7/proc
mount -o bind /dev /mnt/hda7/dev

Then chroot and see if that works.


More information about the Techtalk mailing list