problems with hfs_truncatefs() / HFS_RESIZE_VOLUME
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com 'diskutil resizeVolume...' HFS_RESIZE_VOLUME fsctl() int iRet = 0; u_int32_t uiBlockSize; u_int64_t uiBlockCount, uiCurrentSize, uiNewSize; struct statfs StatFS; // only works if device mounted iRet = statfs ( "/etc/" , &StatFS); if (iRet < 0) { perror ( "statfs failed with" ); return; } uiBlockSize = StatFS.f_bsize; uiBlockCount = StatFS.f_blocks; printf ( "block size:\t %u\n" , uiBlockSize); printf ( "block count:\t %llu\n" , uiBlockCount); uiCurrentSize = uiBlockSize * uiBlockCount; printf ( "partition size:\t %llu\n\n" , uiBlockSize * uiBlockCount); uiNewSize = uiCurrentSize; // only test here!!! printf ( "new volume size: %llu, hex: %llX\n" , uiNewSize, uiNewSize); iRet = fsctl ( "/" , HFS_RESIZE_VOLUME, &uiNewSize, 0); if (iRet < 0) { perror ( "fsctl failed with" ); return; } fsctl() 'hfs_extendfs(): not enough space on device' 'hfs_truncatefs(): invalid size' &uiNewSize bsd/hfs/hfs_readwrite.c u_int64_t
participants (1)
-
Michael Alfred Schmidt