Re: restore boot block

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



That's still wrong.  skip= specifies the number of *blocks* to skip.

So:

   dd if=/dev/hda of=mypartitions skip=446 bs=1 count=64
   dd if=/dev/zero of=/dev/hda bs=512 count=1
   dd if=mypartitions of=/dev/hda skip=446 bs=1

or:

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


> Aarrgh, sorry, did that one from memory...  If anyone is going to try 
> this, then please use the updated values here: (Thanks Robert P. J. Day)
> 
> format of the MBR:
> 
>    446 bytes of code
>    64 (4x16) bytes partition table
>    2 byte signature (x55aa)
> 
> 
> dd if=/dev/hda of=mypartitions skip=446 bs=64 count=1
> dd if=/dev/zero of=/dev/hda bs=512 count=1
> dd if=mypartitions of=/dev/hda skip=446
> 
> Sincerely,
> Richard Black
> 
> - - - - - - - - - - - - - - - - - - - - - - - - -
> 
> The BOOT code is contained in the first 446 bytes.  Try wiping the first
> 446 instead of 512 and see if that does what you need.  You may also
> need to clear the last 2 bytes of the 512 because it will contain 55aa
> which is the boot code "signiture" which says the first 446 is valid.
> 
> dd if=/dev/hda of=mypartitions skip=446 bs=64 count=1
> dd if=/dev/zero of=/dev/hda bs=512 count=1
> dd if=mypartitions of=/dev/hda skip=446
> 
> # This isn't required if the new partitions are the exact same as the
> old ones
> echo w | fdisk /dev/hda
> 
> More info:
> www.cpqlinux.com/mbr.html
> 
> Of course there are many other methods:
> 
> 1. echo commands into fdisk
> 2. use sfdisk (scriptable fdisk)
> 
> 3. Another method is to set PXE to first in the boot order, then have
> the pxe server determine if they will do a local boot or do another
> install.  This method is great for clusters and for testing.
> 
> Sincerely,
> Richard Black
> 
> Fong Vang wrote:
> 
>   >Currently, we automate the installation of hundreds of machines by wiping
>   >the bootblock (first 512 bytes of the disk) to force them to do PXE
> boot on
>   >bootup.  However, because parts of the partition table reside in this
>   >location as well, wiping the 512 bytes of the disk makes the partition
> table
>   >unreadable.  Once anaconda takes over (no longer booting), does anyone
> know
>   >how one could restore the partition table.  What would be the best
> approach
>   >to recreate the partition table?
>   >
>   >
>   >
>   >
>   >
>   >This e-mail has been captured and archived by the ZANTAZ Digital Safe(tm)
>   >service.  For more information, visit us at www.zantaz.com.
>   >IMPORTANT: This electronic mail message is intended only for the use
> of the
>   >individual or entity to which it is addressed and may contain information
>   >that is privileged, confidential or exempt from disclosure under
> applicable
>   >law.  If the reader of this message is not the intended recipient, or the
>   >employee or agent responsible for delivering this message to the intended
>   >recipient, you are hereby notified that any dissemination, 
> distribution or
>   >copying of this communication is strictly prohibited.  If you have
> received
>   >this communication in error, please notify the sender immediately by
>   >telephone or directly reply to the original message(s) sent.  Thank you.
>   >
>   >
>   >_______________________________________________
>   >Kickstart-list mailing list
>   >Kickstart-list@xxxxxxxxxx
>   >https://www.redhat.com/mailman/listinfo/kickstart-list
>   >
>   >
> 
> 
> 
> 
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list
> 
> 
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list
> 




[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux