# Expanding Filesystem Over 2 Disks



## NIX-Knight (Mar 5, 2013)

I have a FreeBSD email server that currently has 300GB hard drive. The entire drive has been given to /. The disk has only 70GB space left and the count is decreasing slowly.

If I add another 300GB hard drive to it, can I expand / so that it may cover the new hard drive, increasing the overall size of /.


----------



## SirDice (Mar 5, 2013)

NIX-Knight said:
			
		

> If I add another 300GB hard drive to it, can I expand / so that it may cover the new hard drive, increasing the overall size of /.


No, that's not possible. You can however move some of the data to the other drive. You could move, for example, /usr/home to the new drive.


----------



## NIX-Knight (Mar 5, 2013)

SirDice said:
			
		

> No, that's not possible. You can however move some of the data to the other drive. You could move, for example, /usr/home to the new drive.



And then mount it in /etc/fstab right?


----------



## SirDice (Mar 5, 2013)

NIX-Knight said:
			
		

> and then mount it in /etc/fstab right?


Yes, exactly.

Mount the new filesystem on /mnt so you can copy the files. Once it's all on the new drive remove the data from the old drive and mount the new one in it's place. It's best to do this in single user mode so nothing can interfere.

Personally I like to put all these on their own filesystem: /usr/src/, /usr/ports/, /usr/home/.

Especially /usr/ports/ tends to grow after some use. You can clean it out, that might give some breathing room:
`# rm -rf /usr/ports/*/*/work`
That will clean up any left over builds that haven't been cleaned.


----------



## NIX-Knight (Mar 5, 2013)

SirDice said:
			
		

> Yes, exactly.
> 
> Mount the new filesystem on /mnt so you can copy the files. Once it's all on the new drive remove the data from the old drive and mount the new one in it's place. It's best to do this in single user mode so nothing can interfere.
> 
> ...



Could I expand to another disk using gconcat if /usr was separate partition?


----------



## SirDice (Mar 5, 2013)

NIX-Knight said:
			
		

> Could I expand to another disk using gconcat if /usr was separate partition?



No, with gconcat(8) you create a striped set _before_ putting data on it. You cannot use it to add disks on the fly.

I would advise against using it too. If one of the disks of the set dies, the whole set dies and you lose all data.


----------

