# How to increase disk space



## arupsarkar (May 26, 2010)

Hi,

I have run out of disk space, as a result of which I cannot install anything, since I am new to unix can someone please suggest what I should do so that I can allocate some space to install. I do have space in my hard disk. I have attached the output of disk commands.

When I am trying to install win32 wireless driver using ndisgen I am getting the error.

```
/tmp: write failed, filesystem is full
ndiscvt: failed to output binary image: No space left on device
CONVERSION FAILED
```

`# 
df -hk`

Output

```
Filesystem  1024-blocks     Used    Avail Capacity  Mounted on
/dev/ad0s1a      507630   257236   209784    55%    /
devfs                 1        1        0   100%    /dev
/dev/ad0s1e      507630   507210   -40190   109%    /tmp
/dev/ad0s1f    32821988 10356206 19840024    34%    /usr
/dev/ad0s1d     2007598    40906  1806086     2%    /var
```

`# 
 du -d1 -h -x /`
Output

```
2.0K	/.snap
512B	/dev
2.0K	/tmp
2.0K	/usr
2.0K	/var
1.7M	/etc
2.0K	/cdrom
2.0K	/dist
1.0M	/bin
144M	/boot
6.7M	/lib
242K	/libexec
2.0K	/media
2.0K	/mnt
2.0K	/proc
4.0M	/rescue
 92M	/root
4.0M	/sbin
254M	/
```

Any help is highly appreciated.

Regards,
Arup


----------



## Matty (May 26, 2010)

check what is taking all the space in /tmp.


----------



## SirDice (May 26, 2010)

Your /tmp is rather small, only +/- 512MB. Mine's about 6GB. But as Matty said, see what's eating up the space.


----------



## arupsarkar (May 26, 2010)

Hi

The following is the output of /tmp

SirDice, How can I increase the space of /tmp?

`# ls -ltr`

Output

```
total 22
drwx------  4 root     wheel      512 May 23 17:05 .Trash-0
drwx------  2 msarkar  msarkar    512 May 23 17:55 .esd-1001
drwx------  2 root     wheel      512 May 23 17:56 .esd-0
drwxrwxrwt  2 root     wheel      512 May 25 23:56 .font-unix
drwxrwxrwt  2 root     wheel      512 May 25 23:56 .XIM-unix
drwxrwxrwt  2 root     wheel      512 May 25 23:56 .X11-unix
-r--r--r--  1 root     wheel       11 May 25 23:56 .X0-lock
drwxrwxrwt  2 root     wheel      512 May 25 23:57 .ICE-unix
drwxrwxr-x  2 root     operator   512 May 25 23:57 .snap
-rw-------  1 root     wheel     4096 May 26 06:09 quot.core
```


----------



## SirDice (May 26, 2010)

Try `# du -sk /tmp/* | sort -n`.

You can't increase it's size. You either partition it correctly to start with or mount a different filesystem on there.


----------



## Matty (May 26, 2010)

you could create a symlink from /usr/tmp to /tmp

```
#man ln
```


----------



## aragon (May 26, 2010)

Or if you have plenty of RAM to spare, turn /tmp into a memory file system with these rc.conf directives:


```
tmpmfs="YES"
tmpsize="1024m"
```

Edit tmpsize as you see fit...


----------



## jem (May 26, 2010)

Or, as a slight variation on the previous point, use tmpfs (as opposed to tmpmfs) by adding the following line to your /boot/loader.conf:


```
tmpfs_load="YES"
```

and the following line to /etc/fstab:


```
tmpfs           /tmp            tmpfs   rw,mode=01777   0       0
```

Your /tmp filesystem will then reside within virtual memory, both RAM and swap, like Solaris does it.

(It's an experimental feature in FreeBSD, but I've been using it for a year with no problems)


----------



## SirDice (May 26, 2010)

jem said:
			
		

> Your /tmp filesystem will then reside within virtual memory, both RAM and swap, like Solaris does it.


Indeed it is. Careful though. Lots of linux people tend to stuff huge amounts of data into /tmp and you don't want to run out of memory x(

Having said that, my next machine will definitely use it. It will have 8GB ram so a 16GB swap would be in order. Since it's a bit of a waste I'd use tmpfs.

I currently have about 6GB space on /tmp. Mainly because I regularly extract dvd images and these gui tools tend to extract it to /tmp to make it browsable.


----------



## DutchDaemon (May 26, 2010)

As far as I know, tmpmfs is based on mdmfs(8), which is swap-based. This is corroborated by /etc/defaults/rc.conf:


```
tmpmfs_flags="-S"	# Extra [B]mdmfs[/B] options for the mfs /tmp
```

Therefore I believe that this creates a swap-based /tmp memory file system as well:


```
tmpmfs="YES"
tmpsize="1024m"
tmpmfs_flags="-m 0 -o async,noatime -S -p 1777"
```


----------



## arupsarkar (May 28, 2010)

Hi All,
I would like to thank everyone for their contribution.

The issue has been resolved. I had implemented what "jem" had suggested and it is working fine so far. Thanks "jem".

Regards,
Arup


----------

