You are not logged in.
Pages: 1
I've switched from syslinux to GRUB with the release of GRUB 2.00. Syslinux installed boot code to the partition which contains /boot (i.e., into the Volume Boot Record or Partition Boot Sector). GRUB doesn't need to use that space in my setup, so it didn't overwrite it. That means the syslinux boot code is still sitting at the start of my filesystem partition. Is there a way to clean that code out of there without wiping out the start of the filesystem?
Similarly, is there a way to clean boot code from an MBR on a disk which used to be bootable, but is now used only for non-boot purposes, without blowing away the partition table?
Obviously, these small messes are of no real importance, but if I can keep things neat, I'd like to do so.
Offline
This should delete the mbr without touching the partition table.
# dd if=/dev/zero of=/dev/sda bs=440 count=1ps: Since this is a very sensitive command, you might want to wait for second opinions.
Offline
Shouldn't the bs size be 512? IE, bs=512. I've seen the number 440 and 512 inter-changeably so I've always wondered which is correct or are they both for different purposes? Sorry to jack your thread but I ran into a similar situation recently and I too would like to know the answer to your question, ataraxia.
Offline
From the wiki article on MBR:
The MBR consists of a short piece of assembly code (the initial bootloader – 446 bytes), a partition table for the 4 primary partitions (16 bytes each) and a sentinel (0xAA55).
EDIT: Also
To erase the MBR only the first 446 bits are zeroed because the rest of the data contains the partition table:
dd if=/dev/zero of=/dev/hda bs=446 count=1
Last edited by fatboy (2012-07-21 18:28:12)
Offline
If you use 512, you'll erase your partition table. Which is probably not what you want ![]()
Offline
This should delete the mbr without touching the partition table.
# dd if=/dev/zero of=/dev/sda bs=440 count=1ps: Since this is a very sensitive command, you might want to wait for second opinions.
You are right, I should have thought of that. This worked fine for the "wipe bootloader from MBR" case. Anyone have an answer for the VBR case?
MoonSwan: Gusar's answer explains the difference between 440 and 512 exactly.
Offline
Pages: 1