我试图在debian 8上使用sfdisk扩展分区。
sfdisk -H 255 -S 63 --quiet --Linux --leave-last -uM --force --no-reread /dev/md1 -N4 < /tmp/abc当我运行命令时,我得到了以下错误:
Successfully wrote the new partition table
Re-reading the partition table ...
sfdisk: BLKRRPART: Device or resource busy
sfdisk: The command to re-read the partition table failed.
Run partprobe(8), kpartx(8) or reboot your system now,before using mkfs
sfdisk: If you created or changed a DOS partition, /dev/foo7, say, then use dd(1) to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1 (See fdisk(8).)为什么当我提到--no-reread时,重读会发生?我是从util-Linux2.25.2在sfdisk上运行这个的。当我从sfdisk (util 2.17.2)在sfdisk上运行相同的命令时,我没有遇到这个错误。这两者之间有什么不同,导致了这个错误的发生吗?
发布于 2016-07-17 22:34:26
--no-reread选项告诉sfdisk不要检查设备是否在使用(例如挂载或交换)。
您所得到的错误来自于sfdisk告诉内核分区信息已经更改;内核正在响应“嘿,这个设备已经在使用;我不会读取新的分区数据”。
因此,现在分区数据的内核副本与磁盘上的实际数据不同。
如果没有--no-reread,那么sfdisk就根本不允许您进行分区。
https://unix.stackexchange.com/questions/296517
复制相似问题