You are not logged in.

#1 2012-07-21 01:55:25

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

removing syslinux VBR

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

#2 2012-07-21 02:30:07

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: removing syslinux VBR

This should delete the mbr without touching the partition table.

# dd if=/dev/zero of=/dev/sda bs=440 count=1

ps: Since this is a very sensitive command, you might want to wait for second opinions.

Offline

#3 2012-07-21 18:22:00

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

Re: removing syslinux VBR

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

#4 2012-07-21 18:25:23

fatboy
Member
From: India
Registered: 2012-03-17
Posts: 73

Re: removing syslinux VBR

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

#5 2012-07-21 18:25:36

Gusar
Member
Registered: 2009-08-25
Posts: 3,607

Re: removing syslinux VBR

If you use 512, you'll erase your partition table. Which is probably not what you want smile

Offline

#6 2012-07-21 22:34:55

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: removing syslinux VBR

x33a wrote:

This should delete the mbr without touching the partition table.

# dd if=/dev/zero of=/dev/sda bs=440 count=1

ps: 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

Board footer

Powered by FluxBB