Today I upgrade from Ubuntu 7.04 (Feisty Fawn) to the release candidate of Ubuntu 7.10 (Gutsy Gibbon). During the update the logical volume /usr comes to it’s limits. I need to add 1 GB of diskspace. It’s a reiserfs. I should be able to extend the running mounted volume.
The overall steps are 3
- Backup first
- Extending the logical volume
- Extending the filesystem on the volume
Extending the logical volume
Show the current state of the logical volums.
lvdisplay
To extend the logical volume by one GB is simple. lvm help leads to the required parameters.
lvresize -L +1G /dev/uvg/usr
With the -t Parameter I can run a test before.
lvresize -t -L +1G /dev/uvg/usr
Extending the filesystem on the volume
To resize the reiserfs to the full new size of the logical volume is still more simple.
resize_reiserfs /dev/uvg/usr
Displaying the success.
lvdisplay
Troubleshouting
After extending the logical volume I can’t run the command resize_reiserfs as expected because the ‘/dev/uvg/usr’ is not found any more. The moment of panic. Good if you have a backup. But I don’t need it. A little search in the Web brings me to a solution.
dmsetup mknodes
This lowlevel command rebuilds the lost mappings of pathes and devices and everything runs fine again.
[...] left in some partitions, while it is needed in others. LVM brings much more flexibility. You can add new space to a partition any time you [...]