[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Wheezy: making a bootable HD with Grub



On Sun 26 Apr 2015 at 19:46:10 -0700, Ldten K wrote:

> On Sun, 4/26/15, Brian <ad44@cityscape.co.uk>  wrote:
> 
> > One of the partitions holds the kernel and initrd image. Another has the
> > files vmlinuz and initrd.img. 'ls ((hd0,msdos1)/' etc should help with
> > locating them. Where are they?
> 
> (hd0,msdos1) is my new boot partition and I copied all the files from
> my old boot partition to the new one. So, I expect the output would
> show all the files and directories that I copied:

'ls ((hd0,msdos1)/grub' to continue checking. Also, the command 'set'
should have a value for 'prefix' which points to a sensible location for
/boot/grub.

>   grub rescue> ls (hd0,msdos1)/
>   config-3.2.0-4-amd64  grub  initrd.img-3.2.0-4-amd64  lost+found  System.map-3.2.0-4-amd64  vmlinuz-3.2.0-4-amd64
> 
> What's not clear to me is how it helps me. Perhaps I could try to boot
> the system from grub rescue (see below)?

This was the direction we were heading in. But note that initrd.img and
vmlinuz are not on (hd0,msdos1) and that 'root=...' is an instruction to
the kernel telling it where to look for /sbin/init. GRUB understands
(hd0,msdos2); the kernel does not.

> grub> linux  (hd0,msdos1)/vmlinuz root=(hd0,msdos2)
> grub> initrd  (hd0,msdos1)/initrd.img
> grub> boot
> 
> Perhaps the system will boot this way. Then what? There's still the
> question of making the new HD bootable the normal way that remains.

Not only is there no TAB completion and command history but you have to
handle module loading yourself. 'insmod normal' and 'insmod linux' are
needed. Then, if (hd0,msdos2) holds /sbin/init, follow up with

 grub> linux  (hd0,msdos1)/vmlinuz-3.2.0-4-amd64 root=/dev/sda2
 grub> initrd  (hd0,msdos1)/initrd.img-3.2.0-4-amd64
 grub> boot

'grub-install' and 'update=grub' after booting would be first steps on
the road to recovery.


Reply to: