Nandwrite how to DO NOT skip BB?

Hello,
I have 1 bad block in chip and many ideas in my mind how to mend this device, but I cannot get beyond this point first:
how to use nandwrite command to do not skip bad blocks?
example:
nandwrite /dev/mtd4 /tmp/mtd4.bin
does write, but if BB then skip it, in result I'm ending up with not enough space for mtd4.bin file because sector is skipped, so what I wish to do is to write mtd4.bin file, obviously do not write to BB sector as this is not possible, but DO NOT skip sectors in file, so this way there would be no error message regarding no space, but not written one sector from my file. I know that booting my fail this way so no worries.

Not sure if you can override the flash writing to bad block, so alternative ideas for you:

You might try shortening the file by an erase block or two, so that the smaller image gets written even though one bad block is jumped over.
(Depending on flash chip, erase blocks are typically 64 or 128 kB)
That way the image is possibly readable, if it is read at one sweep into memory (like the kernel).

If exact block access to the end part of the mtd area is needed, like for complex file systems, then a similar solution might be to cut away a block sized piece from file, exactly from the place where the bad block is, so that the next file block gets again written to the correct place in flash (even though the bad block was skipped)

cut away a block sized piece from file, exactly from the place where the bad block is, so that the next file block gets again written to the correct place in flash (even though the bad block was skipped)

Yeah, that's exactly what I have done while studying any options, your message confirmed that I'm going right direction, sounds like best solution for nandwrite - otherwise I would need to replace chip itself. It's very nice to consult with someone, thank you hnyman :smiley:
Luckily recovered and then I was able to make ordinary stock flash which managed BB on their own after.