Find the answer to your Linux question:
Results 1 to 9 of 9
Information on the net seems very sparse or outdated for how to go about booting to a RAM disk. I need to be be able to boot a PC without ...
  1. #1
    Just Joined!
    Join Date
    Sep 2008
    Posts
    1

    Use initial RAM disk as root file system?

    Information on the net seems very sparse or outdated for how to go about booting to a RAM disk. I need to be be able to boot a PC without a hard drive in it. I want to be able to PXE boot a PC and supply it with a RAM disk image that also contains the contents of the root file system (obviously stripped down enough to keep the file size small and the boot up time fast).

    What I have gathered so far is that I need to extract the contents of the initrd.img file, add files as necessary, and repackage the initrd.img file. What I get confused on is how to configure the kernel line parameters to tell it to boot to RAM and not the hard drive and how to go about modifying the init script in the initrd.img to not switch to the hard drive for the root file system. I can't find anything on the net that describes concrete steps on how to go about accomplishing all of this. I'm aware of the existence of Live CD's, but I need to be able to boot the PC without relying on a hard drive, CD, or any other external media. It needs to get all of its contents from the PXE boot server and boot to RAM only. I have the PXE boot side configured successfully. Also, putting the root file system on a NFS share is also out of the question.

    Can anyone point me in the right direction for how to go about accomplishing this? Thanks so much!

  2. #2
    Linux Newbie theNbomr's Avatar
    Join Date
    May 2007
    Location
    BC Canada
    Posts
    150
    Get SLAX. It runs from a RAM disk, booting from a USB thumb drive. I was once able to extract all of it's bits, and put it on a network boot server, booting with PXE. There are recipes and procedures for adding your own applications.
    --- rod.
    Stuff happens. Then stays happened.

  3. #3
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    I don't think there is any way around having NFS serve up the filesystem. It will need to come from somewhere, the PXE server will only be sending the kernel boot parameters, and part of that will be the filesystem file. Why can you not have NFS? You already are using PXE which requires networking...

  4. #4
    Linux Newbie theNbomr's Avatar
    Join Date
    May 2007
    Location
    BC Canada
    Posts
    150
    Quote Originally Posted by coopstah13 View Post
    I don't think there is any way around having NFS serve up the filesystem. It will need to come from somewhere, the PXE server will only be sending the kernel boot parameters, and part of that will be the filesystem file. Why can you not have NFS? You already are using PXE which requires networking...
    There is a difference between having an NFS root filesystem, and having a RAM-based root with an NFS share mounted on it. I think Caldus wants the latter.

    To address more of his question, most systems that boot using an initrd eventually re-mount a disk based root filesystem. This is done with the pivot_root tool, which basically transfers the root from one filesystem to another, somehow without loosing track of what is mounted and what files are open.

    --- rod.
    Stuff happens. Then stays happened.

  5. #5
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    i have a TFTP server set up here, and the kernel and initrd are passed when the PXE boot is initialized, one of the kernel parameters points to the location of the filesystem on the network, which is a squashfs located on NFS. I'm curious how you can get the root filesystem from the PXE server though.

  6. #6
    Linux Newbie theNbomr's Avatar
    Join Date
    May 2007
    Location
    BC Canada
    Posts
    150
    First, you have to have a kernel that is built with NFS root capability. After that, it is as simple as having the NFS share provide all of the files. The bootloader specifies that the root is NFS, and also specifies the network address of the NFS server. The bootloader can supply a static IP, or can tell the kernel to get it's IP from a DHCP server. In the latter case, you get multiple DHCP queries, because the kernel does not automatically inherit its IP from the bootloader. Naturally, there are a few more details, but that is the basic premise.
    --- rod.
    Stuff happens. Then stays happened.

  7. #7
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    Which is exactly what I have said, just in a different way. My only point was that you can't get around having some NFS server at some point in the process, which the OP made it seem like there could be no NFS at all.

  8. #8
    Linux Newbie theNbomr's Avatar
    Join Date
    May 2007
    Location
    BC Canada
    Posts
    150
    No, not exacly. Your initrd can be served directly by the TFTP server as part of the PXE bootload system. No NFS required there. The initrd can be as large as you want, within the limit of system memory.
    --- rod.
    Stuff happens. Then stays happened.

  9. #9
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    OK, so you're suggesting to bundle the filesystem as part of the initrd then. You should have said that in the first place .

Posting Permissions

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