# ZFS + mfsBSD + dump restore



## xy16644 (Jun 24, 2012)

Today I thought I would start having a look at ZFS on a mirrored root. I downloaded mfsBSD 9.0-RELEASE i386 special edition and burnt it to a bootable DVD. I then ran `# zfsinstall -r mirror -d ada0 -d ada1 /cdrom/9.0-RELEASE-i386.tar.xz -s 4G -c`

This ran great and set up my two drives in a mirrored configuration with ZFS and a 4GB swapfile. There are just two things I am unsure of:

If I run `# zpool status` it shows that the pool name is "tank" but if I am in the root and do an `# ls` it doesn't show up there? In the past when I have experimented with ZFS (not on root though) and I create a pool called "tank" I can see it off the root (ie: /tank). Is it handled differently on a root drive?

Now that I have created a mirrored root drive with ZFS I would like to restore an existing system to it. I have this system in a dump file that I created with dump. What are the steps I should use to restore the system from a dump file (that I have on a USB key) to the mirrored ZFS root drive? Is this possible? I tried booting into single user mode with the mfsBSD DVD but I can't see the root pool.
Thank you! :e


----------



## idownes (Jun 25, 2012)

Assuming you haven't rebooted you'll be running mfsBSD from the memory disk and the tank pool will either not be mounted or it'll be mounted under a temporary alternate root.

Check `# zpool get altroot tank` and `# zfs get mountpoint tank`.


----------



## xy16644 (Jun 25, 2012)

I had rebooted. After I had run the zfsinstall command I removed the DVD from the drive and rebooted. I was then running FreeBSD 9 from the mirrored ZFS drives.


----------



## idownes (Jun 25, 2012)

By default zfs will mount the zpool at /<name> but in your case it'll be mount to /. For example, I have the following:

```
zfs get mountpoint zroot
NAME   PROPERTY    VALUE       SOURCE
zroot  mountpoint  /           local
```


----------



## xy16644 (Jun 25, 2012)

idownes said:
			
		

> By default zfs will mount the zpool at /<name> but in your case it'll be mount to /. For example, I have the following:
> 
> ```
> zfs get mountpoint zroot
> ...



Aaah, thanks. That makes sense.

Can anyone comment on restoring a dump file to a ZFS root?


----------



## tingo (Jun 27, 2012)

Wouldn't you just use the restore(8) command like normal?


----------



## xy16644 (Jun 27, 2012)

That*'*s what I thought but once I booted into the shell from the DVD I wasn't sure where to restore to. Usually I mount my USB drive (which contains the dump file) and then run [cmd=]restore -rf /media/restore.dump[/cmd] and then I edit my /etc/fstab:

```
/dev/label/MirrorSwap               none            swap    sw              0       0
/dev/ufs/MirrorRootFS               /               ufs     rw              1       1
```
but this obviously changes having ZFS now as the filesystem.


----------



## tingo (Jun 27, 2012)

Well, it is still:

figure out where the mountpoint is
`# cd /mountpoint`
restore


----------

