mkbootdisk Command in Linux



mkbootdisk is a command used in Linux for creating bootable disks. This command is particularly helpful when you need a recovery disk or a backup boot disk for system recovery purposes. It's simple, efficient, and essential for system administrators and users who want to ensure they can boot their systems in case of emergencies.

Table of Contents

Here is a comprehensive guide to the options available with the mkbootdisk command −

Syntax of mkbootdisk Command

The general syntax to use the mkbootdisk command on Linux is as follows −

mkbootdisk [options] version

Where −

  • options can include various flags to customize the command's behavior.
  • version specifies the kernel version to use for the boot disk.

mkbootdisk Command Options

Listed below are numerous options you can leverage with the Linux mkbootdisk command −

Option Description
--device Creates the boot image on the specified device file. If not given, /dev/fd0 is used by default. If the device file doesn't exist, it creates a 1.44MB floppy image using the given filename.
--noprompt Skips the prompt that usually asks you to insert a floppy disk.
--verbose Displays detailed output of the actions being performed.
--iso Creates a bootable ISO image instead of a physical disk.
--version Shows the version of mkbootdisk and exits.
--kernelargs Adds additional arguments to the kernel command line.
--size Specifies the size (in kilobytes) of the boot disk image to create. If not specified, it uses a standard 1.44MB size.

Examples of mkbootdisk Command in Linux

Here are some examples of how you can use the command mkbootdisk in Linux −

  • Creating a Bootable USB Drive from an ISO Image
  • Creating a Bootable USB Drive from a Running Linux System
  • Creating a Bootable Floppy Disk
  • Verbose Output
  • No Prompt

Creating a Bootable USB Drive from an ISO Image

To create a bootable USB drive from a specified ISO image, use the following command −

sudo mkbootdisk --iso /path/to/linux.iso /dev/sdb

In this command −

  • --iso /path/to/linux.iso − Specifies the ISO image to use.
  • /dev/sdb − Denotes the device name for your USB drive.

Creating a Bootable USB Drive from a Running Linux System

In case you want to create a bootable USB drive that contains a live version of the current Linux system, use the below-given command −

sudo mkbootdisk --live /dev/sdb

Here −

  • --live − Indicates that the USB drive should contain a live version of the current system.
  • /dev/sdb − Represents the USB drive's device name.

Creating a Bootable Floppy Disk

For creating a bootable floppy disk, you might use −

sudo mkbootdisk --device /dev/fd0

This command −

  • --device /dev/fd0 − Specifies the device file for the floppy disk. If not provided, /dev/fd0 is used by default.

Verbose Output

If you want detailed output during the process, use the --verbose option −

sudo mkbootdisk --verbose --iso /path/to/linux.iso /dev/sdb

This command will show detailed actions being performed as it creates the bootable USB drive.

No Prompt

To skip the confirmation prompt, use the --noprompt option −

sudo mkbootdisk --noprompt --iso /path/to/linux.iso /dev/sdb

This command will bypass the prompt that usually asks you to insert a floppy disk.

Conclusion

The mkbootdisk is a valuable command in Linux for creating bootable disks from the command line. It's simple, efficient, and essential for ensuring you have a recovery or backup boot disk available in case of system emergencies.

By understanding its syntax and exploring various options, you can effectively use mkbootdisk to enhance your system's reliability. Whether you're preparing for system recovery or just want a backup, the mkbootdisk command provides a straightforward solution for your boot disk needs.

Advertisements