# replacing my NAS drives



## canistel (Jun 7, 2013)

I have a freebsd FreeBSD 9.0 NAS setup, but I'm a bit of a freebsd FreeBSD newbie, I only have experience with this NAS and I did that a long time ago and haven't touched it since.

Basically, because my drives are full, I want to replace the four 1 TB drives that I have now, with four new 2 TB drives. 

Each drive is setup set up the same way, three partitions. 
Partition 1 = freebsd-boot (64K)
Partition 2 = freebsd-swap (2.0 G)
Partition 3 = freebsd-zfs  (929 G)

The zfs array is striped-mirrors (like RAID10). My idea is to replace one drive at a time, allowing the zfs array to rebuild after each drive has been replaced with the new bigger drive. I have already looked on the net and configured the zfs array to autoexpand, but after that I'm getting in over my head.

Each (or possibly just one?) drive contains the boot loader, but where is my root/boot drive? Think I might have done zfs-on-root, does that make sense? It must be zfs-on-root because my /etc/fstab is empty?

I know the basic steps, insert new drive, create three partitions (first two identical in size to my current setup), third partition is then the remaining drive size, but how do I copy everything over from the old drive to the new drive? 

Can I just physically unplug a drive while the machine is running, then detect what drive name (adaX) went down? Have no idea now which drive in the machine is which label in freebsd FreeBSD (though I think I would have been smart enough to order them in some fashion).

Running `mount`, I get this

```
tank on / (zfs, local, nfsv4acls)
devfs on /dev (devfs, local, multilabel)
tank/z on /z (zfs, local, nfsv4acls)
```

Running `zpool status`, I get this:


```
pool: tank
state: ONLINE
scan: none requested
config:

NAME            STATE            READ      WRITE      CKSUM
tank            ONLINE              0          0          0
   mirror-0     ONLINE              0          0          0
      ada0p3    ONLINE              0          0          0
      ada2p3    ONLINE              0          0          0
   mirror-1     ONLINE              0          0          0
      ada1p3    ONLINE              0          0          0
      ada3p3    ONLINE              0          0          0

errors: No known data errors
```

Any tips, comments, instructions, insults?


----------



## bluetick (Jun 8, 2013)

I may be wrong and often I am, but I do not think it will work this way. As far as I know, there is not a grow function for the zfs file system. If you have a expansion slot, drop in a cheap RAID card. Make a new raidz pool, transfer data from the old pool. I would not run the OS and data pool on the same disks.


----------



## tingo (Jun 8, 2013)

But ZFS has autoexpand...

```
tingo@kg-f5$ zpool get all z5 | grep autoexp
z5    autoexpand     on                     local
```
Also, read this post.
HTH


----------



## canistel (Jun 8, 2013)

Thanks guys for your help. I did more searching and found this page, so that should help me out a little more too. https://www.dan.me.uk/blog/2012/11/14/increase-capacity-of-freebsd-zfs-array-by-replacing-disks/


----------

