# How to grow jail.1.img



## ustuntas (Jul 3, 2009)

Hi all,

I use the jail with memdisk. But, memdisk size is not sufficient
now. How can i grow this memdisk size that it is not destroying
the data in the memdisk jail.1.img 


```
# mdconfig -a -t vnode -f /jail/images/jail.1.img -u 0
# mount /dev/md0c /jail/jail.1
```


Regards,

Murat USTUNTAS


----------



## danger@ (Jul 3, 2009)

create another one with the size that's sufficient for you and copy the  contents of the original one there and destroy the old image.


----------



## ustuntas (Jul 3, 2009)

Ok,

But is there another way to grow. Because, this image size very high and there is no space making new size like that size. 
This image size 32Gb but I have a 16Gb on disk for growing this
image.


----------



## danger@ (Jul 3, 2009)

Check growfs(8), however I am not sure whether it will help you.


----------



## vermaden (Jul 3, 2009)

ustuntas said:
			
		

> Ok,
> 
> But is there another way to grow. Because, this image size very high and there is no space making new size like that size.
> This image size 32Gb but I have a 16Gb on disk for growing this
> image.



Test this method on some smaller test image:
1. you have your current image *test.img*
2. add needed space by *dd(1)* like that:
`#  dd < /dev/zero >> test.img bs=1m count=${COUNT}`
where you add ${COUNT} megabytes of space.
3. user *growfs(1)* to grow the filesystem on the *test.img*
4. *mount(1)* it and test if it works


----------



## ustuntas (Jul 3, 2009)

I want to grow this memdisk from 32GB to 40GB. 
When growing the /dev/md0c with the command says me;


```
# growfs -s 40610630 /dev/md0c
growfs: /dev/md0c: Operation not permitted
```

I assume that something wrong. 

Any idea please. Or what am i doing something wrong?


----------



## vermaden (Jul 3, 2009)

@ustuntas

Try with md0 itself:

`#  growfs /dev/md0`


----------



## ustuntas (Jul 10, 2009)

I write like,

`#  growfs -s 4194304 /dev/md0`
and os says me;

```
growfs: we are not growing (4194304->1048576)
```
in the man page of growfs; -s parameter in sectors.
How can i calculate the correct sector size for growing? 
My problem is still same .


----------

