zdisk

zdisk's purpose is to put a kernel of your choice and a rescue system on one 1.44 MB.
Download

zdisk Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Kent Robotti
  • Publisher web site:
  • http://www.ibiblio.org/pub/Linux/system/recovery

zdisk Tags


zdisk Description

zdisk's purpose is to put a kernel of your choice and a rescue system on one 1.44 MB. zdisk's purpose is to put a kernel of your choice and a rescue system on one 1.44 MB.Usage: ./zdisk -serial - -k path_to_kernel -i path_to_initrd_contents.tgz -m module_directory The default initrd contents are "-i rescue.tgz".Floppy instructions!Putting the rescue system on a 1.44mb or 1.722mb dos formatted floppy.Tell zdisk where the chosen kernel is, the kernel can't be more than 765Kb in size to fit on a 1.44mb formatted floppy, unless you reduce the size of the initrd contents.The kernel can't be more than 1040Kb in size to fit on a 1.722mb formatted floppy, unless you reduce the size of the initrd contents.This script will format the floppy to the needed size, if not already.The kernel must have ram disk and initial ram disk (initrd) support. The kernel config file should have something like this.# Block devices#CONFIG_BLK_DEV_RAM=yCONFIG_BLK_DEV_RAM_SIZE=4096CONFIG_BLK_DEV_INITRD=ySome possible paths to the kernel.# ./zdisk -fd -k /vmlinuz # ./zdisk -fd -k /boot/vmlinuz# ./zdisk -fd -k /usr/src/linux/arch/i386/boot/zImage# ./zdisk -fd -k /usr/src/linux/arch/i386/boot/bzImageIf you want to include any module(s) put the module(s) in a directory,and tell zdisk what directory they're in.# ./zdisk -fd -k /vmlinuz -m /foo/booThe above means zdisk will expect to find /foo/boo/module1.o /foo/boo/module2.o etc.Cdrom instructions!# ./zdisk -cd -k path_to_kernel -i path_to_initrd_contents.tgz -m module_directoryIf you want to put the rescue system on a cd disk, you'll need 'mkisofs' on your system to create the iso image.Since the bootable cd image can be as large as the cd capacity (about 650mb), you can add to the initrd contents 'rescue.tgz etc.'if you want to. Remember it has to be loaded into memory, 650mb compressed loaded into memory would require about 1300mb of ram.Just extract the initrd contents 'rescue.tgz etc.' and add to it,then tar gzip it.zdisk-2.14# mkdir rescue-cd # tar xzvpf rescue.tgz -C rescue-cd # cd rescue-cdFor example if you wanted to add bash, put bash in rescue-cd/binand the libraries it requires in rescue-cd/lib.# ldd /bin/bash libtermcap.so.2 => /lib/libtermcap.so.2 (0x40016000) libdl.so.2 => /lib/libdl.so.2 (0x4001b000) libc.so.6 => /lib/libc.so.6 (0x4001e000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)You can also create this link in `rescue-cd/bin# ln -sf bash sh'.If you wanted to add network support you would probably need at least./etc/protocols /etc/hosts /etc/services /etc/nsswitch.conf/lib/libresolv /lib/libnss_files /lib/libnss_dns /lib/libnss_compat/bin/hostname /sbin/ifconfig /sbin/routeAfter you add to it or make any changes, tar gzip it.rescue-cd# tar cvzpf ../rescue-cd.tgz *The initrd contents would then be "-i rescue-cd.tgz".Do this to create a bootable cd iso image of the rescue system.# ./zdisk -cd -k path_to_kernel -i path_to_initrd_contents.tgzThen you have to use a program like 'cdrecord' to write 'rescue.iso' to the cd disk.The example below assumes a scsi cd writer on device 0,6,0 with a 4x speed.# cdrecord -scanbus "To find the device your cd writer is on!"Cdrecord release 1.9 Copyright (C) 1995-2000 Jorg Schillingscsibus0:0,6,0) 'TOSHIBA ' 'XM-3401TASUNSLCD' '3593' Removable CD-ROMetc...# cdrecord -v speed=4 dev=0,6,0 rescue.isoIf you need to erase the cd-rw first.# cdrecord -v blank=fast speed=4 dev=0,6,0 rescue.isoGet the CD-Writing-HOWTO from: http://ibiblio.org/pub/Linux/docs/HOWTOYou can then boot the cd disk, if your bios supports it and is set to boot from the cdrom drive first.Initrd instructions!If you want to boot the linux system from a dos/win9x system on your hard drive, do this.# ./zdisk -initrd -i path_to_initrd_contents.tgz -m module_directory The above will create 'linux.gz' from initrd contents 'rescue.tgz etc.',you can then boot 'linux.gz' from your dos/win9x system using loadlin.Since this initrd image 'linux.gz' will be booted from your hard drive, it's size can be larger.Remember it has to be loaded into memory, 8mb compressed loaded into memory would require about 16mb of free ram etc. Create a directory on your dos/win9x system and put linux.gz, loadlin.exe, and a kernel in it.C: mkdir ramlinuxC:ramlinuxlinux.gzC:ramlinuxkernelC:ramlinuxloadlin.exeBoot it!You can't boot linux in windows, quit windows and restart in dos mode.Dos mode is when windows is closed and all you have is a C: prompt.C:ramlinux> loadlin kernel initrd=linux.gz ramdisk_size=8192 root=/dev/ram0 rwYou can create a 'linux.bat' file with this below in it.@echo offloadlin kernel initrd=linux.gz ramdisk_size=8192 root=/dev/ram0 rwC:ramlinux> linuxThe ramdisk size is the amount of RAM required to hold theuncompressed initrd image 'linux.gz'.The zdisk script will tell you this when it creates linux.gz.Image instructions!# ./zdisk -image -k path_to_kernel -i path_to_initrd_contents.tgz -m module_directoryIf you want to create a 1.44mb or 1.722mb bootable image version that can be written to a floppy, the first zdisk option should be '-image'.Serial console instructions!If you want to use a serial console the first option shuld be '-serial'.# ./zdisk -serial -fd -k path_to_kernel -i path_to_initrd_contents.tgz -m module_directory


zdisk Related Software