bfs: erase ext2 superblock when initializing
Having valid superblocks from multiple filesystems on the same disk is confusing, let's try to avoid that. Change-Id: I1a58843d45ea52193a77faaf8dcc3ca6a049406e Reviewed-on: https://review.haiku-os.org/c/haiku/+/1802 Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
parent
354311b57b
commit
e8f5d1ca66
|
@ -828,8 +828,12 @@ Volume::_EraseUnusedBootBlock()
|
|||
{
|
||||
const int32 blockSize = 512;
|
||||
const char emptySector[blockSize] = { 0 };
|
||||
// Erase boot block if any
|
||||
if (write_pos(fDevice, 0, emptySector, blockSize) != blockSize)
|
||||
return B_IO_ERROR;
|
||||
// Erase ext2 superblock if any
|
||||
if (write_pos(fDevice, 1024, emptySector, blockSize) != blockSize)
|
||||
return B_IO_ERROR;
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue