LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-10-2013, 02:24 PM   #1
Verbunk
LQ Newbie
 
Registered: Apr 2013
Posts: 7

Rep: Reputation: Disabled
dd with wrong source target


Hi Everyone,

I used dd the other day to backup some important CD's but I used /dev/sdc1 instead of /dev/cdrom and it seems something was set incorrectly. All of the images refuse to mount correctly citing a bad or unknown format. I have used a non-freeware app to treat it like a broken disk and rescue and it can see inside but will not rescue files until I pay the 100$ fee... I was wondering if the community can help me figure out how to, most likely, convert again to the correct target using linux tools. So far I've tried various combinations of dd to try and treat it as a disk image and not an iso but so far no success.

Thanks in advance!
-JV
 
Old 04-10-2013, 03:03 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,655

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by Verbunk View Post
Hi Everyone,
I used dd the other day to backup some important CD's but I used /dev/sdc1 instead of /dev/cdrom and it seems something was set incorrectly. All of the images refuse to mount correctly citing a bad or unknown format. I have used a non-freeware app to treat it like a broken disk and rescue and it can see inside but will not rescue files until I pay the 100$ fee... I was wondering if the community can help me figure out how to, most likely, convert again to the correct target using linux tools. So far I've tried various combinations of dd to try and treat it as a disk image and not an iso but so far no success.
The obvious question would be: why (since they're your CD's), you can't just re-run the dd with the proper device?
 
Old 04-10-2013, 03:08 PM   #3
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
I don't understand the problem/question. If you backed up /dev/sdc1 instead of /dev/cdrom then you haven't backed up the CD so there's no data to get back, you've just backed up your hard drive partition instead.
What is the exact dd command line you used? What data is it you have lost?
 
Old 04-10-2013, 03:20 PM   #4
Verbunk
LQ Newbie
 
Registered: Apr 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
The CD's were misplaced and most likely destroyed.
 
Old 04-10-2013, 03:23 PM   #5
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
But from your post if you chose the wrong source then you did not back up your CDs. You can't recover the contents of a CD which you backed up by using dd to copy the contents of one hard drive to the other because that means you did not back up the CD.
What command did you run?
 
Old 04-10-2013, 03:31 PM   #6
Verbunk
LQ Newbie
 
Registered: Apr 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by 273 View Post
I don't understand the problem/question. If you backed up /dev/sdc1 instead of /dev/cdrom then you haven't backed up the CD so there's no data to get back, you've just backed up your hard drive partition instead.
What is the exact dd command line you used? What data is it you have lost?
Yes, that's a typo, excuse. It was /dev/scd1 which is a symlink to /dev/cdrom

Even though it's a symlink I believe dd treated it not as a cd source and so it wrote in .img format. Not sure how to convert.
 
Old 04-10-2013, 03:42 PM   #7
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
dd does not treat anything as a format, it just copies byte-by-byte form one place to another so it doesn't matter that you specified the "wrong" name you're still moving the same bytes.
 
Old 04-10-2013, 03:47 PM   #8
Verbunk
LQ Newbie
 
Registered: Apr 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by 273 View Post
dd does not treat anything as a format, it just copies byte-by-byte form one place to another so it doesn't matter that you specified the "wrong" name you're still moving the same bytes.
I couldn't find any basis for that weirdness either. Ok, I'll change my question. When I copied 13 cd's using /dev/scd1 I got data with a messed up header such that linux won't mount it but yet some windows recovery apps can look inside. When I found this out and switched to /dev/cdrom everything works as you would expect. Now I have 13 messed up .iso files and need to figure out how to make into proper .iso files whether or not it's exactly figured out what went wrong.

Thx. J
 
Old 04-10-2013, 04:36 PM   #9
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,993

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
dd is an odd choice to use for optical disk backup. My guess is that it could be possible that you only got track 1 of the disk or maybe track 2 only.

Might mount the iso as a loop and see what testdisk can get.

Last edited by jefro; 04-10-2013 at 04:38 PM.
 
Old 04-10-2013, 04:42 PM   #10
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Assuming that sdc is the target of /dev/cdrom, copying sdc1 would not have copied the entire disk, and that is why it is refusing to be processed.

We need to see the actual links between /dev/cdrom and /dev/scd1... The name scd1 implies the first partition on device scd... And that could skip the header of the volume, such that it is not a complete iso - but a dump of only the first partition on the disks.
 
Old 04-10-2013, 07:26 PM   #11
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213
Quote:
Originally Posted by jpollard View Post
The name scd1 implies the first partition on device scd...
No, it doesn't. Device names and links for CD-ROM devices aren't set up that way. /dev/scd1 would normally be a link to the second CD-ROM device.

@Verbunk -
What does the file command report when you run it on your saved image files? What are the sizes of those files?

I hope they were not audio CDs. You have to use specialized software to rip tracks from those. dd can't do it.

Last edited by rknichols; 04-10-2013 at 07:29 PM.
 
Old 04-11-2013, 09:09 AM   #12
Verbunk
LQ Newbie
 
Registered: Apr 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
@rknichols: The output says <name>: data. They were data CD's, mostly installers for legacy equipment which would be nearly impossible to obtain now. Some of them are CD's to boot from so I'm not enthusiastic to do a rescue and rebuild of the boot mechanism. :/
 
Old 04-11-2013, 10:05 AM   #13
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213
Quote:
Originally Posted by Verbunk View Post
The output says <name>: data. They were data CD's,
That is not encouraging. I would have expected output like, "<name>: ISO 9660 CD-ROM filesystem data ...".

Try running "dd if=one_filename | hexdump -C | head -50" and post the result. Let's see if any sense can be made from that.

Last edited by rknichols; 04-11-2013 at 10:12 AM.
 
Old 04-11-2013, 01:38 PM   #14
Verbunk
LQ Newbie
 
Registered: Apr 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
Seems like it won't be of any use.
00000000 00 ff ff ff ff ff ff ff ff ff ff 00 00 02 00 01 |................|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000810 c5 13 68 2b 00 00 00 00 00 00 00 00 00 f7 00 f5 |..h+............|
00000820 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000860 00 00 00 00 00 00 52 35 b8 7d 00 00 00 00 00 00 |......R5.}......|
00000870 00 00 00 f5 00 f4 00 00 00 00 00 00 00 00 00 00 |................|
00000880 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000008b0 00 00 00 00 00 00 00 00 00 00 00 00 97 26 d0 56 |.............&.V|
000008c0 00 00 00 00 00 00 00 00 00 41 00 00 00 00 00 00 |.........A......|
000008d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2d 17 |..............-.|
000008e0 2e 1b b1 48 b2 44 00 00 00 00 00 00 00 00 00 00 |...H.D..........|
000008f0 00 00 00 00 00 00 00 65 00 c2 00 e6 00 43 00 00 |.......e.....C..|
00000900 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000910 00 00 45 3c 53 75 33 2b 25 62 00 00 00 00 00 00 |..E<Su3+%b......|


Since dd does a byte level copy it shouldn't be representing an iso file anyways. It would be the raw sectors copied off. I guess I'm looking for a way to copy the copy into a reasonable container. Do you know if there is a combination of dd switches that would correctly copy the data out and wrap in an iso? I've tried to force mount as a disk and it doesn't work but that doesn't mean I had everything setup correctly.

J
 
Old 04-11-2013, 02:21 PM   #15
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213
Quote:
Originally Posted by Verbunk View Post
Since dd does a byte level copy it shouldn't be representing an iso file anyways.
Yes, it would. Copying from the raw device, as you said you did, would include all the iso9660 headers and give you an image that looked like an ISO filesystem and which you could mount with "-o loop".

I don't see anything recognizable in the data you posted. You might look a bit further into the hex dump and see if there is anything "interesting" at octal offset 08000. Absent that, I fear that recovering anything at all from those images, if they're all like that, is going to take a lot of very low-level detective work.
 
  


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
iptables mac-source error - No chain/target/match balamadras Linux - Networking 2 12-19-2012 12:57 PM
LXer: Open source testing tools target varied tasks LXer Syndicated Linux News 0 04-18-2008 08:21 PM
Maxtor Onetouch II: symlink points to wrong target Robert S Linux - Hardware 2 12-23-2007 03:26 PM
Source Directory for Target Kernel halfpower Debian 1 05-22-2006 10:48 AM
line count mismatch between source and target systems. cool244 Linux - Enterprise 1 04-08-2005 05:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:32 AM.

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