sfdisk 中缺少參數選項?

sfdisk 中缺少參數選項?
sfdisk --delete $disk

從 Ubuntu 18.04 或更高版本可以使用。 Ubuntu 16.04 LTS 中的等值指令是什麼?

Ubuntu 16.04 LTS(--刪除缺失),

Ubuntu 18.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 

答案2

wipefs -a -f $disk

將要做把戲

相關內容