我正在尝试在 debian 8 上使用 sfdisk 扩展分区。我正在运行以下命令:
sfdisk -H 255 -S 63 --quiet --Linux --leave-last -uM --force --no-reread /dev/md1 -N4 < /tmp/abc
Run Code Online (Sandbox Code Playgroud)
运行命令时出现以下错误:
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).)
Run Code Online (Sandbox Code Playgroud)
为什么当我提到时会发生重读--no-reread
?我sfdisk
从 util-linux 2.25.2运行它。当我sfdisk
从 sfdisk (util-linux-ng 2.17.2)运行相同的命令时,我没有遇到此错误。导致此错误发生的两者之间有什么区别吗?
该--no-reread
选项告诉sfdisk
不检查设备是否正在使用(例如安装或交换)。
你得到的错误是sfdisk
告诉内核分区信息已经改变了;内核响应“嘿,此设备已在使用中;我不打算读取新的分区数据”。
所以现在分区数据的内核副本与磁盘上的实际数据不同。
没有--no-reread
thensfdisk
根本不会让您进行分区。
归档时间: |
|
查看次数: |
1102 次 |
最近记录: |