[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: I am lost with lvm in debian-edu



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 13 Dec 2005 23:09:46 +0100
Nicolas Pettiaux <nicolas.pettiaux@gmail.com> wrote:

> How can I know (= where do I have to look) to know which physical
> partition are used in which logical volume;

Don't remember if Debian-edu currently use lvm1 (package lvm10) or lvm2.

With both versions you can get the details:

  # pvdisplay
  # vgdisplay
  # lvdisplay

With lvm2 you can get compact overviews too:

  # pvs
  # vgs
  # lvs

(the "#" is only to hint that the commands require root access)


> where the logical volumes are defined,

Not sure I understand you here.


> how to add simply some free space to the logican volumes ?


With lvm1 you can use e2fsadm:

  # e2fsadm -L +2G /dev/volume_group/logical_volume

With lvm2 you need to do manually what e2fsadm does:

  # lvresize -L +2G /dev/volume_group/logical_volume
  # e2fsck -f /dev/volume_group/logical_volume
  # resize2fs /dev/volume_group/logical_volume

The above adds 2 GB to the volume


Reducing the size is similar for lvm1:

  # e2fsadm -L -2G /dev/volume_group/logical_volume

With lvm2 it's a bit more tricky, as resizefs needs to run first so
must be given an exact amount, and possibly round the numbers
differently than the LVM tools so give it some headroom (haven't
investigated how tight is safe to go):

  # e2fsck -f /dev/volume_group/logical_volume 58000M
  # resize2fs /dev/volume_group/logical_volume
  # lvresize -L 59500M /dev/volume_group/logical_volume

The above cuts off approx. 2GB from a 60GB volume.


 - Jonas

- -- 
* Jonas Smedegaard - idealist og Internet-arkitekt
* Tlf.: +45 40843136  Website: http://dr.jones.dk/

 - Enden er nær: http://www.shibumi.org/eoti.htm
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDn5sHn7DbMsAkQLgRAlifAJ9VuV1aIE/jwHqRuZ7cSryxE3JoZwCgiS/A
Cl4QQtjXt39WGkOUdMa8g8M=
=u7xX
-----END PGP SIGNATURE-----



Reply to: