Google Site SearchFN Site Search FN Blog Login FN Blog Login
Site Navigation:
 
 

Moving your fedora install to a larger HDD

by Stephen Webley on Mar 02, 2004

This artical assumes a very vanilla install of fedora core 1 but may be useful to others.

The approach I take here was undertaken out of nessessity. I finally had my FC1 system up and running with a nice theme, all updates applied and HEAPS of groovey free apps installed. It was about the time I started ripping a few CD's to listen to tunes while surfing that I discovered my 4 gig IDE was not going to make the grade. I need more space and now. What a situation, I finally had my install the way I wanted it and now I would have to do it all over again.

I have used FC1 since it was released and must say I like it. It is a bit cutting edge but hey, if it works i'm happy. Now, I work in the industry as a System Administrator and have a solid background in Linux but todate I have been unable to make the switch from MS fulltime. Along came FC1 and I realised I hadn't booted to XP for an age. Solution: toast XP and move my install to the free 15 gig IDE and no more problem.

Well so I thought. How does one move a linux system to new hardware ???. The answer would be found with a quick search of google or a visit to the VERY clever and helpful people in #fedora on freenode. After a bit of looking and a lot of asking questions the best I could come up with was to copy everything over and all would be well. So I booted for the FC1 CD and enter linux rescue with both drives in and choose not to mount my existing system. I used the command dd if=/dev/hda of=/dev/hdb and it duplicated the disk with no problems.

Now how does one resize a partition in Linux ???. My disk is pretty straight forward. I have a 128 meg primary partition #1 that mounts to /boot. I have a  root primary partition #2 that takes up the remaining disk (minus my swap partition #3). On the new disk the same was so except there was a heap of free space at the end of the disk. The system started and ran with no errors so all that was left was to expand my root partition and enjoy some free space at last. He is how I did it. Once again boot to the rescue disk with my new 15 gig as the master and again I didn't mount my system. I then used fdisk to toast my swap partition noting the size in blocks. I then toasted my data partition and recreated it with THE SAME STARTING POINT. I naturaly used all the free space minus what I needed for my swap partition. I then ran resize2fs  /dev/hda2 and it complained about needing a check and kindely spat out instructions on how to do this. Next I ran the command e2fsck -f /dev/hda2 and tried the resize program again. SUCCESS it did what I wanted and maxed out the filesystem in the partition and all was well.

Now this is the approach I took so please feel free to add any further information on this topic. I'm sure others would like to know how to do this type of thing.

Cheers for now,

Stooge

PS: My first article ever regarding Linux :).