PDA

View Full Version : configuring LVM?


cwolf
11th July 2006, 13:00
Hi,

I've installed CentOS 4.2 (fully updated) and my disk config is as follows:
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
2.0G 218M 1.7G 12% /
/dev/sda1 99M 23M 72M 24% /boot
none 1004M 0 1004M 0% /dev/shm
/dev/mapper/VolGroup00-LogVol01
2.0G 36M 2.0G 2% /home
/dev/mapper/VolGroup00-LogVol02
1008M 34M 924M 4% /tmp
/dev/mapper/VolGroup00-LogVol03
2.0G 830M 1.1G 44% /usr
/dev/mapper/VolGroup00-LogVol04
102G 330M 96G 1% /var
I want to resize mount-point "/" to 1024MB instead of 2048MB. Then I want to resize "/var" with the 1024MB previously belonging to "/". I've succesfully resized "/home" to 1024MB and back to 2048MB again to test the procedure, but it needs to unmount the mount-point that's being resized. Unmounting "/" or "/var" isn't possible.
[root@localhost ~]# umount /
[root@localhost ~]# umount /var/
umount: /var: device is busy
umount: /var: device is busy

unmounting "/" seems to work, but executing resize2fs gives:
[root@localhost ~]# resize2fs /dev/VolGroup00/LogVol00 1024M
resize2fs 1.35 (28-Feb-2004)
/dev/VolGroup00/LogVol00 is mounted; can't resize a mounted filesystem!
Also "umount -l /" or "umount -l /dev/VolGroup00/LogVol00" shows the "still mounted message".

I was under the impression that LVM is much more user-friendly when it comes to diskspace management, so what can I do, to unmount and resize every mount-point on my system?

Thanks

falko
12th July 2006, 12:52
Have a look here: http://www.linuxdevcenter.com/pub/a/linux/2006/04/27/managing-disk-space-with-lvm.html