On 01/25/2011 02:01 PM, Gnanasekar Loganathan wrote: > Actually i'm writing to the first 512 bytes only. > You're not. You're writing to a sector well within the partition (the one at part_start and not the one at 0) > The value of SECTOR_SIZE is 512. > > Also i noticed that in loadenv.c, while reading the from grubenv file, > read_hook is called. Why the read_hook is not called in this scenario? > read_hook doesn't work with blocklists. You overengineer the stuff. Have a look at e.g. gptsync. > 2011/1/25 Vladimir 'φ-coder/phcoder' Serbinenko : > >> On 01/25/2011 11:34 AM, Gnanasekar Loganathan wrote: >> >>> if(grub_disk_write(disk, part_start, 0, SECTOR_SIZE, nvbuf) ) { >>> >>> >> Writes as well as reads are to partition, not to entire disk erand so >> are the sector numbers >> >> -- >> Regards >> Vladimir 'φ-coder/phcoder' Serbinenko >> >> >> >> _______________________________________________ >> Grub-devel mailing list >> Grub-devel@gnu.org >> http://lists.gnu.org/mailman/listinfo/grub-devel >> >> >> > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > > -- Regards Vladimir 'φ-coder/phcoder' Serbinenko