Shrinking a Reiser file system

Most likely there are integrated, graphical tools that can do this quite nicely, but then with tricky operations I’ve always preferred the bare and basic tools. Gladly, I found a nice walkthrough of the procedure using only basic tools. To state the obvious: backup before you resize.

Here’s a summary, just in case that page disappears: you use resize_reiserfs to shrink the file system (it needs to be offline – I used a USB stick with SystemRescueCD, which comes with all the reiserfsprogs onboard). You can use something like “-s-20G” (note the minus sign) to shrink by 20GB. Shrink the file system a little bit more than you’d really need to (this is the smart, lazy, brilliant trick in the procedure – read on).

In the second step, you use fdisk to resize the partition containing the file system, making sure that you don’t alter the starting cylinder (important!). By shrinking the partition a bit less than you did the file system, you save yourself the worries of getting the end cylinder exactly right.

Finally, run resize_reiserfs again, without any switches: this grows the file system to take all available space in the partition.


%d bloggers like this: