1. Trang chủ
  2. » Công Nghệ Thông Tin

solaris 9 student guide part 2 sa299 phần 3 docx

86 240 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 86
Dung lượng 417,07 KB

Nội dung

Exercise: Managing swap Utility Configuration (Level 2) Run the df -h command Does the /export directory have sufficient space to add 20 Mbytes of swap space? _ Create a 20-Mbyte swap file in the /export directory, and add it to the system swap space _ Use the swap -l command to verify that the new swap space is available _ Use the swap -s command to verify that the new swap space is available How does the output differ between the swap -l command and the swap -s command? _ Remove the swap file created in Step Use the swap utility to verify that the swap space is no longer available Add a disk partition as a swap slice to your existing swap space 10 Add the new swap partition to the /etc/vfstab file to make the partition permanent To verify this change, you must reboot the system 11 After the reboot, verify that the additional swap space exists by using the swap utility Is the newly listed swap partition the same as the one you added to the /etc/vfstab file? _ 12 Verify the additional swap space exists using the df -h command Why is the newly created swap space listed in the /etc/vfstab file not listed in the output of the df -h command? _ 13 To return the system to its initial swap configuration, remove the additional swap space entry from the /etc/vfstab file, and reboot the system 14 Remove the additional swap slice using the swap -d command Managing Swap Configuration Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A 4-15 Exercise: Managing swap Utility Configuration (Level 3) Exercise: Managing swap Utility Configuration (Level 3) In this exercise you add and remove a swap space Preparation To prepare for this exercise: q Each student will configure swap space on their assigned workstation q Each student should unconfigure the additional swap space before exiting the lab exercise q Make sure that the /export directory exists on your system q Each student uses disk slice on their system for this exercise Note – The actual swap statistics will vary depending on the configuration of each system To support disk requirements for the remaining labs in this course, partition the second disk using the information in Table 4-3 Table 4-3 Partition Information Slice Use Mbytes State database replica Mbytes State database replica Mbytes State database replica 310 Mbytes Root (/) mirror 512 Mbytes Swap/dump 4-16 Size free Flash Advanced System Administration for the Solaris™ Operating Environment Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A Exercise: Managing swap Utility Configuration (Level 3) Task Summary Perform the following tasks: q Obtain a report of the swap space usage on the system q List the swap areas that are configured on the system q Configure additional swap space using a swap file q Configure additional swap space using a disk partition q Unconfigure the additional swap space Tasks and Solutions This section describes the tasks you must perform, and lists the solutions to these tasks To determine the amount of disk space used by a swapfs file system, complete the following steps: Run the swap -s command # swap -s total: 106240k bytes allocated + 8528k reserved = 114768k used, 566776k available What is the total number of bytes actually allocated and currently in use? 106, 240 Kbytes What is the number of bytes allocated and not currently in use but reserved by processes for possible future use? 8528 Kbytes What is the total amount of swap space, both allocated and reserved? 114,768 Kbytes What is the total swap space currently available for future reservation and allocation? 566,776 Kbytes Managing Swap Configuration Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A 4-17 Exercise: Managing swap Utility Configuration (Level 3) # swap -l swapfile /dev/dsk/c0t0d0s1 Run the swap -l command dev swaplo blocks 136,1 16 1206736 free 1084736 List the physical swap area configured on your system /dev/dsk/c0t0d0s1 How much total swap space is in the listed swap device? 12,06,736 Kbytes How much space is available for the listed device? 1,084,736 Kbytes Run the df -h command # df -h Filesystem /dev/dsk/c0t0d0s0 /proc mnttab fd swap swap /dev/dsk/c0t0d0s7 size 1.4G 0 552M 554M 2.0G used 876M 0 24K 2M 9K avail capacity Mounted on 503M 64% / 0% /proc 0% /etc/mnttab 0% /dev/fd 552M 1% /var/run 552M 1% /tmp 1.9G 1% /export Does the /export directory have sufficient space to add 20 Mbytes of swap space? Yes Create a 20-Mbyte swap file in the /export directory, and add it to the system swap space # mkfile 20m /export/swapfile # swap -a /export/swapfile # swap -l swapfile /dev/dsk/c0t0d0s1 /export/swapfile 4-18 Use the swap -l command to verify that the new swap space is available dev 136,1 - swaplo blocks 16 1206736 16 40944 free 1084736 40944 Advanced System Administration for the Solaris™ Operating Environment Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A Exercise: Managing swap Utility Configuration (Level 3) Use the swap -s command to verify that the new swap space is available # swap -s total: 106256k bytes allocated + 8512k reserved = 114768k used, 587512k available How does the output differ between the swap -l command and the swap -s command? The swap -l command output is a listing of each space, whereas the swap -s command output only produces a cumulative report Remove the swap file created in Step # swap -d /export/swapfile # rm /export/swapfile Use the swap utility to verify that the swap space is no longer available # swap -l swapfile dev swaplo blocks free /dev/dsk/c0t0d0s1 136,1 16 1206736 1084736 # swap -s total: 106240k bytes allocated + 8528k reserved = 114768k used, 566776k available Add a disk partition as a swap slice to your existing swap space # swap -a /dev/dsk/c#t#d#s5 10 Add the new swap partition to the /etc/vfstab file to make the partition permanent To verify this change, you must reboot the system # vi /etc/vfstab /dev/dsk/c#t#d#s5 - - swap - no - 11 After the reboot, verify that the additional swap space exists by using the swap utility # swap -l swapfile /dev/dsk/c0t0d0s1 /dev/dsk/c1t0d0s3 dev 136,1 32,3 swaplo 16 16 blocks 1206736 614704 free 1206736 614704 Is the newly listed swap partition the same as the one you added to the /etc/vfstab file? Yes Managing Swap Configuration Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A 4-19 Exercise: Managing swap Utility Configuration (Level 3) 12 Verify the additional swap space exists using the df -h command Why is the newly created swap space listed in the /etc/vfstab file not listed in the output of the df -h command? The df -h output does not produce an entry for the additional swap utility devices, however the added swap space is reflected in the total swap space 13 To return the system to its initial swap configuration, remove the additional swap space entry from the /etc/vfstab file, and reboot the system # vi /etc/vfstab 14 Remove the additional swap space using the swap -d command # swap -d /dev/dsk/c#t#d#s5 4-20 Advanced System Administration for the Solaris™ Operating Environment Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A Exercise Summary Exercise Summary ! ? Discussion – Take a few minutes to discuss the experiences, issues, or discoveries that you had during the lab exercises q Experiences q Interpretations q Conclusions q Applications Managing Swap Configuration Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A 4-21 Module Managing Crash Dumps and Core Files Objectives When an operating system has a fatal error, it generates a crash dump file (crash dump) When a process has a fatal error, it generates a core file Upon completion of this module, you should be able to: q Manage crash dump behavior q Manage core file behavior The following course map shows how this module fits into the current instructional goal Managing Virtual File Systems and Core Dumps Managing Swap Configuration Figure 5-1 Managing Crash Dumps and Core Files Configuring NFS Configuring AutoFS Course Map 5-1 Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A Managing Crash Dump Behavior Managing Crash Dump Behavior If a fatal operating system error occurs, the operating system prints a message to the console, describing the error The operating system then generates a crash dump by writing some of the contents of the physical memory to a predetermined dump device, which is typically a local disk slice You can configure the dump device by using the dumpadm command After the operating system has written the crash dump to the dump device, the system reboots The crash dump is saved for future analysis to help you determine the cause of the fatal error The Crash Dump If the Solaris OE kernel encounters a problem that might endanger the integrity of data or when the kernel encounters an unexpected hardware fault, the panic routine is executed Despite its name, a system panic is a well-controlled event where memory contents are copied to a disk partition defined as a dump device Whatever the cause, the crash dump itself provides valuable information to help your support engineer diagnose the problem When an operating system crashes, the savecore command is automatically executed during a boot The savecore command retrieves the crash dump from the dump device and then writes the crash dump to a pair of files in your file system: q The savecore command places kernel core information in the /var/crash/nodename/vmcore.X file, where nodename is the name returned by uname -n, and X is an integer identifying the dump q The savecore command places name list information and symbol table information in the /var/crash/nodename/unix.X file Note – Within the crash dump directory, a file named bounds is created The bounds file holds a number that is used as a suffix for the next dump to be saved Together, these data files form the saved crash dump You can use the dumpadm command to configure the location of the dump device and the savecore directory 5-2 Advanced System Administration for the Solaris™ Operating Environment Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A Troubleshooting NFS Errors The stale NFS file handle Error The following message appears when a process attempts to access a remote file resource with an out-of-date file handle stale NFS file handle A possible cause for the stale NFS file handle error is that the file resource on the server moved To solve the stale NFS file handle error condition, unmount and mount the resource again on the client The unknown host Error The following message indicates that the host name of the server on the client is missing from the hosts table nfs mount: sserver1:: RPC: Unknown host To solve the unknown host error condition, verify the host name in the hosts database that supports the client node Note – The preceding example misspelled the node name server1 as sserver1 The mount point Error The following message appears during the boot process or in response to an explicit mount request and indicates a non-existent mount point mount: mount-point /DS9 does not exist To solve the mount point error condition, check that the mount point exists on the client Check the spelling of the mount point on the command line or in the /etc/vfstab file on the client, or comment out the entry and reboot the system 6-40 Advanced System Administration for the Solaris™ Operating Environment Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A Troubleshooting NFS Errors The no such file Error The following message appears during the boot process or in response to an explicit mount request, which indicates that there is an unknown file resource name on the server No such file or directory To solve the no such file error condition, check that the directory exists on the server Check the spelling of the directory on the command line or in the /etc/vfstab file Configuring NFS Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A 6-41 Performing the Exercises Performing the Exercises You have the option to complete any one of three versions of a lab To decide which to choose, consult the following descriptions of the levels: q q Level – This version of the lab provides more guidance Although each step describes what you should do, you must determine which commands (and options) to input q 6-42 Level – This version of the lab provides the least amount of guidance Each bulleted paragraph provides a task description, but you must determine your own way of accomplishing each task Level – This version of the lab is the easiest to accomplish because each step provides exactly what you should input to the system This level also includes the task solutions for all three levels Advanced System Administration for the Solaris™ Operating Environment Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A Exercise: Configuring NFS (Level 1) Exercise: Configuring NFS (Level 1) In this exercise, you configure an NFS server and client to share and mount the /usr/share/man file Preparation Choose a partner for this lab Determine which systems to configure as the NFS server and the NFS client Verify that entries for both systems exist in the /etc/hosts file on both systems Refer to your lecture notes as necessary to perform the following steps Tasks Perform the following tasks: q Select a system to act as an NFS server, and share the /usr/share/man directory Perform the commands to verify that the directory is shared and that no NFS system mounts are present on the server: q share q dfshares q dfmounts q On the NFS client system, rename the /usr/share/man directory to the /usr/share/man.orig directory Make sure the man pages are not available Create a /usr/share/man mount point Mount the /usr/share/man directory from the NFS server Verify that the man pages are available q On the NFS client, record the default options used for the NFS mount Verify the list of mounts that the server provides Unmount the /usr/share/man file, and verify the list of remote mounts the server is providing q On the NFS server, unshare the /usr/share/man directory In the /etc/dfs/dfstab file, change the entry for this directory so that it uses the -o rw=bogus options Share everything listed in the dfstab file q On the NFS client, attempt to mount the /usr/share/man directory from the NFS server Record your observations Configuring NFS Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A 6-43 Exercise: Configuring NFS (Level 1) q q 6-44 On the NFS server, unshare the /usr/share/man directory, and remove the entry for it from the /etc/dfs/dfstab file On the NFS client, return the /usr/share/man directory to its original configuration Advanced System Administration for the Solaris™ Operating Environment Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A Exercise: Configuring NFS (Level 2) Exercise: Configuring NFS (Level 2) In this exercise, you configure an NFS server and client to share and mount the /usr/share/man file Preparation Choose a partner for this lab Determine which systems to configure as the NFS server and the NFS client Verify that entries for both systems exist in the /etc/hosts file on both systems Refer to your lecture notes as necessary to perform the following steps Task Summary Perform the following tasks: q Select a system to act as an NFS server, and share the /usr/share/man directory Perform the commands to verify that the directory is shared and that no NFS system mounts are present on the server: q share q dfshares q dfmounts q On the NFS client system, rename the /usr/share/man directory to the /usr/share/man.orig directory Make sure the man pages are not available Create a /usr/share/man mount point Mount the /usr/share/man directory from the NFS server Verify that the man pages are available q On the NFS client, record the default options used for the NFS mount Verify the list of mounts that the server provides Unmount the /usr/share/man file, and verify the list of remote mounts the server is providing q On the NFS server, unshare the /usr/share/man directory In the /etc/dfs/dfstab file, change the entry for this directory so that it uses the -o rw=bogus options Share everything listed in the dfstab file q On the NFS client, attempt to mount the /usr/share/man directory from the NFS server Record your observations Configuring NFS Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A 6-45 Exercise: Configuring NFS (Level 2) q On the NFS server, unshare the /usr/share/man directory, and remove the entry for it from the /etc/dfs/dfstab file q On the NFS client, return the /usr/share/man directory to its original configuration Tasks Complete the following tasks Task 1– On the NFS Server Complete the following steps: Edit the /etc/dfs/dfstab file Add an entry to share the directory that holds man pages _ Stop and start the NFS server daemons _ Verify that the /usr/share/man directory is shared and that no NFS mounts are present _ Task – On the NFS Client Complete the following steps: Rename the /usr/share/man directory so that you can no longer access the man pages on the client system Verify that the man pages are not available _ What message does the man command report? _ Create a new man directory (/usr/share/man) to use as a mount point _ 6-46 Mount the /usr/share/man directory from the server Advanced System Administration for the Solaris™ Operating Environment Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A Exercise: Configuring NFS (Level 2) Verify that the man pages are available _ Are the man pages available? _ Verify and record the default ro | rw options used for this mount _ Write a file into the NFS-mounted file system _ What is the result of trying to write to the NFS-mounted file system? _ What conclusion can be reached by this exercise? _ _ _ Verify the list of mounts that the server provides _ Unmount the /usr/share/man directory, and verify the list of remote mounts from the server Task – On the NFS Server Complete the following steps: Unshare the /usr/share/man directory _ Change the share statement in the /etc/dfs/dfstab file for the /usr/share/man directory to read: share -o ro=bogus /usr/share/man Share the /usr/share/man directory _ Configuring NFS Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A 6-47 Exercise: Configuring NFS (Level 2) Task – On the NFS Client Complete the following step: Attempt to mount the /usr/share/man directory again _ What happens? _ Task – On the NFS Server Complete the following steps: Unshare the /usr/share/man directory _ Edit the /etc/dfs/dfstab file to remove the entry for the /usr/share/man directory _ Task – On the NFS Client Complete the following steps: Return the /usr/share/man directory to its original configuration _ Verify that the man pages are now available _ 6-48 Advanced System Administration for the Solaris™ Operating Environment Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A Exercise: Configuring NFS (Level 3) Exercise: Configuring NFS (Level 3) In this exercise, you configure an NFS server and client to share and mount the /usr/share/man file Preparation Choose a partner for this lab Determine which systems to configure as the NFS server and the NFS client Verify that entries for both systems exist in the /etc/hosts file on both systems Refer to your lecture notes as necessary to perform the following steps Task Summary Perform the following tasks: q Select a system to act as an NFS server, and share the /usr/share/man directory Perform the commands to verify that the directory is shared and that no NFS system mounts are present on the server: q share q dfshares q dfmounts q On the NFS client system, rename the /usr/share/man directory to the /usr/share/man.orig directory Make sure the man pages are not available Create a /usr/share/man mount point Mount the /usr/share/man directory from the NFS server Verify that the man pages are available q On the NFS client, record the default options used for the NFS mount Verify the list of mounts that the server provides Unmount the /usr/share/man file, and verify the list of remote mounts the server is providing q On the NFS server, unshare the /usr/share/man directory In the /etc/dfs/dfstab file, change the entry for this directory so that it uses the -o rw=bogus options Share everything listed in the dfstab file q On the NFS client, attempt to mount the /usr/share/man directory from the NFS server Record your observations Configuring NFS Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A 6-49 Exercise: Configuring NFS (Level 3) q On the NFS server, unshare the /usr/share/man directory, and remove the entry for it from the /etc/dfs/dfstab file q On the NFS client, return the /usr/share/man directory to its original configuration Tasks and Solutions Complete the following tasks Task 1– On the NFS Server Complete the following steps: Edit the /etc/dfs/dfstab file Add an entry to share the directory that holds man pages share -o ro /usr/share/man Stop and start the NFS server daemons # /etc/init.d/nfs.server start # share - /usr/share/man Verify that the /usr/share/man directory is shared and that no NFS mounts are present ro # dfshares RESOURCE server:/usr/share/man "" SERVER server ACCESS - TRANSPORT - # dfmounts There is no output for the dfmounts command 6-50 Advanced System Administration for the Solaris™ Operating Environment Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A Exercise: Configuring NFS (Level 3) Task – On the NFS Client Complete the following steps: Rename the /usr/share/man directory so that you can no longer access the man pages on the client system Verify that the man pages are not available # mv /usr/share/man /usr/share/man.orig # man ls What message does the man command report? No manual entry for ls Create a new man directory (/usr/share/man) to use as a mount point # cd /usr/share # mkdir man Mount the /usr/share/man directory from the server # mount server:/usr/share/man /usr/share/man Verify that the man pages are available # man ls Are the man pages available? Yes Verify and record the default ro | rw options used for this mount # mount The ro | rw option for the mount command is read/write (rw) by default Write a file into the NFS-mounted file system # touch /usr/share/man/test touch: /usr/share/man/test cannot create What is the result of trying to write to the NFS-mounted file system? You cannot write to the file system What conclusion can be reached by this exercise? Even though the file system mount is read/write, by default, the actual ro | rw permission is read-only, as defined when the directory was shared on the NFS server Configuring NFS Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A 6-51 Exercise: Configuring NFS (Level 3) Verify the list of mounts that the server provides # dfmounts server RESOURCE SERVER server PATHNAME /usr/share/man CLIENTS client Unmount the /usr/share/man directory, and verify the list of remote mounts from the server # umount /usr/share/man # dfmounts server No output from the dfmounts command indicates that there are no clients mounting the file systems from the server (This output still shows the mount.) Task – On the NFS Server Complete the following steps: Unshare the /usr/share/man directory Change the share statement in the /etc/dfs/dfstab file for the /usr/share/man directory to read: # unshareall share -o ro=bogus /usr/share/man Share the /usr/share/man directory # shareall 6-52 Advanced System Administration for the Solaris™ Operating Environment Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A Exercise: Configuring NFS (Level 3) Task – On the NFS Client Complete the following step: Attempt to mount the /usr/share/man directory again What happens? The client reports the error message: nfs mount: server:/usr/share/man: Permission denied Task – On the NFS Server Complete the following steps: Unshare the /usr/share/man directory Edit the /etc/dfs/dfstab file to remove the entry for the /usr/share/man directory # unshareall Task – On the NFS Client Complete the following steps: Return the /usr/share/man directory to its original configuration # cd /usr/share # rmdir man # mv man.orig man Verify that the man pages are now available # man ls Configuring NFS Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A 6-53 Exercise Summary Exercise Summary ! ? Discussion – Take a few minutes to discuss what experiences, issues, or discoveries you had during the lab exercise Experiences q Interpretations q Conclusions q 6-54 q Applications Advanced System Administration for the Solaris™ Operating Environment Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A ... swap -l swapfile /dev/dsk/c0t0d0s1 /dev/dsk/c1t0d0s3 dev 136 ,1 32 , 3 swaplo 16 16 blocks 120 6 736 614704 free 120 6 736 614704 Is the newly listed swap partition the same as the one you added to the... available dev 136 ,1 - swaplo blocks 16 120 6 736 16 4 094 4 free 1084 736 4 094 4 Advanced System Administration for the Solaris? ?? Operating Environment Copyright 20 02 Sun Microsystems, Inc All Rights Reserved... swaplo blocks free /dev/dsk/c0t0d0s1 136 ,1 16 120 6 736 1084 736 # swap -s total: 10 624 0k bytes allocated + 8 528 k reserved = 114768k used, 566776k available Add a disk partition as a swap slice to your

Ngày đăng: 14/08/2014, 02:22

TỪ KHÓA LIÊN QUAN