1N/A libparted - a library for manipulating disk partitions 1N/A Copyright (C) 2000, 2007, 2009-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#
endif /* ENABLE_NLS */ 1N/Astatic char bigbuf[
128*
1024];
/* for command output storage */ 1N/A * Returns partition number (1..4) that contains geom, 0 otherwise. 1N/A printf(
"_get_partition_num_by_geom: ped_disk_new failed!\n");
1N/A "ped_disk_get_partition_by_sector failed!\n");
1N/A * return the partition device name for geom in partpath. 1N/A * return 1 on success, 0 on failure. 1N/A * XXX Solaris specific 1N/A * Create the path name to the *pn device, where n is the partition # 1N/A * geom->dev->path looks like this: "/devices/.../cmdk@0,0:q" 1N/A * :r is p1, :s is p2, :t is p3, :u is p4 1N/A * Executes cmd in a pipe. 1N/A * Returns -1 on popen failure or the return value from pclose. 1N/A * Saves the output from cmd in bigbuf for later display. 1N/A * Returns new fs on success, NULL on failure. 1N/A * Use system() so the output that shows progress is displayed. 1N/A * Returns 1 on success, 0 on failure. 1N/A * Returns 1 on success, 0 on failure. 1N/A * Use system() so the output that shows progress is displayed. 1N/A ret =
1;
/* return success to the upper layer */ 1N/A * Copy from source fs to destination geom. 1N/A * The destination partition must alreay exist. 1N/A * ntfsclone --overwrite destination-device source-device 1N/A * Returns new fs on success, NULL on failure. 1N/A * Use system() so the output that shows progress is displayed. 1N/A * fs->geom has the current filesystem size in sectors. 1N/A * geom has the new, requested filesystem size in sectors. 1N/A * fs->geom->dev is the same object as geom->dev. 1N/A * geom->dev->path looks like this: 1N/A * /devices/.../cmdk@0,0:q 1N/A * The ntfsresize cmd wants the block disk device, not the raw one. 1N/A * It also wants the partition device, not the whole disk. 1N/A * Returns 1 on success, 0 on failure. 1N/A int ret = 0;
/* this tells the upper layer NOT to resize partition */ 1N/A _(
"Sorry, can't move the start of " 1N/A "ntfs partitions yet."));
1N/A * ntfsresize -f says don't worry about consistency flag 1N/A * ntfsresize -f -f means don't ask "Are you sure?" 1N/A * Use system() so the output that shows progress is displayed. 1N/A ret =
1;
/* this tells upper layer to resize the partition */ 1N/A * return the minimum resize size from the ntfsresize external cmd 1N/A * in blocks, 0 on error. 1N/A * Saves the output from cmd in bigbuf for later display. 1N/A * return the minimum resize size in blocks, fs->geom->length on error. 1N/A#
endif /* !DISCOVER_ONLY */