# texlive 2011 from ports



## jopeto (Jun 25, 2012)

Hello,

I'm trying to install TexLive from ports on a amd64 machine, as described on this website:
http://code.google.com/p/freebsd-texlive/wiki/Installing

First I ran

```
make -C /usr/ports/ports-mgmt/portshaker-config install # Ensure TEXLIVE is checked
```
and that worked fine. However when I ran [cmd=]portshaker -v[/cmd] I got an error message that the /var directory had no inodes left. I assume that because of that X froze as well and I couldn't move my mou*se* or type anything. So I logged on to another ttyv and moved /var/db/portsnap and /var/db/sup a new directory /usr/db. I also changed the /etc/portsnap.conf and supfiles to reflect these new locations. When I logged on to X again, everything worked fine.

However when I ran [cmd=]portshaker -v[/cmd] again, I got many messages of the sort:

```
/var/cache/portshaker/ports/x11/zenity/
mkdir: /var/cache/portshaker/ports/x11: No space left on device
tar: could not chdir to '/var/cache/portshaker/ports/x11/zenity/'
```

which culminated in the following message:

```
[Error 14:42:49] portsnap extract failed.
[Error 14:42:49] Failed to update the 'ports' ports tree.
```

It seems like the /var directory is not big enough. However when I run `df -h` I get this:

```
Filesystem      Size    Used   Avail Capacity  Mounted on
/dev/ada0s4a      2G    548M    1.3G    30%    /
devfs           1.0k    1.0k      0B   100%    /dev
/dev/ada0s4d      2G    771M    1.1G    42%    /var
/dev/ada0s4e      1G    8.1M    918M     1%    /tmp
/dev/ada0s4f    188G    5.2G    167G     3%    /usr
```
which means that I have 1.1G on the /var partition. So I'm guessing the problem is different.

I found this post on the subject, however it does not seem to offer a solution:
http://forums.pcbsd.org/archive/index.php/t-12568.html

I realize that there are binary packages available for amd64
http://forums.freebsd.org/showthread.php?t=26420
so this would be one possible solution. However since I started out with FreeBSD also for educational purposes, I would like to figure out what is going wrong in this case.

Any suggestions would be greatly appreciated. I'm guessing the /var directory needs to be "purged" somehow.


----------



## jopeto (Jun 25, 2012)

As an immediate update, it looks like I've run out of inodes on the /var directory.

```
$ df -hi
Filesystem      Size    Used   Avail Capacity iused ifree %iused  Mounted on
/dev/ada0s4a      2G    548M    1.3G    30%    5.9k  125k    4%   /
devfs           1.0k    1.0k      0B   100%       0     0  100%   /dev
/dev/ada0s4d      2G    771M    1.1G    42%    131k     0  100%   /var
/dev/ada0s4e      1G    8.1M    918M     1%      12   66k    0%   /tmp
/dev/ada0s4f    188G    5.2G    167G     3%    489k   12M    4%   /usr
```

As a result, when I try installing something else from ports, I get the message 
	
	



```
/var: create/symlink failed, no inodes free
```
 and the process exits with an error.

I found this post: http://lists.freebsd.org/pipermail/freebsd-questions/2005-March/079590.html

Can someone let me know which would be the files to delete safely from the /var directory as a quick fix. Maybe at a later point I will try to reformat that partition with more inodes, although at this point this is beyond me.

Thanks.


----------



## jopeto (Jun 25, 2012)

It looks like that indeed the problem was with the number of inodes, which apparently is a documented problem with FreeBSD 9.
http://forums.freebsd.org/showthread.php?t=28620

This is why I used a compilation of these pages and came up with the solution below:
http://www.manpagez.com/man/8/newfs/
https://www.dan.me.uk/blog/2009/06/03/freebsd-newfs-options/
http://www.freebsddiary.org/inodes.php

Copied the entire contents of the folder /var into /usr/var_backup/
Installed lsof from ports
Ran [cmd=]# lsof +D /var[/cmd] to see which processes use the /var directory
Killed those processes using [cmd=]kill -KILL <pid>[/cmd]
Stopped Xorg
Ran 

```
# mount
/dev/ada0s4a on / (ufs, local, journaled soft-updates)
devfs on /dev (devfs, local, multilabel)
/dev/ada0s4d on /var (ufs, local, soft-updates)
/dev/ada0s4e on /tmp (ufs, local, journaled soft-updates)
/dev/ada0s4f on /usr (ufs, local, journaled soft-updates)
```
to identify the name of the /var partition
Ran

```
# umount /dev/ada0s4d
# newfs -O2 -U -b 4096 -f 512 -i 1024 /dev/ada0s4d
# mount /dev/ada0s4d
# cp -r /usr/var_backup/* var/
```

Reboot.
Now I'm able to run [cmd=]# portshaker -v[/cmd] and am currently installing texlive-core from the newly added port!

I guess my issue is resolved. I just have one final question.

Now when I run `df -hi` I get the following:

```
$ df -hi
Filesystem      Size    Used   Avail Capacity iused ifree %iused  Mounted on
/dev/ada0s4a      2G    549M    1.3G    30%    5.9k  125k    4%   /
devfs           1.0k    1.0k      0B   100%       0     0  100%   /dev
/dev/ada0s4d    1.5G    514M    893M    37%    174k  1.9M    8%   /var
/dev/ada0s4e      1G    8.1M    918M     1%      13   66k    0%   /tmp
/dev/ada0s4f    188G    5.5G    167G     3%    471k   12M    4%   /usr
```

As you can see, the /var partition has shrunk from 2G to 1.5G. I'm guessing that this is due to the formatting. Can anyone give me a suggestion if the values I used for [cmd=]newfs -b 4096 -f 512 -i 1024[/cmd] are good or not? Maybe I decreased -i a bit too a*g*gressively? If someone can suggest better values that will give better system performance without running into the problem of having no more inodes, I'd be very happy to hear them.

Thanks.


----------

