-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker desktop with macos apfs case sensitive
- Loading branch information
1 parent
af4f04c
commit cc678cf
Showing
29 changed files
with
368 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.. _macos_apfs_case-sensitive: | ||
|
||
==================== | ||
macOS区分大小写APFS | ||
==================== | ||
|
||
当我在 :ref:`ubuntu_tini_image` 的容器中 :ref:`install_anaconda` ,遇到了一个和底层文件系统 ``区分大小写`` 兼容性问题: | ||
|
||
- macOS的 APFS 在操作系统安装时,默认配置了 ``case insensitive`` ,也就是不区分大小写 | ||
- 当使用 :ref:`docker_volume` 将macOS上的文件系统目录映射到容器内部时,由于Linux文件系统是区分大小写的,所以在一些情况下会出现错乱,例如 :ref:`install_anaconda` 安装报错,类似找不到文件等情况 | ||
|
||
验证方法可以采用类似如下: | ||
|
||
.. literalinclude:: macos_apfs_case-sensitive/check_filesystem_case_sensitive | ||
:caption: 检查文件系统是否区分大小写,在 ``case insensitive`` 的APFS文件系统上现象 | ||
|
||
创建新的 ``case sensitive`` 文件系统 | ||
======================================= | ||
|
||
:ref:`apfs` 使用了 Containter 容器来分隔文件系统,类似于 :ref:`zfs` 和 :ref:`btrfs` 的子卷 | ||
|
||
.. note:: | ||
|
||
虽然 macOS 内置的 ``Disk Utility`` 也能够创建分区,但是APFS并不推荐使用分区: | ||
|
||
- 类似 :ref:`zfs` ,整个磁盘都是一个大的存储池,只需要通过子卷来分隔系统,可以充分使用磁盘 | ||
- 只有在同一个Mac上安装其他操作系统,如Linux时候,才需要使用分区创建 | ||
|
||
- 在APFS上添加子卷: | ||
|
||
.. figure:: ../../_static/apple/macos/apfs_add_subvolume.png | ||
|
||
添加子卷 | ||
|
||
注意创建子卷要选择 ``APFS (Case-sensitive)`` 格式: | ||
|
||
.. figure:: ../../_static/apple/macos/apfs_add_subvolume_case_sensitive.png | ||
|
||
添加区分字符大小写的子卷 | ||
|
||
现在,就可以重新创建 :ref:`ubuntu_tini_image` 的运行容器,映射新创建的区分大小写文件系统到容器内部,就不会导致Linux文件的问题 | ||
|
7 changes: 7 additions & 0 deletions
7
source/apple/macos/macos_apfs_case-sensitive/check_filesystem_case_sensitive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
$ cd /home2/testing/anaconda3 | ||
$ echo A > A | ||
$ echo a > a | ||
$ cat a | ||
a | ||
$ cat A | ||
a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
.. _macos_filesystem: | ||
|
||
===================== | ||
macOS 文件系统 | ||
===================== | ||
|
||
.. _apfs: | ||
|
||
APFS | ||
======== | ||
|
||
现代macOS 从 10.14 版本开始,默认使用 ``APFS`` (Apple File System)。这个现代文件系统是从 macOS High Sierra 10.13 (2017年) 阿开始引入,现在已经广泛用于Apple的产品,包括 Macs, iPhone, iPad, Apple Watches 和 Apple TV。 | ||
|
||
APFS是针对闪存和固态驱动器设计的文件系统,并针对 ``HFS+`` 文件系统做了改进,提供了很多数据一致性和存储空间节约的功能: | ||
|
||
- 使用了 Copy-on-Write(CoW, 写时复制)技术,极大降低了数据损坏的风险 | ||
- APFS使用 ``容器`` (Container) 作为存储数据的关键要素(principal element): | ||
|
||
- 一个单一容器可以保存多个卷(文件系统)并共享存储空间 | ||
- 有关容器的块数量,块大小等信息被保存在Container Superblock,也就是作为每个卷的入口点 | ||
- 通过一个公共的位图(Bitmap)来帮助跟踪整个容器中块的分配 | ||
|
||
- 与此同时,卷也有自己的卷超级块(Volume Superblocks)以及存储数据和元数据的独立结构: | ||
|
||
- 所有文件和目录都被一个二进制搜索树结构所管理,也就是文件和目录的 ``B-Trees`` (类似 :ref:`btrfs` ?) | ||
- 树的节点(nodes)存储键和值(keys and values) | ||
|
||
.. _hfs+: | ||
|
||
HFS+ | ||
========= | ||
|
||
HFS+ (Hierarchical File System Plus) 也称为 Mac OS 扩展文件系统,是Mac OS 8.1 发布的默认文件系统。不过从 macOS High Sierra 10.13开始被APFS取代。 | ||
|
||
HFS+文件系统采用了日志机制来防止结构损坏: | ||
|
||
- 所有文件系统修改都记录在日志区域,这样在发生意外(如断电)时可以立即恢复 | ||
- HFS+的核心结构式卷标头(Volume Header),也就是在HFS+卷开头,包含了一般FS参数以及其他关键元素的位置 | ||
|
||
- 大多数服务信息被组织成特殊文件 | ||
- 这些特殊文件可以在卷的不同部分找到,摒弃主要由B树表示 | ||
|
||
- HFS+的整个存储空间被分成相等的分配块,每个分配块的状态都记录在类似位图的分配文件中 | ||
- 文件的块会分配到连续的组以降低碎片 | ||
|
||
参考 | ||
===== | ||
|
||
- `The file systems of macOS <https://www.ufsexplorer.com/articles/macos-file-systems/>`_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.. _dl_basics: | ||
|
||
================= | ||
深度学习基础知识 | ||
================= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
.. _dl_learn_tips: | ||
|
||
=================== | ||
深度学习的学习Tips | ||
=================== | ||
|
||
.. note:: | ||
|
||
实际上网上能够找到大量的学习线路指南,我这里综合对比记录一些可能有用的资料,以备后续参考学习 | ||
|
||
入门 | ||
====== | ||
|
||
- 深度学习入门: 以 **斋藤康义** 的 「深度学习入门: 基于Python的理论与实现」 来起步,同时参考学习 | ||
|
||
- `CS230 Deep Learning <https://cs230.stanford.edu/>`_ (吴恩达教授) | ||
- `CS231n: Deep Learning for Computer Vision <http://cs231n.stanford.edu/>`_ (李飞飞教授) | ||
|
||
网友整理资料汇总 | ||
================= | ||
|
||
- `ML system 入坑指南 <https://fazzie-key.cool/2023/02/21/MLsys/>`_ 关于机器学习和深度学习资料,太多 | ||
|
||
自然语言处理(NLP) | ||
==================== | ||
|
||
- `斯坦福 XCS224U:自然语言理解 (2023)课程(YouTube) <https://www.youtube.com/playlist?list=PLoROMvodv4rOwvldxftJTmoR3kRcWkJBp>`_ | ||
- `斯坦福 Stanford CS224N NLP with Deep Learning |Spring 2022(YouTube) <https://www.youtube.com/watch?v=4ynrGLIuPv4>`_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.. _deep_learning: | ||
|
||
================================= | ||
深度学习 | ||
================================= | ||
|
||
「不闻不若闻之,闻之不若见之,见之不若知之,知之不若行之」 -- 荀子「儒效篇」 | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
dl_basics.rst | ||
../startup/install_anaconda.rst | ||
../startup/ml_python.rst | ||
dl_learn_tips.rst | ||
|
||
.. only:: subproject and html | ||
|
||
Indices | ||
======= | ||
|
||
* :ref:`genindex` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.. _llm: | ||
|
||
================================= | ||
LLM 大型语言模型 | ||
================================= | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
.. only:: subproject and html | ||
|
||
Indices | ||
======= | ||
|
||
* :ref:`genindex` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.