Differences between file-level and block-level cloning

When discussing backup options, frequently we will mention cloning. There are two basic types of clones, block-level and file-level, and here are the differences between them.

When discussing options for backing up or migrating data to new Macs, we frequently mention cloning as a way to do this. While Time Machine and similar backup schemes can create fully restorable backups of your system, the backups themselves are not bootable, so in order to use them as such you must restore them to an available hard-drive partition, which can take a number of hours to complete. Clones, on the other hand, do allow for immediate booting to the backup, and therefore are quite appealing as an option.

Cloning is when you basically make a mirror copy of one drive on another one, so the two drives are the same in both function and content. While people more commonly use cloning to make functional backups of their boot drives, cloning can also be used for copying secondary data drives or putting an installation DVD on a faster medium. When cloning, there are two methods used that may cause some confusion for people who are unfamiliar with the cloning process. These two methods are file-level cloning and block-level cloning.

File-level cloning
File-level cloning is when the cloning tool copies data from one drive to another one on a file-by-file basis, regardless of where the data for the file is physically located on the drive. This means the tool attempts to build the new drive's data structure by reading the logical filesystem on the source drive. The tool will read the directory tree and the drive type, and then copy files so they are in the exact same directory structure and have the exact attributes (permissions, ownership, and so on) as the current ones.

Block-level cloning
Block-level cloning copies data by bypassing any interpretation of the logical filesystem structure and copying the drive's internal block-level organization. Hard-drive data is organized on the disk in a large circular grid with each grid point being called a "block" or "sector" (read more about hard-drive blocks here). While the logical filesystem (such as "Mac OS Extended" format) on a drive will tell the system exactly which blocks contain file data, you can also copy the whole disk by just duplicating the layout and content of the blocks. As long as the blocks are copied in the same order and with the same data, then the cloned drive should be identified as having the same partition scheme, format, and data as the original one.

This is similar to copying a digital picture by starting at the top left corner and copying the color content in each pixel one by one to a new image. Even if the original image has some errors in it, as long as the pixels are in the same locations then the new image will be an exact duplicate of it.

Practical differences
When it comes to using these schemes, there are some differences in terms of speed and use.

File-level cloning is useful because it allows the cloning tool to synchronize the clone with the original disk, so if you want to update your clone you can do so without copying all the files over to the new drive again. The tool instead can take a fraction of the time to build the clone that it would take to start from scratch.

File-level cloning also has a benefit in that it can be used to defragment drives. Since file-level cloning does not monitor which blocks are used on the drive, the files it copies can be stored on any set of blocks that are available on the new drive. Therefore if a file is fragmented among several groups of blocks on one drive, when it is copied to the new one it will be written in a contiguous group of blocks, thereby defragmenting the file.

The drawback to using file-level cloning is that you can only clone one volume (formatted filesystem) at a time, meaning that if you have two partitions on a drive then this form of cloning will not immediately clone both. Therefore, Boot Camp partitions and secondary data partitions on a boot drive will not be transferred if you tell the cloning utility to duplicate your boot volume.

In terms of speed, when creating the initial clone, file-level cloning will be slower than block-level cloning, especially for drives that are relatively full. This is because file access requires the system to read the filesystem directory, process the location of the file, access the file, and then read it. All of these steps take computing overhead that cuts into the copying time. When performing a block-level transfer, however, the system just needs to read the entire drive block-by-block regardless of the data it contains, and copy the whole data set at the highest speed possible.

Block-level clones are also beneficial because they copy not only recognized files, but also those that have been deleted, corrupted, or otherwise lost from the filesystem. If you have inadvertently deleted an important file and do not have a file recovery tool, using a cloning program to immediately create a block-level clone will increase your chances of recovering the file since it lessens the chance that the file's data blocks will be overwritten.

Cloning utilities
There are a number of cloning utilities out there, which include:

  1. Carbon Copy Cloner -- This popular cloning tool can perform both file-level and block-level cloning.
  2. SuperDuper -- This is another very popular cloning tool that only does file-level cloning.
  3. Clone X -- This tool will perform block-level cloning of a drive.
  4. Stellar Drive Clone -- This relatively new cloning tool does a block-level clone on the drive.
  5. Winclone -- Most Mac cloning tools will not specify Boot Camp partitions, whereas this tool does (though you might also consider cloning Boot Camp from within Windows).

In addition to these, there are a number of data recovery and drive utilities that will create clones of a drive either on another drive device or to a disk image.

  1. Drive Genius
  2. Apple's Disk Utility (included in OS X)
  3. Data Rescue


Questions? Comments? Have a fix? Post them below or e-mail us!
Be sure to check us out on Twitter and the CNET Mac forums.

Tags:
Computers
About the author

    Topher, an avid Mac user for the past 15 years, has been a contributing author to MacFixIt since the spring of 2008. One of his passions is troubleshooting Mac problems and making the best use of Macs and Apple hardware at home and in the workplace.

     

    Join the discussion

    Conversation powered by Livefyre

    Don't Miss
    Hot Products
    Trending on CNET

    HOT ON CNET

    Find Your Tech Type

    Take our tech personality quiz and enter for a chance to win* high-tech specs!