I have 2 drives in a Linux 7.1 server , 1 primary and 1 secondary. I am trying to clone to the secondary slave drive and be take the primary out and change the slave to primary and boot from it. The problem I am having is that it the copied drive will not boot, It is not getting the lilo boot and config properly. When I try to boot the copied drive , it boots to a Blank screen with an "L" in the upper left hand corner. Can anyone tell me the proper commands to run with rsync to mirror from primary to secondary and boot with the copied drive properly with Redhat 7.1 ? If not what other solution would you recommend. Thanks Sysadmin@ocsonline.cmo Danny -------------- next part -------------- HTML attachment scrubbed and removed
Danny, You probably want to use 'dd' rather than 'rsync' for something like this. It'll be much easier. -Mike On Tue, Aug 06, 2002 at 05:01:40PM -0400, Danny wrote:> From: "Danny" <danny@ocsonline.com> > > I have 2 drives in a Linux 7.1 server , 1 primary and 1 secondary. I am trying to clone to the secondary slave drive and be take the primary out and change the slave to primary and boot from it. The problem I am having is that it the copied drive will not boot, It is not getting the lilo boot and config properly. When I try to boot the copied drive , it boots to a Blank screen with an "L" in the upper left hand corner. > Can anyone tell me the proper commands to run with rsync to mirror from primary to secondary and boot with the copied drive properly with Redhat 7.1 ? > If not what other solution would you recommend. > > Thanks > Sysadmin@ocsonline.cmo > Danny >-- Mike Crowl Phone: 303-661-2368 EDS at StorageTek Pager: 888-480-8241 mike_crowl@storagetek.com
A simple file-level copy won't modify the boot sectors, and even if you fix them independently, data won't necessarily be at the offsets expected by the boot code. You should mirror one drive to the other with the dd command. I'm assuming that they have identical geometry. One more knowledgeable than me might be able to do dissimmilar drives, but i wouldn't chance it. Ok, you say the primary master to the secondary slave. I'm assuming the word secondary attached to the word slave indicates that it's on the slave drive on the secondary ide controller (as slave is meaningless in scsi). /dev/hda=master on primary ide controller, /dev/hdd=slave on secondary bus. If "secondary" was redundant, and you mean a master and a slave on the primary ide controller, that's /dev/hdb " dd if=/dev/hda of=/dev/hdd " will clone everything, from the first sector to the last. If you're changing drive sizes, try partitioning as needed, and rsync the filesystems. dd a kernel to a floppy, rdev it to /dev/hda1 or whatever your root partition is, shut down, switch the drives, boot from the floppy, run lilo, pop out the disk, and see if it comes back up. Note: This question is really not very rsync-related. There is an ongoing thread about optionally syncing the contents of a raw device, rather than the device file itself, but I don't think that's what you're needing to do. You might check comp.os.linux.bootutils.lilo, or whatever newsgroup handles such things. Tim Conway tim.conway@philips.com 303.682.4917 office, 303.921.0301 cell Philips Semiconductor - Longmont TC 1880 Industrial Circle, Suite D Longmont, CO 80501 Available via SameTime Connect within Philips, caesupport2 on AIM "There are some who call me.... Tim?" "Danny" <danny@ocsonline.com> Sent by: rsync-admin@lists.samba.org 08/06/2002 03:01 PM To: <rsync@lists.samba.org> cc: (bcc: Tim Conway/LMT/SC/PHILIPS) Subject: Mirroring 2 IDE Drive Linux Classification: I have 2 drives in a Linux 7.1 server , 1 primary and 1 secondary. I am trying to clone to the secondary slave drive and be take the primary out and change the slave to primary and boot from it. The problem I am having is that it the copied drive will not boot, It is not getting the lilo boot and config properly. When I try to boot the copied drive , it boots to a Blank screen with an "L" in the upper left hand corner. Can anyone tell me the proper commands to run with rsync to mirror from primary to secondary and boot with the copied drive properly with Redhat 7.1 ? If not what other solution would you recommend. Thanks Sysadmin@ocsonline.cmo Danny
I gave sample code in an earlier reply, but forgot to mention the obvious. At least the destination disk doesn't have any rw mounted partitions, does it? That'll crash you. Having the source disk containing rw mounted filesystems will just give you invalid data on the destination. To do the copy init s kill anything that's holding non / mounts mount -o ro -o remount / that should switch you back to only root mounted, readonly. If dd is on another partition (some make /usr seperate, and some have dd there, instead of /bin), you'll have to copy it to / before unmounting that partition. mount If any hdaanything is there besides /, or / is not readonly, look again for processes holding mounts. now, try your dd. If you can't get it down to this state, download one of the single-floppy rescue-type distributions, boot to that, and do the dd. I don't have a usenet feed handy, so I can't tell you what the appropriate newsgroup would be for this question. Tim Conway tim.conway@philips.com 303.682.4917 office, 303.921.0301 cell Philips Semiconductor - Longmont TC 1880 Industrial Circle, Suite D Longmont, CO 80501 Available via SameTime Connect within Philips, caesupport2 on AIM "There are some who call me.... Tim?" "Danny" <danny@ocsonline.com> Sent by: rsync-admin@lists.samba.org 08/06/2002 04:02 PM To: <rsync@lists.samba.org> <mike_crowl@storagetek.com> cc: (bcc: Tim Conway/LMT/SC/PHILIPS) Subject: Re: Mirroring 2 IDE Drive Linux Classification: We tried dd but it kept crashing and I had to reboot, I forget the error but tried it twice and both times the system locked up and required rebooting. Any ideas on this. Using dd what commands would you recommend ? I have hda1 (primary) and hdb1 (secondary) Could you let me know the exact commands to use dd ? Maybe we are trying to send too much at one time, thesse are both 40GB hard drive. Redhat 7.1 Thanks for any help. Danny ----- Original Message ----- From: "Mike J Crowl" <crowlmj@stortek.com> To: "Danny" <danny@ocsonline.com> Cc: <rsync@lists.samba.org> Sent: Tuesday, August 06, 2002 5:26 PM Subject: Re: Mirroring 2 IDE Drive Linux Danny, You probably want to use 'dd' rather than 'rsync' for something like this. It'll be much easier. -Mike On Tue, Aug 06, 2002 at 05:01:40PM -0400, Danny wrote:> From: "Danny" <danny@ocsonline.com> > > I have 2 drives in a Linux 7.1 server , 1 primary and 1 secondary. I amtrying to clone to the secondary slave drive and be take the primary out and change the slave to primary and boot from it. The problem I am having is that it the copied drive will not boot, It is not getting the lilo boot and config properly. When I try to boot the copied drive , it boots to a Blank screen with an "L" in the upper left hand corner.> Can anyone tell me the proper commands to run with rsync to mirror fromprimary to secondary and boot with the copied drive properly with Redhat 7.1 ?> If not what other solution would you recommend. > > Thanks > Sysadmin@ocsonline.cmo > Danny >-- Mike Crowl Phone: 303-661-2368 EDS at StorageTek Pager: 888-480-8241 mike_crowl@storagetek.com -- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html
>>>>> "D" == danny <danny@ocsonline.com> >>>>> wrote the following on Tue, 6 Aug 2002 17:01:40 -0400D> I have 2 drives in a Linux 7.1 server , 1 primary and 1 D> secondary. I am = trying to clone to the secondary slave drive D> and be take the primary out = and change the slave to primary and D> boot from it. The problem I am = having is that it the copied D> drive will not boot, It is not getting the = lilo boot and config D> properly. When I try to boot the copied drive , it = boots to a D> Blank screen with an "L" in the upper left hand corner. Can D> anyone tell me the proper commands to run with rsync to mirror D> from = primary to secondary and boot with the copied drive D> properly with Redhat = 7.1 ? If not what other solution would D> you recommend. Make sure the partition structure is the same in both disks, and that rsync has copied all the data in each source partition to the right destination partition. You may have to make a swap partition - I don't think rsync can do that. When you're done with all this, physically swap the disks, and then reboot from the the RH cdrom. Go to the shell, mount the root and boot partitions of the new disk, chroot to /mnt/hda3 or whatever, and then rerun /sbin/lilo. Everything should work when you reboot, even if the disks are different. Of course, this is all off the top of my head... -- Ben Escoto -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 226 bytes Desc: not available Url : http://lists.samba.org/archive/rsync/attachments/20020806/9b1113d6/attachment.bin
2002-08-06-17:01:40 Danny:> I am trying to clone to the secondary slave drive and be take the > primary out and change the slave to primary and boot from it. The > problem I am having is that it the copied drive will not boot, It > is not getting the lilo boot and config properly.I've done this before --- some years back, and on a different platform, but I'm pretty the same issues apply here. Rsync is a fine tool for the vast majority of your replication. Perhaps not the very best, it's optimized for a somewhat different use pattern, but it works very well indeed. Use rsync to copy all the files in each of the filesystems. Your problem is that making a disk bootable, under every Unix-like OS I've worked with, requires updating some data that lies outside the visible filesystem, in boot blocks. You need to make yourself a mirror script. After it runs rsync to get all the files in the filesystems mirrored properly, you'll need to re-install the boot sector on the secondary drive. How to do that depends on details of how your boot loader is set up. You say you're using LILO. To re-install the boot block on your main disk, you just invoke "lilo" with no arguments. But you need to adjust lilo's behavior in two ways. It needs to be looking for the config files, and boot sector boilerplate, and most importantly the kernel image whose block numbers it wants to record in the boot block, on the secondary drive. That part's easy, just use the cmdline option to chroot lilo into the directory tree where you've mounted the partition[s] of your secondary drive. The hard part is then telling lilo to write a boot sector, intended for booting /dev/hda1 or whatever, onto /dev/hdb. That will take some experimenting, and if you mess up you could clobber your real working boot sector, so make sure you have a good boot floppy before you launch this exercise. It may suffice to just make an alternative config file, which you can specify with another lilo cmdline arg, that specifies "boot=/dev/hdb". This is my favourite boot disk replication strategy. It's easier to boot off an alternative disk than it is to recover after drive failure from any drive mirroring setup I've seen; and unlike drive mirroring, if you run this out of an init script at boot time, you'll be capturing the last config that was demonstrated to boot successfully, and thereby helping to protect yourself against accidental admin errors that make the system unbootable --- far more common in my experience than drive failures. -Bennett -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.samba.org/archive/rsync/attachments/20020807/857c79a1/attachment.bin
This is too easy. Download mondo-rescue, http://www.mondorescue.com/ install, make a set of backup disks, swap the drives, use Mondo to reproduce the source disk. It will boot perfectly and be a mirror of the master. If you choose not to make a disk of some of the data, mount the former master afterwards and copy over the data. Chris
dd if=/dev/hda of=/dev/hdc bs=16384k mirror 1st hdd on primary controller to 1st hdd on secondary controller worked fine for me x-times even over network via ssh into an compressed imagefile regards norbert Danny wrote:> I have 2 drives in a Linux 7.1 server , 1 primary and 1 secondary. I > am trying to clone to the secondary slave drive and be take the > primary out and change the slave to primary and boot from it. The > problem I am having is that it the copied drive will not boot, It is > not getting the lilo boot and config properly. When I try to boot the > copied drive , it boots to a Blank screen with an "L" in the upper > left hand corner.Can anyone tell me the proper commands to run with > rsync to mirror from primary to secondary and boot with the copied > drive properly with Redhat 7.1 ?If not what other solution would you > recommend. ThanksSysadmin@ocsonline.cmoDanny-------------- next part -------------- HTML attachment scrubbed and removed