The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
AIX disk less with SAN itik AIX 3 03-31-2008 10:01 AM
How to recover Hp-ux O/S Disk from Mirro Disk waqaralam HP-UX 5 03-23-2005 09:33 AM
available disk space on disk device??? alan UNIX for Dummies Questions & Answers 4 01-02-2004 12:06 AM
Disk Add luisjdm Filesystems, Disks and Memory 4 02-08-2002 03:09 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 03-14-2007
Registered User
 

Join Date: Oct 2005
Posts: 86
How to zero a disk (especially MBR)?

I'm confused. Originally I did

telinit 1
cp /dev/sda /dev/sdb

where sda is my boot disk and sdb is a USB disk. This probably copied my MBR.

Since /dev/sdb is 300GB and /dev/sda only 160GB I had a bunch of space left which I decided to experiment with by creating partitions of various sizes.

Then I did "telinit 1; cp/dev/sda /dev/sdb" again and I could not create additional partitions beyond the orginal 160GB like I had done before. Neither QTParted nor fdisk would let me partitition the 140GB of remaining free space like it had previously.

Now I run VMWare and I tell it I want a new virtual machine and I want it to use /dev/sdb. Well this does not work so well so I run "fdisk /dev/sdb" and delete all the partitions and then I use "dd if=/dev/zero of=/dev/sdb bs=1000 count=200000000" figuring this ought to be more than enough to zero out the MBR. Well dd comes back (very quickly) and says "dd: writing: /dev/sdb: no space left on device ... 65MB copied".

Why does it say that? I asked it to zero out more than 65MB?

Why is this not sufficient to delete GRUB from the entire disk?

I want to zero the entire 300GB disk. How do I do that?

Hmmm... so then I fire up VMWare and assign /dev/sdb to the new virtual machine which promptly gives me a grub prompt but nothing to boot. Arghhh! Why am I getting a grub prompt?

This is a problem because I don't know how to tell it (VMWare) to boot from the CD first instead of the hard disk. I want to install debian on /dev/sdb. Instead VMWare keeps running grub. I figure if I can zero out the entirety of /dev/sdb VMware will try to boot from /dev/sdb and fail and then boot form the CD.

Why do I want to do this? Because I've burned about 6 CDs of various versions of debian etch (net install) and they all register dump on me when I do a physical boot (boot without VMware) from the CD. I cannot boot debian sarge because it does not have support for my marvel network adapter. However, I have discovered that if I boot windows and run VMWare to create virtual disk for debian etch (on /dev/sda), I can boot and install debian etch. Unfortunately, I'm running out of disk space on /dev/sda and I need to use /dev/sdb!

Can someone please tell me now to zero a disk? (Or better yet, tell me how to change the device boot order for VMWare? -- but that is off topic!)

Thanks,
Siegfried
Reply With Quote
Forum Sponsor
  #2  
Old 03-15-2007
killerserv's Avatar
Unix Predator
 

Join Date: Dec 2000
Location: Phoenix, AZ
Posts: 670
i constantly reload the OS of my unix box, so i create a script like this

#!/bin/sh

MBR=`df -hl | grep -v Filesystem | awk '{print $1'} | head -1 | sed -e 's/[0-9]//'`
echo GRUB is installed in $MBR
dd if=/dev/zero of=$MBR bs=512 count=1

make it executable & run it. It will wipe your master boot record.

#WARNING, think twice before you blow off the mbr.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:20 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0