[CentOS] shrink LV with ext3 filesystem

2007-09-04 Thread Thomas Antony

Hi.

I want to make a snapshot from a logical volume and noticed that there 
must be enough free disk space in the volume group. Actually there is no 
  free disk space left.
How do i shrink online /var without losing any data or restore from 
backup? I do not have physical access to the server.



Specs:

Dell PE SC1430 with a 5/i RAID Controller
one RAID 1 array from the Dell RAID controller
2 partitons (boot and LVM)
1 VG
3 LV (swap, /var (/dev/VolGroup00/LogVol02) and / formatted with ext3)
/dev/mapper/VolGroup00-LogVol02 211G   39G  162G  20% /var


Thank you in advance.

Thomas Antony
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] shrink LV with ext3 filesystem

2007-09-04 Thread Luciano Rocha
On Tue, Sep 04, 2007 at 12:40:24PM +0200, Thomas Antony wrote:
  Hi.
 
  I want to make a snapshot from a logical volume and noticed that there must 
  be enough free disk space in the volume group. Actually there is no   free 
  disk space left.
  How do i shrink online /var without losing any data or restore from backup? 

You can't shrink ext2/ext3 filesystems online. You'll have to schedule a
downtime.

Another solution is to remove and use a file for swap (swapoff ... 
lvremove ...), or reduce it (swapoff ...  lvreduce ...  mkswap  swapon).

-- 
lfr
0/0


pgpWNyYQ1lIb9.pgp
Description: PGP signature
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] shrink LV with ext3 filesystem

2007-09-04 Thread Thomas Antony

Luciano Rocha schrieb:

On Tue, Sep 04, 2007 at 12:40:24PM +0200, Thomas Antony wrote:

 Hi.

 I want to make a snapshot from a logical volume and noticed that there must 
 be enough free disk space in the volume group. Actually there is no   free 
 disk space left.
 How do i shrink online /var without losing any data or restore from backup? 


You can't shrink ext2/ext3 filesystems online. You'll have to schedule a
downtime.

Another solution is to remove and use a file for swap (swapoff ... 
lvremove ...), or reduce it (swapoff ...  lvreduce ...  mkswap  swapon).


Hi.

Is it possible that i log into the server with ssh and umount only /var 
and then resize the logical volume?



Thomas

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


RE: [CentOS] shrink LV with ext3 filesystem

2007-09-04 Thread Ross S. W. Walker
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Thomas Antony
 
 Luciano Rocha schrieb:
  On Tue, Sep 04, 2007 at 12:40:24PM +0200, Thomas Antony wrote:
   Hi.
 
   I want to make a snapshot from a logical volume and 
 noticed that there must 
   be enough free disk space in the volume group. Actually 
 there is no   free 
   disk space left.
   How do i shrink online /var without losing any data or 
 restore from backup? 
  
  You can't shrink ext2/ext3 filesystems online. You'll have 
 to schedule a
  downtime.
  
  Another solution is to remove and use a file for swap 
 (swapoff ... 
  lvremove ...), or reduce it (swapoff ...  lvreduce ...  
 mkswap  swapon).
 
 Hi.
 
 Is it possible that i log into the server with ssh and umount 
 only /var 
 and then resize the logical volume?

Maybe in single user mode, but /var is needed for multi-user
mode to function.

Remember: if shrinking, shrink filesystem first then LV, if
expanding then expand the LV first then the filesystem.

-Ross

__
This e-mail, and any attachments thereto, is intended only for use by
the addressee(s) named herein and may contain legally privileged
and/or confidential information. If you are not the intended recipient
of this e-mail, you are hereby notified that any dissemination,
distribution or copying of this e-mail, and any attachments thereto,
is strictly prohibited. If you have received this e-mail in error,
please immediately notify the sender and permanently delete the
original and any copy or printout thereof.

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] shrink LV with ext3 filesystem

2007-09-04 Thread Sebastian Walter
Thomas Antony wrote:
 Is it possible that i log into the server with ssh and umount only
 /var and then resize the logical volume?

Try it. Most probably the system will tell you that the disk is in use.
What you could do then is booting from a live CD and resize it from
there (System will be offline, of course).

Regards
Sebastian
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


RE: [CentOS] shrink LV with ext3 filesystem

2007-09-04 Thread Ross S. W. Walker
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Thomas Antony
 
   Is it possible that i log into the server with ssh and 
 umount only /var and 
   then resize the logical volume?
  
  Yes, but you'll have to stop a lot of daemons and other 
 processes that
  run with files opened in /var.
  
  You can find the processes accessing /var with lsof or fuser:
  # fuser -mv /var
  # lsof /var
 
 
 I stopped all services except sshd and fuser and lsof doesn't show me 
 any files, but i still can't unmount /var :-(
 
 # umount /var
 umount: /var: device is busy
 umount: /var: device is busy
 
 Ayn ideas?

/var is required for multi-user mode.

Try bringing the system to single-user mode 'init 1' and then try it.

-Ross

__
This e-mail, and any attachments thereto, is intended only for use by
the addressee(s) named herein and may contain legally privileged
and/or confidential information. If you are not the intended recipient
of this e-mail, you are hereby notified that any dissemination,
distribution or copying of this e-mail, and any attachments thereto,
is strictly prohibited. If you have received this e-mail in error,
please immediately notify the sender and permanently delete the
original and any copy or printout thereof.

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] shrink LV with ext3 filesystem

2007-09-04 Thread Luciano Rocha
On Tue, Sep 04, 2007 at 08:18:18PM +0200, Thomas Antony wrote:
 
   Is it possible that i log into the server with ssh and umount only /var 
  and  then resize the logical volume?
  Yes, but you'll have to stop a lot of daemons and other processes that
  run with files opened in /var.
  You can find the processes accessing /var with lsof or fuser:
  # fuser -mv /var
  # lsof /var
 
 
  I stopped all services except sshd and fuser and lsof doesn't show me any 
  files, but i still can't unmount /var :-(
 
  # umount /var
  umount: /var: device is busy
  umount: /var: device is busy
 
  Ayn ideas?

Are you using chrooted BIND?

Do a cat /proc/mounts, search for var, and unmount anything in use.

-- 
lfr
0/0


pgp6YuR8J94u2.pgp
Description: PGP signature
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] shrink LV with ext3 filesystem

2007-09-04 Thread Thomas Antony


 # umount /var
 umount: /var: device is busy
 umount: /var: device is busy

 Ayn ideas?


Are you using chrooted BIND?

Do a cat /proc/mounts, search for var, and unmount anything in use.


# cat /proc/mounts | grep var
/dev/VolGroup00/LogVol02 /var ext3 rw,data=ordered 0 0

I can't unmount var.
I think it is like Ross already wrote, that /var can't be unmounted in 
multi-user mode.
It would be nice if someone could explain why /var is unmountable, even 
when fuser -mv /var and /lsof /var doesn't return any files.



Thomas
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos