i needed a bigger swap, its size was 2 Gb and we needed it to grow to 16gb, so we decided to shrink /. A task anybody
would say not possible.
So we tuck in the first installation CD for oracle enterprise linux and when prompted for a kernel option we
issued
: linux recover
Once asked to mount the root partition we said yes…
it ended up in /dev/VolGroup00/LogVol00
we checked a df -k, and it was mounted as /mnt/sysimage, and had a dev, proc and other directories
mounted inside, which were not evident in the df -k, so did a
# cat /etc/mtab
and found other dirs mounted, so for each entry in mtab inside /mnt/sysimage we unmounted it, and ended
up unmounting /mnt/sysimage
#umount /mnt/sysimage/selinux
#umount /mnt/sysimage/dev
#umount /mnt/sysimage/sys
#umount /mnt/sysimage/proc
#umount /mnt/sysimage/boot
#umount /mnt/sysimage
To reduce the filesystem, after unmounted and we issued:
# e2fsck -f /dev/VolGroup00/LogVol00
# resize2fs /dev/VolGroup00/LogVol00 110G
After that we needed to resize the volume, so we issued:
# lvm
> lvreduce -L -16G /dev/VolGroup00/LogVol00
And that did the trick to reduce the / filesystem
Then we booted up the server and resized the swap volume issuing:
# lvresize -L +16G /dev/VolGroup00/LogVol01
Had to remake the swap area
190/433
# swapoff /dev/VolGroup00/LogVol01
# mkswap /dev/VolGroup00/LogVol01
And remount it
# swapon -a
You can verify the new swap size with a “top”
191/433