Hi,
Something I haven't done before is reduce the number of volumes on my server.. Here is my current disk setup..
[root@server1 /]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-RootVol00 15G 1.5G 13G 11% / /dev/md0 190M 42M 139M 24% /boot /dev/mapper/VolGroup00-DataVol00 39G 16G 22G 42% /data none 157M 0 157M 0% /dev/shm /dev/mapper/VolGroup00-HomeVol00 77G 58G 15G 80% /home /dev/mapper/VolGroup00-VarVol00 16G 382M 15G 3% /var
Rather than try and reduce the size of the VarVol00 volume to make more unallocated space which I have heard is a little dangerous.. I would like to get rid of the VarVol00 and have the /var directory on the RootVol00 volume.. Then I can allocate some of the free space to HomeVol00 which is filling up..
So how do I do this?
Do I simply copy /var to /var2 and then edit the /etc/fstab file to remove the line that mounts VarVol00??
Then at what point and how do I rename /var2 to /var to get it all working as normal again?
Should this all be done in "single" mode?
As you can see I am really not sure about this procedure so any help or step by step instructions for be great..
Thanks..
WipeOut wrote:
Hi,
Something I haven't done before is reduce the number of volumes on my server.. Here is my current disk setup..
[root@server1 /]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-RootVol00 15G 1.5G 13G 11% / /dev/md0 190M 42M 139M 24% /boot /dev/mapper/VolGroup00-DataVol00 39G 16G 22G 42% /data none 157M 0 157M 0% /dev/shm /dev/mapper/VolGroup00-HomeVol00 77G 58G 15G 80% /home /dev/mapper/VolGroup00-VarVol00 16G 382M 15G 3% /var
Rather than try and reduce the size of the VarVol00 volume to make more unallocated space which I have heard is a little dangerous.. I would like to get rid of the VarVol00 and have the /var directory on the RootVol00 volume.. Then I can allocate some of the free space to HomeVol00 which is filling up..
So how do I do this?
Do I simply copy /var to /var2 and then edit the /etc/fstab file to remove the line that mounts VarVol00??
Then at what point and how do I rename /var2 to /var to get it all working as normal again?
Should this all be done in "single" mode?
It depends (as always). You need to unmount /var Perhaps this can be done in single user mode. If not (some services still running that have files open) than just use rescue mode. # something like this: rsync -av /var/ /var2 telinit s umount /var rmdir /var (it's probably empty) mv /var2 /var vi /etc/fstab telinit 3 (or 5)
To my understanding sometimes it is possible to resize live ext3 filesystems. (No experience myself). In that case you could simply do something like this:
resize2fs /dev/VolGroup00/VarVol00 2G lvreduce -L2G /dev/VolGroup00/VarVol00
I would still prefer to do this when the disk is unmounted and checked (e2fsck -f /dev/VolGroup00/VarVol00). But in that case you of course get rid of the partition VarVol00 anyhow.
Theo
On Fri, 23 Mar 2007, Theo Band wrote:
[...]
To my understanding sometimes it is possible to resize live ext3 filesystems. (No experience myself). In that case you could simply do something like this:
resize2fs /dev/VolGroup00/VarVol00 2G lvreduce -L2G /dev/VolGroup00/VarVol00
I would still prefer to do this when the disk is unmounted and checked (e2fsck -f /dev/VolGroup00/VarVol00). But in that case you of course get rid of the partition VarVol00 anyhow.
Theo
Last time I tried reducing ext3 was only possible after umount and e2fsck -f;
Enlarging ext3 was generally possible on mounted system, unless you want to enlarge past some limit (depending on how fs was created); in that case umount and e2fsck is also needed.
Best regards,
Wojtek
Wojtek.Pilorz wrote:
On Fri, 23 Mar 2007, Theo Band wrote:
[...]
To my understanding sometimes it is possible to resize live ext3 filesystems. (No experience myself). In that case you could simply do something like this:
resize2fs /dev/VolGroup00/VarVol00 2G lvreduce -L2G /dev/VolGroup00/VarVol00
I would still prefer to do this when the disk is unmounted and checked (e2fsck -f /dev/VolGroup00/VarVol00). But in that case you of course get rid of the partition VarVol00 anyhow.
Theo
Last time I tried reducing ext3 was only possible after umount and e2fsck -f;
Enlarging ext3 was generally possible on mounted system, unless you want to enlarge past some limit (depending on how fs was created); in that case umount and e2fsck is also needed.
Best regards,
Wojtek
Everything I have read said that reducing an LVM volume was dangerous because you have to reduce the file system first and that has issues of its own..
I would rather just migrate the data off the one volume to another then all I have to do is extend the volumes which works fairly easily..
--- WipeOut wipe_out@users.sourceforge.net wrote:
Wojtek.Pilorz wrote:
On Fri, 23 Mar 2007, Theo Band wrote:
[...]
To my understanding sometimes it is possible to
resize live ext3
filesystems. (No experience myself). In that case
you could simply do
something like this:
resize2fs /dev/VolGroup00/VarVol00 2G lvreduce -L2G /dev/VolGroup00/VarVol00
I would still prefer to do this when the disk is
unmounted and checked
(e2fsck -f /dev/VolGroup00/VarVol00). But in that
case you of course get
rid of the partition VarVol00 anyhow.
Theo
Last time I tried reducing ext3 was only possible
after
umount and e2fsck -f;
Enlarging ext3 was generally possible on mounted
system, unless
you want to enlarge past some limit (depending on
how fs was created); in that case
umount and e2fsck is also needed.
Best regards,
Wojtek
Everything I have read said that reducing an LVM volume was dangerous because you have to reduce the file system first and that has issues of its own..
I would rather just migrate the data off the one volume to another then all I have to do is extend the volumes which works fairly easily.. _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
what is the reason you want to go this direction? wouldn't it be easier to add another disk and allocate the space on that instead of trying to move stuff around and delete other stuff. To me this approach would be less work?
Steven
"On the side of the software box, in the 'System Requirements' section, it said 'Requires Windows or better'. So I installed Linux."