Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 7th April 2005, 03:39 PM
adrian_stephens Offline
Registered User
 
Join Date: Apr 2005
Posts: 17
How to do a hard disk upgrade using LVM?

Ideally I'd like to see a HOWTO that shows how to do a hard disk upgrade
for a system using LVM.

Here's how I did it (probably breaking all the rules, but hey it works!).
1. Fdisk created identical size partitions for new /boot and lvm physical volume
to the old partitions.
2. Used DD in single user mode to copy across the old contents
3. Swapped to new hard drive
4. Added partition for remainder of hard disk using fdisk
5. added that partition to the volume group and then extended / to use the info.

This all worked, but it took some time to discover the gotchas. Also, this is
not scalable, because each time I do this, I'm going to increase the number of
partitions comprising the volume group.

Observations along the way:
1. Parted had trouble with my old disk (auto formatted during FC3 install). It got
the geometry wrong, and wouldn't operate on it. I suspect it would be easier to copy
the partitions with it.

2. I thought that Parted "resize" partition was what I wanted - but this doesn't work with
lvm partions. Sigh.

3. Fdisk can be made to create partitions of exactly the right size, regardless of geometry by specifying the size in sectors.

4. pvresize sounds like it might do what I want. But this isn't there yet.

Someone, please tell me a cleaner way to do it!
Reply With Quote
  #2  
Old 7th April 2005, 04:05 PM
df12 Offline
Registered User
 
Join Date: Apr 2005
Posts: 102
I know this isn't really what you are looking for but I recently added an 80gig HDD (hde) to my LVM data volume (/dev/vg00/lvol00).
  1. pvcreate /dev/hde
  2. vgextend vg00 /dev/hde
  3. lvextend -L 80G /dev/vg00/lvol00 /dev/hde
  4. e2fsck -f /dev/vg00/lvol00
  5. resize2fs -p /dev/vg00/lvol00
Some things to consider, I'd suggest getting the latest version of e2fsprogs before begining this process. The version in FC3 has some *issues* you might run into otherwise. The fsck in step 4 above is required before resizefs will function...
Reply With Quote
  #3  
Old 8th April 2005, 06:41 PM
adrian_stephens Offline
Registered User
 
Join Date: Apr 2005
Posts: 17
Thanks for the info, I'd missed that I needed to resize the filesystem too. It's obvious when you say it.

Anyway, I booted into rescue mode, using lvm I did: vgscan and vgchang -ay.
Then I did the e2fsck and resize2fs as you describe.
Then I rebooted.

During reboot, the system complained that there was some problem with the filesystem and dropped into maintenance mode. It suggested I run fsck.

So, I ran fsck. There were several hundred errors of the form:
"Group inode bitmap at xxxx conflicts with some other fs block"

System restarted and ran, and I don't see any problems despite the rather scary errors above.


I'm pretty sure the way I approached this was wrong. I shouldn't try and copy the partition, but I should create a separate volume group using the larger device, create logical volumes on it, format and mount these. Copy across the files.

It's my guess that, given that the kernel already supports lvm, the only changes necessary in the /boot partion would be to update the name of the volume group/logical volume in the grub menu.
Reply With Quote
  #4  
Old 9th April 2005, 04:35 AM
df12 Offline
Registered User
 
Join Date: Apr 2005
Posts: 102
Yep, that's the e2fsprogs gotcha I mentioned. you need to get version 1.36 of e2fsprogs. Oddly enough they just made those updated rpms available through up2date or yum. Basically once you have the new e2fsprogs you'll have to do the following:
  1. debugfs -w /dev/vg00/lvol00 -R "features ^resize_inode"
  2. e2fsck -f /dev/vg00/lvol00
you'll need e2fsprogs 1.36 for this to work, 1.35 is/was the default in FC3.

---Edit---
I might have misread your post, if running fsck as you did, did not fix the errors then you'll probably have to do the steps above.

Last edited by df12; 9th April 2005 at 04:40 AM.
Reply With Quote
Reply

Tags
disk, hard, lvm, upgrade

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
Hard Disk Install Does Not Recognize Upgrade erector Installation and Live Media 0 6th May 2006 05:17 PM
Second Hard Disk sonny8988 Using Fedora 3 15th July 2005 12:24 AM
grub hard disk error after removing secondary hard disk with fc2 installed s86c EOL (End Of Life) Versions 3 6th March 2005 07:13 AM
second hard disk, again Galadan Using Fedora 4 27th February 2005 04:53 PM


Current GMT-time: 10:29 (Wednesday, 19-06-2013)

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