LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to clean super block and MBR under Linux (https://www.linuxquestions.org/questions/linux-general-1/how-to-clean-super-block-and-mbr-under-linux-109539/)

preswang 10-28-2003 12:53 PM

How to clean super block and MBR under Linux
 
I want to clean the super block and MBR before installing a new distro. Some one told me that use Windos98's fdisk /mbr. But when I reboot from win98 boot disk and use fdisk /mbr, it shows no disk.

Can I use cfdisk or fdisk under linux command to clean the super block and MBR?

Thanks!!

Kroppus 10-28-2003 01:12 PM

Eh?

" But when I reboot from win98 boot disk and use fdisk /mbr, it shows no disk."

What do you mean with that? If you're waiting for a confirmation or anything you won't get it. What happens is that the command starts fdisk and when that's done you'll get back the command prompt. THat's all there is to it. :)

I don't know if fdisk or cfdisk for linux has the same command.
but as far as i can see, none of them have.

Use fdisk from your bootdisk.

preswang 10-28-2003 02:34 PM

I have tried fdisk from win98 boot disk or some other win98 boot cd, the fdisk just can not work, a:\>fdisk /mbr it show no disk found.
if I use a:\>fdisk support large HD ?<y/n>
I type y
then exit fdisk :(

I use reiserFS file system and lilo (Slackware9.1)

I confuse that why fdisk and cfdisk under linux do not support clean MBR and super block.

preswang 10-29-2003 08:04 PM

I find this command from google, the guy said it can clean MBR, anyone else know this?
# fdisk -B -b /boot/mbr ad0

unSpawn 10-29-2003 09:00 PM

Can I use cfdisk or fdisk under linux command to clean the super block and MBR?
Use "dd". Make a backup of the Master Boot Record and the Partition Table on disk /dev/hda to a dated file in /tmp: "dd if=/dev/hda of=/tmp/mbr-$(/bin/date '+%Y%m%d').dat bs=1 count=512", then zap the MBR, leaving the PT: "dd if=/dev/zero of=/dev/hda bs=1 count=446" (else change the 466 to 512).

Superblocks are part of the filesystem structure. Reformat the partition to wipe those.


I find this command from google, the guy said it can clean MBR, anyone else know this?
# fdisk -B -b /boot/mbr ad0

Yes it can. Only if you run this command from an installed BSD tho.

preswang 10-30-2003 06:31 AM

thanks! I understand now.
bs=512 for pt and mbr
bs=446 for mbr

do you mean super block is located below the MBR ? for example MBR and partition structure are in 0~512 bytes, where is super block? (512~???)


All times are GMT -5. The time now is 11:05 PM.