for disk in $(lspv | awk '{print $1}') ; do
dd if=/dev/zero of=/dev/${disk} bs=1024 count=$(bootinfo -s ${disk})
echo $disk wiped
done
How do i exclude certain disks like hdisk0,hdisk1 and hdisk3?
Regards, Adel
The simplest way would be:
for disk in $(lspv | awk '{print $1}') ; do
case "$disk" in
hdisk0|hdisk1|hdisk3)
continue
;;
*)
dd if=/dev/zero of=/dev/${disk} bs=1024 count=$(bootinfo -s ${disk})
echo $disk wiped
;;
esac
done
Well, either explicitly list the disks you want to erase in your command, or add some kind of filter to your command.
Perhaps something like lspv | awk '!/regex/ {print $1}'