Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > Linux Newbie > How can i create a bootable img??

Forgot Password?
 Linux Newbie   If you're new to the wonderful world of Linux, start here!

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds


Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 08-08-2003   #1 (permalink)
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
andutt is offline  


Reply With Quote
Old 08-08-2003   #2 (permalink)
Linux Guru
 
Join Date: Oct 2001
Location: Täby, Sweden
Posts: 7,578
What's wrong with the images shipped by RH?
Dolda2000 is offline   Reply With Quote
Old 08-08-2003   #3 (permalink)
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
andutt is offline   Reply With Quote
Old 08-08-2003   #4 (permalink)
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?
Dolda2000 is offline   Reply With Quote
Old 08-08-2003   #5 (permalink)
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
andutt is offline   Reply With Quote
Old 08-08-2003   #6 (permalink)
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.
Dolda2000 is offline   Reply With Quote
Old 08-09-2003   #7 (permalink)
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
andutt is offline   Reply With Quote
Old 08-09-2003   #8 (permalink)
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.
Dolda2000 is offline   Reply With Quote
Old 08-10-2003   #9 (permalink)
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
andutt is offline   Reply With Quote
Old 08-10-2003   #10 (permalink)
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.
Dolda2000 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 08:10 AM.






© 2000 - 2009 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.0 RC2