From 5ebe36f10ab6aa30e1f6d1c0b285e8218705b43d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Wed, 30 Sep 2015 08:25:25 +0200 Subject: [PATCH] Mentioned the starting sector when it overflows in mkntfs In an NTFS boot sector, the first sector of the partition is limited to 32 bits and it may overflow on large disks. This field is only used for booting on the partition and it is ignored by ntfs-3g, but the warning in mkntfs mislead users, so improve it. --- ntfsprogs/mkntfs.8.in | 4 +++- ntfsprogs/mkntfs.c | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ntfsprogs/mkntfs.8.in b/ntfsprogs/mkntfs.8.in index ce687f7d..a83cab9c 100644 --- a/ntfsprogs/mkntfs.8.in +++ b/ntfsprogs/mkntfs.8.in @@ -156,7 +156,9 @@ omitted, .B mkntfs attempts to determine .I part\-start\-sect -automatically and if that fails a default of 0 is used. Note that +automatically and if that fails or the value is oversized, a +default of 0 is used. The partition is usable despite a wrong value, +however note that a correct .I part\-start\-sect is required for Windows to be able to boot from the created volume. .TP diff --git a/ntfsprogs/mkntfs.c b/ntfsprogs/mkntfs.c index a7b1fd23..c49cae47 100644 --- a/ntfsprogs/mkntfs.c +++ b/ntfsprogs/mkntfs.c @@ -3635,10 +3635,12 @@ static BOOL mkntfs_override_vol_params(ntfs_volume *vol) opts.part_start_sect = 0; winboot = FALSE; } else if (opts.part_start_sect >> 32) { - ntfs_log_warning("The partition start sector specified " - "for %s and the automatically determined value " - "is too large. It has been set to 0.\n", - vol->dev->d_name); + ntfs_log_warning("The partition start sector was not " + "specified for %s and the automatically " + "determined value is too large (%lld). " + "It has been set to 0.\n", + vol->dev->d_name, + (long long)opts.part_start_sect); opts.part_start_sect = 0; winboot = FALSE; }