Mac OSX system directory structure

Source: Internet
Author: User
Tags temporary file storage
1 hard disk partition

By default, Mac OS X divides the hard disk into three GPT partitions. The first is the ESP partition required by the GPT standard, which is very small, in the format of 200 MB, fat file system. According to the EFI practice, the boot program should be used to store the operating system. However, Apple does not follow this practice and its boot program boot. EFI is not stored in ESP. This partition is only used by Apple to store files for firmware upgrade. The second partition is the system partition of OS x, which occupies most of the disk space and is used to store the entire OS X system and user data. The format of the partition file system is HFS +. The third partition is the system recovery partition, which stores a streamlined OS X system to complete system recovery, installation, and other tasks, similar to windowspe. By default, the disk tool provided by OS X does not display ESP partitions and restore partitions. You must enable the Debug menu. To enable this function, follow these steps:

defaults write com.apple.DiskUtility DUDebugMenuEnabled 1

Restart the "disk tool". A "debug" menu is displayed in the menu. Select "show all partitions" to display the hidden partitions of the disk on the left. As shown in:

In this case, both the ESP partition and the restored partition are displayed in gray, because although the partition exists, it is not mounted to the system directory tree. Right-click the partition and select mount, you can also view the partition directly in the finder.

The directory structure of the ESP partition is as follows:

2 OS X system partition directory structure

Mac OS X is already an authenticated UNIX system, so its directory structure basically conforms to the UNIX system directory structure. However, many directories are not visible in the finder, because these directories are set with hidden properties. We can use Unix commands in the terminal window to view

It can be seen that there are traditional UNIX System directories under the root directory, as well as some OS X-specific directories.

2.1 conforms to the traditional UNIX directory
  • /Bin stores directories of traditional Unix commands, such as LS, RM, and MV.

  • /Sbin the directory where traditional UNIX management commands are stored, such as fdisk and ifconfig.

  • /Usr third-party program installation directory.

  • /Usr/bin,/usr/sbin,/usr/lib, where the Shared Library (Dynamic Link Library) is stored in the/usr/lib directory ).

  • /Etc. Directory of the standard UNIX system configuration file, such as the user password file/etc/passwd. This directory is actually a link to/private/etc.

  • /Dev device file storage directory, how to represent the hard disk/dev/disk0.

  • /Tmp temporary file storage directory, With the permission to read and write any one. This directory is actually a link to/private/tmp.

  • /Var stores frequently changed files, such as log files. This directory is actually a link to/private/var.

These standard UNIX directories are not visible in the finder, as shown in:

2.2 unique OS X Directory

In the OS X system, in addition to the standard UNIX directory, a unique directory is added.

  • /Applications application directory. By default, all GUI applications are installed here;

  • /Library system data files, help files, documents, and so on;

  • /Network node storage directory;

  • /System contains only one directory named library, which stores most of the system components, such as various frameworks, kernel modules, and font files.

  • /Users stores users' personal data and configurations. Each user has its own separate directory.

  • /Volumes file system mount point storage directory.

  • /Cores kernel dump file storage directory. If the system permits a process to crash, a dump file is generated.

  • The subdirectories in/private store the target directories in the/tmp,/var,/etc and other linked directories.

3. What Directory should the user's data be stored in?

For common OS x users, the understanding of the system directory tree structure does not affect the normal use of the system, so that OS X intentionally hides many directories, so that common users cannot see them through the finder. What users really care about is the convenience and security of storing their data. Windows users usually store their personal data in other partitions of a non-system disk (c), because the content of drive C may not be found once the Windows system dies. Mac OS x users do not have to worry about this problem. The probability that OS X crashes and cannot be started is too low, even if the system encounters a problem, user Directories and System directories are independent of each other, so they are easy to retrieve. Therefore, you can store the data directly in your user directory. We recommend that you do this for OS X and prepare frequently-used subdirectories for the user, as shown in:

Apps, documents, downloads, music, movies, images, and public directories are enough for common users. If you do not think they are enough, add them as needed, for example, the work directory is added to store some work project files, and home photos and videos are used to store photos and videos from mobile phones and DV.

If users from Windows want to keep their original habits and store user files and system files in different partitions, they need to facilitate "disk Tools" and repartition, adjust the system partition to a smaller value, and set aside space for creating a new HFS + partition. You can use this partition when mounting it to the system directory tree.

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.