Boot from SAN
Hi,
I have RHEL 5.4 booting from NetApp SAN.
I would like to migrate NetApp to a different storage ( in my case IBM XIV).
Was wondering what is the best way of migrating a working SAN boot to a new one
-E
Responses
Is your boot drive in an LVM VG? If so, add the new SAN's LUN to the root VG and mirror to the new LUN.
Present the new LUN to the host (so that both LUNs are available). Install/configure a partition table with fdisk or parted, if necessary. Create a new filesystem on the new LUN, making sure to maintain proper LUN alignment (some disk arrays like 32k alignment, so you should start your first partition on a 32k boundary if possible.) You can use fdisk expert mode to do this.
Once you have mounted the new LUN, use 'cpio -pdmv' to migrate the data over from the old LUN to the new one. Here's an example:
cd /; find -depth -print | cpio -pdmv /newroot
(please test this command and verify proper operation on a development host before running in production.)
Once this is done, use 'grub-install' to install a bootloader on the new LUN.
Erez,
It is in your best bet to use cpio to migrate the data if you are performing the work during a maintenance window--cpio is significantly faster than rsync and you don't have the memory and disk overhead of calculating the differential of files to copy when you know none of them exist on the destination anyway.
(I've migrated a couple dozen terabytes of messaging data via rsync, tar and cpio and came to that conclusion after hours of watching rsync build file lists of hundreds of millions of messages, only to run out of physical memory on 16GB+ boxes.)
Please have a look into below kbase also.
>> How can I boot a server from a replicated SAN LUN using device-mapper-multipath in Red Hat Enterprise Linux 5?
https://access.redhat.com/kb/docs/DOC-17660
Hi, One another approach is to use dd command to do the block level copy from the existing boot LUN to new LUN. This worked for me. Shutdown the server. Present the source and destination boot LUN to another Linux server. You can use any one of the device node from the multipath -ll output to use in the dd command for e.g.
dd if=/dev/sda of=/dev/sdaa
where sda is one of the device node of the existing boot LUN (source LUN) showed in multipath -ll command and sdaa is the same for target boot LUN (destination boot LUN on the new storage). The advantage is, it copies all filesystem layout including LVs and VGs to the new LUN. The disadvantage is, it copies corrupted and bad block as it is. Also it is a slow process. For a 60GB boot disk it took me 2.5 hours to do the copy (from a SAS based SAN to SSD based SAN). Hope this helps.
Thanks, Nujoom
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
