LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (http://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Need to reduce the size of a dd image file to fit onto a new smaller SSD drive (http://www.linuxquestions.org/questions/linux-desktop-74/need-to-reduce-the-size-of-a-dd-image-file-to-fit-onto-a-new-smaller-ssd-drive-4175430857/)

bunchdaddy 10-06-2012 11:45 AM

Need to reduce the size of a dd image file to fit onto a new smaller SSD drive
 
I have a 320GB drive I am trying to clone to a new 240GB SSD drive. The 320 has problems and CloneZilla would not work so I have created a dd image file onto a 3rd drive. Now I want to take that 320GB image and reduce it to fit on the 240GB. There is <100GB of used space so the data will fit fine.
What is the best way to accomplish this?
Thanks,
--bunchdaddy

TobiSGD 10-06-2012 01:00 PM

I would rather do a file based copy out of the image to the SSD, for two reasons:
1. Shrinking the partitions/filesystems on the image is no trivial task and includes the risk of data loss.
2. If the 320GB drive from an older installation it is very likely that the partitions are not aligned in a way suitable for a SSD.

So my recommendation would be to partition the disk the way you need (recent versions of GParted will align the partitions automatically and also format the partitions in one go). Then mount the partitions in the image, use rsync or tar to copy the files to the SSD and then reinstall the bootloader.

bunchdaddy 10-06-2012 01:09 PM

Thanks for the info and quick reply. Can you give me some more info on reinstalling the bootloader? This is a winXP install but could I use something like GRUB?
Thanks again - bunchdaddy

TobiSGD 10-06-2012 01:51 PM

Just boot form your XP CD, start the recovery console and launch the commands
Code:

fixmbr
fixboot

On XP installs you can be sure that the partitions are not aligned in a way suitable for SSDs, so the file based approach is much better than copying the image.


All times are GMT -5. The time now is 12:11 PM.