Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora Resources > Guides & Solutions (No Questions)
FedoraForum Search

Forgot Password? Join Us!

Guides & Solutions (No Questions) Post your guides here (No links to Blogs accepted). You can also append your comments/questions to a guide, but don't start a new thread to ask a question. Use another forum for that.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 14th August 2005, 05:45 PM
wizard Offline
Registered User
 
Join Date: Jun 2004
Location: surreal city, usa
Posts: 98
How to move a Fedora installation to a larger hard drive

ext2 or ext3 filesystems only, but this might help someone. Let's assume your Fedora installation has only a root and swap partition, but these instructions can be modified for other uses.

What you need:
  • A target hard drive that's at least as big as the source drive
  • Fedora rescue disk - the later the better
  • A bootable g4l CD - you can download the iso from http://sourceforge.net/projects/g4l
  • Patience and the ability to follow instructions
Okay, here we go...

1. Here's the obligatory 'back up everything' step. The #1 rule of geek professionalism is to never go somewhere you can't get back from. I know, my grammar sucks but it's still true.

2. Insure your system's BIOS is set to boot from CD-ROM first.

3. Power down the system and hook up the new hard drive. Leave the existing hard drive in place.

4. Boot from the g4l CD. At the boot: prompt, type g4l. When you get to a shell prompt, type ./g4l

5. Clone the old drive to the new one in RAW mode using the 'click and clone' thing in g4l. Make DAMN sure you have the source and target drives right otherwise you'll overwrite your Linux installation with a blank hard drive and that would truly suck.

6. Power down the machine and remove the old hard drive from the system. Put it on a shelf so you can put stuff back the way it was if you get stuck or get interrupted or the power goes out or your cat or kid reboots your machine in the middle of the rest of the operation.

(For the rest of this howto we're gonna assume that your Linux partition is /dev/hda1 and your swap partition is /dev/hda2 - you may need to modify this stuff for your own needs.)

7. Boot from the Fedora rescue CD. Do *not* mount the filesystem when prompted - select 'Skip' instead.

8. Check the partition for errors. e2fsck -f /dev/hda1

9. Run parted. Move the swap partition to the very end of the hard drive. Exit parted.

10. Check the partition again. e2fsck -f /dev/hda1

11. Now here's the scary part. Assuming that your Linux partition is /dev/hda1 - run fdisk. Make sure you know where the start block for your Linux partition is - if it's the first partition on the hard drive normally this will be block 1. Write it down. Then delete the partition.

12. Still in fdisk, create a new primary partition with the same number as the one you just deleted and *insure* the start block is the same one as the partition you just deleted. Let the new partition take up all the remaining disk space. Write changes to the disk and exit fdisk.

13. Check the partition one more time. e2fsck -f /dev/hda1

14. Now what you've got is all the data on the proper size partition but the filesystem size hasn't changed. We fix that with resize2fs -f /dev/hda1

15. All done. Reboot. Enjoy

I've never had to reinstall grub using this method, but it'd be good to know how to do that just in case.

One more thing. If you decide to put the old hard drive back in be sure that if /etc/fstab and /boot/grub/device.map think you're booting off the first hard drive that you actually make sure the hard drive you just set up *is* the first hard drive in the system

Last edited by wizard; 14th August 2005 at 05:57 PM.
Reply With Quote
  #2  
Old 15th August 2005, 06:22 AM
gavinw6662 Offline
Registered User
 
Join Date: Feb 2005
Age: 35
Posts: 1,281
that's a pretty nice guide, I think I might have to put it in my archives to remember. Thanks!!
__________________
I read your e-mail
Reply With Quote
  #3  
Old 16th August 2005, 03:05 AM
bazzee Offline
Registered User
 
Join Date: Aug 2005
Location: Sydney Australia
Posts: 1
I tried this method to transfer FC3 from a 40G drive (hda) to an 80G drive (hdb). But I stopped after step 6, removed the old drive, and reconfigured the new as hda (primary master). The system booted as though nothing had changed! I am very pleased with this.

Although there is now 40G of unused space on the new drive i am considering creating another partition for another logical volume for home directories etc. Once I figure out whether it's worth doing it that way!

The transfer process using g4l in raw mode is a little slow, about 12MB/s, and it appeared to be copying the whole 40GB bit-by-bit. There may be some benefit to using the file copy option however the possible time savings here (only copying actual files rather than every single bit) will be offset by the need to set up the target partitions manually. Possibly it would have been faster with the drives on separate IDE channels...

Regardless, I am very pleased with the result, thanks for the good work!
Reply With Quote
  #4  
Old 16th August 2005, 11:57 AM
wizard Offline
Registered User
 
Join Date: Jun 2004
Location: surreal city, usa
Posts: 98
Glad to see it worked for you, bazzee

Yeah - raw mode is a sector copy as opposed to a file copy. It is a little slow, and I copied between two SCSI drives with about the same results - I guess I should have said that I only copied a 9gb drive and that took a bit more than 20 minutes
Reply With Quote
  #5  
Old 30th August 2005, 02:23 PM
axel Offline
Registered User
 
Join Date: Apr 2005
Location: Thessaloniki, Greece
Posts: 290
Hey, i am planning to install fc4 on an externall HDD, let's say /dev/sda1, in order to boot from it and test it on my system. I have fc3 on /dev/hda6 at the moment. Is it possible to copy the installation from sda1 to hda6 if it works ok for me? After the copy, will i have to make any changes in the fc4 installation in order to replace all /dev/sda1 references with /dev/hda6 or this is made automatically?
Reply With Quote
  #6  
Old 30th August 2005, 03:49 PM
wizard Offline
Registered User
 
Join Date: Jun 2004
Location: surreal city, usa
Posts: 98
You'll have to make significant changes to the installation - /etc/fstab and /boot/grub/device.map will both need to be changed and grub will need to be reinstalled on /dev/hda. I *think* since you're booting from an extended partition that grub needs to be installed on the drive's MBR but I may be wrong.

Maybe someone else can chime in here?
Reply With Quote
  #7  
Old 10th September 2005, 07:03 PM
sinistrx Offline
Registered User
 
Join Date: Sep 2005
Posts: 1
Quote:
Originally Posted by wizard
ext2 or ext3 filesystems only, but this might help someone. Let's assume your Fedora installation has only a root and swap partition, but these instructions can be modified for other uses.
I tried doing this with an FC3 installation that I had ext3 turned on with. Everything went fine following these steps until I did resize2fs (doing an fsck on the new partition size right after deleting/recreating the partition but before doing resize2fs would check out fine). Doing an fsck after the resize2fs that would tell me that there were several illegal inodes and parts that need to be relocated (it would do this in an infinite loop, restarting fsck to 0.0% after relocating several times). Is this b/c the original had journaling already on and it needed to be somehow turned off?
Reply With Quote
  #8  
Old 12th September 2005, 07:17 PM
wizard Offline
Registered User
 
Join Date: Jun 2004
Location: surreal city, usa
Posts: 98
I don't know, sinistrx - it didn't happen for me and I didn't have to turn journaling off.

If you want to try it without journaling here's how to do it on an unmounted filesystem - let's assume the partition is /dev/hda1:

1. tune2fs -O ^has_journal /dev/hda1
2. e2fsck /dev/hda1
3. edit /etc/fstab to change /dev/hda1 to mount type ext2

Then maybe try resizing the partition - to turn journaling back on (again on an unmounted filesystem):

1. tune2fs -j /dev/hda1
2. e2fsck /dev/hda1
3. edit /etc/fstab, and for /dev/hda1, change ext2 to ext3

hope this helps -
Reply With Quote
  #9  
Old 24th July 2006, 11:09 PM
twist3d Offline
Registered User
 
Join Date: May 2006
Posts: 8
does this work on S-ATA drives too ?

Last edited by twist3d; 24th July 2006 at 11:20 PM.
Reply With Quote
  #10  
Old 6th August 2006, 05:43 PM
wizard Offline
Registered User
 
Join Date: Jun 2004
Location: surreal city, usa
Posts: 98
No reason it shouldn't.
Reply With Quote
Reply

Tags
drive, fedora, hard, installation, larger

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Migrating FC5 Default Install to Larger Hard Drive gadgetwiz EOL (End Of Life) Versions 14 2nd October 2006 02:33 AM
I want to move Fedora Core 2 to another hard drive in my system. zenwhen Using Fedora 6 24th August 2004 04:41 PM


Current GMT-time: 08:25 (Thursday, 02-10-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat