LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cloning dual-boot drive onto a smaller drive. (http://www.linuxquestions.org/questions/linux-newbie-8/cloning-dual-boot-drive-onto-a-smaller-drive-810845/)

Harju 05-28-2010 10:05 PM

Cloning dual-boot drive onto a smaller drive.
 
Hi!
I've decided that I want to use another, smaller, hard drive for my OS and I'd like to clone /dev/sda onto /dev/sdc. I want it to be an exact clone except my partition for my "/home" will be smaller (since there's not room for it). I was gonna try with dd but I'm not sure if I should build the partition table and use dd-command on one partition at the time? Will this then include GRUB boot loader and will it be working properly? Do I have to clone the disk completely for it to boot properly?

I'm not sure how or where GRUB places itself on disks as you install it. Can I perhaps copy the partitions one by one and then install GRUB from CD afterwards? Should I leave some unallocated space somewhere in between the partitions as I build and clone them?

This is also my first question here on the forum. I hope someone can help me with this, would be nice to use my disks more effectively :)

syg00 05-28-2010 10:19 PM

Do not use "dd". Set up partitions then use (from a liveCD) "cp -a <source> <target>" (or rsync) for each partition.
And yes, you'll need to re-intall grub - can be done from the liveCD as well.

I like to leave some unallocated space - at the "end" of the disk; you can always move partitions around in need.

Harju 05-28-2010 10:26 PM

Quote:

Originally Posted by syg00 (Post 3984915)
Do not use "dd". Set up partitions then use (from a liveCD) "cp -a <source> <target>" (or rsync) for each partition.
And yes, you'll need to re-intall grub - can be done from the liveCD as well.

I like to leave some unallocated space - at the "end" of the disk; you can always move partitions around in need.

Why should I not use dd? One of the partitions is formated in NTFS, can it be handeled by the cp-command?

syg00 05-29-2010 04:49 AM

dd is a byte level copy. The target becomes the same as the source (including errors) - that means same size. Not a lot of use if you're trying to move to smaller partitions. Can be accommodated if you are careful - at least for all but (usually) the last partition.
NTFS is a major PITA - no so bad if only a data partition, but if it's the system (think C: ) partition, I don't move it. Period.

Harju 05-29-2010 11:40 AM

So moving the NTFS-partition is a very bad idea? I guess I'm gonna make a fresh install of windows on that drive and then I'll move my Debian-install over using the cp-command. Thanks for the tips, I'll report back when I've tried this :)


All times are GMT -5. The time now is 05:34 AM.