# mdconfig doesn't work with exec.prestart.



## Krush206 (Aug 28, 2020)

I've set up a Debian jail on my system. Everything works as should. 
However, when the jail is started, it doesn't attach the virtual disk to a memory disk and no log output is returned. If I attach the virtual disk manually the command is executed successfully (two memory disks).

Here's my jail.conf(5) file:

```
debian {
        host.hostname = debian.jail;
        ip4.addr = lo0|127.0.0.2/32;
        ip4.addr = wlan0|192.168.1.249/32;
        path = /opt/jails/debian;
        linux.osrelease = 4.19.0;
        
        exec.prestart = "mdconfig /home/debian.img";
        exec.start = "/etc/init.d/rc 3";
        exec.stop = "/etc/init.d/rc 0";
        persist;

        mount.devfs;
        mount.fstab = /etc/fstab.debian;

        allow.mount;
        allow.mount.devfs;
}
```

I'm using the latest release of FreeBSD, 12.1. I've tried everything possible to get it working. Is this likely to be a bug within jail.conf(5) and jail(8)?


----------



## Krush206 (Aug 28, 2020)

Apparently, the _mount_ parameters are run first before _exec.prestart_.

I've managed to get it to work by erasing the _mount_ parameters and using _exec.prestart_ to mount the file systems as well as the virtual disk.

```
exec.prestart = "mdmfs -T ext2fs -PF /home/debian.img 0 ${path} ; mount -aF /etc/fstab.debian";
```


----------

