About Me

My photo
Kalyan Kumar Pasupuleti B-Tech(Information Technology). • AWS Certified Solutions Architect - Associate • RedHat Certified Engineer(RHCE) • Directory Services and Authentication Certificate of Expertise(LDAP) • Red Hat SELinux Policy Administration Certificate of Expertise(SELinux) • Network Services Security Certificate of Expertise (Network Services) • RedHat Certified Virtualization Administrator(RHCVA) • Red Hat Certified Security Specialist (RHCSS) Working as Cloud DevOps engineer

Monday, January 31, 2011

How to use dd command ?

How to use dd command ?

DD - Disk Dump


1.  Create an empty file of 650MB size.

#dd if=/dev/zero of="empty_file" bs=1024k count=650


2. To Create ISO from CD OR DVD

#dd if=/dev/cdrom of=file.iso


3. Create an exact image of this floppy-disk by issuing the command

#dd if=/dev/fd0 of=floppy.img


4. Create backup of HDD or partition

#dd if=/dev/sdb of=backup.dd


5. Creating backup of one hardisk in to second HDD.

#dd if=/dev/sda of=/dev/sdb


6. How to take backup of only MBR and MBR + Partition Table;

#dd if=/dev/sda of=mbr.bak bs=1 count=446 (Backup only MBR)

#dd if=/dev/sda of=mbr_part.bak bs=1 count=512 (Backup MBR + Partition Table)

   To restore,

#dd if=mbr.bak of=/dev/sda bs=1 count=446 (Restore only MBR)

#dd if=mbr_part.bak of=/dev/sda bs=1 count=512 (Backup only MBR)


7. To wipe the hard disk completely,

#dd if=/dev/zero of=/dev/sda