-
-
Save gatspy/73e0871f60155fe20270e605a0d52e2d to your computer and use it in GitHub Desktop.
小容量MBP外接固态硬盘扩容解决方案
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
针对小容量mac book扩容的解决方案 | |
需要购买: | |
1.nvme硬盘盒 | |
2.大容量 nvme固态硬盘(推荐500G以上容量) | |
推荐下面这种侧插式nvme硬盘盒,完美匹配mac book,速度是10Gb/s,而且关机也不用取下。 | |
缺点是要占用一边两个雷电接口,硬盘盒自带一个充电接口, | |
算下来其实还好,不充电的情况下,多占了一个雷电接口。 | |
【京东】佳翼(JEYI)MacBook Pro雷电三TYPE-C口专用侧插式M.2 NVME硬盘盒APPLE MBP专用翼盘 | |
———————— | |
京东价:¥179.0 | |
抢购链接:https://u.jd.com/tRIzV5n | |
固态硬盘直接购买京东自营的就可以。 | |
如果因为软件目录占用大量空间导致系统剩余空间紧张,可以使用下面的脚本,将系统磁盘上的软件手动移动到外接固态硬盘上 | |
然后执行脚本即可,脚本会创建软链接到 /Applications下面,这样启动台就能看到软件,而且也能搜索到了 | |
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
# coding=utf-8 | |
# 注意:mac应用中以.app 结尾的应用,一般路径可以随便放置的,双击即可打开应用,故可以实现移动到外置磁盘也可以使用 | |
# 请手动将 /Applications 下面空间占用大的应用(如xcode)移动到外置磁盘的 target_path 中,并将原 /Applications下面的同名应用删除 | |
# 下面的脚本会将 target_path 中的应用在 /Applications 创建软链接 | |
# 这样应用就可以在启动台里面看见和搜索到了 | |
import os | |
import glob | |
def main(): | |
source_path = "/Applications" | |
# 外置磁盘存放软件的目录,可自行修改 | |
target_path = "/Volumes/disk/Applications" | |
apps = glob.glob(target_path+"/*.app") | |
for app in apps: | |
print app | |
app_name = app.rsplit("/", 1)[1] | |
print app_name | |
source_app_path = "%s/%s" % (source_path, app_name) | |
if not os.path.isdir(source_app_path) and not os.path.islink(source_app_path): | |
mv_command = "ln -s \"%s\" \"%s\"" % (app, source_path) | |
print mv_command | |
os.system(mv_command) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment