On Dec 16, 2011 5:05 PM, "Neil Bothwick" <n...@digimed.co.uk> wrote:
>
> On Fri, 16 Dec 2011 08:41:07 +0100, J. Roeleveld wrote:
>
> > On Friday 16 December 2011 03:18:16 Allan Gottlieb wrote:
> > > I need to add space to /var (thank you, libreoffice), which is on lvm.
> > > Since my one volume group vg is getting low, I thought this would be a
> > > good time to extend it as well.
> >
> > Actually, you need space in /var/tmp/portage
>
> In fact, he needs space in wherever $PORTAGE_TMPDIR points to. Just set
> this variable to somewhere with enough space before emerging libreoffice.
>
> > > phy disk:   /dev/sda  my only drive
> > > phy part:   fdisk   create another partition of type LVM (/dev/sda8)
> > > phy vol:    pvcreate /dev/sda8
> > > vol grp:    vgextend vg /dev/sda8
> > > log vol:    lvextend --size +10G /dev/vg/var
> > > file sys:   resize2fs /dev/vg/var
>
> Did you say your existing PV is sda7? In that case, why mess with having
> two adjacent partitions are separate PVs in the same VG. Delete sda8,
> resize sda7 to fill the space and run pvresize /dev/sda7 to resize the PV
> to fit. Then you can use lvresize and resize2fs to increase /var, or
> create a separate space for PORT_TMPDIR.
>
> I prefer to keep potentially huge temporary directories away from
> critical filesystems like /var.
>

Alternatively, mount sda8 under /mnt, create "shadow" directories in sda8,
and bindmount them when needed.

E.g.:

mkdir /mnt/sparespace
mount /dev/sda8 /mnt/sparespace
mount -o bind /mnt/sparespace /var/tmp/portage

Of course, this assumes sda8 has enough space for heavy compiles (i.e., 10
GiB or more). Create a huge number of inodes or use a filesystem other than
ext[2-4] for sda8, and you're covered.

Rgds,

Reply via email to