5

I'm trying to understand the Debian "booting from Hard Disk" installation manual.

The process is as follows: I copy a kernel image, a ramdisk initrd and an ISO with installer to the hard drive and then configure GRUB to start the kernel and ramdisk, but also I have to tell GRUB, where is the root filesystem (it should be located at the ISO), so that the kernel could pivot root to it. But the debian-supplied grub configurations seem to specify the whole hard drive as the root filesystem, not the ISO file within it:

GRUB1:

title  New Install
root   (hd0,0)
kernel /boot/newinstall/vmlinuz
initrd /boot/newinstall/initrd.gz

GRUB2:

menuentry 'New Install' {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
linux /boot/newinstall/vmlinuz
initrd /boot/newinstall/initrd.gz
}

Why would that work? Is GRUB so smart to mount the ISO file on the hard disk as root filesystem, not the whole hard disk? Or do I have to dd the contents of ISO right onto the hard disk? Debian is vague on this.

  • 3
    It's the kernel/initrd that loop mounts the ISO once booted, so GRUB is not involved. In case of the net installer it doesn't even need any ISO at all. – frostschutz Oct 1 '13 at 14:40
  • @frostschutz Why would kernel loop mount the ISO? How does it know, what to mount? – Boris Burkov Oct 1 '13 at 14:42
  • 3
    the initrd.gz (initramfs) contains the busybox userland and Debian scripts written to that purpose. GRUB2 also supports loop mounting ISO directly, but usually just to grab the kernel/initrd from the ISO itself, and once that's loaded again the ISO has to be found and loopmounted by the kernel/initrd. – frostschutz Oct 1 '13 at 14:55
  • @frostschutz Thanks so much, frostschutz, your post and this stuff mostly explains it: wiki.gentoo.org/wiki/Early_Userspace_Mounting. So, GRUB's root option only points to a folder, where GRUB stores its belongings, right? And what about the contents of /proc/cmdline, does it point to the Linux root filesystem, obtained from initramfs or GRUB root filesystem, obtained from GRUB config? Could you post your answer as an answer, not as a comment, so that I could accept it and close the question. – Boris Burkov Oct 1 '13 at 15:27
2

Copied from frostshutz comment:

the initrd.gz (initramfs) contains the busybox userland and Debian scripts written to that purpose. GRUB2 also supports loop mounting ISO directly, but usually just to grab the kernel/initrd from the ISO itself, and once that's loaded again the ISO has to be found and loopmounted by the kernel/initrd.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.