Frequently Asked Question (FAQ) list

The Linux Bootdisk HOWTO
Prev |  | Next

# 12. Frequently Asked Question (FAQ) list

Q: I boot from my boot/root disks and nothing happens. What do I do?
Q: How does the Slackware/Debian/RedHat bootdisk work?
Q: How do I use higher-density (> 1440K) diskettes? How do I figure out which densities will work with my diskette drive?
Q: How do I increase the size of my ramdisks?
Q: How do I make bootable CD-ROMs?
Q: How do I make bootable LS-120 disks?
Q: How can I make a boot disk with a XYZ driver?
Q: How do I update my root diskette with new files?
Q: How do I remove LILO so that I can use DOS to boot again?
Q: How can I boot if I've lost my kernel and my boot disk?
Q: How can I make extra copies of boot/root diskettes?
Q: How can I boot without typing in “ahaxxxx=nn,nn,nn” every time?
Q: At boot time, I get error “`A: cannot execute B`”. Why?
Q: My kernel has ramdisk support, but initializes ramdisks of 0K. Why?

Q: I boot from my boot/root disks and nothing happens. What do I do?

A: See Section 7, above.

Q: How does the Slackware/Debian/RedHat bootdisk work?

A: See Section 10, above.

Q: How do I use higher-density (> 1440K) diskettes? How do I figure out which densities will work with my diskette drive?

A: See Section Section 8, above, for the comments by Alain Knaff on this subject. His is the most authoritative answer I know of.

Q: How do I increase the size of my ramdisks?

A: This probably should be explained better in the text, but I'll put an answer here for the time being.

First, do not attempt to use the `rdev` or `ramsize` commands to do this, no matter what their documentation says. The ramdisk word no longer determines the size of ramdisks.

Second, keep in mind that ramdisks are actually dynamic; when you set a ramdisk size you aren't allocating any memory, you're just setting the limit of how large it can grow. Don't be afraid to set these fairly large (eg, 8 or even 16 meg). The RAM space is not actually consumed until you need it. You can set these limits in one of several ways.

1. Use the `ramdisk_size=NNN` command line parameter. You can either enter this manually or use a command like `append="ramdisk_size=NNN"` with LILO.

2. If you're using LILO, you can use a kernel option like `ramdisk=8192K` in the `lilo.conf` file.

3. Change the kernel configuration option `CONFIG_BLK_DEV_RAM_SIZE` and recompile your kernel.

Q: How do I make bootable CD-ROMs?

A: See section Section 11.

Q: How do I make bootable LS-120 disks?

A: Since I don't have an LS-120 drive, the following information is summarized from information provided by Dave Cinege from the Linux Router Project.

The LS-120 is an IDE floppy drive. It is compatible with both standard 3.5" disks and the new 120MB disks. As of Linux v2.0.31 there is full support. To be able to boot from these you must have a BIOS that specifically allows the LS-120 to be treated as drive 0 (whereas IDE devices normally start at 80). If you do not have BIOS support, you can purchase a small IDE FloppyMAX card from Promise Technologies to overcome this deficiency.

The kernel boot loader does not like the LS-120, and instantly dies. Also 2m disks do not like it and will not boot. 1.44MB through 1.74MB disks will work fine. SYSLINUX works with the 120MB disks as of v1.32. You would better off partitioning the disk and using ext2 or minix, instead of SYSLINUX unless you need MS-DOS compatibility.

LILO does work fine with 120MB disks. Here is a sample lilo.conf:

            boot=/dev/hda
            compact
            disk=/dev/hda bios=0
            install=/floppy/boot.b
            map=/floppy/map
            image=/floppy/linux
            label=Linux
            append="load_ramdisk=1"
            initrd=/floppy/root.bin
            ramdisk=8192

The line "disk=/dev/hda bios=0" is what does the trick to make it boot the LS-120.

Q: How can I make a boot disk with a XYZ driver?

A: The easiest way is to obtain a Slackware kernel from your nearest Slackware mirror site. Slackware kernels are generic kernels which atttempt to include drivers for as many devices as possible, so if you have a SCSI or IDE controller, chances are that a driver for it is included in the Slackware kernel.

Go to the `a1` directory and select either IDE or SCSI kernel depending on the type of controller you have. Check the xxxxkern.cfg file for the selected kernel to see the drivers which have been included in that kernel. If the device you want is in that list, then the corresponding kernel should boot your computer. Download the xxxxkern.tgz file and copy it to your boot diskette as described above in the section on making boot disks.

You must then check the root device in the kernel, using the command rdev zImage. If this is not the same as the root device you want, use rdev to change it. For example, the kernel I tried was set to `/dev/sda2`, but my root SCSI partition is `/dev/sda8`. To use a root diskette, you would have to use the command rdev zImage /dev/fd0.

If you want to know how to set up a Slackware root disk as well, that's outside the scope of this HOWTO, so I suggest you check the Linux Install Guide or get the Slackware distribution. See the section in this HOWTO titled ``References''.

Q: How do I update my root diskette with new files?

A: The easiest way is to copy the filesystem from the rootdisk back to the DEVICE you used (from Section 4.2, above). Then mount the filesystem and make the changes. You have to remember where your root filesystem started and how many blocks it occupied:

            dd if=/dev/fd0 bs=1k skip=ROOTBEGIN count=BLOCKS | gunzip > DEVICE
            mount -t ext2 DEVICE /mnt

After making the changes, proceed as before (in Section 4.7) and transfer the root filesystem back to the disk. You should not have to re-transfer the kernel or re-compute the ramdisk word if you do not change the starting position of the new root filesystem.

Q: How do I remove LILO so that I can use DOS to boot again?

A: This is not really a Bootdisk topic, but it is asked often. Within Linux, you can run:

            /sbin/lilo -u

You can also use the dd command to copy the backup saved by LILO to the boot sector. Refer to the LILO documentation if you wish to do this.

Within DOS and Windows you can use the DOS command:

            FDISK /MBR

MBR stands for Master Boot Record. This command replaces the boot sector with a clean DOS one, without affecting the partition table. Some purists disagree with this, but even the author of LILO, Werner Almesberger, suggests it. It is easy, and it works.

Q: How can I boot if I've lost my kernel and my boot disk?

A: If you don't have a boot disk standing by, probably the easiest method is to obtain a Slackware kernel for your disk controller type (IDE or SCSI) as described above for ``How do I make a boot disk with a XXX driver?''. You can then boot your computer using this kernel, then repair whatever damage there is.

The kernel you get may not have the root device set to the disk type and partition you want. For example, Slackware's generic SCSI kernel has the root device set to `/dev/sda2`, whereas my root Linux partition happens to be `/dev/sda8`. In this case the root device in the kernel will have to be changed.

You can still change the root device and ramdisk settings in the kernel even if all you have is a kernel, and some other operating system, such as DOS.

rdev changes kernel settings by changing the values at fixed offsets in the kernel file, so you can do the same if you have a hex editor available on whatever systems you do still have running -- for example, Norton Utilities Disk Editor under DOS. You then need to check and if necessary change the values in the kernel at the following offsets:

    HEX     DEC  DESCRIPTION
    0x01F8  504  Low byte of RAMDISK word
    0x01F9  505  High byte of RAMDISK word
    0x01FC  508  Root minor device number - see below
    0X01FD  509  Root major device number - see below

The interpretation of the ramdisk word was described in Section 6.3, above.

The major and minor device numbers must be set to the device you want to mount your root filesystem on. Some useful values to select from are:

    DEVICE          MAJOR MINOR
    /dev/fd0            2     0   1st floppy drive
    /dev/hda1           3     1   partition 1 on 1st IDE drive
    /dev/sda1           8     1   partition 1 on 1st SCSI drive
    /dev/sda8           8     8   partition 8 on 1st SCSI drive

Once you have set these values then you can write the file to a diskette using either Norton Utilities Disk Editor, or a program called rawrite.exe. This program is included in all distributions. It is a DOS program which writes a file to the ``raw'' disk, starting at the boot sector, instead of writing it to the file system. If you use Norton Utilities you must write the file to a physical disk starting at the beginning of the disk.

Q: How can I make extra copies of boot/root diskettes?

A: Because magnetic media may deteriorate over time, you should keep several copies of your rescue disk, in case the original is unreadable.

The easiest way of making copies of any diskettes, including bootable and utility diskettes, is to use the dd command to copy the contents of the original diskette to a file on your hard drive, and then use the same command to copy the file back to a new diskette. Note that you do not need to, and should not, mount the diskettes, because dd uses the raw device interface.

To copy the original, enter the command:

            dd if=DEVICENAME of=FILENAME

where DEVICENAME is the device name of the diskette drive and FILENAME is the name of the (hard-disk) output file. Omitting the `count` parameter causes dd to copy the whole diskette (2880 blocks if high-density).

To copy the resulting file back to a new diskette, insert the new diskette and enter the reverse command:

            dd if=FILENAME of=DEVICENAME

Note that the above discussion assumes that you have only one diskette drive. If you have two of the same type, you can copy diskettes using a command like:

            dd if=/dev/fd0 of=/dev/fd1

Q: How can I boot without typing in “ahaxxxx=nn,nn,nn” every time?

A: Where a disk device cannot be autodetected it is necessary to supply the kernel with a command device parameter string, such as:

            aha152x=0x340,11,3,1

This parameter string can be supplied in several ways using LILO:

- By entering it on the command line every time the system is booted via LILO. This is boring, though.

- By using LILO's `lock` keyword to make it store the command line as the default command line, so that LILO will use the same options every time it boots.

- By using the `append=` statement in the LILO config file. Note that the parameter string must be enclosed in quotes.

For example, a sample command line using the above parameter string would be:

            zImage  aha152x=0x340,11,3,1 root=/dev/sda1 lock

This would pass the device parameter string through, and also ask the kernel to set the root device to `/dev/sda1` and save the whole command line and reuse it for all future boots.

A sample APPEND statement is:

            APPEND = “aha152x=0x340,11,3,1”

Note that the parameter string must not be enclosed in quotes on the command line, but it must be enclosed in quotes in the `APPEND` statement.

Note also that for the parameter string to be acted on, the kernel must contain the driver for that disk type. If it does not, then there is nothing listening for the parameter string, and you will have to rebuild the kernel to include the required driver. For details on rebuilding the kernel, go to `/usr/src/linux` and read the README, and read the Linux FAQ and Installation HOWTO. Alternatively you could obtain a generic kernel for the disk type and install that.

Readers are strongly urged to read the LILO documentation before experimenting with LILO installation. Incautious use of the `BOOT` statement can damage partitions.

Q: At boot time, I get error “`A: cannot execute B`”. Why?

A: There are several cases of program names being hardcoded in various utilities. These cases do not occur everywhere, but they may explain why an executable apparently cannot be found on your system even though you can see that it is there. You can find out if a given program has the name of another hardcoded by using the strings command and piping the output through grep.

Known examples of hardcoding are:

- shutdown in some versions has `/etc/reboot` hardcoded, so reboot must be placed in the `/etc` directory.

- init has caused problems for at least one person, with the kernel being unable to find init.

To fix these problems, either move the programs to the correct directory, or change configuration files (e.g. `inittab`) to point to the correct directory. If in doubt, put programs in the same directories as they are on your hard disk, and use the same `inittab` and `/etc/rc.d` files as they appear on your hard disk.

Q: My kernel has ramdisk support, but initializes ramdisks of 0K. Why?

A: Where this occurs, a kernel message like this will appear as the kernel is booting:

            Ramdisk driver initialized : 16 ramdisks of 0K size

This is probably because the size has been set to 0 by kernel parameters at boot time. This could possibly be because of an overlooked LILO configuration file parameter:

        ramdisk= 0

This was included in sample LILO configuration files in some older distributions, and was put there to override any previous kernel setting. If you have such a line, remove it.

Note that if you attempt to use a ramdisk of 0 size, the behaviour can be unpredictable, and can result in kernel panics.

Prev | Home | Next
Creating bootable CD-ROMs |  | Resources and pointers