View previous topic :: View next topic |
Author |
Message |
endoalpha Tux's lil' helper
Joined: 29 Jun 2002 Posts: 101
|
Posted: Sun Jul 28, 2002 6:47 am Post subject: /boot linked to itself? |
|
|
Do I have an odd setup or is there a /boot/boot dir linked to '.'? In other words, I have: in my /boot dir
amdxp boot # ll
total 1602
-rw-r--r-- 1 root root 538849 Jul 10 18:10 System.map
lrwxrwxrwx 1 root root 1 Jul 27 16:08 boot -> .
-rw-r--r-- 1 root root 1076013 Jul 10 18:10 bzImage
drwxr-xr-x 2 root root 1024 Jul 10 18:21 grub
drwx------ 2 root root 12288 Jul 10 09:12 lost+found
drwxr-xr-x 2 root root 1024 Jul 17 22:54 memtest86
amdxp boot #
If i remove that /boot/boot link, I can't boot. (file not found error).
I don't quite understand.. kind of...
Can someone enlighten me a little? |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20054
|
Posted: Sun Jul 28, 2002 6:51 am Post subject: |
|
|
That is normal, I'm not sure why. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Sun Jul 28, 2002 6:57 am Post subject: |
|
|
kanuslupus wrote: | That is normal, I'm not sure why. |
To reduce the number of "GRUB doesn't work!" posts. Having that symlink means that even if you specify an extra /boot in the kernel path when you have a separate boot partition, GRUB will still find your kernel. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
friedmud Apprentice
Joined: 18 Apr 2002 Posts: 258 Location: Austin, TX USA
|
Posted: Sun Jul 28, 2002 7:06 am Post subject: |
|
|
I was waiting for someone other than me to notice this....
I noticed it on one of my first install trials - and I'm pretty sure I know why they do it too...
It all has to do with grub.
From the install doc:
Code: |
default 0
timeout 30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title=My example Gentoo Linux
root (hd0,0)
kernel /boot/bzImage root=/dev/hda3
|
NOTE: this explanation assumes you did a *mostly* default install.
First of all notice that you refer to root as (hd0,0) - that is the *boot* partition. This partition is the one that is actually mounted under /boot normally - BUT... IT ITSELF DOES NOT HAVE A BOOT DIRECTORY IN IT!
So - you see how you are referring to both the splashimage and the kernel as being in /boot ?? Grub starts looking in your boot partition for a directory called "boot" - but one actually doesn't exist - so instead we make a symlink back to the root of the boot partition and name it boot - so grub will look there for bzimage.
Does that make any sense???
Now the real question here is: WHY? Well, I think the reason is that people would get confused - because most people dont think about the fact that the boot partition is the only thing grub looks at - so grub doesn't know that it is normally mounted under /boot. So the correct line (if you wanted to do it without a symlink would be:
Code: |
kernel /bzImage root=/dev/hda3
|
But like I said this would confuse people because they would think that they need to put the kernel in the root of their filesystem (/) in order for grub to see it. So instead, to remain consistent - and so people wont ask to many questions they make a symlink.
OK - I know that was kind of convoluted - so what it comes down to is it is there to keep confusion to a minimum.
Hope That Helps....
Derek |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20054
|
Posted: Sun Jul 28, 2002 7:08 am Post subject: |
|
|
rac wrote: | To reduce the number of "GRUB doesn't work!" posts. | If it has, I'd hate to see how many there would be if they didn't do that. Interesting to know that 'trick' though. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
endoalpha Tux's lil' helper
Joined: 29 Jun 2002 Posts: 101
|
Posted: Sun Jul 28, 2002 7:46 am Post subject: |
|
|
friedmud and rac:
You are right on... When I rm the /boot/boot link, I had to cmdline grub to boot /bzImage... NOT /boot/bzImage..
I noticed this quite a while ago too, but never gave it much thought until i decided to delete /boot/boot, then I had to give it some quiet contemplation.... |
|
Back to top |
|
|
mksoft l33t
Joined: 28 May 2002 Posts: 844
|
Posted: Sun Jul 28, 2002 9:00 pm Post subject: |
|
|
That depends if you have /boot as a sepreate partition or not.
If yes, the kernel won't be in /boot/bzImage since there's not /boot dir on the /boot partition (for sake of argument /dev/hda), only on the root partition.
If not, the kernel will be in /boot/bzImage, since /boot is a directory on the root partition grub refers to.
If /boot points to itself, even if /boot is a seperate partition, the image (and stage files, menu.lst) can be found as well under /boot.
You can remove the symlink but make sure you have grub configured correctly. To prevent any confusion this solves it quite nicely (and elegant IMO). _________________ There's someone in my head but it's not me - Pink Floyd |
|
Back to top |
|
|
thor n00b
Joined: 18 Jul 2002 Posts: 25 Location: m-ger
|
Posted: Sun Jul 28, 2002 9:22 pm Post subject: |
|
|
i never had this symlink, so in my first time booting gentoo, grub didn`t find the splash- and bzImage and i edited it by cmdline in grub that kind (removing /boot). after it also in menu.lst and all went fine.
so my question is, why no symlink? probably because of not making 'mkdir boot' in /mnt/gentoo at setup. i unpacked the tarball and then mounted boot in now existing boot folder.
can you agree with this?
hde1=boot - hde2=/ - hde3=opt - hdg1=swap - hdg2=/home
sorry for my bad english
th. _________________ good things come to those who ....................... wait |
|
Back to top |
|
|
abhishek Retired Dev
Joined: 28 Jun 2002 Posts: 393 Location: Los Angeles, CA
|
Posted: Mon Jul 29, 2002 6:41 am Post subject: |
|
|
thor wrote: | i never had this symlink, so in my first time booting gentoo, grub didn`t find the splash- and bzImage and i edited it by cmdline in grub that kind (removing /boot). after it also in menu.lst and all went fine.
so my question is, why no symlink? probably because of not making 'mkdir boot' in /mnt/gentoo at setup. i unpacked the tarball and then mounted boot in now existing boot folder.
can you agree with this?
hde1=boot - hde2=/ - hde3=opt - hdg1=swap - hdg2=/home
sorry for my bad english
th. |
U should have mounted boot then unpacked the tarball, becuase the link is in the tarball. I formatted boot after extracting the tarball an had no link and ended up edinting menu.lst on the command line. |
|
Back to top |
|
|
|