Skip to content

Instantly share code, notes, and snippets.

@aanoaa
Created September 20, 2018 07:32
Show Gist options
  • Save aanoaa/62a6465bc05c0f43b978eb19b129c31d to your computer and use it in GitHub Desktop.
Save aanoaa/62a6465bc05c0f43b978eb19b129c31d to your computer and use it in GitHub Desktop.

hdiutil

case-sensitive 한 file system disk image 를 만들고, 이를 mount 해서 사용

root 권한이 필요없음

# reference: man hdiutil
# hdiutil -- manipulate disk images (attach, verify, create, etc)
# create <size_spec> <image>
#   create a new image of the given size or from the provided data.  If image already
#   exists, -ov must be specified or create will fail.  To make a cross-platform CD or DVD,
#   use makehybrid instead.  See also EXAMPLES below.
# ----------------------------------------------------------------------------------
# <size_spec>
#   -size ??b|??k|??m|??g|??t|??p|??e
#     보면 아실 듯
#   -volname volname
#     요건 그냥 라벨
#   -type UDIF|SPARSE|SPARSEBUNDLE
#     SPARSE creates a UDSP: a read/write single-file image which expands as is is filled with data.
#   -fs <filesystem>
#     Case-sensitive Journaled HFS+ - Mac OS Extended (Case-sensitive, Journaled)
# <image>
#   생성될 이미지 파일 경로

$ hdiutil create -type SPARSE -fs "Case-sensitive Journaled HFS+" -size 60g -volname "hfs" ~/Diskimages/hfs

# read/write 가능한 60GB 짜리 Case-sensitive 한 파일시스템의 disk image 파일을 만들어라

# 만든 disk image 를 ~/repo 에 마운트
$ hdiutil attach ~/Diskimages/hfs.sparseimage -owners on -mountpoint ~/repo;

# unmount
$ hdiutil detach ~/repo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment