grub 2 - when / why I need both in grub.cfg ; set root= and search ... --set=root ...
Hi,
Could please somebody explain me what is the difference between commands ? Quote:
thank you, kind regards, M. |
The first one (set root=...) tells GRUB where to look for grub.cfg, the second one tells GRUB where (and how) to look for the root file system for the specific OS you're loading.
See info grub2 for more details. (If you've installed the info files - IIRC, Ubuntu and some other distributions do not install them by default.) |
Quote:
But WHY in grub.cfg each menuentry contains (I know that does not have to) set root= (in ubuntu generated) if grub.cfg is already loaded (when I am in grub shell prompt in edit mode I mean) ? (I went through https://wiki.archlinux.org/index.php/GRUB2 manual.) I am looking for more information. |
The "root file system for the OS" is not the GRUB2 "root." It is the location, usually "/", that the kernel needs to know in order to start the OS running. On a system with a single OS, those locations are often the same, but not always.
Here's an excerpt from my grub.cfg where you can see that (for that OS) it's on a different drive from the grub.cfg file. (Added comments in red.) Code:
menuentry 'Fedora 17 (/dev/md127)' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-207d8262-a705-4237-8cc6-f527fb3e34cc' { The point of all the above is that the GRUB designers wanted to support as many different booting scenarios as possible, so they tried to make as few assumptions as they could. (The "U" in "GRUB" stands for "unified," not "universal," but they wanted to be as "universal" as the technology available would let them be.) |
Quote:
Hi, Thanks a lot for explanation and patience - but I am not clear about it :-( and I did not find any load.cfg (or similar to it) file on my ubuntu instance. In my case I am using similar menuentry for ocz hard drive because proprietary company does not support linux at all - so kernel module does not exist - disk is not recognized in grub - and for that reason I cannot boot my raid0 from grub (not generating by update-grub at all) by "usual way" , but like following: menuentry " ... exp ... Ubuntu 3.2.0-27 rlraid0ocz[PCEUBU1:raid0ocz] apparmor" --class ubuntu --class gnu-linux --class gnu --class os { recordfail gfxmode $linux_gfx_mode insmod part_gpt insmod gzio insmod part_msdos insmod ext2 insmod raid # fixes software raid boot problem insmod mdraid insmod mdraid1x insmod mdraid09 set root='(hd2,msdos5)' #set root='(hd1,gpt6)' #set root='(/dev/md/PCEUBU1:raid0ocz)' search --no-floppy --fs-uuid --set=root ff504cbf-0446-4de6-a61b-65cc066dd9b7 #search --no-floppy --fs-uuid --set=root /dev/md/PCEUBU1:raid0ocz linux /boot/vmlinuz-3.2.0-27-generic root=UUID=20b7653b-199d-4565-821e-dda9ac0383e2 ro vga=799 $vt_handoff apparmor=1 security=apparmor crashkernel=384M-2G:64M,2G-:128M initcall_debug printk.time=y bootchart=disable verbose elevator=noop #init=/sbin/bootchartd rdinitrd=/sbin/bootchartd initrd /boot/initrd.img-3.2.0-27-generic } so ,grub is taken from different disk - MBR than OS instance - GPT is running from. (But in some cases I do not need to have set root=() - which I prefer - reason:it is more independent when reordering /dev/sdXY - which happened to me very often. - especially boot from external usb hard disk / usb pendrive, mc card , ...) (I have never seen --hint-bios and --hint-efi - something new :-) - is it for fedora grub specific ? Regards, |
Not exactly. Fedora 17 uses GRUB 2.0.0.37.beta6; Ubuntu uses GRUB 1.99.21ubuntu3.1 (in my Ubuntu 12.04 virtual system, updated today). I suspect that the beta version of the 2.0 release is at least slightly different from the older 1.99 version that Ubuntu modified for their last release. (And I have no idea what the Ubuntu developers might have modified in the pre-release version 1.99 of GRUB 2 for their system. I suppose I could look at the source code, but I don't feel like doing that.)
|
All times are GMT -5. The time now is 04:13 AM. |