Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
First, I'm new here, forgive me if I've posted this in the wrong forum, it doesn't quite seem right for Hardware to me...
I'm trying to copy an NTFS partition from one drive to another and I'm stuck. I want to copy /dev/hda1 (20Gb NTFS partition on a 60Gb disk) to /dev/hdb (30GB disk, no partitions).
I've tried:
Code:
dd bs=64k in=/dev/hda1 out=/dev/hdb1
Which I picked up from another board, this fails and complains about in being unrecognised. Maybe this was old, anyway I then tried 'if' and 'of' instead:
Code:
dd bs=64k if=/dev/hda1 of=/dev/hdb1
and now get this error: "dd: writing '/dev/hdb1': No space left on device"
Is this because I need to create a partition to write to first? What do I need to do to get this to work? Or am I missing something else?
That made sense to me! I've made a partition on the second disk, I couldn't figure out how to make one the same size because of the geometry diffferences but using the sectors option of fdisk seemed to work like a charm.
dd works fine if you want to clone a drive to another and don't care about preserving any content on the target drive. In that case no partitions are needed on the target drive, it can be blank the way it comes when new. (File system agnostic) This copies any partitions and their content on the source drive to the target. So if the source is a 160Gb and the target a 320Gb drive then the target has become partitioned as 160GB when finished since it's an exact copy of the source. That can be adjusted later using some partitioning tool.
The source drive is 60GB, but the OP said he/she only wants to copy a 20GB partition from the source drive, not the entire drive including the MBR. There may be other partitions on the source drive, it is not common practice to only use a third of a drive and let the other 40GB sit wasted.
This is bad advice in this particular case. DD is dangerous when following bad advice.
If the OP would have asked for a little lesson in using dd, maybe this advice would apply in this case.
Last edited by Junior Hacker; 11-25-2008 at 10:48 AM.
First, I'm new here, forgive me if I've posted this in the wrong forum, it doesn't quite seem right for Hardware to me...
I'm trying to copy an NTFS partition from one drive to another and I'm stuck. I want to copy /dev/hda1 (20Gb NTFS partition on a 60Gb disk) to /dev/hdb (30GB disk, no partitions).
<snip>
Could you use ntfsclone?
Code:
ntfsclone --overwrite /dev/hdb1 /dev/hda1
Yes, those options are the right way around. Resizing the resulting 20GB image on hdb is an exercise left for the reader...or Google. :-)
That made sense to me! I've made a partition on the second disk, I couldn't figure out how to make one the same size because of the geometry diffferences but using the sectors option of fdisk seemed to work like a charm.
So it's dd'ing now, we'll see how it turns out!
Thanks again,
Al
If the two disks are reporting different geometries, then dd is likely to fail on the copy.
The last time I did that I was copying an NTFS partition off of a failing disk, and I kept having problems getting a good copy. I finally just created the new partition on the new disk and did a cp -ri from the old partition to the new one.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.