LVM resizing root partition quiestion

Paul Howarth paul at city-fan.org
Tue Aug 2 09:26:04 UTC 2005


Michael D. Setzer II wrote:
> I've tried to resize a "/" partition using information from the thread 
> below after booting from the FC3 DVD with linux rescue.
> I ran the lvm lvscan, then lvm vgchange -ay, and then did the resize 
> command to change the partition from 35GB to 30GB. It is using no more 
> than 12GB of space. This was a test machine, and was to see if it would 
> work. It gave a warning message, but it being a test machine, was no 
> problem. Unfortunately, after rebooting the machine had a kernel panic 
> with an inodees error message.

You say you did "the resize command"; which resize command?

You need to reduce the size of the filesystem (resize2fs) before you 
reduce the size of the partition or logical volume (lvreduce) that it's 
on. Did you do that?

> The reason that I want to be able to resize the partition, is that I 
> have another machine with a AMD64 3000+ CPU and a 250GB drive with FC3 
> as well. In the default installation, it setup the drive with the boot 
> and "/" partitions. System works fine, but it is used to do backups of 
> other systems on the network, and these are about 15GB files for each 
> lab. I want to be able to backup the root partition of this machine as 
> well, but with the 200+GB partition, it doesn't work well. I would like 
> to redo the machine in a  way to have the directory for the images as a 
> separate partition. I've been able to add a 70GB drive, and have it map 
> to another directory in the manner that I would like to do with this 
> 250GB drive.
> 
> Can this be done with LVM. I've used presizer in the past, and also 
> partition magic with windows. I'm sure it can be done, but I have found 
> it yet. Thanks again.

Yes, you can do it. You don't another drive. You can reduce the size of 
the root filesystem, then reduce the size of the logical volume. This 
frees up space in the volume group, so you can create a new logical 
volume for the backups, create a new filesystem on that logical volume, 
then mount the new filesystem on the directory you want to use for the 
backups. Job done.

(actually, when reducing partition/volume sizes, I tend to reduce the 
the filesystem size to *smaller* than the target size of the 
partition/volume group, then reduce the size of the partition/volume, 
then use resize2fs without a size so as to get the filesystem to fill 
the partition/volume; this ensures that at all times the filesystem 
lives within the partition/volume, without having to worry about 
rounding errors etc.).

Paul.




More information about the fedora-list mailing list