
sfdisk --delete $disk
Ab Ubuntu 18.04 oder höher funktioniert es. Was ist der entsprechende Befehl in Ubuntu 16.04 LTS?
Antwort1
Lösung 1:sfdisk aus den Quellen erstellen und installieren (um eine aktuellere Version verwenden zu können)
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
Lösung 2:verwendenfdisk
# 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
Antwort2
wipefs -a -f $disk
WilleMache den Trick