# Moving Host to a new SSD



## Sebastian (Feb 15, 2017)

Hello, 

my Host System has only a very small SSD 32GB and it is nearly full. I'm thinking about to migrate to a bigger one, but I don't want to reinstall my host. 

My first thought was to use dd and than try to resize the partition afterwards. I did this on my raspberrypi and it worked well  , but it there I'm running linux I and I don't know if I can do this on freebsd as well. 

The second thought was to do a snapshot and install that snapshot on my new ssd. This sounds really cool ;-) , but I until now I only used zfs snapshots as a rollback point. 

Does anyone has tried any of my solutions ? If you have a better one, please share it !


----------



## abishai (Feb 15, 2017)

If you are on ZFS, you can use `zfs send` / `zfs receive` to send your datasets. I did that to send FreeBSD from my laptop to another one.
http://128bitstudios.com/2010/07/23/fun-with-zfs-send-and-receive/
Just don't forget to install bootcode with `gpart bootcode`


----------



## ANOKNUSA (Feb 15, 2017)

You shouldn't use dd(8) to clone a system to an SSD, since it interferes with TRIM. To add to what abishai said, my tool of choice is sysutils/zxfer, a shell script that turns `zfs send` and `zfs recv` into something a bit like rsync. As the simplest example, suppose you have two pools, *oldpool* and *newpool*. Running `zxfer -FPdv -R oldpool/ newpool` would copy all the contents of the source pool onto the destination pool with snapshots intact. If any of the properties in the new pool conflict with those of the datasets being copied, the properties of the destination pool will override those in the copied datasets. All other properties will remain intact. There's a flag you can use to change that behavior and copy all properties with the dataset if needed.


----------



## wblock@ (Feb 16, 2017)

About transferring UFS: Backup Options For FreeBSD.

It should also be possible to use restore(8) to ZFS.


----------



## TheDreamer (Feb 20, 2017)

If it is possible to attach both SSDs to the system, you could temporarily create a mirrored zpool by using `zpool attach <pool> <olddev> <newdev>`  Wait for resilvering to complete, and then `zpool detach <pool> <olddev>`.  I did this once to upgrade the only drive in machine (with only two drive slots) from 250GB to a pair of 500GB drives (an old disk array using 500GB drives had been decommissioned...)  It turned out later to be a bad move, as that old array was using SATA-I (1.5Gbps) 500GB drives. 

The Dreamer


----------

