l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
November 4: Social gathering
Next Installfest:
TBD
Latest News:
Oct. 24: LUGOD election season has begun!
Page last updated:
2007 Aug 28 13:50

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] I'm over my head - need a cookbook for transferingsystem to new disks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] I'm over my head - need a cookbook for transferingsystem to new disks



On Wed, Aug 22, 2007 at 12:14:58PM -0700, Brian Lavender wrote:
> On Tue, Aug 21, 2007 at 06:36:00PM -0700, Bill Broadley wrote:
> > 
> > I also figured I'd mentioned that with a mirror it's even easier.  I just 
> > did this to migrate from 2 250GB disks to 2 500GB disks.
> > 
> > Something along the lines of:
> > #1 Pull disk B, put it in a safe place in case this goes poorly.
> > #2 Insert 500 GB disk B
> > #3 partition disk b
> > #4 hotraid add
> > #5 install grub
> > #6 wait for raid sync
> > #7 shutdown, put 500 disk B in slot A and new 500GB disk in slot b
> > #8 partition disk b
> > #9 hotsync b
> > #10 install grub
> > #11 resize2fs and/or lvextend
> > 
> > No need for partition magic, and most importantly if it goes poorly you
> > have an original disk to use.  Partition magic and friends often work, but I
> > wouldn't want to try them without a backup.  You have a backup... right?
> > 
> > So there's potentially 3 things to change:
> > 1) Software RAID
> > 2) LVM (pvresize and/or lvextend)
> > 3) Actual filesystem (resize2fs or friends)
> 
> That's pretty cool. Do you just partition the whole new 500 Gig new disk
> with one md partition? And then do the pvresize on top of that?
> 
> ext2online will resize it while it is live. It can only grow though, not
> shrink.

I got together with Dave and we were able to expand the system to use the
full 500 Gigs. I let him give the final verdict. We ended up booting the
Ubuntu install disk (Rescue disk in this case) and then did an apt-get
install mdadm (RAID tools). Then I printed out this HOWTO by Ingo Molnar
who wrote some the original RAID code 99 or 2000, but it turns out the
RAID commands have all changed, not to mention the config file seems
to have changed as well. One of the interesting things I noticed is
that when you create a RAID, it has a physical geometry on the disk for
/dev/md0. So, here's what we did with a little voodoo magic in the middle.

1 Failed a disk on the RAID.
2. Created an ext3 partition on that failed disk.
3. Copied the files off the RAID partion onto the ext3 partition.
4. Stopped the RAID. 

This is where it got a tricky.

5. We created a RAID 1 with one disk onto the whole 500 Gig partion.
What we wanted was a RAID 1 with two disks, but the other disk was
really a failed disk, but I couldn't see a way to do this with mdadm
tools syntax.
6. Formated the RAID 1 and then copied the files from the ext3 back onto
the RAID 1.
7. Used fdisk to change the ext3 partition back to an MD partition.
8. Used mdadm to add the disk to the RAID partition.

But then the RAID showed RAID 1 using 1 disk and the other was a spare.
We wanted the other disk to join the RAID 1 making a it an actual RAID
1

So, we scratched our heads. and this is the voodoo magic, but it seemed
to work.

9. Stopped the RAID. 
10. Used mdadm to create a RAID 1 with the two disks. Magically, it used
the one disk and began syncing the second disk into the RAID.

VooDoo Magic!!

brian
-- 
Brian Lavender
http://www.brie.com/brian/
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Appahost Applications
For a significant contribution towards our projector, and a generous donation to allow us to continue meeting at the Davis Library.