# Transferring FreeBSD to a new drive - ZFS question



## ilemur (Mar 12, 2012)

I have a FBSD FreeBSD 9 system with a root which *I* would like to transfer to another - larger disk - putting up a fresh FBSD FreeBSD install and transfering some of the /etc and /usr/local/etc configuration files.

Within this system *I* have two zfs pools. And one is especially important holding around 5TB of data. It is a raid-z which was created with gpart labels on HDDs. Something like the following

```
backupstorage# gpart create -s GPT ad0
backupstorage# gpart add -b 34 -s 1953525101 -i 1 -t freebsd-zfs -l disk0 ad0
backupstorage# gpart show
=>        34  1953525101  da0  GPT  (932G)
          34  1953525101    1  freebsd-zfs  (932G)
```

Second one is a ZFS stripe.

As *I* don't have a spare HDD to backup all of data on the RAID-Z (only most important files are backed up) - what is the easiest way to attach this zpool after *I* reinstall a fresh new FBSD FreeBSD system?


----------



## phoenix (Mar 12, 2012)

`# zpool import -d /dev/gpt <poolname>`
See the man page (zpool(8)) for details.


----------



## ilemur (Mar 12, 2012)

phoenix said:
			
		

> `# zpool import -d /dev/gpt <poolname>`
> See the man page (zpool(8)) for details.



Shall *I* use *zpool export <poolname>* before this or shutting down will be enough?


----------



## phoenix (Mar 12, 2012)

An export is always a good idea, but generally not needed if you do a proper shutdown of the server.


----------



## ilemur (Mar 25, 2012)

ok. Done. Everything went as smooth as it could be. Except for the thing that before my disks used gpt labels and now they are addressed directly


```
pool: storage
 state: ONLINE
 scan: scrub repaired 38.3M in 4h45m with 0 errors on Sat Mar 24 08:15:01 2012
config:

        NAME        STATE     READ WRITE CKSUM
        storage     ONLINE       0     0     0
          raidz1-0  ONLINE       0     0     0
            ada5p1  ONLINE       0     0     0
            ada2p1  ONLINE       0     0     0
            ada1p1  ONLINE       0     0     0
```
Safe to bring them back to gpt labeling? The easiest way to do that?


----------



## phoenix (Mar 25, 2012)

Export the pool.

Then import is with "-d /dev/gpt"


----------

