Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Apple > Operating Systems

Apple Pro Training Series: OS X Lion Support Essentials: Supporting and Troubleshooting OS X Lion: Data Management

  • Print
  • + Share This
This chapter focuses on the composition and organization of the files and folders that make up Lion. In this chapter you, acting as an administrator, will use the file layout to strategically allocate resources. You will also work with many Mac-specific file technologies, including resource forks, packages, Quick Look, and Spotlight. Finally, you will use the built-in features for archiving data on the Mac, and learn how to back up and restore data using Time Machine.
This chapter is from the book

It is not unusual for an OS X Lion system volume to contain well over 100,000 folders and 500,000 files just to support the operating system and its applications. As you can imagine, the number of items in a user’s home folder varies widely, depending on the user, but even the most frugal of users will have thousands of items in his home folder. With this many files on hand, attempting to explore and fully comprehend Lion’s file layout may seem like a monumental task. To the contrary: Lion’s system files have been streamlined and reorganized into an easy-to-understand layout that is both easier for the Mac administrator to manage and provides enhanced security.

This chapter builds on the previous chapter, “File Systems,” to focus more specifically on the composition and organization of the files and folders that make up Lion. In this chapter you, acting as an administrator, will use the file layout to strategically allocate resources. You will also work with many Mac-specific file technologies, including resource forks, packages, Quick Look, and Spotlight. Finally, you will use the built-in features for archiving data on the Mac, and learn how to back up and restore data using Time Machine.

Understanding the System File Structure

Lion’s system layout is designed to strike a balance between ease of use and advanced functionality. For the basic user, looking at the root, or beginning, of the file system from the Finder will reveal only four default folders: Applications, Library, Users, and System. The contents of these four folders represent all that most users, and many administrators, will ever need to access. Yet when advanced users look at the system root from Terminal, they will see many more items that the Finder would normally hide. Thus, the complexity and flexibility of a UNIX operating system remains for those users who require it.

ch4-001.jpg

The following describes the default system root folders you’ll see from the Finder:

  • Applications—Often called the local Applications folder, this is the default location for applications available to all local users. Only administrative users can make changes to the contents of this folder.
  • Library—Often called the local Library folder, this is the default location for ancillary system and application resources available to all local users. Once again, only administrative users can make changes to the contents of this folder.
  • System—This folder contains resources required by the operating system for primary functionality. Users very rarely have to make changes to the contents of this folder. Even administrative users are unable to make changes to items in the System folder without reauthenticating.
  • Users—This is the default location for local user home folders. Specific access to home folder items is discussed in Chapter 2, “User Accounts.”
  • Developer (Optional)—This optional folder contains the Apple Xcode Developer Tools. This is not part of the standard installation, but it’s still a fundamental part of the system, and its installer can be found in the Mac App Store. Like the Applications and Library folders, the Developer folder can be changed only by an administrative user.

System Resource Types

All Lion-specific system resources can be found in the various Library folders throughout the system volume. System resources can be generally categorized as any resource that is not a general-use application or user file. That’s not to say that applications and user data can’t be found in the Library folders. On the contrary, the Library folder is designed to keep both user and system resources organized and separated from the items you use every day. This keeps the Applications folder and user home folders free from system resource clutter.

Opening any of the Library folders will reveal several dozen categories of items. It is not necessary to explore every possible Library item, but there are a few system resources you should be familiar with:

  • Application Support—This folder can be found in both the user and local Library folders. Any ancillary data needed by an application may end up in this folder. For example, it often contains help files or templates for an application. Once again, application resources are placed here to keep the Applications folders tidy.
  • Extensions—Also called kernel extensions, these items are found only in the system and local Library folders. Extensions are low-level drivers that attach themselves to the kernel, or core, of the operating system. Extensions provide driver support for hardware, networking, and peripherals. Extensions load and unload automatically, so there is little need to manage them, as is common in other operating systems. Extensions are covered to greater detail in Chapter 8, “Peripherals and Printing.”
  • Fonts—Found in every Library folder, fonts are files that describe typefaces used for both screen display and printing. Font management is covered in the “Managing Font Resources” section later in this chapter.
  • Frameworks—Found in every Library folder, frameworks are repositories of shared code used among different parts of the operating system or applications. Frameworks are similar to extensions in that they load and unload automatically, so again, there is little need to manage these shared code resources. You can view your Mac’s currently loaded frameworks from the /Applications/Utilities/System Profiler application.
  • Keychains—Found in every Library folder, keychains are used to securely store sensitive information, including passwords, certificates, keys, website forms, and notes. Keychain technology was covered previously in Chapter 2, “User Accounts.”
  • LaunchDaemons and LaunchAgents—These items can both be found in the local and system Library folders, and LaunchAgents can also be found in the user’s Library folder. These Launch items are used to define processes that start automatically via the launchd process. Lion uses many background processes, which are all started by launchd. Furthermore, every single process is a child of the launchd process. LaunchAgents are for processes that need to start up only when a user is logged in, whereas LaunchDaemons are used to start processes that will always run in the background even when there are no users logged in. More about launchd can be found in Chapter 9, “System Startup.”
  • Logs—Many system processes and applications archive progress or error messages to log files. Log files can be found in every local Library folder. Log files are viewed using the /Applications/Utilities/Console application.
  • PreferencePanes—PreferencePanes can be found in any Library folder. These items are used by the System Preferences application to provide interfaces for system configuration. System Preferences usage is covered in Chapter 1, “Installation and Configuration.”
  • Preferences—Preferences, found in both local and user libraries, are used to store system and application configuration settings. In other words, every time you configure a setting for any application or system function, it is saved to a preference file. Because preferences play such a critical role in system functionality, they are often the cause of software problems. Troubleshooting preference files is covered in Chapter 5, “Applications and Processes.”
  • Startup Items—Found in only the local and system Library folders, these are precursors to LaunchAgents and LaunchDaemons. Starting with Mac OS X 10.5, Apple is officially discouraging the use of Startup Items. In fact, you will have Startup Items only if you’ve installed third-party software that hasn’t been updated. In Lion the launchd process will still support many Startup Items, but this may not be true for future versions.

System Resource Hierarchy

Library folders, and thus system resources, are located in each of the four domain areas: user, local, network, and system. Segregating resources into four domains provides increased administrative flexibility, resource security, and system reliability. Resource domains are more flexible because administrators can choose to allocate certain resources to all users or just specific users. Using resource domains is more secure because standard users can add resources only to their own home folder and cannot access other users’ resources. In addition, it’s more reliable because, in most cases, you don’t have to make changes to the core system functionality in order to provide more services.

The four system resource domains are, in order:

  • User—Each user has his own Library folder in his home folder for resources. When resources are placed here, only the user has access to them. Also, a user can have his own Applications folder in his home folder. This folder is hidden in Lion as it’s now deprecated and thus may not appear in future versions of Mac OS X. However, you will still find many thousands of items in this folder as developers continue to rely on this location for resources.
  • Local—Both the root Applications and root Library folders are part of the local resource domain. This is why they are known as the local Applications and local Library folders. Any resources placed in these two folders are available to all local user accounts. By default, only administrative users can make changes to local resources.
  • Network—Lion can access system resources and applications from a network file share. Administrators must configure an automounted share in order to enable the Network resource domain. Configuring automounted shares goes beyond the scope of this guide. However, it is covered in another reference guide, Apple Pro Training Series: OS X Lion Server Essentials.
  • System—Finally, the system domain encompasses all the items necessary to provide core system functionality. There are many hidden items at the root of the system volume that make up the system resource domain, but the only one you will see in the Finder is the root System folder. In many cases, you do not need to add or manage any resources here.

With four different domains containing resources, a strong likelihood exists for overlap in resources, meaning there may be multiple copies of similar resources available to the system and user at any given time. The system is designed to handle this by searching for resources from the most specific, those in the user domain, to the least specific, those in the system domain. If multiple similar resources are discovered, the system will use the resource most specific to the user. For example, if multiple versions of the font Times New Roman are found, one in the local Library and one in the user’s Library, the copy of the font in the user’s Library will be the one used.

System Resource Troubleshooting

System resource issues are rare, and they are generally easy to identify. You will occasionally see an error message calling out an issue with a specific item, but you may also experience a situation where the item appears to be missing. In some cases, the system resource in question may be missing, but many times the system will simply ignore a system resource if it determines that the resource is in some way corrupted. The solution for both of these situations is to simply replace the missing or suspect item with a known working copy.

When troubleshooting system resources, you must also remember to heed the resource domain hierarchy. Using font resources as an example, you may have loaded a specific version of a font in the local Library that is required by your workflow to operate properly. In spite of this, a user may have loaded another version of the same font in her home folder. In this case, the system will load the user’s font and ignore the font you installed. Therefore, this user may experience workflow problems even though it appears that she is using the correct font.

Logging in with another account on the Mac is always a quick way to determine if the problem is in the user’s home folder. You can also use /Applications/Utilities/System Information to list active system resources. System Information will always show the file path of the loaded system resources, so it’s easy to spot resources that are loading from the user’s Library.

ch4-003.jpg
  • + Share This
  • 🔖 Save To Your Account