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
PARTX(8)						       System Administration							  PARTX(8)

NAME
partx - tell the kernel about the presence and numbering of on-disk partitions SYNOPSIS
partx [-a|-d|-P|-r|-s|-u] [-t type] [-n M:N] [-] disk partx [-a|-d|-P|-r|-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 can also tell the kernel to add or remove partitions from its bookkeeping. 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 "-" (hyphen-minus). For example: partx --show - /dev/sda3 This will see sda3 as a whole-disk rather than as a partition. 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. -g, --noheadings Do not print a header line with --show or --raw. -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. -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:-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 the lower limit only (e.g. --nr 2:). :N Specifies the upper limit only (e.g. --nr :4). M:N Specifies the lower and upper limits (e.g. --nr 2:4). -o, --output list Define the output columns to use for --show, --pairs 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 the --add, --delete, --update or --list options. -P, --pairs List the partitions using the KEY="value" format. -r, --raw List the partitions using the raw output format. -s, --show List the partitions. The output columns can be selected and rearranged with the --output option. All numbers (except SIZE) are in 512-byte sectors. -t, --type type Specify the partition table type. --list-types List supported partition types and exit. -u, --update Update the specified partitions. -S, --sector-size size Overwrite default sector size. -v, --verbose Verbose mode. -V, --version Display version information and exit. -h, --help Display help text and exit. 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=all enables libblkid debug output. AVAILABILITY
The partx command is part of the util-linux package and is available from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils /util-linux/>. util-linux December 2014 PARTX(8)
All times are GMT -4. The time now is 05:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy