# Creating jail using ZFS on UFS base system - FreeBSD 10.0



## bryn1u (Jan 23, 2014)

Hi,


Is that possible to make  a jail using ZFS when i have UFS on base system ? I've made partition for jail /usr/jail - UFS, is there any way to make this jail on ZFS ? - System - FreeBSD 10.0

Greetz,
Michał


----------



## SirDice (Jan 23, 2014)

*Re: Creating jail using ZFS on UFS base system - FreeBSD 10.*



			
				bryn1u said:
			
		

> Is that possible to make  a jail using ZFS when I have UFS on base system?


No. You can however add a ZFS filesystem, they will happily live next to each other.



> I've made partition for jail /usr/jail - UFS, is there any way to make this jail on ZFS?


No. Not with UFS. You will have to make the partition ZFS (freebsd-zfs instead of freebsd-ufs). You can mount the ZFS filesystem on /usr/jail if you want.


----------



## bryn1u (Jan 23, 2014)

*Re: Creating jail using ZFS on UFS base system - FreeBSD 10.*

I want to mount ZFS in /usr/jail/. If I do that, can I create new mount points (ZFS) there?


----------



## usdmatt (Jan 23, 2014)

*Re: Creating jail using ZFS on UFS base system - FreeBSD 10.*

If /usr/jail is a stand-alone filesystem on it's own partition (e.g. ada0p3), then I see no reason why that can't be 'reformatted' as a ZFS pool. I don't think having the correct GPT partition type is critical.


```
# umount /usr/jail
# zpool create data ada0p3
# zfs create -o mountpoint=/usr/jail -o compress=lz4 data/jail
# zfs create data/jail/somejailname (--this will inherit mountpoint and so mount on /usr/jail/somejailname--)
```

Note that I use ada0p3 only as an example. If /usr/jail has its own disk partition, you should be able to find out the device name by running `mount`.


----------



## bryn1u (Jan 23, 2014)

*Re: Creating jail using ZFS on UFS base system - FreeBSD 10.*

Hey,

Thanks for replay. This is what i was looking for. But when i did that, after reboot my server dont want to run. Can't login to console, replay on ping doesn't work too. I can't see what is in logs i can only reinstall from panel.

```
Filesystem    Type      Size    Used   Avail Capacity  Mounted on
/dev/ada0s1a  ufs        19G    443M     17G     2%    /
devfs         devfs     1.0K    1.0K      0B   100%    /dev
/dev/ada0s1d  ufs       968M     48K    891M     0%    /root
/dev/ada0s1e  ufs        19G     33M     17G     0%    /var
/dev/ada0s1f  ufs       9.5G     12K    8.7G     0%    /var/tmp
/dev/ada0s1g  ufs        38G    505M     34G     1%    /usr
/dev/ada0s1h  ufs       9.5G    8.0K    8.7G     0%    /usr/home
/dev/ada0s2a  ufs       351G    8.0K    323G     0%    /jails
procfs        procfs    4.0K    4.0K      0B   100%    /proc
```

then:


> umount /jails
> zpool create data ada0s2a
> zfs create -o mountpoint=/jails -o compress=lz4 data/jails
> zfs create data/jail/jail1



And reboot, after that  server going down. What could be the reason ?

#edit

Ahh. I forgot add # to this line /dev/ada0s2a  ufs  into /etc/fstab before reboot. 

Greetz,
Michał


----------

