Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 57 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
57
Dung lượng
252,7 KB
Nội dung
7 7-24 Solaris™ 8 Operating Environment System Administration II Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services September 2000, Revision A.1 32. Run the automount command to update the list of directories managed by the automounter. # automount -v 33. Remove the /usr/share/man mount point. # cd /usr/share # rmdir man 34. Rename the /usr/share/man directory so you again have access to the manual pages installed on the client system. # mv man.orig man 7 AutoFS 7-25 Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services September 2000, Revision A.1 Exercise Summary Discussion – Take a few minutes to discuss the experiences, issues, or discoveries that you had during the lab exercises. ● Experiences ● Interpretations ● Conclusions ● Applications 7 7-26 Solaris™ 8 Operating Environment System Administration II Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services September 2000, Revision A.1 Task Solutions On the Server Host 1. Edit the /etc/dfs/dfstab file and add the following line in order to share the manual pages: share /usr/share/man 2. Use pgrep to check if mountd is running. # pgrep -xl mountd If mountd is not running, start it. # /etc/init.d/nfs.server start If mountd was already running, share the new directory by using the following command: # shareall On the Client Host 3. Rename the /usr/share/man directory so you can no longer access the manual pages installed on the client system. # cd /usr/share/ # mv man man.orig 4. Make a new man directory for use as a mount point. # mkdir man 5. Change to the /etc directory. # cd /etc 6. Edit /etc/auto_master to add the following line for a direct map: /- auto_direct 7. Use vi to create a new file called /etc/auto_direct and add the following line to it: /usr/share/man server :/usr/share/man 7 AutoFS 7-27 Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services September 2000, Revision A.1 8. Run the automount command to update the list of directories managed by the automounter. # automount -v 9. Test the configuration and verify that a mount for /usr/share/man exists after accessing the manual pages. # man ls < output from man command > # mount | grep man /usr/share/man on server :/usr/share/man read/write/remote on Fri Aug 13 16:56:14 1999 Did it work? This should automatically mount the directory where the manuals are stored. The man command should work. On the Server Host 10. Verify that the /export/home directory exists. If it does not, create it. # ls /export/home # mkdir /export/home The /export/home directory should have been created during installation of the operating system. If not, the second command applies. 11. Run Admintool. # admintool & The admintool window is displayed. 7 7-28 Solaris™ 8 Operating Environment System Administration II Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services September 2000, Revision A.1 12. From the Edit menu, select Add. In the Add User form, complete the following information: a. User Name: Your choice. b. User Id: 3001. c. Primary Group: Leave as 10. d. Secondary Groups: Leave blank. e. Comment: Your choice. f. Login Shell: Your choice. g. Password: Select Normal Password: Set the password to cangetin. Skip the password aging lines. h. Create Home directory: Leave as selected (do not click on the box). i. Path: /export/home/ username . 13. Click OK. This creates a user on this system along with a home directory for the user (physically on this system). 14. Quit Admintool. On the Client Host 15. Verify that the /export/home directory exists. If it does not, create it. # ls /export/home # mkdir /export/home The /export/home directory should have been created during installation of the operating system. If not, the second command applies. 16. Run Admintool. # admintool & 7 AutoFS 7-29 Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services September 2000, Revision A.1 17. From the Edit menu, select Add. In the Add User form, complete the following information: a. User Name: Same user. b. User Id: Same UID as the server. c. Primary Group: Same GID as the server. d. Secondary Groups: Leave blank. e. Comment: Your choice. f. Login Shell: Same shell. g. Password: Select Normal Password: Set the password to cangetin. Skip the password aging lines. h. Create Home directory: Deselect it (click on the box). i. Path: /export/home/ username . On the Client Host 18. Click OK. You are warned that the home directory does not exist. 19. Click OK. This adds a user to this system but does not create a home directory. This is correct. Eventually you will use the automount command to mount the home directory from the server system. 20. Quit Admintool. On Both Systems 21. Edit the /etc/passwd file and change the home directory for the new user from /export/home/ username to /home/ username . Replace username with the name of your new user. 22. Edit the /etc/auto_home file. Add the following line and replace username with the name of your new user: username server :/export/home/ username 7 7-30 Solaris™ 8 Operating Environment System Administration II Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services September 2000, Revision A.1 On the Server Host 23. Edit the /etc/dfs/dfstab file and add the following line to share the /export/home directory: share /export/home 24. Use the pgrep command to check if the mountd daemon is running. # pgrep -xl mountd 391 mountd If the mountd daemon is not running, start it. # /etc/init.d/nfs.server start Once the mountd daemon is running, share the new directory. # share /export/home # On Both Systems 25. Try to log in as the new user. Do both systems automatically mount the new user’s home directory? Yes, this should work. What directory is mounted, and what is the mount point: ▼ On the server? /home/ username on /export/home/ username ▼ On the client? /home/ username on server :/export/home/ username 7 AutoFS 7-31 Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services September 2000, Revision A.1 Check Your Progress Before continuing on to the next module, check that you are able to accomplish or answer the following: ❑ List the benefits of using the automount utility ❑ Describe the purpose of each of the types of automount maps ❑ Configure the auto_master map to specify which direct, indirect, and special maps the automountd daemon reads. ❑ Create the auto_direct map with the full path names and mount options for automatically mounting remote file resources. ❑ Modify the auto_home map as an example of an indirect map providing a consistent view of home directories across the network, regardless of where the user is logged in. [...]... /export/cache_dir Filesystem kbytes /dev/dsk/c0t0d0s3 282 882 4 used avail capacity 327 456 2444792 12% Mounted on /export Compare the size to that output in step 9 The used column shows almost a 1 Mbyte increase (327 456 32 655 7 =89 9 Kbytes) 15 Run the cfsadmin command to determine the maximum amount of space in the /export directory that the cache can use # cfsadmin -l /export/cache_dir cfsadmin: list cache... 5 root other drwxr-xr-x 81 bin bin server:_usr_share_man 51 2 Aug 13 10:27 51 2 Aug 13 10:27 153 6 Feb 8 1999 8 Check the status of the CacheFS file system # cachefsstat /usr/share/man /usr/share/man cache hit rate: consistency checks: modifies: garbage collection: 8- 22 100% (0 hits, 0 misses) 0 (0 pass, 0 fail) 0 0 Solaris 8 Operating Environment System Administration II Copyright 2000 Sun Microsystems,... 90% minblocks 0% threshblocks 85 % maxfiles 90% minfiles 0% threshfiles 85 % maxfilesize 3MB 007man 8- 24 Solaris 8 Operating Environment System Administration II Copyright 2000 Sun Microsystems, Inc All Rights Reserved Enterprise Services September 2000, Revision A.1 8 16 Unmount the /usr/share/man directory and remove the CacheFS file system # umount /usr/share/man # cfsadmin -d 007man /export/cache_dir... read/write/setuid/largefiles on Thu May 11 15: 55: 34 2000 /proc on /proc read/write/setuid on Thu May 11 15: 55: 34 2000 /dev/fd on fd read/write/setuid on Thu May 11 15: 55: 34 2000 /tmp on swap read/write on Thu May 11 15: 55: 35 2000 /data on /cache/cache0/.cfs_mnt_points/host1:_export_data backfstype=nfs/cachedir=/cache/cache0/cacheid=data_cache on Thu May 11 06: 38: 43 2000 You could automate this mount by... file system u Use the appropriate commands to check the status and consistency of the CacheFS file system u Set up CacheFS file system logging u Describe the steps necessary to perform a check of the CacheFS file system u 8- 26 Describe the CacheFS file system List the steps to dismantle and delete a CacheFS file system Solaris 8 Operating Environment System Administration II Copyright 2000 Sun Microsystems,... 14 Display the file system size of the cache directory again using the df command # df -k /export/cache_dir Note – Compare the size to that output in step 9 8- 18 Solaris 8 Operating Environment System Administration II Copyright 2000 Sun Microsystems, Inc All Rights Reserved Enterprise Services September 2000, Revision A.1 8 15 Run the cfsadmin command to determine the maximum amount... consistency check and performs any necessary updates: # cfsadmin -s /data 8- 8 Solaris 8 Operating Environment System Administration II Copyright 2000 Sun Microsystems, Inc All Rights Reserved Enterprise Services September 2000, Revision A.1 8 Enhancing CacheFS File System Caching You can have additional control of the caching mechanism for CacheFS file systems by doing the following: q Set the number of... /data CacheFS 8- 11 Copyright 2000 Sun Microsystems, Inc All Rights Reserved Enterprise Services September 2000, Revision A.1 8 Once you enable logging, you can check the size of the cache # cachefswssize /var/cachelogs/data.log total for cache initial size: end size: high water size: 8- 12 4 256 k 51 1k 51 1k Solaris 8 Operating Environment System Administration II Copyright 2000 Sun Microsystems, Inc All... module # cfsadmin -l /cache/cache0 cfsadmin: list cache FS information maxblocks 90% minblocks 0% threshblocks 85 % maxfiles 90% minfiles 0% threshfiles 85 % maxfilesize 3MB data_cache 3 Unmount all CacheFS file systems that share the same cache directory with the one you intend to delete The examples in this module use only one cache directory, so the command is: # umount /data 8- 14 Solaris 8 Operating... /data 8- 14 Solaris 8 Operating Environment System Administration II Copyright 2000 Sun Microsystems, Inc All Rights Reserved Enterprise Services September 2000, Revision A.1 8 4 Delete the CacheFS file system # cfsadmin -d data_cache /cache/cache0 Note – To delete all CacheFS file systems in the cache directory, use the cfsadmin -d all command 5 If some CacheFS file systems remain after others are deleted, . module: ● System Administration Guide, Volume I, Sun Part Number 80 5- 72 28- 10 ● System Administration Guide, Volume II, Sun Part Number 80 5- 7229-10 ● System Administration Guide, Volume III, Sun. May 11 15: 55: 34 2000 /proc on /proc read/write/setuid on Thu May 11 15: 55: 34 2000 /dev/fd on fd read/write/setuid on Thu May 11 15: 55: 34 2000 /tmp on swap read/write on Thu May 11 15: 55: 35 2000 /data. operating system. If not, the second command applies. 11. Run Admintool. # admintool & The admintool window is displayed. 7 7- 28 Solaris 8 Operating Environment System Administration II Copyright