HDD Upgrade

Other questions, messages

Moderator: feffer

gatorback
Posts: 11
Joined: Thu May 31, 2007 4:33 pm
Location: St. Augustine, Florida

HDD Upgrade

Postby gatorback » Fri Feb 27, 2009 3:19 am

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.

[email protected]
Posts: 3
Joined: Tue Jun 01, 2010 7:48 pm
Location: Austin, Texas
Contact:

RE: HDD Upgrade

Postby [email protected] » 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.

[email protected]
Posts: 3
Joined: Tue Jun 01, 2010 7:48 pm
Location: Austin, Texas
Contact:

Postby [email protected] » 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
fixGrub


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

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

[email protected]
Posts: 3
Joined: Tue Jun 01, 2010 7:48 pm
Location: Austin, Texas
Contact:

Postby [email protected] » 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.


Return to “Miscellanous”

Who is online

Users browsing this forum: No registered users and 1 guest