Skip to main content

Crafting a Bootable USB Drive with dd and for Your Linux Installation

··940 words·5 mins· loading · loading ·
Linux Built-In Bootable
UmmIt
Author
UmmIt
Loves to write about technology, and cybersecurity related topics :)
Table of Contents

Introduction
#

When embarking on a new Linux adventure, having a reliable bootable USB drive is your trusty companion. It’s the key that unlocks the door to a world of new possibilities and operating systems. In this guide, we’ll walk you through the process of creating a bootable USB drive using the powerful and versatile dd command. While there are other tools like BalenaEtcher and Brasero available, but in this blog focuses on the nitty-gritty details of dd, dd are available with most of the distribution, that means are built-in tool!, providing you with a solid foundation to kickstart your Linux installation journey.

Creating a bootable USB drive is an essential skill for any Linux enthusiast. Whether you’re starting a fresh Linux installation, rescuing a system, or trying out a new distribution, having a bootable USB drive at your disposal is incredibly useful. In this guide, we’ll walk you through the process of creating a bootable USB drive using the dd command, one of the most straightforward and versatile methods.

This method only works with Linux distributions. Windows is not supported.

Prerequisites
#

Before we begin our step on how to make a bootable pen drive, Please backup your existing data on your pen drive as the dd command will overwrite your existing data, and make sure you have the following:

  • A USB flash drive with sufficient capacity (8GB or more is recommended)
  • Down Linux distribution ISO file you want to install or use (Ubuntu, linux mint, manjaro … etc)
  • Backup your DATA!!!!

Step 1: Identify Your USB Drive
#

First, you need to identify the device name of your USB drive. Open a terminal and use the lsblk command to list all available block devices:

lsblk

Identify your USB drive based on its size and storage capacity. It will typically be listed as something like /dev/sdX, where X is a letter corresponding to your USB drive.

Step 3: Prepare the USB Drive
#

Before creating the bootable USB, make sure the USB drive is unmounted. You can use the umount command followed by the device name to unmount any existing partitions on the USB drive. Replace /dev/sdX with your USB drive’s device name:

sudo umount /dev/sdX

Step 4: Write the ISO File to the USB Drive
#

With the USB drive properly formatted and ready, it’s time to transfer the Linux distribution ISO file onto it. To accomplish this, we will use the dd command, a powerful yet potentially risky tool. Pay close attention and follow the instructions carefully to avoid accidental data loss.

Note: Please direct to use SDA or other name! . Not part of this partition. You do not need to create a file system on this pen drive. The next step of copying all the files to the pen-drive will do all the things automatically.

  1. Replace path/to/iso in the command below with the actual file path of the downloaded Linux distribution ISO file.

  2. Identify the correct device name of your USB drive. Ensure this is accurate, as the dd command will overwrite the designated device. To identify the correct device name, you can use the lsblk command.

  3. Replace /dev/sdX in the command below with the correct device name of your USB drive. Triple-check this to avoid any mistakes.

  4. Execute the command:

    sudo dd bs=4M if=path/to/iso of=/dev/sdX status=progress oflag=sync
    
    • sudo: Runs the command with superuser privileges.
    • dd: The command used for data duplication.
    • bs=4M: Sets the block size to 4 megabytes for efficient data transfer.
    • if=path/to/iso: Specifies the input file (your Linux ISO).
    • of=/dev/sdX: Specifies the output file (your USB drive).
    • status=progress: Displays the progress of the data transfer.
    • oflag=sync: Flushes data to the output file after each write operation.
  5. Wait for the process to complete. The terminal will display the progress as the ISO file is written to the USB drive.

  6. Once the process is finished, the terminal will display the final summary, and you’ll be returned to the command prompt.

Remember, the dd command has the potential to overwrite data irreversibly. Double-check your command, ensuring the correct paths and device names are used. It’s always a good practice to disconnect any other external drives to minimize the risk of accidentally overwriting the wrong drive.

By following these steps, you’ll successfully write the Linux distribution ISO to your USB drive, transforming it into a bootable medium ready for your Linux installation journey.

Step 5: Safely Eject the USB Drive
#

After the dd command completes, you’ll have a bootable USB drive. Before unplugging the drive, ensure that all data has been written and synced. You can use the sync command to flush any pending data to the USB drive:

sync

Then safely eject the USB drive using the eject command:

sudo eject /dev/sdX

Step 6: Boot from the USB Drive
#

Now that your bootable USB drive is ready, you can use it to boot into a live Linux environment or install the operating system. Insert the USB drive into the target computer, restart it, and access the boot menu to select the USB drive as the boot device. The key to access the boot menu varies depending on your computer’s manufacturer (common keys include F2, F12, ESC, or DEL).

Conclusion
#

Creating a bootable USB drive for your Linux installation is a valuable skill that comes in handy for various scenarios. Whether you’re installing a new Linux distribution, rescuing a system, or performing system maintenance, having a bootable USB drive can save the day. By following these simple steps and using the dd command, you can quickly and effectively create a bootable USB drive and unleash the power of Linux wherever you need it.

Related

Discover the Top 10 Essential Gnome Extensions
··424 words·2 mins· loading · loading
GNOME Linux
ALL Tips to Secure your linux VPS server
··664 words·4 mins· loading · loading
VPS SSH Linux
Resolving ntfs-3g Mounting Issue on your Linux
·384 words·2 mins· loading · loading
Linux NTFS
Mastering Network Management with Net-tools: A Comprehensive Guide
·297 words·2 mins· loading · loading
Linux Net-Tools
Unleash Compression Power with 7-Zip on Linux: Installation and Usage Guide
·343 words·2 mins· loading · loading
Linux 7zip
Efficient and Secure File Transfer with SCP: A Comprehensive Guide
·378 words·2 mins· loading · loading
Linux Scp SSH