One Linux transplant experience

Source: Internet
Author: User
One Linux system porting experience sharing-Linux Enterprise applications-Linux server application information. The following is a detailed description. Problem description:
Two servers of the same type (two servers run HA and use HA to monitor their applications and Oracle databases) cannot be shut down due to improper user operations (the kernel can be shut down, but cannot turn off the power), try to add the power management parameters in the kernel, still cannot solve. Even more depressing is that the user does not install the CD and cannot reinstall the system. The only way is to port the root partition on another machine to this machine.

Solution:
I wanted to use dd to copy the root partition, but the hard disk space was not enough. So I only used tar for backup. The tar method is actually very simple, however, some/proc,/sys,/tmp, And/dev under the root partition should be excluded. Secondly, the installation directories of oracle applications do not need to be packaged (too large ), because tar seems to support a single file up to 8 GB. Of course, the directories stored in tar files must be excluded. The command is as follows:

# Tar zcvf/Bak/root-bak.tgz -- exclude/proc -- exclude/sys -- exclude/tmp -- exclude/dev -- exclude/Bak -- exclude/ora_data/

After the tar command is complete, copy the tar package to the mobile hard disk. Now you can switch to another machine for the operation. before performing the restoration operation, we recommend that you back up the directories installed by Oracle and other applications on this machine and some important data. Then boot to rescue mode through the CD. Note that you must first plug in the hard disk before entering rescue mode, otherwise, the system will not automatically add a USB driver after entering rescue mode. In rescue mode, select "SKIP" to SKIP the mounting of the root partition. The next operation is to format the root partition and then unbind the tar to the root partition.

The command is as follows:
# Mkfs. ext3/dev/sda1

Then, mount it to the new file system and restore the operating system.

# Mkdir/newsystem
# Mount/dev/sda1/newsystem
# Mkdir/bak
# Mount/dev/sdb1/bak
# Tar zxvf/bak/root-bak.tgz-C/newsystem
# Chroot/newsystem
# Grub-install/dev/sda

At first, I thought that this step was completed, but the kernel panic error was reported when I restarted, prompting that the root partition could not be mounted, later I will/etc/fstab,/etc/grub. all the labels in the conf file should be the actual partition name, and redo initrd:

# Cp/boot/initrd-2.6.18-8.2smp.img/boot/initrd-2.6.18-8.2smp.img.bak
# Mkinitrd/boot/initrd-2.6.18-8.2smp.img 2.6.18-8.2smp

Finally, restart OK. The system can be normally accessed and shut down. Restore the backed up Oracle and applications and start HA. Everything is OK.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.