The four most interesting features of the new Apple File System. Slicing apples


At yesterday's WWDC 2016 presentation Apple company showed new versions of the operating systems macOS (Sierra) 10.12, iOS 10, tvOS 10, watchOS 3, an application for teaching children Swift programming Playgrounds and new emojis.

It would seem that there is nothing interesting. However, Apple still rolled out something fundamental. The most significant development of all mentioned at the presentation is the file system of the new Apple generation File System(APFS) in the operating room macOS system(Sierra) 10.12.

Documentation with the main characteristics and description of the file system, which repeats individual functions of the powerful free file system ZFS, was published on the website for developers shortly after the presentation.

Now in Apple computers The HFS+ file system is used, an extended version of HFS (Hierarchical File System, hierarchical file system), created more than 30 years ago. Like its predecessor, HFS+ uses a tree structure called a B* tree to store most of the metadata. Hence the name “hierarchical file system”.

The official introduction of HFS+ took place on January 19, 1998, along with MacOS 8.1. Since 2002, the system has implemented logging to increase the reliability of information storage. Since version OS X 10.3, logging is enabled by default, and it is now possible to work in case-sensitive mode.

Up until OS X 10.7, developers continued to refine HFS+ and implement new features for OS X at the file system level. But the fact remains: HFS was originally developed in the days of floppy disks and spinning hard drives, when file sizes were measured in kilobytes or megabytes. Today many people work with SSD drives, where millions of files are stored - gigabytes or terabytes of data. Completely different requirements are put forward for the file system. Instead of reworking the old code, Apple decided to finally write a new file system from scratch.

File system New generation APFS is still at the stage developer preview, that is, it is not planned to be rolled out into mass use in the near future. IN this moment An APFS volume cannot be used as a boot disk, nor can it be used in a backup system. copy Time Machine, in Fusion Drive or with File Vault encryption. But it is possible for a regular non-bootable volume.

There is still a lot of development and testing ahead, but only then APFS will become Apple's main file system for decades to come.

APFS, unlike HFS+, inherently distinguishes the case of characters in file and folder names, and this feature cannot be disabled. This should be kept in mind by anyone who decides to use APFS.

Main characteristics

The official documentation lists the general characteristics of the file APFS systems compared to HFS+.

Containers and volumes

Container is the main object for storing data in APFS. Containers are usually exactly the same as GUID Partition Table (GPT) entries and have their own crash protection and distribution scheme disk space. Each container contains one or more volumes or file systems, each of which has its own namespace, that is, a set of files and directories.

APFS does not directly support software RAID, but it can be used with Apple volumes RAID to support Striping (RAID 0), Mirroring (RAID 1) and Concatenation (JBOD).

64-bit inodes

64-bit inodes significantly increase the namespace compared to 32-bit inodes in HFS+. The 64-bit APFS file system supports more than 9 quintillion files on each volume. This should be enough for everyone, as Bill Gates said.

Nanosecond timestamps

APFS has significantly increased the accuracy of timestamps. APFS supports timestamping with nanosecond precision. For comparison, in HFS+, time stamps were set with an accuracy of up to a second.

Nanosecond timestamps are very important in modern file systems because they help implement atomicity and atomic transactions - one of the main ACID requirements for a transactional system (for example, a DBMS). Atomicity ensures that no transaction is partially committed to the system. Either all of its sub-operations will be performed, or none will be performed.

Failure protection

APFS implements an innovative copy-on-write metadata scheme that Apple calls “Crash Protection.” It ensures that file system changes and log writes remain synchronized if something happens while the write is in progress, such as a power failure.

Copy-on-write scheme in ZFS

Sparse files

A file with the “sparse” attribute assumes that it contains blocks of zero bytes that are not stored on the drive, but are implied. HFS+ did not have support for sparse files.

Extended Attributes

APFS has built-in support for advanced file attributes, which in HFS+ was implemented through the Attributes file, that is, through a B-tree.

Encryption

Apple says encryption is fundamental property, which is built into APFS at the file system level. For each volume in an APFS container, one of the encryption models is set: no encryption, single-key encryption, or multiple-key encryption. In the latter case, separate keys are used to encrypt files and metadata. Depending on the hardware, APFS uses AES-XTS or AES-CBC encryption mode.

Cloning files and directories

Cloning is an almost instantaneous copying of a file or directory, which does not require extra bed for data storage. When a clone is modified, the file system only records the data change. This way the new file system can store many versions large files, taking up less disk space.

Snapshots

Snapshots are read-only snapshots of the file system on a volume. The operating system can use snapshots for more effective procedure Reserve copy. That is, finally Time Machine will work fine (fast).

Of course, APFS is significantly inferior in its capabilities to the 128-bit file system ZFS, which is supported by Linux, FreeBSD and other free operating systems, but on Apple's part this is a step in the right direction.

It is strange that the preliminary documentation does not mention the compression function, which HFS+, by the way, supports.

Apple has been trying to port ZFS to OS X for a long time, there was an active discussion about this on the ZFS mailing lists, preliminary snapshots for next version OS X. Later an implementation of OpenZFS was made for OS X (O3X) and MacZFX.

File ZFS system distributed openly source code, and Apple may well have borrowed some ideas for the APFS file system. Implementation open source for APFS is not yet ready, Apple plans to document and publish the APFS format in 2017.

The first formal session will take place at WWDC this evening, where the new APFS capabilities will be demonstrated to developers in more detail.

At the last WWDC, Apple introduced a new file system - Apple File System, or APFS. Although HFS+ is used on all Apple products (and will be used for at least another year, APFS is scheduled for release in 2017), HFS+ does not meet the requirements of modern file systems. She is already more than 30 years old, she was created for the times when floppy disks and hard disks were considered the latest technology. To use HFS+ on iOS, tvOS and watchOS, Apple had to add completely third-party functionality that is not supported on macOS: for example, encryption for each individual file.

The new APFS has added so many features that it’s dizzying: optimization for Flash and SSD, protection against data loss during crashes by increasing the number of atomic operations, built-in support for several types of encryption, greatly reduced response time, quick estimation of the size of files and folders - the list goes on and on. In this article we will look at what we think are four of the most interesting features new file system.

Secure Copy-on-write

First, we'll have to understand a few key terms. Atomic operations are operations that are performed inseparably on a file system or database and cannot be simplified. An atomic operation cannot remain unfinished if it is interrupted. Such an operation is either performed completely or not at all. POSIX-compliant secure atomic file storage is performed as follows - when we work with an application and save a file, data from memory is downloaded to a temporary file on disk. When the application is confident that the data has been downloaded completely and without errors, the application queries the file system about renaming. The renaming operation is atomic; it will either be completed completely or not at all. When renaming, what happens is that the file system moves the temporary file to the save location (say from /var/tmp/Batcave_shopping.pages to ~fedor/Documents/Batcave_shopping.pages) and then deletes the old file.

However, what if we are saving not a file, but a folder or Bundle (for example, .rtfd or .app, also, in essence, folders)? Let's say we are working with the document ~fedor/Documents/AlfredHappyBirthday.rtfd. This is a Bundle, it contains text and several images. When we make changes and save them, the application overwrites the entire Bundle, not just the changed text or image. POSIX requirements do not allow you to rename a folder somewhere where there is already data, so you have to resort to tricks. The document is moved from ~fedor/Documents/ to free up space, then the temporary file in /var/tmp/AlfredHappyBirthday.rtfd is renamed to empty place. This operation is non-atomic and unsafe. If a system error occurs or the computer loses power during an operation, the document will be lost.

Obviously, such a solution is undesirable. Therefore, APFS introduced a new, POSIX-incompatible atomic safe folder save operation. When an application requests to save a folder, the temporary and permanent files are swapped. This is done by the file system and is an atomic operation.

This is the secure Copy-on-write feature - one of the most important innovations in APFS.

Cloning and snapshots

If you need a copy of a file or folder, you click on it right click mouse and select Duplicate. In HFS+, this means that the file system reads all data and then writes it to free space. This approach is an inefficient use of space and wastes the disk and processor load. In APFS, when you duplicate data - via Duplicate or simply ⌘C, ⌘V - the file system copies only the link to it (the so-called hard link), and the content is not duplicated. This operation is called cloning. Thanks to cloning, a duplicate data or folder appears almost instantly and takes up a negligible amount of free space. If you make changes to the original or clone, the file system will record the changes and redirect the link accordingly, leaving the original piece of data untouched. In APFS, the cloning operation is atomic.

Snapshots is a specific snapshot of a volume that stores information about the data on that volume at a specific point in time. The easiest way to understand how it works is with an example. Let's say we have a volume (let's say a flash drive) with two presentations. We create a Snapshot of this flash drive, it contains two files Joker.key and Riddler.key, the files belong to next blocks data. The Snapshot itself does not contain data from the flash drive - only what files were on it at the time the snapshot was created and what blocks they belonged to. The peculiarity of Snapshot is that blocks written to it are closed. They cannot be deleted, moved or overwritten. Therefore, for example, if we make changes to Joker.key and delete Riddler.key altogether, the original data blocks will remain intact. Although this approach takes up additional free space, it allows APFS to almost instantly return the volume back in time to the point at which any snapshot was taken.

Space sharing

Space sharing is another very interesting feature of APFS. Once again, the easiest way to understand it is with an example. Let's say you have a laptop, it has a 256 GB SSD installed (it's very possible that you actually have such a laptop) and you want to install OS X El Capitan and the beta on it macOS Sierra. Alas, Apple doesn't yet allow you to boot the operating system from an APFS volume (or use it for Time Machine, for that matter), so you'll need to create two HFS+ partitions. You launch Disk Utility and you are faced with a dilemma - how big should you make the partitions? You can simply split the disk in half, but what if you don't have enough space for comfortable work at El Capitan? Or, on the contrary, will you overdo it and the applications you need won’t fit in Sierra?

APFS solves this problem with Space sharing. On a disk with APFS volumes at a higher level, a container is created containing all the volumes. They can freely and dynamically grow or shrink within such a container, without requiring the user to choose how large they should be. Let's return to our hypothetical laptop. If you use APFS instead of HFS+ for both volumes, both OS would report that 256 GB of space is available for each. At the same time, the space busy with files one system would be inaccessible to another. This solution greatly simplifies the work with multiple volumes and allows you to get the maximum benefit from their use without much difficulty.

Migration from HFS+

Finally, how can we migrate to APFS? The process of switching to a file system is usually difficult, long and not always safe. You have to backup your data to external media, wash HDD computer, write a new file system, install the OS, restore your data from a copy and hope that nothing has disappeared from its place.

Fortunately, Apple took care of this. The company's engineers did a lot of work on the migration process. The process consists almost entirely of atomic operations, but the main thing is that data about the new file system is written only to empty space on an HFS+ volume. This means that even if something goes wrong, it will not damage either your data or the structure of your existing file system. And according to Apple engineers, the entire migration takes just a few minutes.

Here we come to the end. We only talked about four functions, but there are many more in APFS. If you want to dive into the details, the official documentation has all the details. The new file system, as we mentioned above, cannot be used for boot disk or Time Machine and will not be supported on OS X Yosemite and older. Official release APFS is scheduled for 2017.

Since January this Apple of the Year testing iOS update 10.3, in which the company implements a new file system. New way Data storage organization will follow the Mac to iPhone, iPad and Apple Watch. How users of Apple devices will benefit from this is further in our material.

What is Apple File System (APFS)?

Apple File System Apple system") - This own development company, which was announced last summer. It replaced the previous HFS+ file system, which Apple first introduced back in 1998. APFS was announced in June 2016 at the WWDC Worldwide Developers Conference. The technology was developed by Apple from scratch and is primarily focused on working with flash drives and more advanced data encryption.

APFS supports almost all the features of HFS+, but it better meets the requirements of modern Apple products. Unlike HFS+, it is optimized for flash and SSD drives, supports stronger encryption, creating system snapshots, copy-on-write metadata, and atomic primitives.

What are the benefits of APFS?

It may not be something that all users will notice, but APFS allows devices to run faster. Firstly, the new file system calculates the amount of free and used space differently, so after switching to APFS it will turn out that there will be more space on the drive. This has already been noticed by developers who installed on iPhone and iPad beta iOS 10.3.

Secondly, APFS moves and copies files faster, which means it will take less time to boot the OS and install applications. The advantages of APFS over HFS+ were clearly demonstrated at WWDC 2016 by Apple engineer Eric Tamura, who copied iTunes to a flash drive formatted for the new system. When APFS had already completed its work, the disk on HFS+ continued to copy for another 17 seconds.

APFS allows you to copy while writing metadata, clone files and folders, take file system snapshots, has increased fault tolerance, supports sharing space, faster cataloging and many other features that will allow iPhone and iPad to work faster and more reliably.

APFS release date

The seventh one came out last Thursday iOS beta versions 10.3, which means the final release is just around the corner. Users don't have to worry: the new OS will automatically convert the current HFS+ file system to APFS.

APFS is designed to work with iOS, macOS, tvOS and watchOS, so it can be installed on all Apple products. The company is going to transfer its devices to it. Changing the file system should not lead to the loss of user data, the company says, but it is recommended to back up information just in case.

In 2017, Apple will begin using the new Apple File System (APFS) in its devices, which will replace the HFS+ system used on Mac computers from 1998, which is based on HFS from 1985.

APFS is a completely new file system designed for today's hardware And cloud technologies. It improves encryption, security, and reliability over Apple's older systems. As usual in such cases, there will be compatibility issues, but Apple has time to resolve them before new system will become available to a wide range of users.

First look at APFS

APFS is currently available in the beta version of macOS Sierra 10.12 (successor to OS X Capitan 10.11) for developers.

You can create an APFS disk image in it, but there are not many actions available with it - copying files to and from it, and you cannot use the APFS disk as a boot disk. All this is set to change in 2017 with the advent of new Mac models, iPhone and iPad.

Improved security and persistent cloning

Most users won't notice anything radically new about devices that support APFS on the hard drive, but there are a lot of significant differences hidden under the hood. APFS uses integrated encryption instead of installable third-party techniques in the existing OS X FileVault feature, which slowly encrypts and decrypts the entire disk.

APFS can encrypt entire disks and individual files with different keys for file and metadata, giving flexible control that can allow users to modify data in a file without accessing other areas of the disk.

APFS also allows you to instantly copy folders and drives. This technology will improve the speed of Sierra's built-in feature that automatically backs up files from your Desktop and Documents folders to cloud storage iCloud (the function can be disabled) - we have already talked about this feature in the article “macOS Sierra: new features of the successor to OS X“. The functionality already works on existing devices, but should get faster with APFS.

Nanosecond accuracy, improved backup

Apple's current file system timestamps files to within one second, which is not sufficient to capture file changes at current device speeds. APFS timestamps files with nanosecond accuracy, which, combined with backup technology, allows you to store different versions files, taking up minimal space.

You can wait for availability in macOS Sierra new version Apple features Time Machine, which will take advantage of the file system to improve creation productivity backup copies. Microsoft created similar functionality in the NTFS file system many years ago, and Mac users will now be able to work with similar “shadow copy” technology as in Windows.

Improved space distribution

Other benefits of APFS disks include flexible space allocation, so that two APFS "disks" can borrow space from each other rather than having to settle for just the space they were given at creation.

APFS has support for "sparse files" that do not fill all allocated disk space. Previous versions OS X already supports sparse files, but not in the most convenient way and only for developers.

And thanks to fast built-in file management, we are promised more reliable protection against data loss during system crashes.

Optimization for Flash Memory

Other internal innovations include optimizations for flash memory, while HFS+ technologies are designed for spinning hard drives. Those who have ever waited a long time for OS X to tell you how much space a particular folder takes up will be glad to know that APFS's quick directory sizing feature will solve this problem.

If you are going to use your Mac computer next 25 years, it is better to upgrade to APFS before February 6, 2040, as HFS+ will not be able to create file timestamps after this date.

Disadvantages of APFS

The main thing is compatibility. If the Mac has a created Apple program Boot Camp section for Windows, then you need Windows driver, which can read an APFS drive the way Apple's Windows driver can read HFS+ drives. Surely Apple will provide such a driver before the public release of APFS.

Similar dual boot Using Sierra and older versions of OS X will not allow access to the APFS partition from the partition with older versions. Ordinary network access to and from the APFS disk will not be a problem since APFS supports standard network protocol SMB, used by Windows and everyone else.

Instead of a conclusion

Only developers need to think about learning APFS. For the rest, the new file system will give higher speed system operation, enhanced safety and reliability. Coming out in July public beta macOS Sierra, then everyone will be able to access the new file system.

You've connected your iPhone or iPad to your Windows computer, but nothing Windows Explorer, nor in iTunes do you see everything that is in the memory of your device? So how to connect an iPhone or iPad like a regular external USB disk? And is this possible without jailbreak? Yes, using PhoneBrowse, for example.

PhoneBrowse is free tool for Windows, allowing you to view and manage files on iPhone, iPad and iPod without jailbreaking the devices. With this program, you can even add, delete or rename all types of files stored on your iOS device. All this in a rather simple but very pleasant user interface, stylized for Mac OS X.

Download and install PhoneBrowse on your Windows computer, connect your device, and off you go. The tool will automatically detect the connected device and scan its file system. After this you will see five different tabs, the first of which displays general information about the connected device, including battery percentage, OS version and memory status.

The process of adding and deleting files through PhoneBrowse is simple and fast. For this purpose, the “Import” and “Delete” buttons are provided. And you can add it like separate file, and the entire folder. To copy files from the device to your computer, there is an “Export” button. You can also create new folders and rename files. You can also view through PhoneBrowse file structure installed applications.

As mentioned above, the tool is available for free and runs on different versions Windows – from XP to 8 and 8.1.







2024 gtavrl.ru.