|
Lines 313-319
Link Here
|
| 313 |
int clear_ntfs_boot_sectors(logical_volume_t * ev) |
313 |
int clear_ntfs_boot_sectors(logical_volume_t * ev) |
| 314 |
{ |
314 |
{ |
| 315 |
int rc = 0; |
315 |
int rc = 0; |
| 316 |
private_data_t * pd = (private_data_t *) ev->private_data; |
|
|
| 317 |
int fd; |
316 |
int fd; |
| 318 |
void * block; |
317 |
void * block; |
| 319 |
int32_t bytes_written; |
318 |
int32_t bytes_written; |
|
Lines 346-352
Link Here
|
| 346 |
} |
345 |
} |
| 347 |
|
346 |
|
| 348 |
/* Wipe out the NT4+ backup boot sector. */ |
347 |
/* Wipe out the NT4+ backup boot sector. */ |
| 349 |
bytes_written = EngFncs->write_volume(ev, fd, block, NTFS_BLOCK_SIZE, (pd->fs_size << EVMS_VSECTOR_SIZE_SHIFT) - NTFS_BLOCK_SIZE); |
348 |
bytes_written = EngFncs->write_volume(ev, fd, block, NTFS_BLOCK_SIZE, (ev->vol_size << EVMS_VSECTOR_SIZE_SHIFT) - NTFS_BLOCK_SIZE); |
| 350 |
if (bytes_written != NTFS_BLOCK_SIZE) { |
349 |
if (bytes_written != NTFS_BLOCK_SIZE) { |
| 351 |
LOG_WARNING("Failed to clear the primary boot sector on volume %s. " |
350 |
LOG_WARNING("Failed to clear the primary boot sector on volume %s. " |
| 352 |
"Only %d bytes were written.\n", |
351 |
"Only %d bytes were written.\n", |
|
Lines 355-361
Link Here
|
| 355 |
} |
354 |
} |
| 356 |
|
355 |
|
| 357 |
/* Wipe out the NT3.51- backup boot sector. */ |
356 |
/* Wipe out the NT3.51- backup boot sector. */ |
| 358 |
bytes_written = EngFncs->write_volume(ev, fd, block, NTFS_BLOCK_SIZE, (pd->fs_size << (EVMS_VSECTOR_SIZE_SHIFT - 1))); |
357 |
bytes_written = EngFncs->write_volume(ev, fd, block, NTFS_BLOCK_SIZE, (ev->vol_size << (EVMS_VSECTOR_SIZE_SHIFT - 1))); |
| 359 |
if (bytes_written != NTFS_BLOCK_SIZE) { |
358 |
if (bytes_written != NTFS_BLOCK_SIZE) { |
| 360 |
LOG_WARNING("Failed to clear the primary boot sector on volume %s. " |
359 |
LOG_WARNING("Failed to clear the primary boot sector on volume %s. " |
| 361 |
"Only %d bytes were written.\n", |
360 |
"Only %d bytes were written.\n", |