LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-18-2012, 04:31 PM   #1
rmknox
Member
 
Registered: May 2010
Posts: 354

Rep: Reputation: 34
Can someone speculate?


fedora 17 32 bit

I just had an experience with DD that confuses and scares me - and I'm curious to see if anyone has some theory on what happened.

I booted from my live CD with 2 hard drives on the system: my normal fedora drive and my backup drive. I do this once a week to do a full disk backup.

A full explanation of what I do and why and what happened would be boring and beside the point.

I do my backup one partition at a time.

eg: dd if=/dev/sda3 of=/dev/sda3

the dd process abended on partition 3 - and I think I know why - but I dont understand what happened next.

I then did a shutdown now

Understandably the backup drive was not bootable - but to my surprise and terror my normal drive would not boot fedora. It booted to the grub boot system, it tried to start fedora 17 and said it could not mount my logical volume that holds my fedora 17 system - something about it being locked. and droped in to command line mode.

partition 3 is part of the LV system - but we were reading partition 3 on my normal drive when the abend occurred

it is as if DD locked the input - perhaps to keep people from messing with the input? - and then didn't get a chance to unlock it?

even if that happened - and I dont know how in this system a partition gets marked as locked - I wuold expect shutdown to unlock everything being processed.

While you may be tempted to tell me that what I do is stupid - and suggest an alternative approach - what I really want to understand is "How did the DD abend cause information to be stored that causes my normal disk to think that one of its partitions was "locked"?

My normal disk was the if (input file) to DD.

Thru some magic I got it running by booting my live CD, running LVM to look at the logical volumes. Somehow that "fixed" the problem.

The reason its scary is that now I dont have a functioning backup drive and dont really understand what DD does to its input.

My plan is to do a full backup ie
dd if=/dev/sda of=/dev/sdb because there dd would not be in a position to pass judgement on what it is processing. When I copy a partition to a partition dd may apply certain rules to what it considers a valid partition. I see a peculiarity in my partition setup that may have caused my problem - a full drive copy should not look at the partitions.

Any ideas - reactions - knowledge on how the dd input partition looked like it was locked when grub/init tried to start it subsequently?
 
Old 12-18-2012, 05:09 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 17,168

Rep: Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562Reputation: 2562
dd should not "lock" the input after the process. I'd be more tempted to start at smart diags or hard drive or memory diags.
 
1 members found this post helpful.
Old 12-18-2012, 09:22 PM   #3
rmknox
Member
 
Registered: May 2010
Posts: 354

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by jefro View Post
dd should not "lock" the input after the process. I'd be more tempted to start at smart diags or hard drive or memory diags.
jefro
thanks - by the way - I mis-typed (if Regan could misspoke then I can mistype) - the command I issued was if=sda of=sdb

I am pretty wet behind ears as regards linux and other op systems that run on the modern intel type processors . Are you aware of any convention that allows a partition to be marked as "locked"
 
Old 12-18-2012, 09:58 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,361
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
Quote:
Originally Posted by rmknox View Post
Are you aware of any convention that allows a partition to be marked as "locked"
'dd' can convert data given the right switches but it doesn't "pass judgment": it passively nibbles the source disk and just passes the data stream on. Like jefro suggested start by having proper stdout / stderr logging and performing diagnostics, preferably before + after the fact so you have a baseline to compare with.
 
1 members found this post helpful.
Old 12-19-2012, 12:19 AM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,614

Rep: Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576
If you tried to boot the system with both drives connected, then you would have duplicate LVM logical volumes present, including the broken one, and various bad things can happen. Best guess is that the system tried to use the broken volume on sdb3.
 
1 members found this post helpful.
Old 12-20-2012, 12:05 AM   #6
rmknox
Member
 
Registered: May 2010
Posts: 354

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by rknichols View Post
If you tried to boot the system with both drives connected, then you would have duplicate LVM logical volumes present, including the broken one, and various bad things can happen. Best guess is that the system tried to use the broken volume on sdb3.
In this instance I didn't make that mistake - both drives were connected only when i was booted from the live cd

That particular mistake is one that i made already - once upon a time.

Thanks for the response

Dick
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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] Can someone speculate? rmknox Linux - Hardware 3 10-29-2012 06:50 AM
LXer: Microsoft lawyer 'won't speculate' on more Linux suits LXer Syndicated Linux News 0 02-26-2009 08:30 PM

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

All times are GMT -5. The time now is 09:19 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration