# How can I expand my jail?



## bsus (Aug 28, 2011)

Hi,
I have three jails, now I need some more es testing zone.

What is the easiest way to do this?
Which Jail Administration tool do you recommand and what are the first steps to use it?

Regards,
bsus


----------



## UNIXgod (Aug 28, 2011)

You can write your own scripts with

jls()
jexec()


----------



## bsus (Aug 29, 2011)

Thank you.

Found now the easiest way

```
D=/here/is/the/jail
cd /usr/src
mkdir -p $D
make world DESTDIR=$D
make distribution DESTDIR=$D
mount -t devfs devfs $D/dev
# mod the rc.conf
```

Now I have still two problems:
1. I can't delete my old jails:

```
freebsd jails # rm -rf mail
rm: mail/mail/usr/lib/librt.so.1: Operation not permitted
rm: mail/mail/usr/lib: Directory not empty
rm: mail/mail/usr/lib32/libcrypt.so.5: Operation not permitted
rm: mail/mail/usr/lib32/libc.so.7: Operation not permitted
rm: mail/mail/usr/lib32/librt.so.1: Operation not permitted
rm: mail/mail/usr/lib32/libthr.so.3: Operation not permitted
rm: mail/mail/usr/lib32: Directory not empty
rm: mail/mail/usr/bin/yppasswd: Operation not permitted
rm: mail/mail/usr/bin/chsh: Operation not permitted
rm: mail/mail/usr/bin/opieinfo: Operation not permitted
rm: mail/mail/usr/bin/ypchfn: Operation not permitted
rm: mail/mail/usr/bin/ypchsh: Operation not permitted
rm: mail/mail/usr/bin/chfn: Operation not permitted
rm: mail/mail/usr/bin/login: Operation not permitted
rm: mail/mail/usr/bin/crontab: Operation not permitted
rm: mail/mail/usr/bin/passwd: Operation not permitted
rm: mail/mail/usr/bin/rsh: Operation not permitted
rm: mail/mail/usr/bin/opiepasswd: Operation not permitted
rm: mail/mail/usr/bin/chpass: Operation not permitted
rm: mail/mail/usr/bin/su: Operation not permitted
rm: mail/mail/usr/bin/rlogin: Operation not permitted
rm: mail/mail/usr/bin/ypchpass: Operation not permitted
rm: mail/mail/usr/bin: Directory not empty
rm: mail/mail/usr: Directory not empty
rm: mail/mail/bin/rcp: Operation not permitted
rm: mail/mail/bin: Directory not empty
rm: mail/mail/lib/libcrypt.so.5: Operation not permitted
rm: mail/mail/lib/libthr.so.3: Operation not permitted
rm: mail/mail/lib/libc.so.7: Operation not permitted
rm: mail/mail/lib: Directory not empty
rm: mail/mail/libexec/ld-elf32.so.1: Operation not permitted
rm: mail/mail/libexec/ld-elf.so.1: Operation not permitted
rm: mail/mail/libexec: Directory not empty
rm: mail/mail/var/empty: Operation not permitted
rm: mail/mail/var: Directory not empty
rm: mail/mail/sbin/init: Operation not permitted
rm: mail/mail/sbin: Directory not empty
rm: mail/mail: Directory not empty
rm: mail: Directory not empty
```

2. How can I set up to mount devfs on my jail automaticly?

Regards


----------



## SirDice (Aug 29, 2011)

bsus said:
			
		

> 1. I can't delete my old jails:


`# chflg -R noschg mail/*`
Then you can remove the files.



> 2. How can I set up to mount devfs on my jail automaticly?


In /etc/rc.conf:

```
jail_myjail_devfs_enable="YES"
```


----------



## bsus (Aug 29, 2011)

```
chflags -R noshg /usr/home/jails/mail
```
did it.

I am now building a new jail from world for a openldap test section.
After its build can I just copy the created jail

```
cp -Rfv /usr/home/jails/openldap /usr/home/jails/mail
```
Or do I have to build a new jail/use a special tool?

Thanks for the help, Regards


----------



## bsus (Aug 29, 2011)

By the way is the use of jail administration tools like ezjail recommended?

At the moment I have three independent working jails. Is it recommended to have one basic jail? And if yes what do I have to add to fstab so this works?

Regards


----------



## fbsd1 (Sep 2, 2011)

qjail is the best automated jail utility for admin use.


----------



## MasterOne (Sep 9, 2011)

Searching freshports shows several jail admin utils. Is qjail the recommended way nowadays? What about qjail vs. ezjail?

I am not familiar with FreeBSD jail management yet, but I am actually looking into converting from Debian with OpenVZ to FreeBSD with jails to run some virtual servers.


----------

