LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-30-2006, 07:20 PM   #1
SparceMatrix
Member
 
Registered: Aug 2002
Distribution: SME Server, CentOS
Posts: 219

Rep: Reputation: 30
How to migrate Fedora Core 5 installation to a new hard drive using LVM?


I have a Fedora Core 5 installation that uses Logical Volume Management and I would like to transfer this system to a new hard drive. I have a USB connected drive and I would hope to be able to move the new system on to the new, larger hard drive there. From there, I would move it into the original machine swapping it with the one there.

How do you set up the new drive on the USB and how do you transfer the old installation on to the new drive? There is a graphical tool system-config-lvm that looks like it might be useful.

Any documentation, tips or clues would be appreciated.
 
Old 05-02-2006, 09:09 AM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
The LVM Howto has the instructions. It's basically a two step process: add the new drive as a physical volume, then remove the old physical volume. In the process documented, the data will be migrated off the old volume.
 
Old 05-05-2006, 12:11 AM   #3
SparceMatrix
Member
 
Registered: Aug 2002
Distribution: SME Server, CentOS
Posts: 219

Original Poster
Rep: Reputation: 30
That sounds good and I'll try it. I found your post a little late, so let me post what I've done so far and my conclusions. And, I think the use of "dd" in managing the boot partition is still relevent as the boot partition is not managed by LVM.



Here is what I've done:

I start with my Fedora 5 Core installation on a little 8 GB drive on /dev/hda

I install my larger 40 GB so that it is available as /dev/hdc

Using fdisk I give /dev/hdc two new partitions to match the installation on /dev/hda as provided Fedora's installer; /dev/hdc1 with the boot sector toggled on and a Linux 83 system partition type and /dev/hdc2 with the rest of the drive set to Linux LVM 8e partition type.

I apply the instructions I found at this link:

http://www.rajeevnet.com/hacks_hints...s_cloning.html

dd if=/dev/hda of=/dev/hdc bs=446 count=1
dd if=/dev/hda1 of=/dev/hdc1
dd if=/dev/hda2 of=/dev/hdc2

I shutdown and remove the original drive so that the new 40 GB drive is the only one found by BIOS and boot.

Great! That worked. I'm back again in the new drive, but I look around at all the graphical interfaces explaining my paritions and all I see is the original space that the old installation has. I look at the Logical Volume Manager and see that my main /dev/VolGroup00/LogVol00 is only 7.22 GB. Poking around Logical Volume Manager provides no clues as to where the rest of my hard drive is and how I can get at it.

So, I figure out that the way to access LVM from the command line is "lvm". "vdiskscan" gives me a list showing /dev/hdc2 as being 37.16 GB with "LVM Physical Volume" labeled after it. "lvextend" looks like it might be promising in getting me the rest of my disk, but I keep getting "insufficient ... extents ... allocated" or something.



I'll try your suggestion and see what happens.
 
Old 05-05-2006, 11:19 AM   #4
SparceMatrix
Member
 
Registered: Aug 2002
Distribution: SME Server, CentOS
Posts: 219

Original Poster
Rep: Reputation: 30
Success!

Yes, macemoneta has it. After you get the partitions set up and "dd" the boot drive over as explained in the link above, it is simply a matter of accessing the hard drive and proceeding as macemoneta describes. I used the Logical Volume Manager which did the job handily.

I'll summarize the proceedure again:

Start with your original Fedora 5 Core installation on /dev/hda -- or where ever your original drive is. Make sure you get that straight or "dd" below may destroy your installation.

Install your target drive so that it is available as /dev/hdc -- or where ever you want your target drive to be. I prefer installing on IDE because even USB 2.0 is so much slower to copy all those files.

Boot up to a desktop and using fdisk from a console (you should have some familiarity here with fdisk) give /dev/hdc two new partitions to match the installation on /dev/hda as provided Fedora's installer; /dev/hdc1 with the boot sector toggled on and a Linux 83 system partition type and /dev/hdc2 with the rest of the drive set to Linux LVM 8e partition type. The rest of the drive constitutes your new larger host drive.

I apply the instructions I found at this link:

http://www.rajeevnet.com/hacks_hints...s_cloning.html

The two "dd" instructions copy the boot capacity of the original drive to the new target drive. Again, make sure you get your locations right or you may destroy your original installation.

dd if=/dev/hda of=/dev/hdc bs=446 count=1
dd if=/dev/hda1 of=/dev/hdc1

Now, from the desktop, go to Administration->Logical Volume Manager.

If I recall correctly, you must initialize your target drive's partition that shows up as uninitialized in the left window -- /dev/hdc2. It will then show up further up. You add this physical volume to your current original drive's volume group. It then becomes an extension of your original drive. If you wanted to, you could just leave it at that and use the additional space. But if you have other plans like I did, now you remove the original physical volume -- /dev/hda2. This procedure is available with the physical volume focused in the Manager's window. All the files you need from the original volume will be copied to the new target drive. This takes a little time even over IDE. Finally just remove the original hard drive and leave the target drive to boot up and it will, just like it was the original. Now the installation has been completely migrated to the new hard drive. END OF JOB

The only thing I haven't examined is what happens to the original drive. Is it completely unusable now? If I wanted to go back to that drive, would my original installation still be there?

The last part with the Manager might be easier from the command line as described at macemoneta's LVM How To link.
 
Old 05-05-2006, 10:31 PM   #5
Bobymc
Member
 
Registered: Apr 2006
Location: INDONESIA
Distribution: SLAX,Damn S.L,Suse,Mandrake,Rd HAT62,72,73,90, Mandriva2k6, FEdora, SUNmicrosys.
Posts: 269

Rep: Reputation: 30
Hello there, I've been wanting to do like you guys but I want is like I do in Window[Norton Ghost] so I can move the entire LINUX instalation to a single image file and restore to another drive.

Is there any special command/utility in doing that?
 
Old 05-05-2006, 11:04 PM   #6
SparceMatrix
Member
 
Registered: Aug 2002
Distribution: SME Server, CentOS
Posts: 219

Original Poster
Rep: Reputation: 30
I am not aware of one. I would have liked to have been able to do that myself.

And also, about my original installation on the original hard drive. It is not copied to the target drive. I tried to boot up the original hard drive by itself and the kernel could not find the host volume and the boot was incomplete. This makes sense, it is at least Logical as the new system implies.

I have to admit, despite all the fuss, I kind of like LVM.

Last edited by SparceMatrix; 05-05-2006 at 11:09 PM.
 
Old 05-06-2006, 10:59 AM   #7
Bobymc
Member
 
Registered: Apr 2006
Location: INDONESIA
Distribution: SLAX,Damn S.L,Suse,Mandrake,Rd HAT62,72,73,90, Mandriva2k6, FEdora, SUNmicrosys.
Posts: 269

Rep: Reputation: 30
OK on using LVM but by the time you meet multipleBOOTloader XP,FEDORA,SUSE in 1 DISK would'nt that be a problem ( I hope NOT ,coz I had that system )...........
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
migrate to a new hard drive vk101 Linux - Hardware 7 11-24-2005 02:38 PM
Windows installation cant see the whole hard drive after Fedora Core fratkiller General 1 10-08-2005 08:34 PM
hard drive migrate scankyfrank Linux - Hardware 8 06-05-2005 04:53 PM
Updated to Fedora Core 2 and can't get at my second hard drive redhatman Linux - Newbie 2 08-10-2004 03:19 PM
Problem in Fedora Core 2 Hard Drive installation raysonpak Linux - Newbie 0 05-25-2004 11:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 02:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration