From 68e382fc9d00cfa10b55fbb1b7d9baa45de36199 Mon Sep 17 00:00:00 2001 From: szaka Date: Mon, 5 May 2008 15:53:40 +0000 Subject: [PATCH] ntfs_boot_sector_parse: hints on error (Ralph Corderoy, Szabolcs Szakacsits) --- libntfs-3g/bootsect.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libntfs-3g/bootsect.c b/libntfs-3g/bootsect.c index f13a11cd..f3ffb5d1 100644 --- a/libntfs-3g/bootsect.c +++ b/libntfs-3g/bootsect.c @@ -151,6 +151,13 @@ not_ntfs: return ret; } +static const char *last_sector_error = +"HINTS: Either the volume is a RAID/LDM but it wasn't setup yet,\n" +" or it was not setup correctly (e.g. by not using mdadm --build ...),\n" +" or a wrong device is tried to be mounted,\n" +" or the partition table is corrupt (partition is smaller than NTFS),\n" +" or the NTFS boot sector is corrupt (NTFS size is not valid).\n"; + /** * ntfs_boot_sector_parse - setup an ntfs volume from an ntfs boot sector * @vol: ntfs_volume to setup @@ -198,9 +205,7 @@ int ntfs_boot_sector_parse(ntfs_volume *vol, const NTFS_BOOT_SECTOR *bs) SEEK_SET) == -1) { ntfs_log_perror("Failed to read last sector (%lld)", (long long)sectors); - ntfs_log_error("Perhaps the volume is a RAID/LDM but it wasn't " - "setup yet, or the\nwrong device was used, " - "or the partition table is incorrect.\n" ); + ntfs_log_error("%s", last_sector_error); return -1; }