Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to zero a disk (especially MBR)? Post 302110736 by siegfried on Thursday 15th of March 2007 01:43:12 AM
Old 03-15-2007
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
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Installing Linux on an individual drive and the MBR..

-------------------------------------------------------------------------------- If I install linux on my 2nd HD which is aprox 30 Gigs do I still need to worry about all this W2k MBR editing stuff, and could anyone tell me a good size for each area (Root, Home, var etc etc)) (1 Reply)
Discussion started by: PravusMentis
1 Replies

2. Red Hat

Dual boot (Booting Windows from Linux MBR)

Hi , I have two disk installed with Linux(disk 1) and WinXP(disk 2) .Now i am changing Hardisk jumbper manualy to get in to Linux/Windows .I want to configure my REDHAT linux boot manager to list Linux and WindowXP and wanna boot according to my choice . Here is what my fdisk -l shows (Only... (2 Replies)
Discussion started by: gkrishn
2 Replies

3. UNIX for Dummies Questions & Answers

About MBR,Boot Loader programe.

Hi all, I am newbie here.I want to know what is MBR,boot loader & boot strap programe. What is procedure of loading OS in to memory. Thanx in advance:) (1 Reply)
Discussion started by: vishwasrao
1 Replies

4. UNIX for Dummies Questions & Answers

What Does Happen During Boot Process? - BIOS and MBR

I'm talking about boot process in multi-boot Linux perceptive. Please tell me whether my explanation is right or wrong? If wrong, please explain. "The BIOS checks the system and loads this initial bootstrapping code into memory. This initial bootstrap code searches for an active partition... (0 Replies)
Discussion started by: f.ben.isaac
0 Replies

5. SCO

Backup MBR an Partition Table

hi How can I backup MBR an Partition Table of SCO 5.0.6? (7 Replies)
Discussion started by: ccc
7 Replies

6. Boot Loaders

GPT/Protective MBR problem...

Hi, short thing: I've done something I didn't know what happens; bad thing: I did it with my partition table. :D My OS is Ubuntu 10.10. I've used GPT and now want to convert it to MBR with gdisk. I started gdisk, chose 'r' for "transformation options" and chose 'g' to "convert GPT into MBR... (3 Replies)
Discussion started by: Blackbird
3 Replies

7. Boot Loaders

Lost MBR on disk

trying to recover a lost partition table, where the signature (0x55AA) has been lost, though attempting to restore using a number of tools (fdisk, testdisk et al) the write fails. also the os is unable to read the disk geometry correctly, after attempting to correct the geometry, the updated... (2 Replies)
Discussion started by: xaphan
2 Replies

8. Boot Loaders

GRUB MBR and restoring a partition

I tried to install another Linux O.S along with MS and to make two Linux's and one windows.Usually when I try this GRUB losses the ability to boot the first Linux install. It did it again. I would really like to get this first install bootable again. Here are some facts. -I have a rescue... (0 Replies)
Discussion started by: theKbStockpiler
0 Replies

9. Fedora

Disk Paritioning Scheme--GPT or MBR

Hi, I just built myself a new machine which has an ASUS motherboard with is UEFI based. I noticed after I installed Fedora 17 that my sda is MBR and my sdb is GPT: sda is a ssd drive. Should the ssd drive be GPT or is MBR okay? sda is 60Gb drive. (3 Replies)
Discussion started by: mojoman
3 Replies

10. Hardware

Hard Drives and MBR

Hello everyone. I have a question which I may know the answer to, I'm just looking for a confirmation. When it comes to the MBR of a hard drive, i've read in multiple sources that it's always located in the first sector of the hard drive. Is the MBR there from the factory? When I buy a new blank... (3 Replies)
Discussion started by: Lost in Cyberia
3 Replies
PARTX(8)						       System Administration							  PARTX(8)

NAME
partx - tell the Linux kernel about the presence and numbering of on-disk partitions SYNOPSIS
partx [-a|-d|-s|-u] [-t TYPE] [-n M:N] [-] disk partx [-a|-d|-s|-u] [-t TYPE] partition [disk] DESCRIPTION
Given a device or disk-image, partx tries to parse the partition table and list its contents. It optionally adds or removes partitions. The disk argument is optional when a partition argument is provided. To force scanning a partition as if it were a whole disk (for example to list nested subpartitions), use the argument "-". For example: partx --show - /dev/sda3 This will see sda3 as a whole-disk rather than a partition. The partx is not an fdisk program -- adding and removing partitions does not change the disk, it just tells the kernel about the presence and numbering of on-disk partitions. OPTIONS
-a, --add Add the specified partitions, or read the disk and add all partitions. -b, --bytes Print the SIZE column in bytes rather than in human-readable format. -d, --delete Delete the specified partitions or all partitions. -u, --update Update the specified partitions. -g, --noheadings Do not print a header line. -h, --help Print a help text and exit. -l, --list List the partitions. Note that all numbers are in 512-byte sectors. This output format is DEPRECATED in favour of --show. Do not use it in newly written scripts. -o, --output list Define the output columns to use for --show and --raw output. If no output arrangement is specified, then a default set is used. Use --help to get list of all supported columns. This option cannot be combined with --add, --delete or --list options. -P, --pairs Output using key="value" format. -n, --nr M:N Specify the range of partitions. For backward compatibility also the format M-N is supported. The range may contain negative num- bers, for example --nr :-1 means the last partition, and --nr -2:-1 means the last two partitions. Supported range specifications are: M Specifies just one partition (e.g. --nr 3). M: Specifies lower limit only (e.g. --nr 2:). :N Specifies upper limit only (e.g. --nr :4). M:N or M-N Specifies lower and upper limits (e.g. --nr 2:4). -r, --raw Use the raw output format. -s, --show List the partitions. All numbers (except SIZE) are in 512-byte sectors. The output columns can be rearranged with the --output option. -t, --type type Specify the partition table type aix, bsd, dos, gpt, mac, minix, sgi, solaris_x86, sun, ultrix or unixware. -v, --verbose Verbose mode. EXAMPLES
partx --show /dev/sdb3 partx --show --nr 3 /dev/sdb partx --show /dev/sdb3 /dev/sdb All three commands list partition 3 of /dev/sdb. partx --show - /dev/sdb3 Lists all subpartitions on /dev/sdb3 (the device is used as whole-disk). partx -o START -g --nr 5 /dev/sdb Prints the start sector of partition 5 on /dev/sdb without header. partx -o SECTORS,SIZE /dev/sda5 /dev/sda Lists the length in sectors and human-readable size of partition 5 on /dev/sda. partx --add --nr 3:5 /dev/sdd Adds all available partitions from 3 to 5 (inclusive) on /dev/sdd. partx -d --nr :-1 /dev/sdd Removes the last partition on /dev/sdd. SEE ALSO
addpart(8), delpart(8), fdisk(8), parted(8), partprobe(8) AUTHORS
Davidlohr Bueso <dave@gnu.org> Karel Zak <kzak@redhat.com> The original version was written by Andries E. Brouwer <aeb@cwi.nl>. ENVIRONMENT
LIBBLKID_DEBUG=0xffff enables debug output. AVAILABILITY
The partx command is part of the util-linux package and is available from Linux Kernel Archive <ftp://ftp.kernel.org/pub/linux/utils/util- linux/>. util-linux June 2012 PARTX(8)
All times are GMT -4. The time now is 09:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy