# How change the size of the volume (FBSD4.2) without losing data



## NeverSummer (Feb 3, 2009)

Please advise - There is virtual machine (under WMvare 6.5) with FreeBSD 4.2 (don't ask why it is so old). And now the volume /dev/ad0s1a (capacity 103%) is over  . Whether are there methods to increase the size of partion without losing data?


----------



## graudeejs (Feb 3, 2009)

backup, reparation, format, restore
https://forums.freebsd.org/showthread.php?t=185.

I suppose you have virtual disk image. If i was you, i would make another disk image (with more space if necessary), portion it, make labels, format.  and then simply use dump/restore


let's say you want to dump /dev/ad1s1a to new /dev/ad2s1a
mount new slice to some path, cd to it and 
*dump -0Lauf - /dev/ad1s1a | restore -rf -*
this will basically move files from one disk to another.
you might need some /tmp space


you will need to repeat this for all partitions

there are also other options.
but using this you will have 2 virtual disks with same data.
If anything fails you still got original disk, if all works well (as it should), remove disk 1 and keep using disk 2.

if you can boot etc.... you car finally delete original disk


i suggest dump/restore because that will ensure you keep owner/group permission.


----------



## graudeejs (Feb 3, 2009)

if you don't want to use extra virtual disk, you will need to backup all or some partitions, repartition them, and restore from backups....

basically everything leads to almost the same.


----------



## graudeejs (Feb 3, 2009)

ups double post the same


----------



## NeverSummer (Feb 3, 2009)

Thanx a lot


----------

