Penguin Crumbs

Notes and tips from a Linux user

home about this blog
search:  

Two uses of dd

All in all, in everyday life I mainly use dd for two purposes: writing a bootable ISO image to removable media, such as a USB stick, and cloning hard disks, often increasing the size of a partition if the new disk is larger than the old one.

Some preliminary suggestions are necessary.

With that in mind, let's look at the two commands for both use cases.

How to write a bootable ISO image to a removable media

Let's assume that the file is called liveimage.iso and that the USB stick is /dev/sdX (replace these details with the appropriate values for your case!). The command in this case will be:

sudo dd bs=4M if=/path/to/liveimage.iso of=/dev/sdX conv=fsync oflag=direct status=progress

Enlarge your hard... drive

This is the typical situation: when you change your hard drive. You buy a new device with much more capacity than the previous one, and you want to transfer everything from one to the other, including the partition table, the boot partition, etc.
Let's assume that the old disk is /dev/sdX and the new one is /dev/nvme0nX. So the command to clone the entire disk (including the partition table and bootloader) will be:

sudo dd if=/dev/sdX of=/dev/nvme0nX bs=64M conv=noerror,sync oflag=direct status=progress

Just two warnings. The first is that after executing the dd command, partitions in both disks will have the same UUIDs. Therefore, the PC may become confused and I recommend disconnecting the old disk one when the system first reboots. The second is that if you use certain file systems such as ext4, you could use gparted to increase the size of one or more partitions. In this case, gparted may complain about “backup GPT table”. Give it permission to fix the problem: it's just one click.

And finally, here are a few brief explanations

 
 
Posted on 2025-08-13  
 
⇦  back
 
__________________
 
Copyright © 2019-2025 Marcello Zaniboni