[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: wiping all partitions from a disk.
- From: "Brent M. Clements" <bclem rice edu>
- To: "Discussion of Red Hat Enterprise Linux 3 (Taroon)" <taroon-list redhat com>
- Subject: Re: wiping all partitions from a disk.
- Date: Wed, 14 Jul 2004 15:51:35 -0500 (CDT)
Well I figured out what I needed to do. Thanks for the help though.
For everyone's future reference you can use parted to do this.
As an example.
PATH=/sbin:/bin:/usr/bin:/usr/sbin:/tmp
parted -s -- /dev/hda mklabel msdos || shellout
DISK_SIZE=`parted -s /dev/hda print | grep 'Disk geometry for' | sed 's/^.*-//g' | sed 's/\..*$//' `
START_MB=0
END_MB=$(echo "scale=3; ($START_MB + 1993)" | bc)
parted -s -- /dev/hda mkpart primary ext2 $START_MB $END_MB
END_OF_LAST_LOGICAL=$END_MB
START_MB=$END_OF_LAST_LOGICAL
END_MB=$(( $DISK_SIZE - 0 ))
parted -s -- /dev/hda mkpart primary ext2 $START_MB $END_MB
END_OF_LAST_LOGICAL=$END_MB
mkswap -v1 /dev/hda1
swapon /dev/hda1
mke2fs -j /dev/hda2
tune2fs -L /scr /dev/hda2
mount /dev/hda2 /scr -t ext3 -o rw,defaults
-Brent
Brent Clements
Linux Technology Specialist
Information Technology
Rice University
Linux Rice news and information
available only at http://linuxsupport.rice.edu
On Wed, 14 Jul 2004, Stephen Smoogen wrote:
> On Wed, 2004-07-14 at 13:37, Brent M. Clements wrote:
> > Anyone have a quick way to wipe all linux partitions from a disk?
> >
> > Ie, I know I can do a dd if=/dev/zero of=/dev/hda bs=1024k but that takes
> > a while.
> >
> > What utility does redhat use in it's anaconda installer that wipes all
> > partitions fast?
> >
>
> It depends on what you are wanting to consider wiping.
>
> If you just want to whack the partitions and dont care what is on the
> disk, fdisk can do that or
>
> dd if=/dev/zero of=/dev/hda bs=1024 count=1
>
> If you are wanting to do data scrubbing, there are probably programs
> that do that, and the poor man's way would be to do similar to what you
> have above:
>
> dd if=/dev/zero of=/dev/hda bs=1024k
> dd if=/dev/random of=/dev/hda bs=1024k
> dd if=/dev/zero of=/dev/hda bs=512k
> dd if=/dev/random of=/dev/hda bs=512k
>
>
>
> > Thanks,
> > Brent
> >
> > Brent Clements
> > Linux Technology Specialist
> > Information Technology
> > Rice University
> >
> > Linux Rice news and information
> > available only at http://linuxsupport.rice.edu
> >
> >
> > --
> > Taroon-list mailing list
> > Taroon-list redhat com
> > http://www.redhat.com/mailman/listinfo/taroon-list
> --
> Stephen John Smoogen smoogen lanl gov
> Los Alamos National Lab CCN-5 Sched 5/40 PH: 4-0645
> Ta-03 SM-1498 MailStop B255 DP 10S Los Alamos, NM 87545
> -- "We cannot have a free government without elections; and if the
> -- rebellion could force us to forgo, or postpone, a national election,
> -- it might fairly claim to have already conquered us." Abraham Lincoln
>
>
> --
> Taroon-list mailing list
> Taroon-list redhat com
> http://www.redhat.com/mailman/listinfo/taroon-list
>
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]