LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-15-2005, 12:41 AM   #1
jomy
Member
 
Registered: Jul 2004
Location: UAE
Distribution: RedHat
Posts: 93

Rep: Reputation: 15
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
 
Old 01-15-2005, 11:00 PM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
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?
 
Old 01-15-2005, 11:41 PM   #3
jomy
Member
 
Registered: Jul 2004
Location: UAE
Distribution: RedHat
Posts: 93

Original Poster
Rep: Reputation: 15
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
 
Old 01-16-2005, 12:03 AM   #4
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
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
 
Old 01-16-2005, 12:23 AM   #5
jomy
Member
 
Registered: Jul 2004
Location: UAE
Distribution: RedHat
Posts: 93

Original Poster
Rep: Reputation: 15
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
 
Old 01-16-2005, 12:35 AM   #6
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
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
 
Old 01-16-2005, 01:00 AM   #7
jomy
Member
 
Registered: Jul 2004
Location: UAE
Distribution: RedHat
Posts: 93

Original Poster
Rep: Reputation: 15
Thank you very much . Your answers really helped me.

Jomy
 
Old 01-16-2005, 03:03 AM   #8
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
as an alternative howto burn grub to cdr is here
http://www.linuxquestions.org/questi...hreadid=237511
 
Old 01-25-2005, 07:07 PM   #9
clinton
Member
 
Registered: Oct 2003
Location: Vancouver
Distribution: RH Enterprise AS 3
Posts: 47

Rep: Reputation: 15
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!
 
Old 01-25-2005, 07:57 PM   #10
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
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`
cdrecord -v dev=0,0,0 -data boot.iso
Or you can make a grub boot floppy disk with these commands:
Code:
fdformat /dev/fd0
mke2fs -m 0 /dev/fd0

dd if=/boot/grub/stage1 of=/dev/fd0 bs=512 count=1
dd if=/boot/grub/stage2 of=/dev/fd0 bs=512 seek=1
 
Old 01-26-2005, 04:35 AM   #11
Lazarus
Member
 
Registered: Dec 2001
Location: Kent in UK
Distribution: Fedora 2
Posts: 170

Rep: Reputation: 30
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
 
Old 01-26-2005, 12:30 PM   #12
clinton
Member
 
Registered: Oct 2003
Location: Vancouver
Distribution: RH Enterprise AS 3
Posts: 47

Rep: Reputation: 15
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!
 
Old 01-26-2005, 12:38 PM   #13
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
Right, just go ahead and burn it to cdrom. Use an R/W if you are afraid of making coasters.
 
Old 01-26-2005, 01:05 PM   #14
clinton
Member
 
Registered: Oct 2003
Location: Vancouver
Distribution: RH Enterprise AS 3
Posts: 47

Rep: Reputation: 15
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!
 
Old 01-26-2005, 05:08 PM   #15
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Floppy Boot Image - Help Bobalternate Linux - Newbie 7 11-04-2005 07:39 AM
Boot floppy image for Fedora Core 2 Butterbroetchen Linux - Laptop and Netbook 22 01-03-2005 09:25 PM
What image file do I use for the boot floppy on Install??? sourlinux Linux - Newbie 8 10-15-2003 11:54 PM
craeting a boot floppy kaustav Linux - General 4 11-22-2002 12:48 PM
FreeBSD 4.5 boot floppy image glock19 Linux - General 0 03-01-2002 05:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration