Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 May 2011 20:38:29 +0000 (UTC)
From:      Josh Paetzel <jpaetzel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r222079 - head/usr.sbin/pc-sysinstall/backend
Message-ID:  <201105182038.p4IKcT7Q007568@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jpaetzel
Date: Wed May 18 20:38:28 2011
New Revision: 222079
URL: http://svn.freebsd.org/changeset/base/222079

Log:
  Wipeout the end of disks, home to things like gmirror metadata, backup GPT tables,
  and other potential evil.
  
  Submitted by:	Kris Moore <kris@pcbsd.org>
  Approved by:	kib (mentor)
  Sponsored by:	iXsystems

Modified:
  head/usr.sbin/pc-sysinstall/backend/functions-disk.sh

Modified: head/usr.sbin/pc-sysinstall/backend/functions-disk.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend/functions-disk.sh	Wed May 18 20:29:07 2011	(r222078)
+++ head/usr.sbin/pc-sysinstall/backend/functions-disk.sh	Wed May 18 20:38:28 2011	(r222079)
@@ -582,17 +582,9 @@ stop_gjournal()
 # Function to wipe the potential backup gpt table from a disk
 clear_backup_gpt_table()
 {
-  # Get the disk block size
-  local dSize="`gpart show $1 | grep $1 | tr -s ' ' | cut -d ' ' -f 3`"
-
-  # Make sure this is a valid number
-  is_num "${dSize}" >/dev/null 2>/dev/null
-  [ $? -ne 0 ] && return
-
-  # Die backup label, DIE
   echo_log "Clearing gpt backup table location on disk"
-  rc_nohalt "dd if=/dev/zero of=${1} bs=512 seek=${dSize}"
-
+  rc_nohalt "dd if=/dev/zero of=${1} bs=1m count=1"
+  rc_nohalt "dd if=/dev/zero of=${1} bs=1m oseek=`diskinfo ${1} | awk '{print int($3 / (1024*1024)) - 4;}'`"
 } ;
 
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105182038.p4IKcT7Q007568>