From Linux to Solaris (Backup recovery, fault diagnosis)

Source: Internet
Author: User
Chapter 9 Backup Recovery

Linux uses the dump and restore commands to execute file system backup and recovery jobs, while Solaris uses ufsdump and ufsrestore.

Quote:
  • Linux

#/Sbin/Dump-0u-F/dev/st0/home
# Cd/home
# Restore RF/dev/st0

  • Solaris

# Ufsdump 0 UF/dev/RMT/0/export/home
# Cd/export/home
# Ufsrestore RF/dev/RMT/0

Zfs of Solaris 10 uses the snapshot function:
Zfs snapshot tank/home @ ss_monday

The above command will generate the ss_monday snapshot of the tank/Home file system, and then back up it through the snapshot:
Zfs send tank/home @ ss_monday>/dev/RMT/0

The preceding command backs up the snapshot data to the tape.

  • Linux and Solaris often use tar and cpio commands to back up the file system.
  • There are also many third-party backup tools that can be used on both operating systems, such as the open-source software Amanda. For example, the famous backup software nbu (VERITAS NetBackup ).
  • Solaris also released sun storagetek Enterprise Backup Software and other storage management-related tools. Sun Also resends Legato NetWorker and IBM Tivoli.

Chapter 10: Fault Diagnosis

Even if you follow the rigorous and step-by-step operations in accordance with various technical guidance documents, you will still encounter various accidents from time to time. This article will try your best to help you analyze and diagnose various faults. The content includes:

  • Install
  • System Startup
  • Core files
  • Kernel crash dump
  • Logs
  • Command loss
  • Root Password Recovery
  • Network
  • NFS sharing
  • Diagnostic and debugging tools

1. Installation

Quote: Install from USB-CDROM
Installation of Solaris 10 x86 from the USB-CDROM is not always successful even if the x86 machine supports starting from the USB-CDROM. Sometimes the system cannot find the USB-CDROM at installation. The solution is as follows:
1. Select the interactive text installation type "Solaris interactive text (console session)" during installation )"
Follow the installation steps until the installation program prompts the following error and jumps to the shell prompt:
Error: the disc you inserted is not a Solaris OS CD/DVD

2. View and record available devices in the/dev/DSK directory
3, pull out the USB-CDROM, wait a few seconds to insert again
4. view new cognitive devices, such as c1t0d0xxxx.
5. Mount USB-CDROM
Mount-F hsfs/dev/DSK/c1t0d0p0/CDROM. Note that the device name must be P0 (partition 0)
6. Run/sbin/install-Solaris to continue installation.

The author reserves the copyright. For Reprinted Information, please indicate the source, from Cu-yuhuohu.

2. Start the system

Quote: system startup
If you encounter problems related to system startup, you can collect the required information using the following methods:
1. SVCs-x FMRI
The Solaris 10 system can use the SVCs command to view the detailed reference information of any (unstarted) service instance (Solaris 10 is called fMRI, fault management resource identification ).

2. view the/var/adm/messages file. Generally, this file contains all System Log message records.
3. Check whether the script in the/etc/rc *. d directory is correct.

Fix boot files

  • If you encounter a message "panic: Cannot mount boot Archive" at startup, the boot file (boot_archive) may be lost ). This problem often occurs when multiple patches need to be re-booted at the same time.
  • To fix this problem, you need to start the system to enter the "failsafe" mode. Normally, the failsafe mode prompts you to update the boot file. If so, restart the system after the update.

There is another common method:

  • Link the partition to a directory, such as/A: Mount-F ufs/dev/DSK/c1d0t0s0/.
  • Run the following command to recreate the boot file:/a/boot/Solaris/bin/create_ramdisk-R/
  • Restart the system

3. core files

Quote: a core file is created when the system exits unexpectedly ). The information provided by core file can help you find the cause of application interruption. You can use the coreadm tool to define the location, name, and content of the core file generated by Solaris.
There are several common applications that can be used to extract information from core files:
Pflags View "tracing flags"
PCRed view credential (certificate)
PLDD: view the dynamic library linked to the process
Pstack to view the hexadecimal "symbolic stack trace" of the lwp of each process"
"Tracing flags" and "stack trace" are development terms. You can Google them.

4. kernel crash dump

Quote: If a kernel panic occurs on a Linux machine, an oops message is generated. The cause of the fault can be determined through this message, the Linux kernel does not generate the actual crash dump file (crash-dump-file)
  • [Note] During Redhat Enterprise Linux 5 installation, you can choose whether to start generating crash-dump-file.

If the Solaris kernel crashes, a crash dump file is generated in the/var/crash/hostname directory. The technician will analyze the cause of the system crash through this file.

5. Logs

Quote: When you encounter problems, it is a good habit to first view various related log files. There are several important system log files:
/Var/adm/messages main system logs
/Var/log/syslog sendmail log and others
Log information of/var/cron/log automatic job (cron tab)
/Var/LP/logs/lpsched printer server log
In addition, some applications have dedicated log files:
/Var/samba/log
/Var/Apache/log
/Var/apache2/log

6. Command loss

Quote: commands may be stored in multiple directories. Some commands may need to be installed separately, or even re-ported (Compiled) If the command is unavailable)
First, check the PATH variable $ path of the current shell. For the directory where the command may be stored, see the previous article.
If the command has not been installed, you can download the Open Source version of the software package that provides the command through the supporting CD, sunfreeware.com, and blastwave.org, or compile and install it using the source code.

If the command does not have the Solaris version, you may need to port or write the Solaris version.

7. Root Password Recovery

Quote: if you forget the root password or take over a machine that nobody knows the root password, you can start from the Solaris installation disk and choose to enter the single-user mode, then, mount the root partition to the/a directory, modify the/A/etc/shadow file, clear the password field of the root account, and restart the system.

8. Network

Quote: If you encounter a network connection problem, you can use the following common tools for debugging and diagnosis:
Traceroute: Check the Route status of the package in the network, or the hop (router) has a problem.
/Usr/sbin/ping to check whether the remote machine is reachable
Netstat
Snoop packet capture tool, similar to tcpdump
Tcpdump is available for various operating systems, and is available on Solaris's supporting CD.

9. NFS sharing

Quote: Sometimes, when mounting a file system shared from a Linux system on Solaris 10, the following error message may occur:
$ Mount linxu-nfs-server:/export/mnt
NFS mount: Mount:/mnt: Not owner

This is because the Solaris 10nfs client uses the NFS V4 protocol by default to mount the shared file system, while Linux NFS does not support nfsv4
To solve this problem, modify the default NFS protocol used by the NFS client of Solaris 10:
Edit/etc/default/nfs and add a line:
Nfs_client_versmax = 3

In addition, if you do not want the Solaris NFS server to use nfsv4, you can modify the/etc/default/nfs file as follows:
Nfs_server_versmax = 3

In this way, the NFS server of the Solaris system can only support up to the NFS V3 version.

10. Diagnostic and debugging tools

Quote: dtrace is a powerful tool added in solairs 10. dtrace makes it easier to diagnose system faults. Dtrace can detect all aspects of the system, including network, Io, function call, and startup and stop of applications on the CPU. there are many places to get the dtrace script, the most common is opensolaris dtrace community: http://opensolaris.org/ OS /community/dtrace. "Dtrace toolkit" provides many scripts that focus on fault diagnosis.

The other two useful tools are:

  • Truss, used to track system calls of applications
  • Apptrace: the user traces the function call of an application.

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.