사용자:Dialektike/Sparse image

위키백과, 우리 모두의 백과사전.

sparse image맥 OS X에서 Disk Utility을 사용해서 만들 수 있는 disk image file 중 하나의 유형이다. 맥 OS X에서 FileVault 기능을 이용해서 사용자의 홈 폴더를 암호화할때, 암호화 된 sparse image(Encrypted sparse image) 파일을 사용한다.

이 이미지 파일은 이미지 파일이 있는 실제 디스크의 실제 공간을 차지하는 완전한 이미지 파일인 (.dmg) 과는 다르게, 단지 자신의 이미지 파일 안에 가지고 있는 데이터의 용량만큼만 실제 디스크 공간을 차지하지 않는다. 다시 말해 맨 처음 이미지를 만들때는 설정한 논리적 크기를 가지고 만들어 지기는 하지만, 실제 크기는 이미지 파일이 가지고 있는 데이터의 양만 차지하게 된다. 예를 들어 당신이 5GB parse image를 생성하고 거기에 500MB의 데이터를 복사했다고 생각해보자. 이때 그 디스크의 이미지는 단지 500MB 정도만 차지하게 될 것이다.

이런 특징 때문에 이 이미지 파일은 자료를 백업하는데 당당히 유리하다. 예를 들어 For example, assume a user would like to make a backup of a hard disk volume named "INFO" that is 5GB in size, yet only contains 2.5GB of actual data. While a single layer DVD-R (with around 4.7GB capacity) would be too small to store a full-sized "INFO.dmg" image file, an "INFO.sparseimage" image file will fit. This is because the unused 2.5GB from the original volume is not actually allocated within the sparse image file. The "INFO.sparseimage" file will occupy only 2.5GB.

Note that if the 2.5GB "INFO.sparseimage" backup on the DVD is subsequently opened and mounted as a "clone" of the source volume, the Finder will report the clone as having the original 5GB capacity, with 2.5GB available, but the virtual disk will be "read-only", because the source image file resides on read-only media. However, the first-generation 2.5GB "INFO.sparseimage" on a hard drive, when mounted, may have files added to it until the originally designated 5GB capacity is reached. The ".sparseimage" file will expand in size to accommodate the additional data. Deleting files from the mounted virtual volume will not result in a reduction in the size of the corresponding ".sparseimage" file. However, the size of the image can be reduced when the volume is not mounted.

Two limitations are therefore worth noting regarding the use of this image file format:

  1. A customized ".sparseimage" image file can be assigned a larger total capacity than the physical volume (or HD partition) on which it originally resides. While the virtual volume will seem to make that capacity available, attempting to exceed the physical capacity of the underlying volume will result in a disk error: "ran out of space". The ".sparseimage" file must first be moved to a larger physical disk or partition.
  2. As noted above, while mounted ".sparseimage" image files automatically expand to their preassigned limit if and when data is added, they cannot be arbitrarily resized without the use of Disk Utility, hdiutil, or other such software.

When the sparseimage file is not mounted, the .sparseimage file may be resized using Disk Utility’s Resize Image function. Sparseimages may also be resized from the Terminal. The following example resizes a .sparseimage so that it can expand to a maximum size of 50 gigabytes:

hdiutil resize -size 50g MyFile.sparseimage

Similarly, a .sparseimage file that has expanded in size but then had files deleted, can be "compacted" to a smaller size with the following command:

hdiutil compact MyFile.sparseimage

Additional information about the hdiutil command may be seen by typing the following in the Terminal:

man hdiutil

Sparse bundle[편집]

Mac OS X v10.5 (Leopard) introduced the concept of the sparse bundle.[1] Instead of a monolithic file, a sparse bundle is a bundle (directory) that stores the disk image as banded data files.틀:Vague When the content of the image changes, one or more band files is changed, created, or deleted. This allows backup software (such as Time Machine) to operate more efficiently.

References[편집]

틀:Mac-stub