[nflug] Replacing Linux Disk Drives (Cloning?)

David J. Andruczyk djandruczyk at yahoo.com
Tue Feb 6 16:12:01 EST 2007


I use mondo-rescue for a DR tool (Disaster recovery).  It works remarkably
well.. 

so you have many choices (grow array, partition with lvm,  copy, remove old
paritions, add free space to VG, etc....)

use mondo-rescue...

use a USB memory stick ( not recommended due to speed, reliability, nothing
like flash memory that wear out and starts throwing bits)



--- Justin Bennett <Justin.Bennett at Dynabrade.com> wrote:

> I've only used the normal Distro's (Usually Redhat Enterprise) CDs, I'll 
> keep it in mind, especially if I get into trouble. :)
> 
> Thanks
> 
> Justin
> 
> 
> David J. Andruczyk wrote:
> > mondo-rescue is an excellent tool to use as well...
> > I've used it to backup boxes to CD/Tape/remote, and reload elsewhere or
> on
> > the same box with new drives..
> >
> > http://www.mondorescue.org/
> >
> > --- Justin Bennett <Justin.Bennett at Dynabrade.com> wrote:
> >
> >   
> >> I've got a 200/400GB tape drive, my first task is to back it all up, 
> >> that's my failsafe. In the past I've just launched a linux rescue 
> >> console, partition the drives the same way, (as far as partition numbers
> 
> >> size will obviously vary, to keep the fstab in sync), mount the new 
> >> filesystem, untar to the fiesystem, do a chroot to the filesystem, 
> >> install the boot loader, and reboot. It's been years since I've needed 
> >> to do that, and was wondering if anybody's run into any issues doing 
> >> that. It's the same hardware so kernel and initrd will still be valid.
> >>
> >> I've never played with the LVM stuff so I am kinda intrigued to see it
> >> work.
> >>  
> >>
> >> Mark Musone wrote:
> >>     
> >>> I'd just stick in a USB drive as a transfer drive...
> >>>
> >>> Copy from existing drives. Take out drives. Put in new ones. Untar.
> Done.
> >>> life is good.
> >>>
> >>> -Mark
> >>>
> >>>
> >>> -----Original Message-----
> >>> From: nflug-bounces at nflug.org [mailto:nflug-bounces at nflug.org] On
> Behalf
> >>>       
> >> Of
> >>     
> >>> Justin Bennett
> >>> Sent: Tuesday, February 06, 2007 11:06 AM
> >>> To: nflug at nflug.org
> >>> Subject: Re: [nflug] Replacing Linux Disk Drives (Cloning?)
> >>>
> >>> ah ok. I follow. I've never used LVM but have 10 hours of flight time
> to
> >>> read up on it. :)
> >>>
> >>> Thanks for the help.
> >>>
> >>> Justin
> >>>
> >>> David J. Andruczyk wrote:
> >>>   
> >>>       
> >>>> OK,  simple..
> >>>> break mirror,  add bigger drive,  allow mirror to complete,  break 
> >>>> mirror again (remove other small drive) add new drive.  let mirror
> >>>>     
> >>>>         
> >>> complete..
> >>>   
> >>>       
> >>>> create new logical raid volume  (72 GB) using PERC tools fdisk that 
> >>>> partition as 0x83 (Linux LVM), pvcreate it, create a new volume group 
> >>>> with it (i.e. VG00) and create logical volumes for /usr /var /tmp 
> >>>> /export / and swap and format that as appropriate (EXT3 recommended as
> 
> >>>> it's the only FS that can be grown AND shrunk)
> >>>>
> >>>> Mount and copy data from old place to new (use whatever method you 
> >>>> like), just be sure you do it correctly.
> >>>>
> >>>> edit your kernel options in /boot to point the root fs to the logical 
> >>>> volume (i.e. root=/dev/VGNAME/LVNAME, or root=/dev/VG00/SlashVol), and
> 
> >>>> make sure your initrd is configured to startup LVM (it should be 
> >>>> ablready if this is a commercial linux distro)  edit the fstab on the 
> >>>> "new" (on the linux LVM) /etc to point all the fs's to be from the
> >>>>         
> >> logical
> >>     
> >>>>     
> >>>>         
> >>> volume).
> >>>   
> >>>       
> >>>> reboot,  make sure all fs's mounted are NOT from the logical volume 
> >>>> (not the old paritions).  IF it worked,  you can delete all the old 
> >>>> partitions EXCEPT FOR /BOOT,  and repartition that as Linux LVM, add 
> >>>> it to the existing volume group and then grow all partitions as
> >>>>         
> >> needed...
> >>     
> >>>>
> >>>> --- Justin Bennett <Justin.Bennett at Dynabrade.com> wrote:
> >>>>
> >>>>   
> >>>>     
> >>>>         
> >>>>> I was thinking of doing something like that as an option, I'm not 
> >>>>> running LVM, and its actually several partitions:
> >>>>>
> >>>>> Yes It's a RAID1 pair.
> >>>>>
> >>>>> Filesystem           1K-blocks      Used Available Use% Mounted on
> >>>>> /dev/sda2              5036316    294016   4486468   7% /
> >>>>> /dev/sda1               147766     36770    103367  27% /boot
> >>>>> /dev/sda8             56182236  43861416   9466876  83% /export
> >>>>> none                    512588         0    512588   0% /dev/shm
> >>>>> /dev/sda7              1004024     16628    936392   2% /tmp
> >>>>> /dev/sda5              5036284   2242852   2537600  47% /usr
> >>>>> /dev/sda6              2016016    789172   1124432  42% /var
> >>>>>
> >>>>> I bet you can spot the issue. :)
> >>>>>
> >>>>> I do have the linux utilities, but could always use the bios as well.
> >>>>>
> >>>>> I don't care if the extra ~72GB was a seperate partition, so I could 
> >>>>> follow your instructions.
> >>>>>
> >>>>> 1. Pull the second disk,
> >>>>> 2. Add the 140GB
> >>>>> 3. Mirror the primary to the new 140GB 4. Replace the Primary with a 
> >>>>> new 140GB 5. Create a second logical drive on the free space of the 
> >>>>> pair (/dev/sdb) 6. Mount /dev/sdb to say /export2 7. Move some stuff 
> >>>>> from /export to /export2
> >>>>>
> >>>>> I would love the help, but you'd need a Brazilian Visa. :)
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> David J. Andruczyk wrote:
> >>>>>     
> >>>>>       
> >>>>>           
> >>>>>> Assuming the RAID setup is RAID1  (mirror) not RAID0 (Stripe)
> >>>>>>
> >>>>>> I'll also make the assumption that the logical RAID volume was 
> >>>>>> paritioned into 2 pieces, 1 for /boot and the rest as Linux LVM.
> >>>>>>
> >>>>>> You should be able to  pull one drive, i.e. "break the mirror",  
> >>>>>> install
> >>>>>>       
> >>>>>>         
> >>>>>>             
> >>>>> one
> >>>>>     
> >>>>>       
> >>>>>           
> >>>>>> NEW drive (, if your two new drives are NOT identical size,  use the
> >>>>>>       
> >>>>>>         
> >>>>>>             
> >>>>> smaller
> >>>>>     
> >>>>>       
> >>>>>           
> >>>>>> of the two),  let the mirroring complete 100%,  then pull the other
> >>>>>>         
> >>>>>>             
> >>> "old"
> >>>   
> >>>       
> >>>>>>       
> >>>>>>         
> >>>>>>             
> >>>>> 72
> >>>>>     
> >>>>>       
> >>>>>           
> >>>>>> GB drive and install the new one. Fire up the raid mgmt software for
> 
> >>>>>> that card (I donno if there is a native linux tool or not) create a 
> >>>>>> second
> >>>>>>       
> >>>>>>         
> >>>>>>             
> >>>>> logical
> >>>>>     
> >>>>>       
> >>>>>           
> >>>>>> volume on the remaining space on the new 144 GB drives,  in linux 
> >>>>>> take
> >>>>>>       
> >>>>>>         
> >>>>>>             
> >>>>> that
> >>>>>     
> >>>>>       
> >>>>>           
> >>>>>> new volume fdisk it as Linux LVM,  pvcreate it and add it to your
> >>>>>>       
> >>>>>>         
> >>>>>>             
> >>>>> existing
> >>>>>     
> >>>>>       
> >>>>>           
> >>>>>> volume group and just extend your volumes.
> >>>>>>
> >>>>>> If your system has raid mgmt software native in linux this should 
> >>>>>> all be doable wihtout even rebooting the machine ( depends on what 
> >>>>>> filesystems
> >>>>>>       
> >>>>>>         
> >>>>>>             
> >>>>> you
> >>>>>     
> >>>>>       
> >>>>>           
> >>>>>> have)
> >>>>>>
> >>>>>>
> >>>>>> NOW, if you did NOT use LVM, it's a little trickier but still
> doable.
> >>>>>>       
> >>>>>>         
> >>>>>>             
> >>>>> (live
> >>>>>     
> >>>>>       
> >>>>>           
> >>>>>> CD may be required)
> >>>>>>
> >>>>>> If you want assistance,  feel free to ask,  I may have some evening
> >>>>>>         
> >>>>>>             
> >>> free.
> >>>   
> >>>       
> >>>>>> (pizza/beer/cash is also a good motivator)
> >>>>>>
> >>>>>>
> >>>>>> --- Justin Bennett <Justin.Bennett at Dynabrade.com> wrote:
> >>>>>>
> >>>>>>   
> >>>>>>       
> >>>>>>         
> >>>>>>             
> >>>>>>> Hardware Ultra320 Scsi Perc4.
> >>>>>>>
> >>>>>>>
> >>>>>>> David J. Andruczyk wrote:
> >>>>>>>     
> >>>>>>>         
> >>>>>>>           
> >>>>>>>               
> >>>>>>>> Are these drivers HARDWARE mirrored  (i.e. onboard raid card, like
> 
> >>>>>>>> a
> >>>>>>>>       
> >>>>>>>>           
> >>>>>>>>             
> >>>>>>>>                 
> >>>>>>> Perc4)
> >>>>>>>     
> >>>>>>>         
> >>>>>>>           
> >>>>>>>               
> >>>>>>>> or software mirrored like in terms of Linux MD software raid or
> LVM?
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> --- Justin Bennett <Justin.Bennett at Dynabrade.com> wrote:
> >>>>>>>>
> >>>>>>>>   
> >>>>>>>>       
> >>>>>>>>           
> >>>>>>>>             
> >>>>>>>>                 
> >>>>>>>>> Hey Folks,
> >>>>>>>>>
> >>>>>>>>>     I believe this was touched upon a little in some of the 
> >>>>>>>>> cloning talk, but I have a 2U Dell Poweredge Running Redhat 3ES, 
> 
> >>>>>>>>> that has a pair of Mirrored 72GB drives (only has 2 drive bays), 
> >>>>>>>>> I need to
> >>>>>>>>>             
> >>>>>>>>>               
> >>>>>>>>>                   
> >>>>> replace
> >>>>>     
> >>>>>       
> >>>>>           
> >>>>>>>>> these with a larger pair of drives (146GB) due to running out of
> >>>>>>>>>             
> >>>>>>>>>               
> >>>>>>>>>                   
> >>>>> space. 
> >>>>>     
> >>>>>       
> >>>>>           
> >>>>>>>>> I am hoping to not have to reload and reconfigure the whole box, 
> >>>>>>>>> but
> >>>>>>>>>             
> >>>>>>>>>               
> >>>>>>>>>                   
> >>>>> if
> >>>>>     
> >>>>>       
> >>>>>           
> >>>>>>>>> I have to I can. Have you guys had any luck cloning like this? 
> >>>>>>>>> What products have you used. In the past I have tar'd the whole 
> >>>>>>>>> file system
> >>>>>>>>>             
> >>>>>>>>> (minus /proc) to tape, loaded a fresh installation, and tar'd 
> >>>>>>>>> back
> >>>>>>>>>             
> >>>>>>>>>               
> >>>>>>>>>                   
> >>>>> over
> >>>>>     
> >>>>>       
> >>>>>           
> >>>>>>>>> the fresh installation with decent results but haven't done this 
> >>>>>>>>> in years. The biggest issue I have is only having 2 drive bays, 
> >>>>>>>>> and
> >>>>>>>>>             
> >>>>>>>>>               
> >>>>>>>>>                   
> >>>>> wanting
> >>>>>     
> >>>>>       
> >>>>>           
> >>>>>>>>>         
> >>>>>>>>> a mirrored configuration, Normally I could build a second logical
> >>>>>>>>>             
> >>>>>>>>>               
> >>>>>>>>>                   
> >>>>> pair,
> >>>>>     
> >>>>>       
> >>>>>           
> >>>>>>>>> with the two new drives and do a Disk to Disk with something like
> >>>>>>>>>             
> >>>>>>>>>               
> >>>>>>>>>                   
> >>>>> ghost,
> >>>>>     
> >>>>>       
> >>>>>           
> >>>>>>>>>         
> >>>>>>>>> I can't really do that with only 2 drive bays.
> >>>>>>>>>
> >>>>>>>>> Thanks
> >>>>>>>>> Justin
> >>>>>>>>>
> >>>>>>>>>     
> >>>>>>>>>         
> >>>>>>>>>             
> >>>>>>>>>               
> >>>>>>>>>                   
> >>>>>>>>>> begin:vcard
> >>>>>>>>>>       
> >>>>>>>>>>           
> >>>>>>>>>>               
> >>>>>>>>>>                 
> >>>>>>>>>>                     
> >>>>>>>>> fn:Justin Bennett
> >>>>>>>>> n:Bennett;Justin
> >>>>>>>>> org:Dynabrade Inc.;IT Department
> >>>>>>>>> adr;dom:;;8989 Sheridan Dr;Clarence;NY;14031 
> >>>>>>>>> email;internet:Justin.Bennett at Dynabrade.Com
> >>>>>>>>> title:Network Administrator
> >>>>>>>>> tel;work:716-631-0100
> >>>>>>>>> x-mozilla-html:TRUE
> >>>>>>>>> url:http://www.dynabrade.com
> >>>>>>>>> version:2.1
> >>>>>>>>> end:vcard
> >>>>>>>>>
> >>>>>>>>>     
> >>>>>>>>>         
> >>>>>>>>>             
> >>>>>>>>>               
> >>>>>>>>>                   
> >>>>>>>>>> _______________________________________________
> >>>>>>>>>>       
> >>>>>>>>>>           
> >>>>>>>>>>               
> >>>>>>>>>>                 
> >>>>>>>>>>                     
> >>>>>>>>> nflug mailing list
> >>>>>>>>> nflug at nflug.org
> >>>>>>>>> http://www.nflug.org/mailman/listinfo/nflug
> >>>>>>>>>
> >>>>>>>>>     
> >>>>>>>>>         
> >>>>>>>>>             
> >>>>>>>>>               
> >>>>>>>>>                   
> >>>>>>>> -- David J. Andruczyk
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>  
> >>>>>>>>
> >>>>>>>>       
> >>>>>>>>           
> >>>>>>>>             
> >>>>>>>>                 
> >>>> ______________________________________________________________________
> >>>> ______________
> >>>>   
> >>>>     
> >>>>         
> >>>>>>   
> >>>>>>       
> >>>>>>         
> >>>>>>             
> >>>>>>>> Cheap talk?
> >>>>>>>> Check out Yahoo! Messenger's low PC-to-Phone call rates.
> >>>>>>>> http://voice.yahoo.com
> >>>>>>>> _______________________________________________
> >>>>>>>> nflug mailing list
> >>>>>>>> nflug at nflug.org
> >>>>>>>> http://www.nflug.org/mailman/listinfo/nflug
> >>>>>>>>   
> >>>>>>>> begin:vcard
> >>>>>>>>       
> >>>>>>>>           
> >>>>>>>>             
> >>>>>>>>                 
> >>>>>>> fn:Justin Bennett
> >>>>>>> n:Bennett;Justin
> >>>>>>> org:Dynabrade Inc.;IT Department
> >>>>>>> adr;dom:;;8989 Sheridan Dr;Clarence;NY;14031 
> >>>>>>> email;internet:Justin.Bennett at Dynabrade.Com
> >>>>>>> title:Network Administrator
> >>>>>>> tel;work:716-631-0100
> >>>>>>> x-mozilla-html:TRUE
> >>>>>>> url:http://www.dynabrade.com
> >>>>>>> version:2.1
> >>>>>>> end:vcard
> >>>>>>>
> >>>>>>>     
> >>>>>>>         
> >>>>>>>           
> >>>>>>>               
> >>>>>>>> _______________________________________________
> >>>>>>>>       
> >>>>>>>>           
> >>>>>>>>             
> >>>>>>>>                 
> >>>>>>> nflug mailing list
> >>>>>>> nflug at nflug.org
> >>>>>>> http://www.nflug.org/mailman/listinfo/nflug
> >>>>>>>
> >>>>>>>     
> >>>>>>>         
> >>>>>>>           
> >>>>>>>               
> >>>>>> -- David J. Andruczyk
> >>>>>>
> >>>>>>
> >>>>>>  
> >>>>>>
> >>>>>>       
> >>>>>>         
> >>>>>>             
> >>>> ______________________________________________________________________
> >>>> ______________
> >>>>   
> >>>>     
> >>>>         
> >>>>>> Get your own web address.  
> >>>>>> Have a HUGE year through Yahoo! Small Business.
> >>>>>> http://smallbusiness.yahoo.com/domains/?p=BESTDEAL
> >>>>>> _______________________________________________
> >>>>>> nflug mailing list
> >>>>>> nflug at nflug.org
> >>>>>> http://www.nflug.org/mailman/listinfo/nflug
> >>>>>>   
> >>>>>> begin:vcard
> >>>>>>       
> >>>>>>         
> >>>>>>             
> >>>>> fn:Justin Bennett
> >>>>> n:Bennett;Justin
> >>>>> org:Dynabrade Inc.;IT Department
> >>>>> adr;dom:;;8989 Sheridan Dr;Clarence;NY;14031 
> >>>>> email;internet:Justin.Bennett at Dynabrade.Com
> >>>>> title:Network Administrator
> >>>>> tel;work:716-631-0100
> >>>>> x-mozilla-html:TRUE
> >>>>> url:http://www.dynabrade.com
> >>>>> version:2.1
> >>>>> end:vcard
> >>>>>
> >>>>>     
> >>>>>       
> >>>>>           
> >>>>>> _______________________________________________
> >>>>>>       
> >>>>>>         
> >>>>>>             
> >>>>> nflug mailing list
> >>>>> nflug at nflug.org
> >>>>> http://www.nflug.org/mailman/listinfo/nflug
> >>>>>
> >>>>>     
> >>>>>       
> >>>>>           
> >>>> -- David J. Andruczyk
> >>>>
> >>>>
> >>>>  
> >>>> ______________________________________________________________________
> >>>> ______________ Expecting? Get great news right away with email 
> >>>> Auto-Check.
> >>>> Try the Yahoo! Mail Beta.
> >>>> http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html
> >>>> _______________________________________________
> >>>> nflug mailing list
> >>>> nflug at nflug.org
> >>>> http://www.nflug.org/mailman/listinfo/nflug
> >>>>   
> >>>>     
> >>>>         
> >>> _______________________________________________
> >>> nflug mailing list
> >>> nflug at nflug.org
> >>> http://www.nflug.org/mailman/listinfo/nflug
> >>>   
> >>> begin:vcard
> >>>       
> >> fn:Justin Bennett
> >> n:Bennett;Justin
> >> org:Dynabrade Inc.;IT Department
> >> adr;dom:;;8989 Sheridan Dr;Clarence;NY;14031
> >> email;internet:Justin.Bennett at Dynabrade.Com
> >> title:Network Administrator
> >> tel;work:716-631-0100
> >> x-mozilla-html:TRUE
> >> url:http://www.dynabrade.com
> >> version:2.1
> >> end:vcard
> >>
> >>     
> >>> _______________________________________________
> >>>       
> >> nflug mailing list
> >> nflug at nflug.org
> >> http://www.nflug.org/mailman/listinfo/nflug
> >>
> >>     
> >
> >
> > -- David J. Andruczyk
> >
> >
> >  
> >
>
____________________________________________________________________________________
> > TV dinner still cooling? 
> > Check out "Tonight's Picks" on Yahoo! TV.
> > http://tv.yahoo.com/
> > _______________________________________________
> > nflug mailing list
> > nflug at nflug.org
> > http://www.nflug.org/mailman/listinfo/nflug
> >   
> > begin:vcard
> fn:Justin Bennett
> n:Bennett;Justin
> org:Dynabrade Inc.;IT Department
> adr;dom:;;8989 Sheridan Dr;Clarence;NY;14031
> email;internet:Justin.Bennett at Dynabrade.Com
> title:Network Administrator
> tel;work:716-631-0100
> x-mozilla-html:TRUE
> url:http://www.dynabrade.com
> version:2.1
> end:vcard
> 
> > _______________________________________________
> nflug mailing list
> nflug at nflug.org
> http://www.nflug.org/mailman/listinfo/nflug
> 


-- David J. Andruczyk


 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com
_______________________________________________
nflug mailing list
nflug at nflug.org
http://www.nflug.org/mailman/listinfo/nflug



More information about the nflug mailing list