|
|
int clear_ntfs_boot_sectors(logical_volume_t * ev) | int clear_ntfs_boot_sectors(logical_volume_t * ev) |
{ | { |
int rc = 0; | int rc = 0; |
private_data_t * pd = (private_data_t *) ev->private_data; |
|
int fd; | int fd; |
void * block; | void * block; |
int32_t bytes_written; | int32_t bytes_written; |
|
|
} | } |
| |
/* Wipe out the NT4+ backup boot sector. */ | /* Wipe out the NT4+ backup boot sector. */ |
bytes_written = EngFncs->write_volume(ev, fd, block, NTFS_BLOCK_SIZE, (pd->fs_size << EVMS_VSECTOR_SIZE_SHIFT) - NTFS_BLOCK_SIZE); |
bytes_written = EngFncs->write_volume(ev, fd, block, NTFS_BLOCK_SIZE, (ev->vol_size << EVMS_VSECTOR_SIZE_SHIFT) - NTFS_BLOCK_SIZE); |
if (bytes_written != NTFS_BLOCK_SIZE) { | if (bytes_written != NTFS_BLOCK_SIZE) { |
LOG_WARNING("Failed to clear the primary boot sector on volume %s. " | LOG_WARNING("Failed to clear the primary boot sector on volume %s. " |
"Only %d bytes were written.\n", | "Only %d bytes were written.\n", |
|
|
} | } |
| |
/* Wipe out the NT3.51- backup boot sector. */ | /* Wipe out the NT3.51- backup boot sector. */ |
bytes_written = EngFncs->write_volume(ev, fd, block, NTFS_BLOCK_SIZE, (pd->fs_size << (EVMS_VSECTOR_SIZE_SHIFT - 1))); |
bytes_written = EngFncs->write_volume(ev, fd, block, NTFS_BLOCK_SIZE, (ev->vol_size << (EVMS_VSECTOR_SIZE_SHIFT - 1))); |
if (bytes_written != NTFS_BLOCK_SIZE) { | if (bytes_written != NTFS_BLOCK_SIZE) { |
LOG_WARNING("Failed to clear the primary boot sector on volume %s. " | LOG_WARNING("Failed to clear the primary boot sector on volume %s. " |
"Only %d bytes were written.\n", | "Only %d bytes were written.\n", |