craeting a boot image when I don't have a floppy drive
Hi,
I've an RHEL AS 3 server of which I want to make a boot disk. But I dont have a floppy drive.Is there any way to create the boot image to a file name and later copy it to windows system and copy it to the floppy drive.Or is there any other solution. I tried mkbootdisk 2.4.21-4.EL (Because the man page said that if the device is not present ,it create a boot image with the name of the default image file, ie, /dev/fd0) But if gave error Please give a solution Thanking you in advance Jomy |
I had to use the size option as the default size of 1440 is too small for newer kernels.
Normally, you would put it directly onto a floppy with this command: Note: those are backticks ( ` ) and not single quotes ( ' ) mkbootdisk --device /dev/fd0 `uname -r` and using the size option, it looks like this ... mkbootdisk --size 1440 --device /dev/fd0 `uname -r` or mkbootdisk -- size 2880 --device /dev/fd0 `uname -r` Since you just want to make the image ( the size is still a problem ) mkbootdisk --device boot.img `uname -r` or using the size option... mkbootdisk --size 1440 --device boot.img `uname -r` or mkbootdisk --size 2880 --device boot.img `uname -r` There is also the possiblity of making an iso image... mkbootdisk --iso --device boot.img `uname -r` Note: the size 2880 is too big for the average floppy disk but a person might ask.. How are you going to use it anyway since you don't have a floppy disk? :) |
thanks. The command "mkbootdisk --device boot.img `uname -r` " worked but showed the size as 1.5M. the iso image "mkbootdisk --iso --device boot.img `uname -r`" gave me a message on the screen "size of boot image is 4 sectors --> No emulation. once created the boot image can I write on to a cd from another machine (with windows os)
Jomy |
Yes you should be able to use iso to create a bootable cdrom from Windows or better yet from Linux.
In Linux, use cdrecord . For example... cdrecord -v dev=0,0,0 -data boot.img Note: Use the command: cdrecord --scanbus to find out what your dev should be. Also, if you want to burn the image in a Windows program, you may have to use a different name for the image like boot.iso instead of boot.img |
Thank you very much. May I know why the message "size of boot image is 4 sectors --> No emulation " appeared on the screen although the image was created when I tried to create the iso image.
Jomy |
My guess is the program is automatically doing what you would have to type if you made a bootable cdrom iso without emulation ( without making a boot floppy first ) . For example...
mkisofs -R -b boot/grub/iso9660_stage1_5 -no-emul-boot \ -boot-load-size 4 -boot-info-table -o grub.iso iso |
Thank you very much . Your answers really helped me.
Jomy |
as an alternative howto burn grub to cdr is here
http://www.linuxquestions.org/questi...hreadid=237511 |
I am having the same trouble as jomy did, but am having a little more trouble resolving it.
Should I execute the command that homey mentions in post 6 (mkisofs -R -b....)? If so, I don't have /boot/grub/iso9660_stage1_5. What I would put in place of that (if anything?) Also, if I execute "mkbootdisk --device boot.img `uname -r` " I still get the disk full error. Specifically: ---------------------------------------- Formatting boot.img... done. Copying /boot/vmlinuz-2.4.21-27.0.1.ELsmp... done. Copying /boot/initrd-2.4.21-27.0.1.ELsmp.img... cp: writing `/tmp/mkbootdisk.Q74IJT/initrd.img': No space left on device done. Configuring bootloader... cat: write error: No space left on device cat: write error: No space left on device done. ---------------------------------------- Which, is the same error returned if I don't use the '--device' argument, and regardless of whether I specify '--size 1440' or not. I am not really sure what is going wrong here. Can anyone provide advice? Thanks very much! |
I just used that example to show what -no-emul-boot looks like. You don't need it when using mkbootdisk. The problem is that kernels are too large lately to fit onto a floppy disk. So, you have to make an iso image and put it onto a cdrom like this...
Where your cdrom device is found with the command: cdrecord --scanbus Code:
mkbootdisk --iso --device boot.iso `uname -r` Code:
fdformat /dev/fd0 |
After a bit of googling I found a way to make 2.8Mb bootable floppy images. Here is my script, feel free to adapt it to your needs!
#!/bin/sh # makes a pseudo 2.88 bootable floppy image for resq diskc etc # if [ -z $1 ]; then echo " " echo "type:-" echo "make_grub_boot_image vmlinuz.x.y.z" echo "Where vmlinuz.x.y.z is the kernel to use" echo " " echo "Output image is boot288.img" exit fi dd if=/dev/zero of=boot288.img bs=512 count=5760 # # associate the loop device with the image file # /sbin/losetup -d /dev/loop0 /sbin/losetup /dev/loop0 boot288.img # # set up filesystem # /sbin/mke2fs /dev/loop0 # # mount it # mount /dev/loop0 /mnt # # set up boot files # # #copy grub files and menu # cd /mnt mkdir boot cd boot # copy kernel cp /boot/$1 /mnt/boot mkdir grub cp /boot/grub/* /mnt/boot/grub cp /home/source/shell/grub.menu.floppy /mnt/boot/grub/grub.conf cd $h # # create the device map file # echo "(fd0) /dev/loop0">/tmp/dev.map cd /home/source/shell umount /mnt # # install grub # /sbin/grub --device-map=/tmp/dev.map --no-curses <<END device (fd0) boot288.img root (fd0) setup (fd0) END /sbin/losetup -d /dev/loop0 Grub.menu.floppy contains what I would like in my grub.conf. In my case it is:- # # This is copied to grub.conf when makeing boot floppies # # written 2nd May 2002 # title hda1 (linux) root (fd0) kernel /boot/vmlinuz ro root=/dev/hda1 title hda2 (linux) root (fd0) kernel /boot/vmlinuz ro root=/dev/hda2 title cdrom root (fd0) kernel /boot/vmlinuz ro root=/dev/hdc init=/sbin/recover title windows or dos partition 1 rootnoverify (hd0,0) chainloader +1 title windows or dos partition 2 rootnoverify (hd0,1) chainloader +1 title floppy ... hit enter after invalid system disk # note floppy is set to fd1 because on cd boot # fd0 is used by the boot image rootnoverify (fd1) chainloader +1 Again this can be adapted for your needs. I used this method to make myself a rescue cd. enjoy |
Hi homey,
Does your last post mean that the "size of boot image is 4 sectors --> No emulation " message doesn't matter? ie. that the output of mkbootdisk was successful (and I just have to burn the image to CD)? Thanks! |
Right, just go ahead and burn it to cdrom. Use an R/W if you are afraid of making coasters. :)
|
Excellent! Thanks homey; it worked fine.
But! Now I have another question regarding boot disks (CD's actually): My goal is to be able to boot completely off a CD so that I can fsck my hard drives. When I boot of my newly made CD it provides me with an opportunity to supply arguments to the linux kernel and then proceeds to boot off the hard drives as normal, mounting partitions, etc. Something I don't want it to do. My question is how I would go about creating a boot CD with enough of the OS on it to be able to fsck my hard drives? Thanks again! |
Good news clinton!
All of your previous efforts where a waste of time. :) The idea behind mkbootdisk is just making a boot floppy or cdrom which will get you back into your system. Since you want some minimal linux functions from the cdrom, there are a couple of ways to proceed. 1 ) get a live cd like Knoppix 2 ) get the Fedora rescue cd which has some basic linux functions like e2fsck and fdisk .... 3 ) Use mkcdrec to make a small livecd based on your kernel and busybox. I just stumbled onto #3 while checking into options for you. :) This is one sweet package and I think you aught to check it out. This program has several options, #1 is to make a basic livecd using your kernel and other options include making system backups and put them onto cdrom. I recommend downloading the gz package to someplace like /home and unpacking it there. That makes a folder called /home/mkcdrec. Change into that directory and run the command: make test to see what kind of programs are needed for this to proceed. Note: I used synaptic to install nasm and mt-st . Note: You need to check in the config.sh for any changes which relate to your system. When the make test doesn't pop any errors, you are ready to go. Just run the program with the command: make For a basic cdrom, select #1 The iso image is saved in your tmp folder Burn the image to cdrom with the command: cdrecord -v dev=0,0,0 -data /tmp/CDrec.iso Reboot and check it out. |
All times are GMT -5. The time now is 05:21 PM. |