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

Re: Run out of disk space on LVM

Le samedi 24 février 2007 09:58, Justin Hartman a écrit :
> Hi guys
> I must say I'm a little confused here. In the past I just created one
> large partition for my debian install but for this one machine I setup
> seperate partitions using LVM. I may be way off the mark here but I
> thought that with lvm I could resize partitions if it ran out of
> space?
> My current filesystem looks like this:
> Filesystem            Size  Used Avail Use% Mounted on
> /dev/mapper/debian-root                   268M  268M     0 100% /
> tmpfs                 249M     0  249M   0% /lib/init/rw
> udev                   10M   64K   10M   1% /dev
> tmpfs                 249M     0  249M   0% /dev/shm
> /dev/hda1             236M   24M  200M  11% /boot
> /dev/mapper/debian-home
>                        27G  4.8G   21G  19% /home
> /dev/mapper/debian-tmp
>                       380M   11M  350M   3% /tmp
> /dev/mapper/debian-usr
>                       4.7G  3.0G  1.6G  66% /usr
> /dev/mapper/debian-var
>                       2.9G  283M  2.4G  11% /var
> As you can see my /dev/mapper/debian-root is 100% full and I have no
> idea how to extend the size to that partition or how to remove stuff
> from that partition.
> My first prize solution is to move space from my /home partition to my
> /dev/mapper/debian-root partition but again - not sure how.
> Any ideas please?
> --
> Regards
> Justin Hartman
> PGP Key ID: 102CC123

0) You must tell us what filesystems you use on / and /var. I suppose it's 
ext3 for now.

1) If there's space on the VG debian, just extend the root LV :
To see space used on the debian VG :
# vgs debian

Add space to root :
# lvextend -L+50M /dev/vg/debian/root

Extend the filesystem
# resize2fs /dev/vg/debian/root

2) You've got space on /var, so reduce it to give space to root :
# resize2fs /dev/debian/var 2G
# lvextend -L 350M /dev/debian/root
# resize2fs /dev/debian/root

If you use reiserfs instead of ext3, replace resize2fs by resize_reiserfs (see 
man for the parameters).
If you use xfs, you cannot shrink, but can grow with xfs_grow
If you use jfs, I don't know, but there's certainly a command at least to grow 
the filesystem.

Note :
ext3 can be resize online since <put her a kernel version> and by default if 
the filesystem has been created with e2fsprogs >= 1.38+1.39-WIP-2006.03.29-1 
(mke2fs -O resize_inode is by default)

Attachment: pgp9Qpb4Qv6bV.pgp
Description: PGP signature

Reply to: