迁移 Mac 前切记先处理 OrbStack 产生的 data.img 文件,否则迁移时间贼长

9 天前
 goodryb

最近换了 m4pro 的 MBP ,直接通过迁移助理把原系统迁移过来,免得重新配置环境,记录下遇到的坑

OrbStack 虚拟磁盘文件导致传输卡住,发现 OrbStack 会在

~/Library/Group\ Containers/HUAQ24HBR6.dev.orbstack/data 新版本路径

~./orbstack/data/ 老版本路径

下创建 data.img 8T ,如果不删除,文件同步就会卡在这里,哪怕是用了雷电线连接,这个文件 orbstack 自己也有说明

OrbStack data

This folder is used to store all OrbStack data, including Docker images, containers, and Linux machines.

If you see an 8 TB data.img file, don't panic! It's a special type of file that it only takes as much space as you use, and automatically shrinks when you delete data. It does not take up 8 TB of disk space.

To find the real size: - Run "du -sh data.img" in Terminal, or - Right-click the file and select "Get Info" Then look at "size on disk"

For more details, see https://orb.cx/data-img

895 次点击
所在节点    Apple
8 条回复
wuyazuofeiji
9 天前
→ data du -sh data.img
5.0G data.img

直接删除再迁移吗
goodryb
9 天前
@wuyazuofeiji 我是直接删除了。虽然实际占用空间不大,但是我严重怀疑 迁移助理把他当做正常文件来同步了
lululau
9 天前
cp 命令是支持空洞文件的,可以使用 cp 命令复制到移动硬盘来完成迁移

rsync 有个 --sparse 选项,但是我试了一下,然并卵


~/tmp/sparse-file via Rb v3.2.0
❯ dd if=/dev/null of=sparsefile.img bs=1 count=0 seek=10G
0+0 records in
0+0 records out
0 bytes transferred in 0.000006 secs (0 bytes/sec)

~/tmp/sparse-file via Rb v3.2.0
❯ l
total 0
-rw-r--r--@ 1 liuxiang staff 10G 9 11 14:57 sparsefile.img

~/tmp/sparse-file via Rb v3.2.0
❯ du -sh *
0B sparsefile.img

~/tmp/sparse-file via Rb v3.2.0
❯ cp sparsefile.img sparsefile2.img

~/tmp/sparse-file via Rb v3.2.0
❯ l
total 0
-rw-r--r--@ 1 liuxiang staff 10G 9 11 14:57 sparsefile.img
-rw-r--r--@ 1 liuxiang staff 10G 9 11 14:57 sparsefile2.img

~/tmp/sparse-file via Rb v3.2.0
❯ du -sh *
0B sparsefile.img
0B sparsefile2.img

~/tmp/sparse-file via Rb v3.2.0
❯ rsync -zP --sparse sparsefile.img sparsefile3.img
sparsefile.img
10737418240 100% 198.90MB/s 00:00:51 (xfer#1, to-check=0/1)

~/tmp/sparse-file via Rb v3.2.0 took 54s
❯ l
total 20373448
-rw-r--r--@ 1 liuxiang staff 10G 9 11 14:57 sparsefile.img
-rw-r--r--@ 1 liuxiang staff 10G 9 11 14:57 sparsefile2.img
-rw-r--r--@ 1 liuxiang staff 10G 9 11 14:58 sparsefile3.img

~/tmp/sparse-file via Rb v3.2.0
❯ du -sh *
0B sparsefile.img
0B sparsefile2.img
9.7G sparsefile3.img
goodryb
9 天前
@lululau 看起来这是一种方法,先备份,删除文件,迁移后再恢复。 但从迁移助理实际的情况来看,他似乎就是当成一个大文件在同步
ansemz
9 天前
用 timemachine 的时候,被这个文件坑过一次。
lyon95
9 天前
被这个坑过一次,还原的时候整个备份都废了,备份盘里之前的备份也因为这个太大被覆盖了,还原时电脑根本没这么大空间,又不能在 timemachine 里手动删除,只能重装,手动复制相关文件😭
volvo007
7 天前
明天要同步,还好看到,等会去把这个删了后面再装
geniusjoy
5 天前
我是通过.zshrc, docker-compose.yaml 这些配置文件启动.重装后把配置恢复,插件补上.

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1158554

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX