Contents
- INDEX
- HP-UX Index
- Solaris
- Linux Index
- Other Unix types
- General Unix
- Unix Networking
- Unix Scripts
- Unix Databases
Associated Information
- none
Useful Links
- HOWTOs, FAQs, etc
- Linux Documentation Project
- Linux Sites Search Engine
- GNU free software sight
- Freshmeat software sight
- Linux Weekly News
- Linux Gazzette
- Caldera Openlinux knowledge d/base
- Corel Linux knowledge d/base
- Debian documentation
- Mandrake documentation
- Redhat Online Manuals
- Slackware FAQs
- SUSE support database
|
Changing your Linux Boot Diskette Image
Occassionally you may need to change the boot image on your Linux boot diskette.
For example, you may need to add a driver that is required to get a minimal system
running. In my case I required a RAID driver so the disks could be seen. This
procedure is based on the RedHat disribution but should work for any distribution.
- Use dd to make a copy of your boot diskette
- mount the new diskette
- Uncompress the boot image to disk, cd mountpoint;
gzip -dc initrd.img > /tmp/initrd.ext2
- mkdir /mnt/initrd
- The boot image is actually an ext2 filesystem, so mount this,
mount -o loop /tmp/initrd.ext2 /mnt/initrd
- Uncompress the boot image modules file to disk,
cd /mnt/initrd; gzip -dc modules/modules.cgz >
/tmp/modules.cpio
- mkdir /tmp/Modules; cd /tmp/Modules
- The modules file is actually a cpio image so you need to extract this to add more
modules, cpio -idumv < /tmp/modules.cpio
- Copy your extract modules into /tmp/Modules (NOTE: At this point you
may want to also remove any unnecessary drivers as space is often an issue with the
boot images).
- Recreate the CPIO image, cd /tmp/Modules;
find . | cpio -ov > /tmp/modules
- Compress the image, cd /tmp; gzip -S .cgz modules
- Copy the image back, cp modules.cgz /mnt/initrd/modules
- umount /mnt/initrd
- gzip -c /tmp/initrd.ext2 > /tmp/initrd.img
- cp /tmp/initrd.img /mnt/floppy (assuming
/mnt/floppy was were you originally mounted your floppy)
At this point you may well find that your new initrd.img won't fit on the diskette.
If you have this problem, you'll need to create a new smaller image file as follows:
- Create an empty file of a defined size (the count controls the size so adjust this
to the size you need),
dd if=/dev/zero of=filename bs=1024 count=1400
- Format the empty file as a filesystem,
mke2fs filename
- Mount it, mount -t ext2 -o loop filename
/mnt/mountpoint
- Remount your amended image, mount -o loop /tmp/initrd.ext2
/mnt/initrd
- Copy the amended image to the newly created image file,
cd /mnt/initrd; find . | cpio -dumpv /mnt/mountpoint
- umount /mnt/mountpoint
- gzip -c filename > initrd.img
- cp initrd.img /mnt/floppy
|