← Documents Documentation/filesystems/hfs.rst GitHub 원문 ↗

Linux 6.18.37 · Filesystems

Macintosh HFS Filesystem for Linux

Linux HFS driver의 지원 범위, mount option, UNIX 기능 제약과 resource fork 동작을 설명하는 전문 번역입니다.

Source pathDocumentation/filesystems/hfs.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

hfs.rst:1-87

Linux HFS driver는 classic Macintosh HFS를 다루며 MFS는 지원하지 않고 HFS+에는 별도 `hfsplus` driver를 사용합니다. mount option은 Finder creator/type, 공통 UID/GID·umask, CD-ROM session·partition, invalid option 처리 방식을 정합니다.

HFS의 resource fork와 Finder metadata는 Linux namespace에서 숨김 추가 파일로 표현되지만 독립적으로 조작할 수 없고 data fork·directory와 함께 움직입니다. 다른 filesystem으로 복사할 때 이 속성을 잃으면 MacOS에서 필요한 파일 의미도 손실될 수 있습니다.

Linux에서 HFS를 다루는 핵심
volume이 HFS인지 HFS+인지 확인HFS는 `hfs`, HFS+는 `hfsplus` driver 선택필요한 creator/type·UID/GID·umask option 지정CD-ROM이면 session·partition option 검토복사 시 resource fork와 Finder metadata 보존 여부 확인

형식 선택부터 mount와 fork 보존까지의 점검 순서입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ==================================
4 Macintosh HFS Filesystem for Linux
5 ==================================
6
7
8 .. Note:: This filesystem doesn't have a maintainer.
9
10
11 HFS stands for ``Hierarchical File System`` and is the filesystem used
12 by the Mac Plus and all later Macintosh models. Earlier Macintosh
13 models used MFS (``Macintosh File System``), which is not supported,
14 MacOS 8.1 and newer support a filesystem called HFS+ that's similar to
15 HFS but is extended in various areas. Use the hfsplus filesystem driver
16 to access such filesystems from Linux.
17
18
19 Mount options
20 =============
21
22 When mounting an HFS filesystem, the following options are accepted:
23
24 creator=cccc, type=cccc
25 Specifies the creator/type values as shown by the MacOS finder
26 used for creating new files. Default values: '????'.
27
28 uid=n, gid=n
29 Specifies the user/group that owns all files on the filesystems.
30 Default: user/group id of the mounting process.
31
32 dir_umask=n, file_umask=n, umask=n
33 Specifies the umask used for all files , all directories or all
34 files and directories. Defaults to the umask of the mounting process.
35
36 session=n
37 Select the CDROM session to mount as HFS filesystem. Defaults to
38 leaving that decision to the CDROM driver. This option will fail
39 with anything but a CDROM as underlying devices.
40
41 part=n
42 Select partition number n from the devices. Does only makes
43 sense for CDROMS because they can't be partitioned under Linux.
44 For disk devices the generic partition parsing code does this
45 for us. Defaults to not parsing the partition table at all.
46
47 quiet
48 Ignore invalid mount options instead of complaining.
49
50
51 Writing to HFS Filesystems
52 ==========================
53
54 HFS is not a UNIX filesystem, thus it does not have the usual features you'd
55 expect:
56
57 * You can't modify the set-uid, set-gid, sticky or executable bits or the uid
58 and gid of files.
59 * You can't create hard- or symlinks, device files, sockets or FIFOs.
60
61 HFS does on the other have the concepts of multiple forks per file. These
62 non-standard forks are represented as hidden additional files in the normal
63 filesystems namespace which is kind of a cludge and makes the semantics for
64 the a little strange:
65
66 * You can't create, delete or rename resource forks of files or the
67 Finder's metadata.
68 * They are however created (with default values), deleted and renamed
69 along with the corresponding data fork or directory.
70 * Copying files to a different filesystem will loose those attributes
71 that are essential for MacOS to work.
72
73
74 Creating HFS filesystems
75 ========================
76
77 The hfsutils package from Robert Leslie contains a program called
78 hformat that can be used to create HFS filesystem. See
79 <https://www.mars.org/home/rob/proj/hfs/> for details.
80
81
82 Credits
83 =======
84
85 The HFS drivers was written by Paul H. Hargrovea ([email protected]).
86 Roman Zippel ([email protected]) rewrote large parts of the code and brought
87 in btree routines derived from Brad Boyer's hfsplus driver.
88

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

HFS 계보와 mount option

1-49

이 Linux HFS filesystem에는 현재 maintainer가 없습니다.

HFS는 `Hierarchical File System`의 약자이며 Mac Plus와 그 이후의 모든 Macintosh model이 사용한 filesystem입니다.

더 이른 Macintosh model은 MFS(`Macintosh File System`)를 사용했으며 Linux HFS driver는 MFS를 지원하지 않습니다.

MacOS 8.1 이후에는 HFS와 비슷하지만 여러 영역이 확장된 HFS+도 지원합니다. Linux에서 HFS+ filesystem에 접근할 때는 별도의 `hfsplus` filesystem driver를 사용해야 합니다.

HFS mount 시에는 새 파일의 Finder 속성, Linux에서 보이는 소유권·권한, CD-ROM session·partition 선택, 잘못된 option 처리 방식을 지정할 수 있습니다.

`creator=cccc`와 `type=cccc`는 새 파일을 만들 때 MacOS Finder가 표시할 네 문자 creator/type 값을 지정합니다. 두 값의 default는 `'????'`입니다.

`uid=n`과 `gid=n`은 filesystem의 모든 파일을 소유하는 user와 group을 지정합니다. default는 mount를 수행한 process의 user ID와 group ID입니다.

`dir_umask=n`은 모든 directory, `file_umask=n`은 모든 file, `umask=n`은 file과 directory 모두에 적용할 umask를 지정합니다. default는 mount process의 umask입니다.

`session=n`은 HFS로 mount할 CD-ROM session을 선택합니다. default는 CD-ROM driver가 결정하게 두는 것이며, 기반 device가 CD-ROM이 아니면 이 option은 실패합니다.

`part=n`은 device에서 partition number `n`을 선택합니다. Linux에서 CD-ROM을 일반 disk처럼 partition할 수 없기 때문에 CD-ROM에서만 의미가 있습니다.

disk device는 generic partition parsing code가 partition 선택을 대신 처리합니다. `part`의 default 동작은 partition table을 전혀 해석하지 않는 것입니다.

`quiet`는 유효하지 않은 mount option을 오류로 보고하지 않고 무시하게 합니다.

Macintosh filesystem 계보
FilesystemMacintosh 세대Linux 접근
MFSHFS 이전 model지원하지 않음
HFSMac Plus 이후`hfs` driver
HFS+MacOS 8.1 이후`hfsplus` driver

Linux에서 각 형식에 접근할 때의 지원 관계입니다.

HFS mount option
Option역할Default·제약
`creator=cccc`, `type=cccc`새 파일의 Finder creator/type`'????'`
`uid=n`, `gid=n`모든 파일의 owner user/groupmount process의 UID/GID
`dir_umask=n`모든 directory의 umaskmount process의 umask
`file_umask=n`모든 file의 umaskmount process의 umask
`umask=n`file과 directory 모두의 umaskmount process의 umask
`session=n`HFS CD-ROM session 선택CD-ROM driver에 위임; CD-ROM 전용
`part=n`CD-ROM partition number 선택기본적으로 partition table을 해석하지 않음
`quiet`invalid option 무시지정하지 않으면 오류 보고

option 값, default와 적용 범위를 원문 기준으로 정리합니다.

.. SPDX-License-Identifier: GPL-2.0

==================================
Macintosh HFS Filesystem for Linux
==================================


.. Note:: This filesystem doesn't have a maintainer.


HFS stands for ``Hierarchical File System`` and is the filesystem used
by the Mac Plus and all later Macintosh models.  Earlier Macintosh
models used MFS (``Macintosh File System``), which is not supported,
MacOS 8.1 and newer support a filesystem called HFS+ that's similar to
HFS but is extended in various areas.  Use the hfsplus filesystem driver
to access such filesystems from Linux.


Mount options
=============

When mounting an HFS filesystem, the following options are accepted:

  creator=cccc, type=cccc
        Specifies the creator/type values as shown by the MacOS finder
        used for creating new files.  Default values: '????'.

  uid=n, gid=n
          Specifies the user/group that owns all files on the filesystems.
        Default:  user/group id of the mounting process.

  dir_umask=n, file_umask=n, umask=n
        Specifies the umask used for all files , all directories or all
        files and directories.  Defaults to the umask of the mounting process.

  session=n
          Select the CDROM session to mount as HFS filesystem.  Defaults to
        leaving that decision to the CDROM driver.  This option will fail
        with anything but a CDROM as underlying devices.

  part=n
          Select partition number n from the devices.  Does only makes
        sense for CDROMS because they can't be partitioned under Linux.
        For disk devices the generic partition parsing code does this
        for us.  Defaults to not parsing the partition table at all.

  quiet
          Ignore invalid mount options instead of complaining.

쓰기 제약과 resource fork semantics

50-73

HFS는 UNIX filesystem이 아니므로 일반적인 UNIX filesystem 기능을 모두 제공하지 않습니다.

파일의 set-uid, set-gid, sticky, executable bit를 변경할 수 없으며 file의 `uid`와 `gid`도 개별적으로 변경할 수 없습니다. mount option으로 정한 공통 소유권과 권한 표현을 사용합니다.

hard link와 symbolic link를 만들 수 없고 device file, socket, FIFO도 생성할 수 없습니다.

반면 HFS에는 파일 하나가 여러 fork를 갖는 개념이 있습니다. Linux HFS driver는 표준 data fork가 아닌 추가 fork를 일반 filesystem namespace의 숨김 추가 파일로 나타냅니다.

원문은 이 mapping을 다소 임시방편적인 구조라고 설명합니다. HFS의 fork model을 UNIX namespace에 투영하기 때문에 일부 operation의 semantics가 낯설게 보입니다.

resource fork와 Finder metadata를 개별적으로 생성·삭제·rename할 수는 없습니다.

대신 대응하는 data fork 또는 directory를 생성하면 default 값을 가진 resource fork와 Finder metadata도 함께 생성됩니다. data fork나 directory를 삭제하거나 rename할 때도 함께 삭제·rename됩니다.

파일을 다른 filesystem으로 복사하면 이 추가 속성이 사라질 수 있습니다. 이 속성은 MacOS가 해당 파일을 올바르게 사용하는 데 필수적일 수 있으므로 단순 data copy만으로는 의미가 온전히 보존되지 않습니다.

HFS에서 제공하지 않는 UNIX 기능
범주지원하지 않는 동작
권한 bitset-uid, set-gid, sticky, executable bit 변경
소유권개별 file의 `uid`, `gid` 변경
linkhard link, symbolic link 생성
특수 nodedevice file, socket, FIFO 생성

Linux에서 HFS를 쓸 때 변경·생성할 수 없는 항목입니다.

HFS fork의 동행 동작
data fork 또는 directory 생성default resource fork와 Finder metadata 자동 생성data fork 또는 directory rename연결된 fork와 metadata도 함께 renamedata fork 또는 directory 삭제 시 함께 삭제다른 filesystem으로 일반 복사하면 추가 속성 손실 가능

resource fork와 Finder metadata는 data fork·directory에 종속되어 함께 움직입니다.


Writing to HFS Filesystems
==========================

HFS is not a UNIX filesystem, thus it does not have the usual features you'd
expect:

 * You can't modify the set-uid, set-gid, sticky or executable bits or the uid
   and gid of files.
 * You can't create hard- or symlinks, device files, sockets or FIFOs.

HFS does on the other have the concepts of multiple forks per file.  These
non-standard forks are represented as hidden additional files in the normal
filesystems namespace which is kind of a cludge and makes the semantics for
the a little strange:

 * You can't create, delete or rename resource forks of files or the
   Finder's metadata.
 * They are however created (with default values), deleted and renamed
   along with the corresponding data fork or directory.
 * Copying files to a different filesystem will loose those attributes
   that are essential for MacOS to work.

HFS 생성 도구와 driver credits

74-87

Robert Leslie의 `hfsutils` package에는 HFS filesystem을 생성하는 `hformat` program이 포함되어 있습니다.

`hformat`과 `hfsutils`의 자세한 내용은 `https://www.mars.org/home/rob/proj/hfs/`에서 확인할 수 있다고 원문은 안내합니다.

HFS driver는 Paul H. Hargrove가 작성했습니다. 원문의 이름 표기는 `Paul H. Hargrovea`이고 연락처는 `[email protected]`입니다.

Roman Zippel(`[email protected]`)은 code의 큰 부분을 다시 작성하고 Brad Boyer의 `hfsplus` driver에서 유래한 btree routine을 도입했습니다.

HFS filesystem 생성
`hfsutils` package 준비`hformat` program으로 HFS filesystem 생성생성 후 Linux `hfs` driver로 mountHFS+ 형식이면 `hfsplus` driver 사용

원문에서 안내하는 user space 생성 도구입니다.

HFS driver 기여자
기여자역할연락처·출처
Paul H. Hargrove초기 HFS driver 작성`[email protected]`
Roman Zippel대규모 code rewrite`[email protected]`
Brad Boyerbtree routine의 기반이 된 `hfsplus` driver원문 credits

원문 credits에 기록된 역할과 연락처입니다.

Creating HFS filesystems
========================

The hfsutils package from Robert Leslie contains a program called
hformat that can be used to create HFS filesystem. See
<https://www.mars.org/home/rob/proj/hfs/> for details.


Credits
=======

The HFS drivers was written by Paul H. Hargrovea ([email protected]).
Roman Zippel ([email protected]) rewrote large parts of the code and brought
in btree routines derived from Brad Boyer's hfsplus driver.