Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to zero a disk (especially MBR)? Post 302110757 by killerserv on Thursday 15th of March 2007 05:21:48 AM
Old 03-15-2007
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.
 

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
installgrub(1M) 														   installgrub(1M)

NAME
installgrub - install GRUB in a disk partition or a floppy SYNOPSIS
/sbin/installgrub [-fm] stage1 stage2 raw-device The installgrub command is an -only program. GRUB stands for GRand Unified Bootloader. installgrub installs GRUB stage 1 and stage 2 files on the boot area of a disk partition. If you specify the -m option, installgrub installs the stage 1 file on the master boot sector of the disk. The installgrub command accepts the following options: -f Suppresses interaction when overwriting the master boot sector. -m Installs GRUB stage1 on the master boot sector interactively. The installgrub command accepts the following operands: stage1 The name of the GRUB stage 1 file. stage2 The name of the GRUB stage 2 file. raw-device The name of the device onto which GRUB code is to be installed. It must be a character device that is readable and writable. For disk devices, specify the slice where the GRUB menu file is located. (For Solaris it is the root slice.) For a floppy disk, it is /dev/rdiskette. Example 1: Installing GRUB on a Hard Disk Slice The following command installs GRUB on a system where the root slice is c0d0s0: example# /sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0d0s0 Example 2: Installing GRUB on a Floppy The following command installs GRUB on a formatted floppy: example# mount -F pcfs /dev/diskette /mnt # mkdir -p /mnt/boot/grub # cp /boot/grub/* /mnt/boot/grub # umount /mnt # cd /boot/grub # /sbin/installgrub stage1 stage2 /dev/rdiskette /boot/grub Directory where GRUB files reside. See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ boot(1M), fdisk(1M), fmthard(1M), kernel(1M), attributes(5) Installing GRUB on the master boot sector (-m option) overrides any boot manager currently installed on the machine. The system will always boot the GRUB in the Solaris partition regardless of which fdisk partition is active. 24 May 2005 installgrub(1M)
All times are GMT -4. The time now is 11:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy