首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >sfdisk --“这个磁盘目前正在使用中”--但是似乎没有任何东西在使用它?

sfdisk --“这个磁盘目前正在使用中”--但是似乎没有任何东西在使用它?
EN

Unix & Linux用户
提问于 2018-07-22 22:52:30
回答 1查看 12.9K关注 0票数 3
代码语言:javascript
复制
# sfdisk /dev/mmcblk0p1

Welcome to sfdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Checking that no-one is using this disk right now ... FAILED

This disk is currently in use - repartitioning is probably a bad idea.
Umount all file systems, and swapoff all swap partitions on this disk.
Use the --no-reread flag to suppress this check.

但我找不到它的用途。

代码语言:javascript
复制
# grep mmc /proc/mounts
# grep mmc /proc/swaps
# lsof /dev/mmc*
# fuser /dev/mmc*

sfdisk来自util-linux 2.29.2-1+deb9u1

代码语言:javascript
复制
# strace -f sfdisk /dev/mmcblk0p1
...
write(1, "\33[0mChanges will remain in memor"..., 115Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
) = 115
write(1, "\n", 1
)                       = 1
fstat64(3, {st_mode=S_IFBLK|0660, st_rdev=makedev(179, 1), ...}) = 0
ioctl(3, BLKRRPART)                     = -1 EINVAL (Invalid argument)
write(1, "Checking that no-one is using th"..., 62Checking that no-one is using this disk right now ... FAILED
EN

回答 1

Unix & Linux用户

回答已采纳

发布于 2018-07-22 22:52:30

代码语言:javascript
复制
ioctl(3, BLKRRPART)                     = -1 EINVAL (Invalid argument)

实际上,如果消息是正确的,错误代码应该显示EBUSY而不是EINVAL

您有一个“无效的参数”,因为您传递了/dev/mmcblk0p1。这是一个分区。sfdisk编辑列出所有分区的表。您需要通过整个设备,即

代码语言:javascript
复制
# sfdisk /dev/mmcblk0
票数 1
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/457839

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档