From owner-svn-src-all@FreeBSD.ORG Wed May 18 20:38:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34B8F1065672; Wed, 18 May 2011 20:38:29 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 25F9A8FC18; Wed, 18 May 2011 20:38:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IKcTk9007570; Wed, 18 May 2011 20:38:29 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IKcT7Q007568; Wed, 18 May 2011 20:38:29 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201105182038.p4IKcT7Q007568@svn.freebsd.org> From: Josh Paetzel Date: Wed, 18 May 2011 20:38:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222079 - head/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 20:38:29 -0000 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 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;}'`" } ;