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

Re: De GRUB i MBR ...




Lluís Gras wrote:
> Bones !!!
> 
> Ara que està a punt de començar el curs escolar i aprofitant que durant
> l'estiu m'he "radicalitzat" vull deixar d'emprar el magnific Ghost de
> Symantec i restaurar els equips de les aules emprant el partimage.
> 
> Bé el cas és que estic confeccionant un petit script "ghostpc", llegeixis
> ghost pel cole, que em permet el següent:
(...)
> 
> Restaura una imatge de la partició sda5 desde el servidor 192.168.0.1
> ghostpc -r sda5-ext3 192.168.0.1
> 
> El cas és que la cosa funciona prou bé exceptuant el fet que quan faig una
> restauració de tot el disc, reescric el MBR emprant una còpia feta amb el
> dd ( dd if=/dev/$disc of=backup-$disc.mbr bs=512 count=1 ) durant una
> execució prèvia del ghostpc ( ghostpc -S hda ns1 ).
> 
> El resultat és "sorprenent" en el sentit que per algun motiu el GRUB que
> surt després de la restauració no és el que en teoria hi havia al equip
> mòdel i dic jo que malgrat ho pugui solventar forçant la reinstal·lació
> del GRUB em semblava que restaurant el MBR previ ja n'hi havia prou.
> 
> Si algú en sap alguna cosa li estaria molt agraït.
> 

Jo no en sé massa del grub, però al llarg del temps he vist que consta de
diversos "stages" (3 com a mínim). És massa gran per caber en un sol
sector i,
per tant, et caldrà copiar alguna cosa més que el MBR.

Per si et serveix d'alguna cosa:

GRUB boot process

   1. The BIOS finds a bootable device (hard disk) and transfers control
to the master boot record (MBR, the first 512 bytes of the hard disk).
   2. The MBR contains GRUB stage 1. Given the small size of the MBR,
Stage 1 does little more than load the next stage of GRUB (which may
reside physically elsewhere on the disk). Stage 1 can either load stage
1.5, or it can load Stage 2 directly.
   3. GRUB Stage 1.5 is located in the first 30 kilobytes of hard disk
immediately following the MBR. Stage 1.5 loads Stage 2.
   4. GRUB Stage 2 (loaded by Stage 1 or 1.5) receives control, and
displays to the user the GRUB boot menu (or if the menu is inaccessible,
drops the user to the GRUB prompt, where the user can manually specify
the boot parameters).
   5. GRUB loads the user-selected (or default) kernel into memory and
passes control on to the kernel. Alternatively chainloading is possible:
GRUB hands off control to another bootloader which then continues the
process of loading that kernel. The chainloading makes it possible to
boot operating systems that don't follow the conventions and have boot
processes of their own, for example, Microsoft Windows



Reply to: