Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Using dd for sector-by-sector copy to ISO?

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
Storsnusarn^
Posts: 15
Joined: 2015-10-29 00:39

Using dd for sector-by-sector copy to ISO?

#1 Post by Storsnusarn^ »

I wounder if it's possible to for example run

Code: Select all

dd if=sda of=hdd.iso

to make it copying the drive sectorwise (including deleted files and files on corrupted sectors)? The reason i ask is that a friend asked me to help recover some data she deleted by mistake and i find it a lot more convenient to work on an exact copy and just mount the ISO at home where i have much better resources than to work directly on her hardware.

Thanks in advance!

User avatar
dasein
Posts: 7680
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Using dd for sector-by-sector copy to ISO?

#2 Post by dasein »

The output file isn't an .iso, but yes, you can dd a device to a file.

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Using dd for sector-by-sector copy to ISO?

#3 Post by phenest »

The correct command would be:

Code: Select all

dd if=/dev/sda of=filename
(Don't forget "/dev/sda" and not just "sda".)
I'm not sure about corrupted sectors though. If the hard drive marks them as bad, it copies the data to good sectors. Bad sector access is restricted by the hard drive. But you'll still get a complete image of the drive.

EDIT: Damn! It's not possible to highlight within code tags. :(
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

Storsnusarn^
Posts: 15
Joined: 2015-10-29 00:39

Re: Using dd for sector-by-sector copy to ISO?

#4 Post by Storsnusarn^ »

dasein wrote:The output file isn't an .iso, but yes, you can dd a device to a file.
What do you mean by the output file isn't an iso? of=filename.iso, maybe i'm just stupid :mrgreen:
phenest wrote:The correct command would be:

Code: Select all

dd if=/dev/sda of=filename
(Don't forget "/dev/sda" and not just "sda".)
I'm not sure about corrupted sectors though. If the hard drive marks them as bad, it copies the data to good sectors. Bad sector access is restricted by the hard drive. But you'll still get a complete image of the drive.

EDIT: Damn! It's not possible to highlight within code tags. :(
Yes ofc i meant /dev/sda i was really tired when i posted this OP :lol: but thanks for the clearness. By complete image i guess you mean sector-by-sector including deleted files (that hasn't been overwritten ofc))? Does the blocksize matter if i want to copy sector-by-sector, i mean "bs=4M", must this match the current blocksize on the current drive i'm copying or can i just skip that flag?

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Using dd for sector-by-sector copy to ISO?

#5 Post by phenest »

You can give the output file an .iso extension, but that doesn't make it an ISO, nor will it be to ISO spec. It'll be a drive image with an .iso extension. The extension doesn't matter in this case. Choose whatever you want.

Block size doesn't matter in this case, Sectors are usually 512 bytes if you want to do it that way. A complete copy of the drive will take time regardless.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

User avatar
dasein
Posts: 7680
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Using dd for sector-by-sector copy to ISO?

#6 Post by dasein »

Storsnusarn^ wrote:
dasein wrote:The output file isn't an .iso, but yes, you can dd a device to a file.
What do you mean by the output file isn't an iso? of=filename.iso
And do you imagine that if you named it filename.jpg it'd magically morph into a photograph?
Or that if you named it filename.ods it'd somehow become a spreadsheet?
Storsnusarn^ wrote:...maybe i'm just stupid :mrgreen:
(I'm not gonna say it... I'm not gonna say it...)

Storsnusarn^
Posts: 15
Joined: 2015-10-29 00:39

Re: Using dd for sector-by-sector copy to ISO?

#7 Post by Storsnusarn^ »

phenest wrote:You can give the output file an .iso extension, but that doesn't make it an ISO, nor will it be to ISO spec. It'll be a drive image with an .iso extension. The extension doesn't matter in this case. Choose whatever you want.

Block size doesn't matter in this case, Sectors are usually 512 bytes if you want to do it that way. A complete copy of the drive will take time regardless.
Ok thank you. That makes sense :). Now i'm just gonna figure out how to mount it in a win32 system as a regular iso. Sorry for the misunderstanding iso above was just me trying to explain mountable file... Too damaged by windows administrating :(
dasein wrote: And do you imagine that if you named it filename.jpg it'd magically morph into a photograph?
Or that if you named it filename.ods it'd somehow become a spreadsheet?
No i didn't imagined that. Have you ever heard of files with diffirent extentions that does the same thing?
Storsnusarn^ wrote:...maybe i'm just stupid :mrgreen:
dasein wrote: (I'm not gonna say it... I'm not gonna say it...)
Happy to let you feel like the smartest person in the room.

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Using dd for sector-by-sector copy to ISO?

#8 Post by phenest »

Storsnusarn^ wrote:Now i'm just gonna figure out how to mount it in a win32 system as a regular iso.
From now on, you're on your own.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Using dd for sector-by-sector copy to ISO?

#9 Post by debiman »

Storsnusarn^ wrote:Now i'm just gonna figure out how to mount it in a win32 system as a regular iso.
just take a random .jpg, change its extension to .iso and try mounting that as "a regular iso".

dasein might not be the most clever person in the room (definitely not the most friendly or polite), but you, on the other hand... :lol:

pendrachken
Posts: 1394
Joined: 2007-03-04 21:10
Location: U.S.A. - WI.

Re: Using dd for sector-by-sector copy to ISO?

#10 Post by pendrachken »

There are a few ways to mount the image in Windows. Pretty sure daemontools / lite should do it. Another is osfmount.


Or you could just throw together a decent sized VM and run Linux and all the fun recovery tools from there.
fortune -o
Your love life will be... interesting.
:twisted: How did it know?

The U.S. uses the metric system too, we have tenths, hundredths and thousandths of inches :-P

Storsnusarn^
Posts: 15
Joined: 2015-10-29 00:39

Re: Using dd for sector-by-sector copy to ISO?

#11 Post by Storsnusarn^ »

pendrachken wrote:There are a few ways to mount the image in Windows. Pretty sure daemontools / lite should do it. Another is osfmount.


Or you could just throw together a decent sized VM and run Linux and all the fun recovery tools from there.
From Windows 8 and above daemon tools and similar programs are not longer required to mount iso and img-files, you can mount these natively in windows. Therefore my question above about the file not being an iso according to previous answers, what i tried to ask before was if it's possible to "convert" a file created this way to a iso or img-file? Not sure if windows or maybe daemon/similar can mount it anyways if i'll just name it ".iso" and give it a try.

I will use both linux and windows tools, depending on how deep i need to dig. I have more experience recovering whole partitions with windows-tools.

Thank you for a decent answer :D

EDIT: Just read about osfmount you told me about and this seems to be able to aim specifically at dd-images, perfect. Thx once again, now i dont need to worry about that. Just still a bit unsure on how datarecovery from a image will work though, but as i understood from here and some more googling it should work as well as if i copied it to another drive sector-by-sector

Post Reply