Find the answer to your Linux question:
Page 5 of 16 FirstFirst 1 2 3 4 5 6 7 8 9 15 ... LastLast
Results 41 to 50 of 154
Dolda, It seems like /etc/modules is a Debian specific file. How do you load modules during boot time? Another question about initrd, what file does GRUB load using the initrd ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #41
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319

    Dolda,

    It seems like /etc/modules is a Debian specific file. How do you load modules during boot time?
    Another question about initrd, what file does GRUB load using the initrd command? I don't have any entries in my menu.lst (similar to grub.conf) but I recall in Redhat that it loaded something.
    The best things in life are free.

  2. #42
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    I don't load modules at boot time. I let them load on demand.
    What file GRUB loads? The one you specify, naturally?

  3. #43
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319
    Looking over the second reply on this topic
    Code:
    mkinitrd -f /boot/initrd-<kernel version>.img /lib/<kernelname>
    I guess this creates an initrd image of the kernel.
    1. I looked in my /lib directory and couldn't not find any files related to the kernel. Is this OK?
    2. What is the advantage of loading this in GRUB? I noticed that a lot of tutorials load initrd right after the kernel. On one of the last posts, you explained how initrd works. If the kernel is already loaded, what would be the use of loading the image file into memory?
    The best things in life are free.

  4. $spacer_open
    $spacer_close
  5. #44
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    1. Where did you get that they should be in /lib? The kernel images are normally in /boot, if you copy them there. The main thing is that it should be the uncompressed image of the kernel that you want to boot along with this initrd.

    2. Well, you can't load it in any other way than from GRUB or LILO. How else would you load it, do you mean? I believe that these tutorials refer to that the boot loader loads the initrd after it has loaded the kernel, but before it boots the kernel. LILO always loads the initrd after it has loaded the kernel. GRUB can load them in any order; it doesn't matter which one is loaded first.
    Why wouldn't there be a point in loading the initrd if the kernel is already loaded? The initrd is used by the kernel when it boots, not by the boot loader.

  6. #45
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319
    Dolda,

    1. The example is from the second post on this subject.
    2. The most common examples in GRUB uses the kernel command to load the kernel and then uses initrd to load the image file. What does your configuration look like? I know in mine I leave out the initrd option. If possible, can you perhaps explain this concept of kernel and initrd command in GRUB?
    The best things in life are free.

  7. #46
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    1. Well, I guess andutt keeps his kernel images in /lib, then. I don't know, but I do know that I don't; I keep mine in /boot.

    2. I don't use an initrd. My GRUB boot is just a standard root, kernel, boot. If you don't use an initrd, but mount your root partition immediately, you naturally don't need an initrd command for GRUB.
    What exactly is it that you want me to explain? Both commands basically just allocate a chunk of memory and loads the kernel image and an initrd into them. That's just about it. The kernel command can also specify the kernel command line. When the control is passed to the kernel, it is given the address at which the initrd was loaded.

  8. #47
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319
    1. I too keep my kernel images in the /boot directory. This isn't really important at all.
    2. Well, here's what my GRUB file looks like.
    Code:
    title Debian GNU/Linux
    root &#40;hd0,1&#41;
    kernel /vmlinuz-2.4.18-bf2.4 root=/dev/hda4
    The second partition on my primary IDE hard drive (hd0,1) is the boot partition I use. Back when I used to use Redhat, this is how it setup and I was too lazy to redo the partition. Exactly what is the benefit of using a boot partition?
    Now, as far as I understand GRUB, the kernel command in line 3 will load the kernel then mount /dev/hda4 as the root file system. In many examples, I see a line after line 3 including an initrd command and a kernel image. What I'm not understanding is if the kernel is already loaded (via line 3), why do people load the kernel image with initrd?
    The best things in life are free.

  9. #48
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Oh, I think that you may have misunderstood some things here.
    The kernel line only loads the kernel into memory, it doesn't run it. "root=/dev/hda4" only specifies to the kernel that it should mount /dev/hda4 as its root file system when it has completed its initialization and is ready to boot the system. It is not parsed by GRUB, only by the kernel, which has not started running at this point.
    The menu system in GRUB implicates a "boot" command after the last command in a menu entry. The boot command is what actually passes control to the kernel.
    So if you have something like this:
    Code:
    title Debian GNU/Linux
    root &#40;hd0,1&#41;
    kernel /vmlinuz
    initrd /initrd.gz
    It translates into this when GRUB boots it:
    Code:
    root&#40;hd0,1&#41;
    kernel /vmlinuz
    initrd /initrd.gz
    boot
    This is what happens when these commands are run:
    1. GRUB sets its root filesystem as the second partition of the first hard drive. This is only used by GRUB.
    2. It finds the file /vmlinuz on that partition, unzips it and loads it into a chunk of memory somewhere.
    3. It finds the file /initrd.gz on the same partition, unzips it and loads it into another chunk of memory.
    4. It writes the address if the unzipped initrd image into the kernel's setup space (in the memory chunk that it loaded the kernel in), sets the processor back into real mode, and then jumps to the beginning of the kernel's initialization code. The kernel then does its normal startup, including IP initialization, VFS initalization, block device initalization and so on. In the block device initialization, the ramdisk driver initializes the initrd device (major 1, minor 250) to use the address of the initrd image that GRUB passed it. The last step is that the kernel mounts the initrd and then creates a process that runs /linuxrc on that filesystem. /linuxrc is only used by initrds.

    If you don't use an initrd, the system skips the third step, ramdisk initialization and mounts the partition pointed to by the root= option that you passed to it via the kernel command line. It also runs /sbin/init instead of /linuxrc.


    As for the benefit of using a boot partition, it doesn't really exist anymore. In the old days when BIOSes didn't have LBA support, the boot loader (which accesses hard drives through the BIOS) could only access the first few MBs of the hard drive. Therefore, the kernel images had to be first on the hard drive, so you created a boot partition as the first partition on the drive to make sure that all files in /boot could be accessed through the BIOS.
    Today, when virtually all BIOSes support LBA, you don't really need it anymore.

  10. #49
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319
    Dolda,

    Would you possibly know what module I need to load for my USB mouse? As far as I can see, I've loaded every single module needed but the after X starts, the mouse doensn't move at all.
    The best things in life are free.

  11. #50
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319
    Dolda,

    Please disregard that last message. It looks like I have succeeded in kernel compilation. I finally have my joystick working along with this kernel and for once, the physical memory isn't as boggled up as it was with the other kernel.
    Although I am content with this kernel, I know that I saw some error messages during the boot up screen. Do you know if there is a way to log those info to a file so that I can read them and fix them?
    The best things in life are free.

Page 5 of 16 FirstFirst 1 2 3 4 5 6 7 8 9 15 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •