PDA

View Full Version : cloning partition



billcu
6th July 2015, 01:50 AM
I would like to clone an ntfs parition of two different sizes. I would like to get good with dd. And I am asking about that. But I could use a form of 'cp' or ntfsclone with F20 if need be.

The source parition is about 160 GB the destination is 30 GB. The amount of data to copy is a little over 4 GB. So there is enough room on the destination for data. But the partition sizes are different. Can dd take care of this? What about dd or sfdisk or fdisk -S ? Then what about ntfsclone?

flyingdutchman
6th July 2015, 04:22 AM
Howdy,

Data Definition is a low level byte for byte copy program. It doesn't interpret what it copies. So whether copying 4 GB of data will work or not, depends on the state of the file system that you are copying.

If you defragment NTFS, so that all the data resides inside the first 4 GB, then copying only the first 4 GB will work. If not, it won't.

Simple as that.

jpollard
6th July 2015, 08:01 AM
Howdy,

Data Definition is a low level byte for byte copy program. It doesn't interpret what it copies. So whether copying 4 GB of data will work or not, depends on the state of the file system that you are copying.

If you defragment NTFS, so that all the data resides inside the first 4 GB, then copying only the first 4 GB will work. If not, it won't.

Simple as that.

Well, almost. The 4GB of the data you want will be packed... But you must also allow for the metadata that is used by NTFS to describe that 4GB.

I don't know the overhead NTFS imposes, but just copying 4GB will likely not get everything you want - if the overhead to describe the 160 GB takes up 4GB, then you would have to copy AT LEAST 8GB...

Personally, I would suggest trying to copy the first 30GB (which is the size of the destination...)

Then you can try to read the data. But note: the NTFS description will still be for the 160 GB partition and that may introduce some other errors or require some repair... and that conceivably could cause other errors (dynamic table sizing changing allocations?)

I would think that mounting two filesystems, then copying the data you want would work more reliably.

billcu
6th July 2015, 10:46 PM
I seem to run into some trouble formatting an ntfs system with mkfs.ntfs. When I use a XP windows defragmenter the filesystem just isn't the same than if formatted with a windows xp formatter. If I copied this to a fat32 partition then back to an ntfs one. Via mounting two filesystems in ext3 would that work?

antikythera
6th July 2015, 11:37 PM
Can I suggest an alternative?

Try using GParted from Live MATE-Compiz for example to create and format the new partition, maybe less problematic. Also, if the source and destination partitions are both accessible at the same time you can then mount the two NTFS partitions and use the file manager (Caja) with 'show hidden files' checked to copy the 4GB across in entirety. There should be no need to bother with FAT32 or Ext3 :confused:

Also, Windows XP partitioner is not great at aligning partitions properly. GParted will align better.

billcu
6th July 2015, 11:58 PM
Can I suggest an alternative?

Try using GParted from Live MATE-Compiz for example to create and format the new partition, maybe less problematic. Also, if the source and destination partitions are both accessible at the same time you can then mount the two NTFS partitions and use the file manager (Caja) with 'show hidden files' checked to copy the 4GB across in entirety. There should be no need to bother with FAT32 or Ext3 :confused:

Also, Windows XP partitioner is not great at aligning partitions properly. GParted will align better.

The thing is my DVD-RW is now broken. My cat knocked the computer on the floor and the drive stays out all the time and will not stay in. I haven't received my new usb dvd burner yet. I hate to mess around too much. As a side note they talk about rsync being such a good copier. It seems too complicated for its' own good imo. I can't get some things to copy and I have tried rsync -XAav.

I thought I was going to confuse. I have an empty fat32. My ext3 and the ntfs with my in XP x64 system. i mount /dev/sda3 /tmp and tmp contains the fat32 or empty partition. I have tried it with ntfs too as well as fat32. /xp is mounted as the main ntfs filessytem. I have tried cp -rav from /xp to /tmp. I will look at gparted. Or maybe parted. I have no gui install right now.

It has seemed to me that the mkfs.ntfs doesn't align partitions. Or it has seemed to be the trouble.