Operating System - Linux
1753301 Members
6867 Online
108792 Solutions
New Discussion юеВ

howto remove GRUB from the partition using fdisk ?

 
SOLVED
Go to solution
ayion
New Member
Solution

Re: howto remove GRUB from the partition using fdisk ?

hi chris

open your linux pc in CLI mode and type

dd if=/dev/zero of=/dev/hda bs=400 count=1

then reboot your pc

ayion
ayion
New Member

Re: howto remove GRUB from the partition using fdisk ?

hi chris

open your linux pc in CLI mode and type

dd if=/dev/zero of=/dev/hda bs=400 count=1

then reboot your pc

i hope u got ur dentination.

ayion
'chris'
Super Advisor

Re: howto remove GRUB from the partition using fdisk ?

thanks !

dd if=/dev/zero of=/dev/hda bs=400 count=1

that's good idea !

I think, fdisk is not a good tool to do that, what I want.
fdisk cannot selectively delete only parts of a partition !

in this partition I have important data.
anyway I saved everything using freesbie.

maybe other solution is to use /dev/random, but I have never used before.
Knows someone, how it should work using /dev/random ?
Andrew Cowan
Honored Contributor

Re: howto remove GRUB from the partition using fdisk ?

If all you want to do is blank the partition without removing it simply run "newfs" on it.
'chris'
Super Advisor

Re: howto remove GRUB from the partition using fdisk ?

sorry, I think correct is:

dd if=/dev/zero of=/dev/hda bs=446 count=1


this will not overwrite the partition table !
the partition table is kept in the last 66 bytes of the MBR.

greetings
chris
Bojan Nemec
Honored Contributor

Re: howto remove GRUB from the partition using fdisk ?

chris,

Maybe a:

dd if=/dev/hda of=backupmbr bs=446 count=1

will be good before

dd if=/dev/zero of=/dev/hda bs=446 count=1

So if something goes wrong, you can boot from a rescue disc and do:

dd if=backupmbr of=/dev/hda bs=446 count=1

to restore the parition table.(replace backupmbr with yours favorite file name)

Bojan
'chris'
Super Advisor

Re: howto remove GRUB from the partition using fdisk ?

thanks,

but I don't have any MBR BACKUPS !
Charles Lacour_1
New Member

Re: howto remove GRUB from the partition using fdisk ?

Chris,

I sincerely hope you didn't follow any of the advice given so far, especially the stuff about overwriting the first xxx bytes of /dev/hda!

Folks, he said, several times, that grub is installed on a PARTITION. It is NOT installed on the Master boot record. In fact, it's not even on drive hda at all.

The difference is if you went into grub and said
setup (hd0) # Installs to /dev/hda, like everyone has been assuming

and

setup (hd1,4) # Installs to /dev/hdb5, which is what Chris said.

Chris, I found this thread in the first place because I'm looking for the same info.

If you use dd on anything the output file (of = parameter) will be /dev/hdb5, not /dev/hda.

What I DON'T know right now is whether copying 400, 446 or 512 bytes of zeros will mess up your partition.

Copying 512 bytes will be the entire first sector of the partition, and will definitely get rid of grub on it. It may also screw up your partition badly. You haven't said what you have on it, how hard it would be to recover, etc.

What effects are you seeing from this?

In my own case, I deliberately installed it on hda7, because I already had a different grub installed on hda. Long story short, it now wants to double boot, once from hda, then from hda7.

I have stuff I want to keep on hda7, so I'm a little leery of trying anything drastic.

If I find an answer or try something drastic and it works, I'll post a followup.

Hope this helps,

Charles Lacour