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 02:01 PM
How to recover Hp-ux O/S Disk from Mirro Disk waqaralam HP-UX 5 03-23-2005 12:33 PM
available disk space on disk device??? alan UNIX for Dummies Questions & Answers 4 01-02-2004 03:06 AM
Disk Add luisjdm Filesystems, Disks and Memory 4 02-08-2002 06:09 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-15-2007
siegfried siegfried is offline
Registered User
  
 

Join Date: Oct 2005
Posts: 91
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
  #2 (permalink)  
Old 03-15-2007
killerserv's Avatar
killerserv killerserv is offline Forum Advisor  
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.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:32 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0