1N/A Copyright (C) 1998-2000, 2007-2010 Free Software Foundation, Inc. 1N/A This program is free software; you can redistribute it and/or modify 1N/A it under the terms of the GNU General Public License as published by 1N/A the Free Software Foundation; either version 3 of the License, or 1N/A (at your option) any later version. 1N/A This program is distributed in the hope that it will be useful, 1N/A but WITHOUT ANY WARRANTY; without even the implied warranty of 1N/A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1N/A GNU General Public License for more details. 1N/A You should have received a copy of the GNU General Public License 1N/A/* Recursively builds (i.e. makes consistent) the duplicated directory tree 1N/A * (leaving the original directory tree in tact) 1N/A /* remove "stale" entries at the end */ 1N/A Constructs the new directory tree for legacy (FAT16) file systems. 1N/A Constructs the new directory tree for new (FAT32) file systems. 1N/A/* Converts the root directory between FAT16 and FAT32. NOTE: this code 1N/A * can also do no conversion. I'm leaving fat_construct_directory(), because 1N/A * it's really pretty :-) It also leaves a higher chance of deleted file 1N/A * recovery, because it doesn't remove redundant entries. (We do this here, 1N/A * because brain-damaged FAT16 has an arbitary limit on root directory entries, 1N/A _(
"There's not enough room in the root " 1N/A "directory for all of the files. Either " 1N/A "cancel, or ignore to lose the files."))
1N/A /* remove "stale" entries at the end, just in case there is some 1N/A/* This MUST be called BEFORE the fat_construct_new_fat(), because cluster 1N/A * allocation depend on the old FAT. The reason is, old clusters may 1N/A * still be needed during the resize, (particularly clusters in the directory 1N/A * tree) even if they will be discarded later. 1N/A/* when converting FAT32 -> FAT16 1N/A * fat_duplicate clusters() duplicated the root directory unnecessarily. 1N/A * This must be called AFTER fat_construct_new_fat(). (otherwise, our 1N/A * changes just get overwritten) 1N/A _(
"Error writing to the root directory."))
1N/A Constructs the new directory tree to match the new file locations. 1N/A Constructs the new fat for the resized file system. 1N/A#
endif /* PED_VERBOSE */ 1N/A "then you will have no problems.");
1N/A "is installed on this partition, then " 1N/A "you must re-install the MS Windows boot " 1N/A "loader. If you want to do this, you " 1N/A "should consult the Parted manual (or " 1N/A "your distribution's manual).");
1N/A "then you will not introduce any new " 1N/A "is installed on this partition, then " 1N/A "you must re-install the MS Windows boot " 1N/A "loader. If you want to do this, you " 1N/A "should consult the Parted manual (or " 1N/A "your distribution's manual). Also, " 1N/A "converting to FAT32 will make the file " 1N/A "system unreadable by MS DOS, MS Windows " 1N/A "95a, and MS Windows NT.");
1N/A _(
"Would you like to use FAT32?"),
1N/A _(
"The file system can only be resized to this " 1N/A "size by converting to FAT16."),
1N/A _(
"The file system can only be resized to this " 1N/A "size by converting to FAT32."),
1N/A _(
"GNU Parted cannot resize this partition to this size. " 1N/A "We're working on it!"));
1N/A/* For resize operations: determine if the file system must be FAT16 or FAT32, 1N/A * or either. If the new file system must be FAT32, then query for 1N/A * confirmation. If either file system can be used, query for which one. 1N/A/* Creates the PedFileSystem struct for the new resized file system, and 1N/A sticks it in a FatOpContext. At the end of the process, the original 1N/A (ctx->old_fs) is destroyed, and replaced with the new one (ctx->new_fs). 1N/A /* hypothetical number of root dir sectors, if we end up using 1N/A/* preserve boot code, etc. */ 1N/A /* what about copying? */ 1N/A /* we add calc_align_sectors to push the cluster_offset 1N/A forward, to keep the clusters aligned between the new 1N/A and old file systems 1N/A/* copies the "hidden" sectors, between the boot sector and the FAT. Required, 1N/A * for the Windows 98 FAT32 boot loader 1N/A /* nothing to copy for FAT16 */ 1N/A#
endif /* !DISCOVER_ONLY */