Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 17
How can i create a small bootable image(RAM-disk) that i can have for upgrade and installalation purpouses??. What i want to do is... Boot on this small image that includes ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796

    How can i create a bootable img??


    How can i create a small bootable image(RAM-disk) that i can have for upgrade and installalation purpouses??. What i want to do is...

    Boot on this small image that includes the basic drivers and start the nic. Then connect against a repository that have a kickstartfile that tells how tha filesystems should be build and creates the filesystems after the specs. And then installs the new packages accourding the kickstartfile.

    Have anybody done that??...
    Regards

    Andutt

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    What's wrong with the images shipped by RH?

  3. #3
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    I want to build an image/ramdisk with our specific drivers on that is bootable so i can have free hands partitioning,installing,upgrading on the server with just the needed drivers loaded (automaticly)...can i do that??
    How do i build a botable ramdisk?? mkisofs?? or can i create a specific /usr/lib/<bootstrap> directory with the specific modules and create a ramdisk with mkinitrd??

    Any ideas anybody??
    Regards

    Andutt

  4. #4
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    mkisofs? Are looking to build a bootable CD? I though you were going to make a boot floppy.
    I don't know if you know how the El-Torito boot scheme, so I guess I'll just explain it. Basically, you create a boot floppy image, then you put it in the CD file system, and you give the path to it, relative to the CD's root dir, and upon boot, the BIOS will emulate a floppy drive using that image.
    That means that the boot image must be exactly as large as a floppy disk (although it may be as large as a 2.88 MB floppy as well). However, essentially, you only need to put a boot loader and the kernel on it, and then make the kernel use the CD as its root filesystem. Then just write some startup scripts to put on the CD. You can, of course, use an initrd as well, if you really want the root filesystem to be R/W.

    Was there anything more that you wanted to know?

  5. #5
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    If i create an image with mkinitrd and put that on a floppy..will that work to boot on?? Without haveing anything else on the harddrives??
    Regards

    Andutt

  6. #6
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    That can boot, but you won't be able to actually do anything with it. The only that the initrds by mkinitrd can do is to load modules before the actual root file system is mounted, so you'll still need a root file system that will actually do something.
    You know, you don't need an initrd. If possible, just boot the real root file system directly.

  7. #7
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    Yes i know about mkinitrd...but if im starting to mount filesystems like the root filesystem then i´m not able to create new filesystems with fdisk for example,right??

    thats why i want to boot with somekind of ramdisk, that just starts everythig into memory and not touches the harddrives.
    Regards

    Andutt

  8. #8
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    You can mount a CD-ROM as the root file system. Then you can do anything you want to the hard drives.

  9. #9
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    Yes..ok but can i somehow create a local image?? i would prefer not to use any extern media to get to this stage. Just for easier administration.

    So when i want to upgrade my systems i just choose in lilo this upgradeimage.
    Regards

    Andutt

  10. #10
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Ah! Now I understand what you mean. That's an interesting thing to do, of course.
    In that case, it's pretty easy as well. Just create an initrd that contains everything you want, and add a LILO entry that loads it.
    Don't use mkinitrd to create it, just create a template (ie. that contains the files that should be on the initrd) for it somewhere in your home dir, then just run these to create the initrd:
    Code:
    dd if=/dev/zero of=/tmp/initrd bs=1024 count=8000
    mke2fs /tmp/initrd
    mount -o loop /tmp/initrd /mnt/initrd
    cp -a ~/initrd-template/* /mnt/initrd
    umount /mnt/initrd
    gzip -9 /tmp/initrd
    Then you'll have an initrd.gz in /tmp, that you can move to /boot and add to your lilo.conf. As you can see, this creates a filesystem that is 8 MBs, so just extend it if you need more.
    Just remember that when the kernel boots from an initrd, it doesn't use /sbin/init for the init process, but /linuxrc.
    I guess the easiest thing to do, though, might be to create an initrd that mounts an nfs filesystem as the root filesystem. Then you won't ever have to upgrade the initrd.

Page 1 of 2 1 2 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
  •