# Shrinking a UFS partition



## Gambler (Dec 11, 2009)

I have 70G /usr partition and 500M /tmp partition. I would like to reduce /usr to 60Gig and make /tmp 4Gig in size. Is it doable? I've searched this forum and the Internet, but haven't found any definite answers, let alone methods.

The reason I need a large /tmp is to store backups of /usr, /var and /boot before restore. It's also a good place to store backups in general, since it can be easily accessed in case of software failure.


----------



## Gambler (Dec 11, 2009)

After posting this, I decided to search a bit more, and found this:
http://forums.freebsd.org/showthread.php?t=4075

Hm, apparently resizing is not possible.


----------



## SirDice (Dec 11, 2009)

Gambler said:
			
		

> The reason I need a large /tmp is to store backups of /usr, /var and /boot before restore. It's also a good place to store backups in general, since it can be easily accessed in case of software failure.


Keep in mind that /tmp will be cleared during boot.


----------



## Gambler (Dec 11, 2009)

SirDice said:
			
		

> Keep in mind that /tmp will be cleared during boot.


Why? I have a system with backups in /tmp, and they stay in place over reboots.


----------



## graudeejs (Dec 11, 2009)

SirDice, he doesn't have *clear_tmp_enable="YES"* in his /etc/rc.conf


----------



## Gambler (Dec 11, 2009)

To clarify: I'm not really storing backups in /tmp, they are simply left there from the previous restore.

clear_tmp_enable looks like an interesting option. It kind of makes sense to clear a "temporary" directory on each booy. On the other hand, my /tmp usually has over 99% free space. Even when it's the default 500Mb partition. Lately, I started to make it much larger, precisely for the cases when I need to restore the system from dump's output.


----------

