Miroslav Skoric wrote: > 1. What would you do if you need more space in /tmp and you know you have > some spare space in /home or else, but do not want to reinstall? No need to re-install. Brute force works. I would use a second disk large enough to hold everything. Copy off the old, repartition, then copy back to the smaller sized partition. > 2. Wouldn't be nice if resizing routines/commands/programs/... show > calculated time they would need for such an operation, so a user could > decide whether to continue or cancel? Yes. Of course. But it must be possible to estimate this. Sometimes the only way to know is to actually do the work and it isn't known until then. And someone must actually do the work of coding it up. In the case of the ext2 resize2fs the problem is mainly due to some inefficiency in the implemented algorithm. The expansion is well used and quite fast. But the shrink code is only rarely used. The shrink code is not optimized and hasn't had much attention. If someone were to get into that code base and review it I am confident they would find some type of nested loop causing it to operate in nasty exponential time that could be entirely avoided but is currently implemented in a most brute force and inefficient way. For example anyone who has ever implemented an AVL tree will know that supporting adding elements is quite easy. But supporting deleting elements is quite a bit more work. Many things are asymmetrical that way. It is the 80%-20% rule. 80% of the work takes 20% of the time. The remaining 20% of the work takes 80% of the time. In my case I had read the documentation. I had resized smaller partitions successfully. I had no idea it would take more than a week of 24x7 runtime before completing. If I had I would have done it differently. Which is why I am noting it here as the topic came up. To forewarn others. If I had only known then what I know now I would have copied it off and then back after resizing. Experience is sometimes the scars left behind after having done things poorly the first time. Bob
Attachment:
signature.asc
Description: Digital signature