LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 04-20-2013, 09:19 PM   #1
shangshangw
LQ Newbie
 
Registered: Apr 2013
Posts: 4

Rep: Reputation: Disabled
Difference between clone and create an image


I am trying to recover data from a damaged drive.
It seems I can use one same size drive to clone the damage drive,
or use one bigger drive to create an image and exact the raw image to a third drive.
What's the difference between this two process in terms of the result I get ?

best
 
Old 04-21-2013, 12:02 AM   #2
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
!!!!!!!!!!!!!1Warning: While using dd command, if you are not careful, and if you don’t know what you are doing, you will lose your data!!!!!!!!!!!!
first of all if you are trying to recover data on a corrupted drive. you will make a exact image onto another drive.
dd if=/dev/sdxx of=/home/user/some-folder/harddriveimage.image
now if you are just trying to get data you can mount it and copy what you can get.
we will create a directory in the /mnt and name it image
now cd /to/the/ harddriveimage.image




mount -o loop harddriveimage.image /mnt/image
now go in and fix or copy what you need.
Or we can repair it.
Quote:
Since fsck cannot read images directly, you have to then mount the image, using the "-o loop" option, using Linux's loopback device. Then, since fsck cannot read the recovery image's file system type, you need to manually call the correct version of fsck
so if your if your drive was formated ext3 it would be
fsck.ext3 /mnt/image/

so if you got room on any drive just make a back up image in a folder there you go.
This is a Note! only do this to mounted images Not Mounted hard drives you can cause serious damage to the data.

now that it has hall been fixed I do this my way. mount the image then make a tar of that /mnt/image
cd /mnt and tar -zcvf image-fixed.tar.gz image you will now have a compressed tar of that image named [image-fixed.tar.gz] . you will always have a back up. I do this for my multi partition drives.
any way while your mounted to your image you can copy it to a new hard drive.

to answer your question. if you ar creating images you must ask what do I want to do. fix the partition of a drive that may own that operating system or data. or do I want to make a image of the complete drive. when you do that from one drive to another it does just that makes that drive a image.
you can also do the same with the drive. dd -if=/dev/sdx of=/dev/sdx now you can run the fsck tools.
you can work out of a folder or you can work on a drive.
I find the first better I moved most of my systems to different formats from ext 2 to ext3 and from ext3 to ext4 or what ever I want. I just go in and
edit the /etc/fstab to reflect that ext.
for systems i want to keep coppies of I have found squashfs tools to work very good.
Hope this helped.

Last edited by Drakeo; 04-21-2013 at 12:17 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Difference between vmware image and iso image hitmen Linux - Newbie 3 01-12-2013 05:02 AM
centos clone /image amartlk Linux - Newbie 4 12-16-2010 08:49 AM
clonezilla clone disk to image, when restore from image to destination hdd problem. hocheetiong Linux - Newbie 3 05-06-2008 07:59 PM
Create RedHat gold image help (clone my server) wadevondoom Linux - Enterprise 4 05-23-2007 09:10 PM
difference netween linux-image and kernel image? mariogarcia Linux - Software 2 06-19-2006 08:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 03:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration