0

I have small task to read/write sectors in "free area", this free area between MBR's sector (LBA=0) and first sector of the first partition (tipicaly LBA=2048).

So, I can read/write first 128 sectors. After LBA=127 write operation end successfully but nothing has been written to disk really.

So is there a some kernel limitation ?

  • 1
    Do not assume that such area is free, Often it is used, so do a backup of that sectors. I do not understand the question: how to you read other sectors? You can read all disk, normally. You do not have to have partitions on a disk. AFAIK there was just limitation on the final sector (depending on alignment of last sector), but you ca write and read the fist sector normally. And people do it regularly )for backup) before to change MBR. – Giacomo Catenazzi Apr 12 '18 at 11:39
  • I can assume that this area is "free" until no special limitation is take place. :-) BTW, GRUB allocate 102 sectors at the time from this area. So, GRUB don't count that this are cannot be used ... –  Apr 12 '18 at 11:59
  • 1
    IIRC also windows used it. Usually just bootloader or for upgrades. – Giacomo Catenazzi Apr 12 '18 at 12:10

1 Answers1

0

It was a logic bug in the C code, so the problem was resolved. It was incorrect file offset computation as input for vfs_read() routine.

  • 2
    It's good to hear that you found the cause of your problem. You could make your answer more helpful for future readers by explaining *how* you diagnosed it, and in particular, which evidence will identify this problem when it's seen elsewhere. – Toby Speight Aug 28 '18 at 12:38