Fedora Linux Support Community & Resources Center
  #1  
Old 12th August 2012, 09:26 AM
gurutech Offline
Registered User
 
Join Date: Nov 2008
Location: Central NJ
Posts: 365
windows_8firefox
dd question on bitcopy of hard drives

A couple weeks ago I was able to use "dd" to bitcopy an 80gb hard drive to a 500gb drive. The only "issue" I ran into was that the new 500gb drive now had an 80gb partition and the rest was free space. I was able to correct this simply by extending the partition.

Just wondering what would happen if I had gone the other way, from a 500gb drive to an 80gb drive. Obviously the 80gb drive can't handle a 500gb partition. Would it just max itself out at the 80gb, or would I get an error saying it couldn't be done?

Should I go from the 500gb drive to an ISO, then from the ISO to the 80gb drive?
Reply With Quote
  #2  
Old 12th August 2012, 11:37 AM
george_toolan Offline
Registered User
 
Join Date: Dec 2006
Posts: 2,077
linuxfirefox
Re: dd question on bitcopy of hard drives

It doesn't fit. Try to shrink the partition first.
Reply With Quote
  #3  
Old 12th August 2012, 01:19 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,830
linuxfirefox
Re: dd question on bitcopy of hard drives

Not exactly efficient - even shrinking the partition (though it will fit) will still leave the filesystem metadata configured for the larger drive.
Reply With Quote
  #4  
Old 12th August 2012, 06:59 PM
Gareth Jones Offline
Official Gnome 3 Sales Rep. (and Adminstrator)
 
Join Date: Jul 2011
Location: Birmingham, UK
Age: 31
Posts: 2,765
linuxfirefox
Re: dd question on bitcopy of hard drives

dd will copy up to the point it runs out of space, then display a warning message that it did so.

You can shrink the partition, but you'll need to resize the file-system first to something smaller than the intended partition size, then expand the file-system to fill the partition after it's resized. See the resize2fs manual page if you're using ext2/3/4.

Or create a new partition and new file-system on the drive and use "cp -a" to copy the files. You'll probably need to "touch /.autorelabel" so that SELinux metadata is recreated on the next boot. Then you won't waste time copying unused blocks across.

If you just want to back-up onto the smaller drive, consider (compressed) tar instead.
Reply With Quote
  #5  
Old 12th August 2012, 09:57 PM
gurutech Offline
Registered User
 
Join Date: Nov 2008
Location: Central NJ
Posts: 365
windows_8firefox
Re: dd question on bitcopy of hard drives

I'd actually be copying an NTFS partition. I have the 500gb drive with about 50-60gb of data on it now, so I know it would fit on the 80gb drive.
Reply With Quote
  #6  
Old 12th August 2012, 10:21 PM
Gareth Jones Offline
Official Gnome 3 Sales Rep. (and Adminstrator)
 
Join Date: Jul 2011
Location: Birmingham, UK
Age: 31
Posts: 2,765
linuxfirefox
Re: dd question on bitcopy of hard drives

Then I'd definitely go with formatting the 80 GiB as a new NTFS (if you really must use that...) and using "cp -a" – SELinux attributes won't be an issue for NTFS, as it doesn't support them anyway, and shrinking file-systems is potentially more problematic than enlarging them, especially for reverse-engineered non-native file-systems like NTFS.
Reply With Quote
  #7  
Old 12th August 2012, 10:58 PM
gurutech Offline
Registered User
 
Join Date: Nov 2008
Location: Central NJ
Posts: 365
windows_8firefox
Re: dd question on bitcopy of hard drives

will the cp -a copy all of the "hidden" NTFS files (like $MFT, etc...) and allow it to boot from the drive once it's been copied?
Reply With Quote
  #8  
Old 12th August 2012, 11:50 PM
Gareth Jones Offline
Official Gnome 3 Sales Rep. (and Adminstrator)
 
Join Date: Jul 2011
Location: Birmingham, UK
Age: 31
Posts: 2,765
linuxfirefox
Re: dd question on bitcopy of hard drives

Quote:
Originally Posted by gurutech View Post
will the cp -a copy all of the "hidden" NTFS files (like $MFT, etc...) and allow it to boot from the drive once it's been copied?
I'm afraid I don't know about that. If it's an installed Windows system partition, I'd use Windows tools to resize it rather than Linux, unless you have space to back-up the whole partition image before resizing it.
Reply With Quote
  #9  
Old 13th August 2012, 12:49 AM
stoat Offline
Registered User
 
Join Date: Jun 2006
Posts: 7,550
linuxfirefox
Re: dd question on bitcopy of hard drives

Quote:
Originally Posted by gurutech

will the cp -a copy all of the "hidden" NTFS files (like $MFT, etc...) and allow it to boot from the drive once it's been copied?
So this has been about a partition with a Windows operating system. I tried that once with tar. Maybe you'll have a different and better experience than me with methods that copy files (e.g., cp, tar, rsync, etc). But like you speculated, all those normally hidden files such as desktop.ini and whatnot (zillions of them all over the place) were not hidden after "cloning" with tar (something I do routinely with Linux systems). The cloned system actually booted up, but I didn't want to deal with those messed up file attributes everywhere. So for cloning Windows I went back to imaging their partitions with Acronis TrueImage.
Reply With Quote
Reply

Tags
bitcopy, drives, hard, question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
question about hard drives? asif2k Hardware & Laptops 3 21st September 2006 02:53 PM
Newb question: 2 hard drives Private Iron Using Fedora 1 26th August 2006 09:56 PM
USB Hard Drives AcornTech Using Fedora 3 21st July 2006 06:42 PM
2 Hard Drives Rangerover Hardware & Laptops 21 17th August 2005 02:15 AM
Sharing hard-drives and mapping network hard-drives twn_onizuka Servers & Networking 0 14th June 2005 04:19 PM


Current GMT-time: 06:45 (Tuesday, 02-09-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat