[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RAID+LVM migration, need help



Probably dont need to say this but just for safety.
Backup all your data before even thinking about starting a project like this.
Backing up to media which you cannot access while you are messing with raid 
and lvm is best. (Prevent tiredness creeping in and letting you add the disk 
with your backups on to a raid array)
</disclaimer>
On Friday 20 May 2005 23:17, Bill Mair wrote:
> Hi,
Hail.
> my current system (sarge) has basically the following set up:
>
> RAID1 root on md0
> RAID5 (4xHD) with LVM and the other mounts.
Sounds similar to the setup in my pc, could you give more details please?
(Annoted /proc/mdstat, vgdisplay, mount command output spring to mind)

> Create new rootfs and mount to /new-disk (using new RAID1 on new HDs)
> cp -ax / /newdisk
> The creating new LVs on the "mainvg" and mounting them to into /newdisk.
This is effectively how i originally moved my install from a single partition 
over to raid/lvm. Seems to work :)
> e.g.
> lv create +20G -nlv_usr mainvg
do you not mean:
lvcreate -L 20G -n lv_usr mainvg
> mkfs.ext3 /dev/mainvg/lv_usr
> mount /dev/mainvg/lv_usr /new-disk/usr
> cp -ax /usr /new-disk/usr
>
> And then doing the above for each of the current LVs.
>
> After that, adjusting "/new-disk/etc/[lvm|m|fs]tab" to match.
Interesting. What version of lvm are you using?
Kernel version?

> The binary files in "/etc/lvmtab.d/*" are my main worry ATM, the PV is
> using md7 on the current setup, this would "eventually" become "md5" on the
> newly booted system.
>
> Can LVM handle the change from md7 to md5 between boots, and still find the
> volumes ?
Should be fine.
On occasion while setting up my pc I noticed lvm picking VGs up on individual 
disks while the VG was originally created on the raid (I broke something bad. 
(I love backups))
>
> I obviously want to keep the old system in a working state until I can
> physically remove the old HDs and boot from the new ones.
>
> Am I doing this the hard way ?
> Should/could I use LVM snapshots to do the same ?
> Is using vgexport/vgimport a better way to go ?
Possibly simpler but not necessaraly better.
Using this method you will probably transfer the fragmentation that you get 
when resizing LVs in lvm.
Probably better to get filesystems that are all on a continuous set of blocks.
(lvcreate && mkfs && cp as you already suggested)
> The system as it is runs fine, I could also save an image of the current
> system in the network and just do a reinstall on the server to get the file
> system the way I want it then do a restore on top of it (using a boot CD or
> something to access everything on the server).
Backup is very very very good

> It may be a tall order but I am counting on the people here to give me some
> pointers :)
I hope my pointers were not to sharp for you.
> --
> Bill

HTH 
David Leggett



Reply to: