Tuesday, May 17, 2011

How to Clone Whole Hardisk with Ubuntu operating System

ye command aap ki pori ki pori hard disk ko dosri harddisk main istarha copy kardayti hay kay usko operating system bhi copy hojata hay
aur aap wo harddisk kisi dosray computer main laga kar use karsaktay hain aur sub kuch waysa hi hoga.

aik new harddisk lain jo bilkul usi size/capacity ki ho jis ko aap copy karna chatay hain
Ubuntu main gpart ki madad say pehlay uskay sary partitions delete kar dain phir system restart kar kay nechay di hoi command apply karain.

dd command
--------------

sudo dd if=/dev/sdb of=/dev/sdc

iss command ko istarha parhain gay

disk copy karo "if=/dev/sdb" input disk drive say output drive main "of=/deve/sdc

is kay ilawa aap iss ki madad say pori harddisk ki ISO file bana kar bhi backup lay saktay hain
is kay liye nechay wali command use karain

sudo dd if=/dev/sdb of=/home/shaheer/thumbImage.img
------------------------------------------------End-----------------------------------------------

hosakta hay kay jab aap ye hard disk apnay dosray system main lagain to wahan 
Network Card conflict kar jaen ye is liye hota hay kay aap k Ubuntud main MAC address purana wala 
hi  hota hay aur new system main Network Card dosra aajata hay

Following is the solution for this Problem: 


 “SIOCSIFADDR: No such device eth0″

After a bit of googling I found a solution that required editing /etc/ftab to remove an incorrect generated mac address. Hardy Heron doesn’t have this file though so I did a bit more searching around the filesystem and found a reference to the mac address stored in the vmx (vmware config) file found in /etc/udev/rules.d/70-persistent-net.rules. Note: For Debian the file can be found at /etc/udev/rules.d/z25_persistent-net.rules
Method One – delete the rules file

Quickest way to solve this is to move/delete the rules file. (Thanks to the comment from SonniesEdge.)

Ubuntu
sudo mv /etc/udev/rules.d/70-persistent-net.rules /etc/udev/rules.d/70-persistent-net.rules.old

Debian
sudo mv /etc/udev/rules.d/z25_persistent-net.rules /etc/udev/rules.d/z25_persistent-net.rules.old

Now reboot the system so that rule file will be recreated by the Ubuntu

-------------------------------------------------------------------------------------------------------


Method Two – edit the rules file

The second way is to comment out the line relating to eth0 which had the wrong mac address and replaced “eth1″ with “eth0″. After rebooting eth0 should be working properly and normality will be restored.

Here’s an example carried out on Ubuntu.

The old /etc/udev/rules.d/70-persistent-net.rules looked like this:
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:50:xx:xx", ATTR{type}=="1", NAME="eth0"

# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:36:xx:xx", ATTR{type}=="1", NAME="eth1"

Was edited to look like this:
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:3

No comments:

Post a Comment