sfdisk --delete $disk
在Ubuntu 18.04或更高版本上可以使用。Ubuntu 16.04 LTS中的等效命令是什么?
解决方案1:从源代码构建和安装sfdisk(以便能够使用最新版本)
wget https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.35/util-linux-2.35.tar.gz
tar -xvf util-linux-2.35.tar.gz
cd cd util-linux-2.35
./configure
make
make install
/usr/local/bin/sfdisk --delete $disk
解决方案2:使用fdisk
# list disk and partitions
fdisk -l
# open the target disk with fdisk
fdisk /dev/target-disk
# then use the d command option to delete the partition you want to remove
# then use the w command option to save the changes
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句