Page 1 of 1

HDD Upgrade

Posted: Fri Feb 27, 2009 3:19 am
by gatorback
I create an image with the stock 80GB HDD using partimage. If I upgrade the HDD to a 500GB drive, will the image work? Any experience or constructive insight is appreciated.

RE: HDD Upgrade

Posted: Tue Jun 01, 2010 7:52 pm
You shouldn't have any problems with getting the image to work on the larger hard drive. However, you will have to go back and resize the partition using a tool such as parted or gparted if you feel more comfortable in a graphical environment.

Posted: Thu Jul 08, 2010 4:17 pm
I normally store my images as a 4GB image so that I can push it out to other machines that range from having a 5GB partition to a 40GB partition. Partimage seems to have a small quirk that if you image from a smaller partition to a larger one, it will maintain its size, but allocate the entire space. IE: My 4GB image pushed to a 10GB partition takes up the full 10GB of space, but reports only 4GB available. I had to add the following in my reimage code. With these changes, everything works great and the partitioning is allocated properly. I also included the code I use to repair grub before booting into the reimaged Linux partition. Hope this helps!!

partimage restore -b -f3 $targetPartLinux $imageDir/$imageName
# e2fsck needed by resize2fs to resolve sizing issues
e2fsck -fy $targetPartLinux
# Correcting resize issue caused by restoring to larger partitions
resize2fs $targetPartLinux
# call fixGrub function to fix grub

# My Linux partition id sda5. You will have to adjust the root
# and setup to match your schema
if [ ! -d /active ]; then
mkdir /active

mount $targetPartLinux /active
if [ -f /active/sbin/grub ]; then
/active/sbin/grub --batch <<EOT >/dev/null 2>&1
root (hd0,4)
setup (hd0,4)
/active/usr/sbin/grub --batch <<EOT >/dev/null 2>&1
root (hd0,4)
setup (hd0,4)
umount /active

Posted: Thu Jul 08, 2010 4:22 pm
Side note... That fixGrub function will not work properly on grub2.
I have done some work trying to get the same functionality out of grub2 to match what has been working, but as far as I can tell there is still some work that needs to be ironed out and I ended up reverting back grub for our test systems.