From 397848e21def6b24c7092191b0e46855d5733367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Tue, 30 Jul 2013 10:35:13 +0200 Subject: [PATCH] Reserved a single sector for the backup boot sector Reserve a single sector, instead of a full cluster, for the backup boot sector. --- ntfsprogs/ntfsresize.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ntfsprogs/ntfsresize.c b/ntfsprogs/ntfsresize.c index 08b4ec44..6f541811 100644 --- a/ntfsprogs/ntfsresize.c +++ b/ntfsprogs/ntfsresize.c @@ -4401,13 +4401,12 @@ int main(int argc, char **argv) opt.reliable_size = 1; } - /* Take the integer part: don't make the volume bigger than requested */ - new_size = opt.bytes / vol->cluster_size; - /* Backup boot sector at the end of device isn't counted in NTFS volume size thus we have to reserve space for it. */ - if (new_size) - --new_size; + if (opt.bytes > vol->sector_size) + new_size = (opt.bytes - vol->sector_size) / vol->cluster_size; + else + new_size = 0; if (!opt.info && !opt.infombonly) { print_vol_size("New volume size ", vol_size(vol, new_size));