RE: Not clearing all partitions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sorry about the poor formatting,
something-funny-happened-on-the-way-to-the-Windows-machine....

Bryan Tonnet

%pre
# Get a list of drives, and for each one look for an extended partition.

# If one is found, get rid of it first.  If the diagnostics part is 
# in the extended part, it will be deleted.  It probably shouldn't be 
# there anyway. 
for i in `list-harddrives | cut -d' ' -f1` ; do
   for j in `sfdisk -l /dev/$i | grep $i \
             | grep -i ext | cut -d' ' -f1` ; do
      partname=`basename $j`
      partno=`grep "$partname " /proc/partitions | cut -b9-10`
      parted -s /dev/$i rm $partno 1>/dev/null 2>&1
   done
done

# Now do the same again, but remove all parts except any diagnostics. 
# Specifically, we don't want the Compaq diagnostics to be 'vanished'.
for i in `list-harddrives | cut -d' ' -f1` ; do
   for j in `sfdisk -l /dev/$i | grep $i | grep -v Disk \
             | grep -vi disgnostics | cut -d' ' -f1` ; do
      partname=`basename $j`
      partno=`grep "$partname " /proc/partitions | cut -b9-10`
      parted -s /dev/$i rm $partno 1>/dev/null 2>&1
   done
done
**********************************************************************
This message is intended for the addressee named and may contain
privileged information or confidential information or both. If you
are not the intended recipient please delete it and notify the sender.
**********************************************************************




[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux