Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

Examples

Caution: Use dd cautiously, improperly entering the wrong values could inadvertently
wipe, destroy, or overwrite the data on the hard drive.
dd if=/dev/sr0 of=/home/hope/exampleCD.iso bs=2048 conv=noerror,sync
Create a ISO disc image from the CD in the computer.
dd if=/dev/sda of=~/disk1.img
Create an img file of the /dev/sda hard drive. To restore that image type: dd
if=disk1.img of=/dev/sda
dd if=/dev/sda of=/dev/sdb
Copy the contents from the if= drive /dev/sda to the of= drive /dev/sdb.
lvcreate -l 100%FREE -n lvol1 vg01

full hard disk copy


dd if=/dev/hdx of=/dev/hdy
dd if=/dev/hdx of=/path/to/image dd if=/dev/sda of=/linuxshare2/centos5-40G-image)
dd if=/dev/hdx | gzip > /path/to/image.gz dd if =/linuxshare2/centos5-40G-image
of=/dev/hda
Hdx could be hda, hdb etc. In the second example gzip is used to compress the image if
it is really just a backup.
Restore Backup of hard disk copy
dd if=/path/to/image of=/dev/hdx
gzip -dc /path/to/image.gz | dd of=/dev/hdx
MBR backup
In order to backup only the first few bytes containing the MBR and the partition table
you can use dd as well.
dd if=/dev/hdx of=/path/to/image count=1 bs=512

MBR restore
dd if=/path/to/image of=/dev/hdx
Add "count=1 bs=446" to exclude the partition table from being written to disk. You can
manually restore the table.

Problem Found duplicate PV iU3uWsnnNJZd4Yle7Z0Pl3tE0PJkdwN9: using /dev/sdb4


not /dev/sda4
Solution
pvremove /dev/sda4
Change UUID (online or using bootcd)
tune2fs /dev/sdaX -U random

vgchange -a y vg01 activate vg01


vgchange -a n vg01 deactivate vg01

You might also like