# trying to mount /usr/ports in a different filesystem



## sundeepk_1 (Mar 4, 2013)

I tried /usr/ports into a separate filesystem but after installation the /usr/ports in a different filesystem is not being utilized, I see that the [cmd=]portsnap fetch[/cmd] and [cmd=]portsnap extract[/cmd] has put data onto /usr/ports in the /usr filesystem. Please find the [cmd=]df -h[/cmd] and [cmd=]gpart show[/cmd] command output below and please guide me through the required steps for moving the /usr/ports to a differnt filesystem .

```
root@sd:/usr # df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ada0p2      2G    369M    1.4G    20%    /
devfs          1.0k    1.0k      0B   100%    /dev
/dev/ada0p5    3.9G     32M    3.5G     1%    /tmp
/dev/ada0p4    4.8G    179M    4.3G     4%    /var
/dev/ada0p7    3.9G    1.5G    2.1G    41%    /usr/ports
/dev/ada0p6     19G    1.8G     16G    10%    /usr
/dev/ada0p8    3.9G     32M    3.5G     1%    /mnt/projects
/dev/ada0p9     19G     32M     17G     0%    /mnt/my_stuff

************************************************************
root@sd:/usr # gpart show /dev/ada0
=>       34  156301421  ada0  GPT  (74G)
         34       1024     1  freebsd-boot  (512k)
       1058    4194304     2  freebsd-ufs  (2.0G)
    4195362    6291456     3  freebsd-swap  (3.0G)
   10486818    4194304        - free -  (2.0G)
   14681122    8388608     5  freebsd-ufs  (4.0G)
   23069730   10485760     4  freebsd-ufs  (5.0G)
   33555490   20971520        - free -  (10G)
   54527010    8388608     7  freebsd-ufs  (4.0G)
   62915618   41943040     6  freebsd-ufs  (20G)
  104858658    8388608     8  freebsd-ufs  (4.0G)
  113247266   41943040     9  freebsd-ufs  (20G)
  155190306    1111149        - free -  (542M)

root@sd:/usr #
```
I am not sure how the /dev/ada0p7 is occupying space 

```
root@sd:/usr # cd ports
root@sd:/usr/ports # df -h .
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ada0p6     19G    1.8G     16G    10%    /usr
root@sd:/usr/ports #
```
as it's the /dev/adaop6 that's occupying the space for /usr/ports instead of the separate filesystem. 


Please advice


----------



## sundeepk_1 (Mar 4, 2013)

My fstab file:

```
root@sd:/root # cat /etc/fstab
# Device        Mountpoint      FStype  Options Dump    Pass#
/dev/ada0p2     /               ufs     rw      1       1
/dev/ada0p3     none            swap    sw      0       0
/dev/ada0p5     /tmp            ufs     rw      2       2
/dev/ada0p4     /var            ufs     rw      2       2
/dev/ada0p7     /usr/ports      ufs     rw      2       2
/dev/ada0p6     /usr            ufs     rw      2       2
/dev/ada0p8     /mnt/projects   ufs     rw      2       2
/dev/ada0p9     /mnt/my_stuff   ufs     rw      2       2
root@sd:/root #
```


----------



## SirDice (Mar 4, 2013)

sundeepk_1 said:
			
		

> ```
> /dev/ada0p7     /usr/ports      ufs     rw      2       2
> /dev/ada0p6     /usr            ufs     rw      2       2
> ```


Wrong order. You want to mount /usr/ _before_ mounting /usr/ports/.


```
/dev/ada0p6     /usr            ufs     rw      2       2
/dev/ada0p7     /usr/ports      ufs     rw      2       2
```


----------



## sundeepk_1 (Mar 4, 2013)

I've already installed a few apps and started working on it. *I*s there any possibility to correct the issue here*?*


----------



## SirDice (Mar 5, 2013)

You're in luck, mounting /usr/ afterwards only overlapped /usr/ports/ which isn't really important and can be restored quite easily.

Mount only the /usr/ filesystem and remove anything in /usr/ports/. Then mount /usr/ports normally. Everything should be fine then.


----------



## sundeepk_1 (Mar 5, 2013)

*W*hat I did was I edited the fstab file accordingly and before rebooting deleted everything in /usr/ports as suggested and then did a reboot. *P*ost reboot I did `portsnap fetch extract clean` 

*N*ow the system is pretty as much as I wanted it to be  Thanks a lot.

As I am a newcomer to FreeBSD you may get few more questions from me. Thanks once again.


----------

