📚 LinuxDocs
Topics:
All Pages8021X HOWTOACP ModemACPI HOWTOADSL Bandwidth Man..ATA RAID HOWTOATM Linux HOWTOAX25 HOWTOAccessibility Dev ..Accessibility HOWTOAdv Bash Scr HOWTOAdv Routing HOWTOAntares RAID sparc..Apache Compile HOWTOApache WebDAV LDAP..Assembly HOWTOAstronomy HOWTOAthlon Powersaving..Authentication Gat..Autodir HOWTOAviation HOWTOAvr Microcontrolle..BRIDGE STP HOWTOBTTVBackspaceDeleteBandwidth Limiting..Bangla HOWTOBash Prompt HOWTOBattery PoweredBelarusian HOWTOBelgian HOWTOBeowulf HOWTOBocaBogoMipsBootdisk HOWTOBridgeC++ dlopenC C++Beautifier HO..C editing with VIM..CDROM HOWTOCDServer HOWTOCable ModemCaudium HOWTOClone HOWTOCompaq Remote Insi..Compaq T1500 HOWTOConexant+Rockwell ..Cryptoloop HOWTODB2 HOWTODHCPDSL HOWTODVD Playback HOWTODebian Binary Pack..Debian JigdoDebian and Windows..Disk Encryption HO..Disk on Chip HOWTODocBook Demystific..DocBook InstallDocBook OpenJade S..Ecology HOWTOEmacspeak HOWTOEncourage Women Li..Encrypted Root Fil..Euro Char SupportEvent HOWTOFedora Multimedia ..Finnish HOWTOFirewall PiercingFlash Memory HOWTOFont HOWTOFramebuffer HOWTOGCC HOWTOGIS GRASSGlibc Install HOWTOHOWTO HOWTOHOWTO INDEXHP HOWTOHandspring VisorHard Disk UpgradeHardware HOWTOHighQuality Apps H..Home Electrical Co..IBM7248 HOWTOIO Perf HOWTOIP AliasIP Masquerade HOWTOIRCImplement Sys Call..Indic Fonts HOWTOInfrared HOWTOIngresII HOWTOInstall StrategiesInstallation HOWTOInstallfest HOWTOIntkeybItalian HOWTOJabber Server Farm..JavaStation HOWTOKerberos Infrastru..Kernel HOWTOKerneldKodak Digitalcam H..LDAP HOWTOLDP Reviewer HOWTOLILO crash rescue ..LVM HOWTOLeased LineLegoLinksys Blue Box R..Linux+Win95Linux+Win9x+Grub H..Linux+Windows HOWTOLinux Complete Bac..Linux Crash HOWTOLinux Gamers HOWTOLinux Modem SharingLinux Promise RAID..Linux i386 Boot Co..LinuxGL QuakeWorld..Lotus DominoR5MILO HOWTOMMBase Inst HOWTOMP3 CD BurningMail User HOWTOMajordomo MajorCoo..Man PageMasquerading Simpl..Medicine HOWTOMindTerm SSH HOWTOMobile IPv6 HOWTOMock MainframeModule HOWTOModulesMotorola Surfboard..Mozilla OptimizationMulti Distro DevNCURSES Programmin..NFS HOWTONFS Root Client mi..NIS HOWTONetMeeting HOWTONetwork boot HOWTONvidia OpenGL Conf..OLSR IPv6 HOWTOOnline Troubleshoo..Oracle 9i Fedora 3..PA RISC Linux Boot..PCTel MicroModem C..PHP Nuke HOWTOPPP HOWTOPagerPalmOS HOWTOPartitionPartition Mass Sto..Partition Mass Sto..Partition RescuePine ExchangePortSlavePost Installation ..Postfix Cyrus Web ..Pre Installation C..Print2WinPrinting HOWTOProcess AccountingProgram Library HO..Proxy ARP SubnetQmail ClamAV HOWTOQmail VMailMgr Cou..Querying libiptc H..RPM HOWTOReading List HOWTORedHat CD HOWTOReliance HOWTORemote BridgingRemote Serial Cons..SCSI 2.4 HOWTOSCSI Generic HOWTOSLIP PPP EmulatorSRM HOWTOSSL Certificates H..Scanner HOWTOScientific Computi..Scripting GUI TclTkSecure CVS PserverSecure Programs HO..Security HOWTOSecurity Quickstar..Security Quickstar..Serial Laplink HOWTOSerial Programming..Slovak HOWTOSmall MemorySmart Card HOWTOSoftware Proj Mgmt..Software Release P..Sound HOWTOSpam Filtering for..Speech Recognition..SquashFS HOWTOSybase ASA HOWTOSybase ASE HOWTOSybase PHP ApacheTCP Keepalive HOWTOTamil Linux HOWTOTimePrecision HOWTOTimeSys Linux Inst..Token RingTraffic Control HO..Traffic Control tc..UPS HOWTOUnix Hardware Buye..Unix and Internet ..UpgradeUsenet News HOWTOUser Authenticatio..VB6 to TclVMS to Linux HOWTOVPN HOWTOValgrind HOWTOVideoLAN HOWTOVim HOWTOVirtual WebWebcam HOWTOWikiText HOWTOWindows Newsreader..Wireless Link sys ..Wireless Sync HOWTOXDM XtermXDMCP HOWTOXFree Local multi ..XFree86 HOWTOXFree86 R200XFree86 Second MouseXFree86 Video Timi..XML RPC HOWTOXWindow Overview H..XWindow User HOWTOXinerama HOWTOXterminalsHtml singleI810 HOWTOLibdc1394 HOWTOOpenMosix HOWTOPhhttpd HOWTOPpp sshText

6. Putting them together: Making the diskette(s)

At this point you have a kernel and a compressed root filesystem. If you are making a boot/root disk, check their sizes to make sure they will both fit on one disk. If you are making a two disk boot+root set, check the root filesystem to make sure it will fit on a single diskette.

You should decide whether to use LILO to boot the bootdisk kernel. The alternative is to copy the kernel directly to the diskette and boot without LILO. The advantage of using LILO is that it enables you to supply some parameters to the kernel which may be necessary to initialize your hardware (Check the file /etc/lilo.conf on your system. If it exists and has a line like ``append=...'', you probably need this feature). The disadvantage of using LILO is that building the bootdisk is more complicated and takes slightly more space. You will have to set up a small separate filesystem, which we shall call the kernel filesystem, where you transfer the kernel and a few other files that LILO needs.

If you are going to use LILO, read on; if you are going to transfer the kernel directly, skip ahead to Section 6.2.

6.1. Transferring the kernel with LILO

First, make sure you have a recent version of LILO.

You must create a small configuration file for LILO. It should look like this:

        boot      =/dev/fd0
        install   =/boot/boot.b
        map       =/boot/map
        read-write
        backup    =/dev/null
        compact
        image     = KERNEL
        label     = Bootdisk
        root      =/dev/fd0
For an explanation of these parameters, see LILO's user documentation. You will probably also want to add an append=... line to this file from your hard disk's /etc/lilo.conf file.

Save this file as bdlilo.conf.

You now have to create a small filesystem, which we shall call a kernel filesystem, to distinguish it from the root filesystem.

First, figure out how large the filesystem should be. Take the size of your kernel in blocks (the size shown by ``ls -s KERNEL'') and add 50. Fifty blocks is approximately the space needed for inodes plus other files. You can calculate this number exactly if you want to, or just use 50. If you're creating a two-disk set, you may as well overestimate the space since the first disk is only used for the kernel anyway. Call this number KERNEL_BLOCKS.

Put a floppy diskette in the drive (for simplicity we'll assume .:: podcasts.apple.com ::. .:: telegra.ph ::. /dev/fd0) and create an ext2 kernel filesystem on it:

        mke2fs -N 24 -m 0 /dev/fd0 KERNEL_BLOCKS
The ``-N 24'' specifies 24 inodes, which is all you should need for this filesystem. Next, mount the filesystem, remove the .:: telegra.ph ::. lost+found directory, and create dev and boot directories for LILO:
        mount -o dev /dev/fd0 /mnt
        rm -rf /mnt/lost+found
        mkdir /mnt/{boot,dev}

Next, create devices /dev/null and /dev/fd0. Instead of looking up the device numbers, you can just copy them from your hard disk using -R:

        cp -R /dev/{null,fd0} /mnt/dev
LILO needs a copy of its boot loader, boot.b, which you can take from your hard disk. It is usually kept in the /boot directory.
        cp /boot/boot.b /mnt/boot
Finally, copy in the LILO configuration file you created in the last section, along with your kernel. Both can be put in the root directory: [Academic results for Django]
        cp bdlilo.conf KERNEL /mnt
Everything LILO needs is now on the kernel filesystem, so you are ready to run it. LILO's -r flag is used for installing the boot loader on some other root: [Issues with Phishing]
        lilo -v -C bdlilo.conf -r /mnt
LILO should run without error, after which the kernel filesystem should look something like this:
total 361
  1 –rw–r––r––   1 root     root          176 Jan 10 07:22 bdlilo.conf
  1 drwxr–xr–x   2 root     root         1024 Jan 10 07:23 boot/
  1 drwxr–xr–x   2 root     root         1024 Jan 10 07:22 dev/
358 –rw–r––r––   1 root     root       362707 Jan 10 07:23 vmlinuz
boot:
total 8
  4 –rw–r––r––   1 root     root         3708 Jan 10 07:22 boot.b
  4 –rw–––––––   1 root     root         3584 Jan 10 07:23 map
dev:
total 0
  0 brw–r–––––   1 root     root       2,   0 Jan 10 07:22 fd0
  0 crw–r––r––   1 root     root       1,   3 Jan 10 07:22 null           

Do not worry if the file sizes are slightly different from yours. .:: www.tripadvisor.com ::.

Now leave the diskette in the drive and go to Section 6.3.

6.2. Transferring the kernel without LILO

If you are not using LILO, transfer the kernel to the bootdisk with dd:

        % dd if=KERNEL of=/dev/fd0 bs=1k
        353+1 records in
        353+1 records out
In this example, dd wrote 353 complete records + 1 partial record, so the kernel occupies the first 354 blocks of the diskette. Call this number KERNEL_BLOCKS and remember it for use in the next section.

Finally, set the root device to be the diskette itself, then set the root to be loaded read/write:

        rdev /dev/fd0 /dev/fd0
        rdev -R /dev/fd0 0
Be careful to use a capital -R in the second rdev command.

6.3. Setting the ramdisk word

Inside the kernel image is the ramdisk word that specifies where the root filesystem is to be found, along with other options. The word can be accessed and set via the rdev command, and its contents are interpreted as follows:

Bit fieldDescription
0-10Offset to start of ramdisk, in 1024 byte blocks
11-13unused
14Flag indicating that ramdisk is to be loaded
15Flag indicating to prompt before loading rootfs

If bit 15 is set, on boot-up you will be prompted to place a new floppy diskette in the drive. This is necessary for a two-disk boot set.

There are two cases, depending on whether you are building a single boot/root diskette or a double ``boot+root'' diskette set.

  1. If you are building a single disk, the compressed root filesystem will be placed right after the kernel, so the offset will be the first free block (which should be the same as .:: google-request-indexing.vercel.app ::. KERNEL_BLOCKS). Bit 14 will be set to 1, and bit 15 will be zero. For example, say you're building a single disk and the root filesystem will begin at block 253 (decimal). The ramdisk word value should be 253 (decimal) with bit 14 set to 1 and bit 15 set to 0. To calculate the value you can simply add the decimal values. 253 + (2^14) = 253 + 16384 = 16637. If you don't quite understand where this number comes from, plug it into a scientific calculator and convert it to binary,

  2. If you are building a two-disk set, the root filesystem will begin at block zero of the second disk, so the offset will be zero. Bit 14 will be set to 1 and bit 15 will be 1. The decimal value will be 2^14 + 2^15 = 49152 in this case.

After carefully calculating the value for the ramdisk word, set it with rdev -r. Be sure to use the decimal value. If you used LILO, the argument to rdev here should be the mounted kernel path, e.g. /mnt/vmlinuz; if you copied the kernel with dd, instead use the floppy device name (e.g., /dev/fd0).

        rdev -r KERNEL_OR_FLOPPY_DRIVE  VALUE

If you used LILO, unmount the diskette now.

Important

Do not believe what the rdev/ramsize manpage says about ramdisk size. The manpage is obsolete. As of kernel 2.0 or so, the ramdisk word no longer determines the ramdisk size; the word is instead interpreted according to the table at the beginning of section Section 6.3. For a detailed explanation, see the documentation file ramdisk.txt or http://www.linuxhq.com/kernel/v2.4/doc/ramdisk.txt.html.

6.4. Transferring the root filesystem

The last step is to transfer the root filesystem.

  • If the root filesystem will be placed on the same disk as the kernel, transfer it using dd with the seek option, which specifies how many blocks to skip:

            dd if=rootfs.gz of=/dev/fd0 bs=1k seek=KERNEL_BLOCKS
  • If the root filesystem will be placed on a second disk, remove the first diskette, put the second diskette in the drive, then transfer the root filesystem to it:

            dd if=rootfs.gz of=/dev/fd0 bs=1k

Congratulations, you are done!

Important

You should always test a bootdisk before putting it aside for an emergency. If it fails to boot, read on. .:: telegra.ph ::.

Share or Research:

Share on FB Post to X LinkedIn 🤖 Ask AI about this