Hi.
This thread is not a "question" thread, but much more an "answer" thread (for probably asked and maybe for some unasked questions).
Well, in this thread I will write my experience about moving everything (systems (WinXP & Lin) and /home) from one HDD to another. The reason I'm writing this post is because I did this on a laptop, where 2 laptop HDDs cannot be present at the same time. As you know this makes things a bit more complicated.
The situation:
In my laptop there was an old (3,5 years) 40GB PATA HDD and one day I decided to replace it. I bought a 160 GB HDD as a replacement.
Partition table of my drive:
hda1: winxp (NTFS)
hda2: linux (ext3)
hda3: swap
hda4: /home (ext2)
Preparing for system and user data transfer:
Before touching any hardware I did the following:
1.
Searched for a partition cloning software.
I found
CloneZilla. There are 4 reasons why I chose this: it boots from a CD, supports external drives (USB HDD in my case), supports cloning of NTFS partitions, I can chose if I want to compress the image of the partition or not. This is important, because many other cloning tools don't ask you about compression. Compressing many GBs of data takes much time, and when you only need a quick transfer of data you definately don't want any compression.
2. Searched for a good partitioning live CD for easy and quick partition management on the new HDD. I chose
Parted Magic. Any reasons? Well, it has everything I need.
3.
Now I opened a root console, (on the "to be cloned system"), mounted the external HDD and copied the whole /home directory to it. The reason I didn't clone it is because the on-disc file order is not important at all on the /home partition, and of course simple copying from disc to disc will defragment my files.
After that
I booted to CloneZilla and cloned my WinXP and Linux partitions. I created separate image files for both systems because of security reasons.
NOTE: cloning the entire disc is not an option when transferring systems and data from a smaller HDD to a bigger HDD!! Always clone partitions only!!
Moving data
1. Turned off computer, pulled out AC adapter, removed battery and finally
replaced the HDD to the new one.
2.
Booted Parted Magic, and created all the previously mentioned partitions.
NOTE No.1: My home is an ext2 partition because this way I have full read-write access to my data from both Windows and Linux. Windows has full access to ext2 with the help of
this.
NOTE No.2: If you also want to access an ext2 partition with the mentioned method you have to create the ext2 partition with the inode size of 128 and NOT 256! If it's 256 the windows tool won't mount the ext2 partition!
NOTE No.3: It seems that the latest parted magic (the mke2fs application through gparted) creates an ext2 partition with the inode size of 256 by default. There is no way to change it in gparted, so if you need 128, than you need to create the ext2 partition manually, in the console (using mke2fs of mkfs.ext2). Read the man pages for instructions.
NOTE No.4:parted (not gparted of qtparted!) came handy when I needed to create an empty, not formatted partiton for mke2fs.
NOTE No.5:If you want to put your systems on a bigger partition than they were previously, than you need to know this: Create just a slightly bigger (or the same size as the old one) partition for the systems. Don't forget to keep the necessary empty space after this and before the next partition for later partition growing.
So why you need to do this? Well, because the partition image you created, contains the filesystem too, and when you deploy it to the new place the old filesystem will be written to this new place (with the old size). Writing the old filesystem to the new one will result the old filesystem, despite the true size of the filesystem. To prevent waste of disc space you will need to grow the partition after you deployed the image.
3.
Booted CloneZilla again and deployed the partition images to the newly created partitions.
4.
Booted Parted Magic again and grew system partitions (see point 2, note no. 5 for reason). Now copied the whole /home folder back to the new and bigger hda4.
NOTE No.1:Don't forget to set the "boot" flag to hda1 (inside gparted), otherwise neither systems will boot!!
NOTE No.2:If you created a different partitioning on your new HDD (the /home is somewhere else now), that don't forget to modify your fstab, otherwise none of your user settings will work. This step is the appropriate time for doing this (after growing of course).
5.
Restored GRUB to MBR.
NOTE for the whole "guide(??)": I assume that everybody reads all the man pages and documentations for the mentioned (and not mentioned but related) applications before doing anything.
I take no responsibility for any data loss! (there shouldn't be any with proper background knowledge though).
Have fun!