Need to reduce the size of a dd image file to fit onto a new smaller SSD drive
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
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.
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
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.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.