首页 > 解决方案 > badblocks:尝试确定设备大小时资源繁忙

问题描述

我正在尝试在 macOS High Sierra 10.13.6 上运行坏块。我使用 macports 安装了坏块。我在尝试运行它时不断遇到错误,我什至不知道如何让坏块运行

sudo badblocks -c 4096 -s -w -o /Users/mcbeav/Desktop/blocks.txt /dev/disk0s2

这不断返回错误

badblocks:尝试确定设备大小时资源繁忙

如果我尝试

sudo badblocks -c 4096 -s -w -o /Users/mcbeav/Desktop/blocks.txt /dev/disk0

我得到错误

badblocks:值太大,无法存储在数据类型无效的结束块(7813820416)中:必须是 32 位值

谁能帮帮我?

标签: unixterminal

解决方案


我的建议是你:

a) 在恢复模式下通过 Mac OS X 控制台运行 badblocks

High Sierra (10.13+) 和 APFS(文件格式系统)可防止磁盘上的某些操作。您必须处于恢复模式或关闭磁盘保护才能按照您的建议进行操作。

Turn off your Mac (Apple > Shut Down).
Hold down Command-R and press the Power button. ...
Wait for OS X to boot into the OS X Utilities window.
Choose Utilities > Terminal.
Enter csrutil disable.
Enter reboot.

Mac OS X 解决方法:

根据过去的经验,我的感觉是您正在使用 MacOSX 的安全功能(磁盘保护和应用程序认证)。

引导到 Ubuntu(USB 记忆棒)并以这种方式运行 badblocks 测试会更容易。(在我看来)

我希望这能为您指明正确的方向。


推荐阅读