macOS使用SMB局域网共享作为TimeMachine时间机器的备份盘


参考网上的教程,使用“磁盘工具”创建一个“稀疏磁盘映像”在共享的文件夹中,然后使用命令设置为TimeMachine的目标盘。
sudo tmutil setdestination -a /Volumes/SMBTimeMachine



但是报错:
/Volumes/SMBTimeMachine: Disk does not support Time Machine backups. (error 45)
The backup destination could not be added.



Google很久,没有找到解决办法,最终在Apple帮助中的找到一个解决方案分享的方法,终于顺利解决:

1、使用命令行工具创建一个“稀疏捆绑磁盘映像”,不能是“磁盘工具”,我试过用“磁盘工具”依然不行,用命令行就没有问题。
sudo hdiutil create -size 120g -type SPARSEBUNDLE -nospotlight -volname "SMBTimeMachine" -fs "Case-sensitive Journaled HFS+" -verbose /Volumes/yanghl/HaiLong_Mac_TimeMachine.sparsebundle



“SMBTimeMachine”是新建的磁盘映像的标签,最后面跟的是磁盘映像文件保存的路径,“-size 120g”是磁盘映像的大小,这些参数可以修改。
命令运行输出参考:
Initializing…
Creating…
DIDiskImageCreatorProbe: interface  1, score     1000, CSparseBundleDiskImage
DIDiskImageCreatorProbe: interface  2, score    -1000, CSparseDiskImage
DIDiskImageCreatorProbe: interface  3, score    -1000, CRawDiskImage
DIDiskImageCreatorProbe: interface  7, score    -1000, CWOUDIFDiskImage
DIDiskImageCreatorProbe: interface  9, score    -1000, CCFPlugInDiskImage
DIDiskImageCreateWithCFURL: CSparseBundleDiskImage
CBSDBackingStore::createProbe directory, not a valid image file.
DIBackingStoreCreatorProbe: interface  0, score    -1000, CBSDBackingStore
DIBackingStoreCreatorProbe: interface  1, score     1000, CBundleBackingStore
DIBackingStoreCreatorProbe: interface  2, score        0, CRAMBackingStore
DIBackingStoreCreatorProbe: interface  3, score      100, CCarbonBackingStore
DIBackingStoreCreatorProbe: interface  5, score     -100, CCURLBackingStore
DIBackingStoreCreateWithCFURL: CBundleBackingStore
DIFileEncodingCreatorProbe: interface  2, score    -1000, CEncryptedEncoding
DIBackingStoreCreatorProbe: interface  0, score      100, CBSDBackingStore
DIBackingStoreCreatorProbe: interface  1, score    -1000, CBundleBackingStore
DIBackingStoreCreatorProbe: interface  2, score        0, CRAMBackingStore
DIBackingStoreCreatorProbe: interface  3, score      100, CCarbonBackingStore
DIBackingStoreCreatorProbe: interface  5, score     -100, CCURLBackingStore
DIBackingStoreCreateWithCFURL: CBSDBackingStore
DIBackingStoreCreateWithCFURL: creator returned 0
DIBackingStoreCreateWithCFURL: creator returned 0
DIDiskImageCreateWithCFURL: creator returned 0
DI_kextWaitQuiet: about to call IOServiceWaitQuiet...
DI_kextWaitQuiet: IOServiceWaitQuiet took 0.000004 seconds
Formatting…
Finishing…
created: /Volumes/wei/TM.sparsebundle
hdiutil: create: returning 0



2、完成后,在Finder中找到磁盘映像文件,双击加载。然后再使用命令:
sudo tmutil setdestination -a /Volumes/SMBTimeMachine/



3、命令成功执行,没有任何输出。进入“系统设置”->“时间机器”,可以看到“ SMBTimeMachine”已被设置为目标磁盘。
这下就可以正常进行TimeMachine的后续操作了。

注意:目前发现这种方法必须一次备份完,如果备份中途中断,sparsebundle磁盘映像一旦卸载,就不能再加载了,因为没有备份完成,该文件就不完整,就无法再次加载


2021年5月9日 阅读:178 评论:0

青锋幽灵

゛. - 看過世间最冷漠滴眼神,  爱過⒈生最无缘滴人﹎

评论 More..

该页面还没有任何评论,赶快占个沙发吧!

登录 注册

您没有登录,如果还不是会员请先注册

文明上网,理性发帖!


顶部