"dd" - Copy Data from/to Storage Devices

Provides a tutorial example on how to copy continuous blocks of data bytes from or to storage devices using the 'dd' command. File system structures can be bypassed.

If you want to copy data as continuous blocks of bytes from one device to another, you can use the "dd (data duplicator)" command as shown in this tutorial. If device names are used in "dd" commands, file system structures are not respected.

1. Copy data from a raw device. This will read data continuously from the device without respecting the partition and format structures.

(copy the first block (512 bytes) from a USB drive)
herong$ sudo dd count=1 if=/dev/sdb of=one-block
1+0 records in
1+0 records out
512 bytes copied, 6.1976e-05 s, 8.3 MB/s

2. Copy data to a raw device. This will write data continuously to the device and whipping out the partition and format structures. This command is very dangerous. One typo in the device name could damage the MBR (Master Boot Record) of the hard disk, which is represented as /dev/sda.

(copy CentOS 8 DVD image to a USB drive)
herong$ sudo dd if=CentOS-8.1.1911-x86_64-boot.iso of=/dev/sdb

(copy a backup file in TAR (Tape ARchiving) format to a tape device )
herong$ sudo dd if=backup.tar of=/dev/sdc

(copy 1 GB of '0' to the beginning of a tape device)
(this is a good way to remove sensitive data on old tapes)
herong$ sudo dd if=/dev/zero of=/dev/sdc bs=64k count=16k

Table of Contents

 About This Book

 Introduction to Linux Systems

 Cockpit - Web Portal for Administrator

 Process Management

 Files and Directories

 Users and Groups

File Systems

 "df" - Display Free Space of File System

 Mount USB Drive as File System

 "fdisk" - Format Disk Partitions

"dd" - Copy Data from/to Storage Devices

 Use "dd" Command to Test I/O Speed

 "hdparm" - Hard Disk Parameters

 "du" - Display Disk Usage of Directories

 Mount Windows NTFS File System

 Access Persmissions on "ntfs-3g" File System

 Mount Windows Shared Folders

 W95 Ext'd (LBA) Partition

 File System Types, IDs and Formats

 LVM (Logical Volume Manager)

 "parted" - Partition Manipulation Program

 Reformat NTFS Partition into EXT4 Partition

 Unreachable Remote File Systems

 Installing CentOS

 SELinux - Security-Enhanced Linux

 Network Connection on CentOS

 Software Package Manager on CentOS - DNF and YUM

 Running Apache Web Server (httpd) on Linux Systems

 Running PHP Scripts on Linux Systems

 Running MySQL Database Server on Linux Systems

 Running Python Scripts on Linux Systems

 vsftpd - Very Secure FTP Daemon

 Postfix - Mail Transport Agent (MTA)

 Dovecot - IMAP and POP3 Server

 Email Client Tools - Mail User Agents (MUA)

 GCC - C/C++ Compiler

 Conda - Environment and Package Manager

 Tools and Utilities


 Full Version in PDF/EPUB