LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-20-2010, 04:36 PM   #1
pofadda
Member
 
Registered: Jan 2005
Location: Bristol, UK
Distribution: Depend on what was loaded yesterday...
Posts: 50

Rep: Reputation: 15
Unwanted dd result


I have just tried to clone the total contents of my XP partition using dd to another NTFS partition, just as a parking place while I wreck its original in situ. My intention is to return the files to the original partition after my experiment.

I wrote in a Linuxmint Live terminal:
sudo dd if=/dev/sda3 of=/dev/sda2

When it was finished, my results looked like this:
...
mint@mint ~ $ ls -al /media/SpareSpace
ls: cannot access /media/SpareSpace/NVIDIA: Input/output error
ls: cannot access /media/SpareSpace/trace.txt: Input/output error
[snip]
ls: cannot access /media/SpareSpace/ProgramData: Input/output error
ls: cannot access /media/SpareSpace/Recovery: Input/output error
[more snip]
ls: cannot access /media/SpareSpace/_Backup.RC: Input/output error
total 12
drwx------ 1 mint mint 12288 2010-02-20 14:29 .
drwxr-xr-x 7 root root 140 2010-02-20 15:43 ..
-????????? ? ? ? ? ? autoexec.bat
d????????? ? ? ? ? ? $AVG
d????????? ? ? ? ? ? _Backup
d????????? ? ? ? ? ? _Backup.RC
-????????? ? ? ? ? ? config.sys
d????????? ? ? ? ? ? Documents and Settings

... and so on. Clearly, I need to redo it.

What (many things) did I do wrong?
 
Old 02-20-2010, 04:48 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
I think you changed the partitioning and filesystem on the disk after it was mounted. You don't need to clone the partition. It is a bad idea if the two partitions don't match up in size. Try unmounting the partition and remounting it.


If this fails reformat the drive, and use something like:
sudo dd if=/dev/sda1 of=/media/SpareSpace
instead. If you want to pull files from the backed up image, you can mount the image using the "loop" option. Try to mount it before mucking with /dev/sda1.

---

Note. The location of the mounted drive (/media/SpareSpare) implies an external drive but the device you used ( of=sda2 ) implies the destination was on your primary fixed hard drive. Be very careful when using the dd command. Make sure you absolutely know which drive and partition is which.
 
Old 02-20-2010, 05:26 PM   #3
minrich
Member
 
Registered: Aug 2003
Location: Isles of Man & Wight
Distribution: See signature
Posts: 548

Rep: Reputation: 40
I think that the output of: sudo fdisk -l

would help us help you
 
Old 02-20-2010, 06:31 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 17,689

Rep: Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795
Quote:
Originally Posted by pofadda View Post
I have just tried to clone the total contents of my XP partition using dd to another NTFS partition, just as a parking place while I wreck its original in situ. My intention is to return the files to the original partition after my experiment.
Using dd for backup purposes is a *bad* idea - but at least you had the nous to check your backup first.
In addition to the above, go read this - at least you'll have some confidence the filesystem is o.k. on the backup.
 
Old 02-21-2010, 10:35 AM   #5
pofadda
Member
 
Registered: Jan 2005
Location: Bristol, UK
Distribution: Depend on what was loaded yesterday...
Posts: 50

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by syg00 View Post
Using dd for backup purposes is a *bad* idea - but at least you had the nous to check your backup first.
Yes... What I didn't tell you was that, thanks to a dodgy keyboard battery, My first (very short) run of dd was truncated by one digit - the partition number. Quickly corrected with crossed fingers, this went un-noticed by dd which completed as described. And was the very probable cause of the mess. The result is that I have a totally unstructured HDD, prick that I am. Oh well.

Why is it a *bad* idea? I suspect my woes were self-inflicted.

Quote:
In addition to the above, go read this - at least you'll have some confidence the filesystem is o.k. on the backup.
Many thanks for this. I'll be using it soon. Amazing how much good stuff there is out there, more than one person can really get a handle on.
 
Old 02-21-2010, 06:23 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 17,689

Rep: Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795Reputation: 2795
dd is unaware of, and doesn't care about, filesystems - i.e. your data. If there are errors in the filesystem itself, or on the media (or you screw up ) dd blithely carries on and you will wind up with a bad/corrupt copy. And you'll generally never know about it.
If you use a filesystems aware tool, you'll hear about it, and can take remedial action immediately.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
m4 sendmail.mc > sendmail.cf generate unwanted result on OpenSolaris johncsl82 Solaris / OpenSolaris 1 09-08-2008 11:25 PM
unwanted data leveex Slackware 5 01-05-2007 02:21 AM
Unwanted link mat_uk111 SUSE / openSUSE 1 05-18-2006 09:04 PM
unwanted folders oscotty General 11 08-28-2005 01:01 PM
Unwanted shutdown tireseas Linux - Hardware 17 01-02-2004 06:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:16 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