≡ Menu

dd command

How do I remove all partitions, data and create clean empty hard disk under Linux operating systems?
[click to continue…]

Q. I can use dd command to create ISO images from a CD but how do I get volume information from CDs and ISO images from a shell prompt?
[click to continue…]

How do I create 1 GB or 10 GB image file instantly with dd command under UNIX / Linux / BSD operating systems using a shell prompt?
[click to continue…]

Q. One of my responsibilities is backing up UNIX server. How do I backup data under HP-UX UNIX? How do I use mt, fbackup and frecover commands to perform full and incremental backups?
[click to continue…]

Linux Set the Block Size for a SCSI Tape Device

Q. I've Debian Linux 4.0 Install on HP Server. This server has SCSI tape device. According to my tape documentation size should be 64k. How can I set the block size for a HP SCSI tape device?
[click to continue…]

How to Create Bootable Linux CD

Q. I'm using CentOS Linux and I'd like to create bootable Linux CD for the same. How do I create an installation boot disk?

A. You need to find images/ directory located on CentOS / Fedora / RHEL or any other Linux distribution. This directory contains image files that can be used to create media capable of starting the Linux installation process.

[click to continue…]

Linux Copy One Hard Disk to Another Using dd Command

Q. How can I copy one hard disk to another using dd command?

A. dd command can copy disk in raw format. It will copy partition table and bootloader and all partitions within this disk. For example, you can copy /dev/sda to /dev/sdb (same size) using the following dd command. dd should complete with no errors, but output the number of records read and written.

Login as the root user (use sudo or su command)

WARNING! These examples may result into data loss, ensure there are good backups before doing this, as using dd wrong way can be dangerous.

Open terminal or shell prompt and type the following dd command:
# dd if=/dev/sda of=/dev/sdb

  • if=/dev/sda : Input disk (source)
  • of=/dev/sdb : Output disk (destination)

You can also copy hard disk or partition image to another system using a network and netcat (nc) command.