Changes by: szaka
Update of /cvsroot/linux-ntfs/linux-ntfs/ntfstools
In directory usw-pr-cvs1:/tmp/cvs-serv32416/ntfstools
Modified Files:
ntfsresize.c
Log Message:
Mark the NTFS volume dirty. No need for ntfsfix anymore after ntfsresize.
Index: ntfsresize.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/ntfstools/ntfsresize.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -U2 -r1.13 -r1.14
--- ntfsresize.c 14 Jul 2002 15:43:35 -0000 1.13
+++ ntfsresize.c 14 Jul 2002 18:13:04 -0000 1.14
@@ -177,5 +177,5 @@
/* Needs to be multiple of 8 bytes */
bm_bsize = (bm_bsize + 7) & ~7;
- printf("Bitmap byte size : %lld (%lld clusters)\n",
+ Dprintf("Bitmap byte size : %lld (%lld clusters)\n",
bm_bsize, rounded_up_division(bm_bsize, vol->cluster_size));
@@ -449,5 +449,5 @@
u64 k = (u64)rl[i].lcn + j;
ntfs_set_bit(lcn_bitmap.bm, k, 0);
- printf("Unallocate cluster: "
+ Dprintf("Unallocate cluster: "
"%llu (%llx)\n", k, k);
}
@@ -464,5 +464,5 @@
rl_set(rl + trunc_at + 1, nr_bm_clusters, -1LL, 0LL);
- printf("Runlist truncated at index %d, "
+ Dprintf("Runlist truncated at index %d, "
"new cluster length %d\n", trunc_at, i);
}
@@ -641,10 +641,10 @@
"please try again (or see -f option).\n");
+ printf("NTFS volume version: %d.%d\n", vol->major_ver, vol->minor_ver);
if (ntfs_is_version_supported(vol))
- perr_exit("Unknown NTFS version %d.%d detected",
- vol->major_ver, vol->minor_ver);
+ perr_exit("Unknown NTFS version");
- printf("Cluster size : %u\n", vol->cluster_size);
- printf("Number of clusters: %lld\n", vol->nr_clusters);
+ printf("Cluster size : %u\n", vol->cluster_size);
+ printf("Number of clusters : %lld\n", vol->nr_clusters);
setup_lcn_bitmap();
@@ -678,7 +678,19 @@
/* FIXME: first do all checks before any write attempt */
- if (!opt.ro_flag)
+ if (!opt.ro_flag) {
+ u16 flags;
+
+ flags = vol->flags | VOLUME_IS_DIRTY;
+ if (vol->major_ver >= 2)
+ flags |= VOLUME_MOUNTED_ON_NT4;
+
+ printf("Setting NTFS $Volume flag dirty ...\n");
+ if (ntfs_set_volume_flags(vol, flags))
+ perr_exit("Failed to set $Volume dirty");
+
+ printf("Resetting $LogFile ...\n");
if (ntfs_reset_logfile(vol))
perr_exit("Failed to reset $LogFile");
+ }
truncate_badclust_file(new_volume_size);
@@ -687,8 +699,9 @@
/* FIXME: create backup boot sector -- if possible*/
- /* FIXME: set the volume dirty */
- printf("NTFS had been resized on device %s. "
- "Please run 'ntfsfix' on it.\n", vol->dev_name);
+ printf("==> NTFS had been successfully resized on device %s.\n"
+ "==> New NTFS volume size is %lld MB.\n"
+ "==> Now you can go on to resize/split the partition.\n",
+ vol->dev_name, (((opt.size * vol->cluster_size) >> 20) + 1));
return 0;
|