Ubuntu ZFS replication

Most of you will know that Ubuntu 16.04 will have ZFS merged into the kernel. Despite licensing arguments I see this as a positive move. I recently tested btrfs replication (http://blog.ls-al.com/btrfs-replication/) but being a long time Solaris admin and understanding how easy ZFS makes things I welcome this development. Here is a quick test of ZFS replication between two Ubuntu 16.04 hosts.

Install zfs utils on both hosts.

# apt-get install zfsutils-linux

Quick and dirty create zpools using an image just for the test.

root@u1604b1-m1:~# dd if=/dev/zero of=/tank1.img bs=1G count=1 &> /dev/null
root@u1604b1-m1:~# zpool create tank1 /tank1.img 
root@u1604b1-m1:~# zpool list
NAME    SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
tank1  1008M    50K  1008M         -     0%     0%  1.00x  ONLINE  -

root@u1604b1-m2:~# dd if=/dev/zero of=/tank1.img bs=1G count=1 &> /dev/null
root@u1604b1-m2:~# zpool create tank1 /tank1.img
root@u1604b1-m2:~# zpool list
NAME    SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
tank1  1008M    64K  1008M         -     0%     0%  1.00x  ONLINE  -
root@u1604b1-m2:~# zfs list
NAME    USED  AVAIL  REFER  MOUNTPOINT
tank1    55K   976M    19K  /tank1

Copy a file into the source file system.

root@u1604b1-m1:~# cp /media/sf_E_DRIVE/W.pdf /tank1/
root@u1604b1-m1:~# ls -lh /tank1
total 12M
-rwxr-x--- 1 root root 12M Apr 20 19:22 W.pdf

Take a snapshot.

root@u1604b1-m1:~# zfs snapshot tank1@snapshot1
root@u1604b1-m1:~# zfs list -t snapshot
NAME              USED  AVAIL  REFER  MOUNTPOINT
tank1@snapshot1      0      -  11.2M  -

Verify empty target

root@u1604b1-m2:~# zfs list
NAME    USED  AVAIL  REFER  MOUNTPOINT
tank1    55K   976M    19K  /tank1

root@u1604b1-m2:~# zfs list -t snapshot
no datasets available

Send initial

root@u1604b1-m1:~# zfs send tank1@snapshot1 | ssh root@192.168.2.29 zfs recv tank1
root@192.168.2.29's password: 
cannot receive new filesystem stream: destination 'tank1' exists
must specify -F to overwrite it
warning: cannot send 'tank1@snapshot1': Broken pipe

root@u1604b1-m1:~# zfs send tank1@snapshot1 | ssh root@192.168.2.29 zfs recv -F tank1
root@192.168.2.29's password: 

Check target.

root@u1604b1-m2:~# zfs list -t snapshot
NAME              USED  AVAIL  REFER  MOUNTPOINT
tank1@snapshot1      0      -  11.2M  -
root@u1604b1-m2:~# ls -lh /tank1
total 12M
-rwxr-x--- 1 root root 12M Apr 20 19:22 W.pdf

Lets populate one more file and take a new snapshot.

root@u1604b1-m1:~# cp /media/sf_E_DRIVE/S.pdf /tank1
root@u1604b1-m1:~# zfs snapshot tank1@snapshot2

Incremental send

root@u1604b1-m1:~# zfs send -i tank1@snapshot1 tank1@snapshot2 | ssh root@192.168.2.29 zfs recv tank1
root@192.168.2.29's password: 

Check target

root@u1604b1-m2:~# ls -lh /tank1
total 12M
-rwxr-x--- 1 root root 375K Apr 20 19:27 S.pdf
-rwxr-x--- 1 root root  12M Apr 20 19:22 W.pdf

root@u1604b1-m2:~# zfs list -t snapshot
NAME              USED  AVAIL  REFER  MOUNTPOINT
tank1@snapshot1     9K      -  11.2M  -
tank1@snapshot2      0      -  11.5M  -

Powerline for your terminal on Ubuntu

I noticed on Fedora it is really easy to enable powerline in your terminal. This article explains it well: http://fedoramagazine.org/add-power-terminal-powerline/

On Ubuntu 15.04 it looks like powerline is pretty easy to enable although it did not appear like the tmux or vim powerline plugins are available from regular repos.

Enable powerline in your terminal like this:

# apt-get install powerline fonts-powerline

~ cat .bashrc
[..]
if [ -f `which powerline-daemon` ]; then
  powerline-daemon -q
  POWERLINE_BASH_CONTINUATION=1
  POWERLINE_BASH_SELECT=1
  . /usr/share/powerline/bindings/bash/powerline.sh
fi

Ubuntu On a ZFS Root File System for Ubuntu 15.04

Start Update 03.18.15:
This is untested but I suspect if you are upgrading the kernel to 3.19.0 and you have issues you may need to change to the daily Vivid ppa. In my initial post I used stable and Utopic since Vivid was very new.
End Update 03.18.15:

This is what I did to make an Ubuntu 15.04 virtualbox guest (works for Ubuntu 14.10 also) boot with the ZFS file system.

Previous articles:

Ubuntu On a ZFS Root File System for Ubuntu 14.04

Booting Ubuntu on a ZFS Root File System

SYSTEM REQUIREMENTS
64-bit Ubuntu Live CD. (Not the alternate or 32-bit installer)
AMD64 or EM64T compatible computer. (ie: x86-64)
15GB disk, 2GB memory minimum, Virtualbox
Create new VM. I use bridged networking in case I want to use ssh during the setup.
Start the Ubuntu LiveCD and open a terminal at the desktop. I used the 15.04 64-bit alpha CD.
Control-F1 to first text terminal.

1. Setup repo.

$ sudo -i
# /etc/init.d/lightdm stop
# apt-add-repository --yes ppa:zfs-native/stable

** Change /etc/apt/sources.list.d/… down to trusty. Or utopic possibly. I did not test.

2. Install zfs.

# apt-get update
# apt-get install debootstrap ubuntu-zfs
# dmesg | grep ZFS:
[ 3900.114234] ZFS: Loaded module v0.6.3-4~trusty, ZFS pool version 5000, ZFS filesystem version 5

** takes a long time to compile initial module for 3.16.0-28-generic

3. Install ssh.

Using a ssh terminal makes it easier to copy and paste for both command execution and documentation. However with this bare bones environment at this point openssh might not install very clean. I played with it a little to get at least sshd to run.

# apt-get install ssh
# /etc/init.d/ssh start
# /usr/sbin/sshd

** check with ps if ssh process is running
** edit sshd_config and allow root login
** set root passwd

4. Setup disk partitions.

# fdisk -l
Disk /dev/loop0: 1 GiB, 1103351808 bytes, 2154984 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sda: 15 GiB, 16106127360 bytes, 31457280 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc2c7def9

Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 411647 409600 200M be Solaris boot
/dev/sda2 411648 31457279 31045632 14.8G bf Solaris

5. Format partitions.

# mke2fs -m 0 -L /boot/grub -j /dev/disk/by-id/ata-VBOX_HARDDISK_VBf3c0d5ba-e6881c52-part1
# zpool create -o ashift=9 rpool /dev/disk/by-id/ata-VBOX_HARDDISK_VBf3c0d5ba-e6881c52-part2

6. ZFS Setup and Mountpoints.

# zpool create -o ashift=9 rpool /dev/disk/by-id/ata-VBOX_HARDDISK_VBf3c0d5ba-e6881c52-part2
# zfs create rpool/ROOT
# zfs create rpool/ROOT/ubuntu-1
# zfs umount -a
# zfs set mountpoint=/ rpool/ROOT/ubuntu-1
# zpool set bootfs=rpool/ROOT/ubuntu-1 rpool
# zpool export rpool
# zpool import -d /dev/disk/by-id -R /mnt rpool
# mkdir -p /mnt/boot/grub
# mount /dev/disk/by-id/ata-VBOX_HARDDISK_VBf3c0d5ba-e6881c52-part1 /mnt/boot/grub

7. Install Ubuntu 15.04 on /mnt

# debootstrap vivid /mnt
I: Retrieving Release
...
I: Base system installed successfully.

# cp /etc/hostname /mnt/etc/
# cp /etc/hosts /mnt/etc/
# vi /mnt/etc/fstab
# cat /mnt/etc/fstab
/dev/disk/by-id/ata-VBOX_HARDDISK_VBf3c0d5ba-e6881c52-part1 /boot/grub auto defaults 0 1

# cat /mnt/etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

8. Setup chroot to update and install ubuntu-minimal

# mount --bind /dev /mnt/dev
# mount --bind /proc /mnt/proc
# mount --bind /sys /mnt/sys
# chroot /mnt /bin/bash --login
# locale-gen en_US.UTF-8

# apt-get update
# apt-get install ubuntu-minimal software-properties-common

9. Setup ZOL repo

# apt-add-repository --yes ppa:zfs-native/stable

** leave grub repo off for now.

# cat /etc/apt/sources.list.d/zfs-native-ubuntu-stable-vivid.list
deb http://ppa.launchpad.net/zfs-native/stable/ubuntu trusty main
# deb-src http://ppa.launchpad.net/zfs-native/stable/ubuntu vivid main
# apt-get update
# apt-get install --no-install-recommends linux-image-generic linux-headers-generic

# apt-get install ubuntu-zfs

** skipped grub stuff for this pass

# apt-get install zfs-initramfs
# apt-get dist-upgrade

10. Make sure root has access

# passwd root

11. Test grub

# grub-probe /
bash: grub-probe: command not found

12. Use older patched grub from ZOL project

# apt-add-repository --yes ppa:zfs-native/grub
gpg: keyring `/tmp/tmp5urr4u7g/secring.gpg' created
gpg: keyring `/tmp/tmp5urr4u7g/pubring.gpg' created
gpg: requesting key F6B0FC61 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp5urr4u7g/trustdb.gpg: trustdb created
gpg: key F6B0FC61: public key "Launchpad PPA for Native ZFS for Linux" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK

# cat /etc/apt/sources.list.d/zfs-native-ubuntu-grub-vivid.list
deb http://ppa.launchpad.net/zfs-native/grub/ubuntu raring main

# apt-get install grub2-common grub-pc
Installation finished. No error reported.
/usr/sbin/grub-probe: error: failed to get canonical path of `/dev/ata-VBOX_HARDDISK_VBf3c0d5ba-e6881c52-part2'.

** As you can see grub has issues with dev path.

# ln -s /dev/disk/by-id/ata-VBOX_HARDDISK_VBf3c0d5ba-e6881c52-part2 /dev/ata-VBOX_HARDDISK_VBf3c0d5ba-e6881c52-part2
# apt-get install grub2-common grub-pc

# grub-probe /
zfs
# ls /boot/grub/i386-pc/zfs*
/boot/grub/i386-pc/zfscrypt.mod /boot/grub/i386-pc/zfsinfo.mod /boot/grub/i386-pc/zfs.mod

** Note at the end I show a udev rule that can help work around this path issue.

# update-initramfs -c -k all

# grep "boot=zfs" /boot/grub/grub.cfg
linux /ROOT/ubuntu-1@/boot/vmlinuz-3.16.0-28-generic root=ZFS=rpool/ROOT/ubuntu-1 ro boot=zfs quiet splash $vt_handoff

# grep "boot=zfs" /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash boot=zfs"

# update-grub
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-3.16.0-28-generic
Found initrd image: /boot/initrd.img-3.16.0-28-generic
done

# grub-install $(readlink -f /dev/disk/by-id/ata-VBOX_HARDDISK_VBf3c0d5ba-e6881c52)
Installing for i386-pc platform.
Installation finished. No error reported.

# exit
logout

13. unmount chroot and shutdown

# umount /mnt/boot/grub
# umount /mnt/dev
# umount /mnt/proc
# umount /mnt/sys
# zfs umount -a
# zpool export rpool
# init 0

14. Cleanup and finish
** Create snapshot
** bootup
** install ssh and configure root to login in sshd_config, restart ssh

15. udev rule for grub bug

# cat /etc/udev/rules.d/70-zfs-grub-fix.rules
ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*", ENV{ID_FS_TYPE}=="zfs_member", SYMLINK+="$env{ID_BUS}-$env{ID_SERIAL} $env{ID_BUS}-$env{ID_SERIAL}-part%n"

# /etc/init.d/udev restart

16. install desktop software

# apt-get install ubuntu-desktop

Ubuntu On a ZFS Root File System for Ubuntu 14.04

This is an update post to making an Ubuntu 14.04 (Trusty Tahr) OS work with ZFS root volume. Mostly the instructions remains the same as a previous post so this is a shortened version:

Booting Ubuntu on a ZFS Root File System

Small warning I did this 4 times. It worked the first time but of course I did not document it well the first time and when I tried again I had grub issues.

Step 1:

$ sudo -i
# apt-add-repository --yes ppa:zfs-native/stable

** Don’t need grub ppa as per github instructions???

# apt-get update
# apt-get install debootstrap ubuntu-zfs

** Will take quite a while kernel modules compiles!!

# modprobe zfs
# dmesg | grep ZFS:
[ 1327.346821] ZFS: Loaded module v0.6.2-2~trusty, ZFS pool version 5000, ZFS filesystem version 5

Step 2:

# ls /dev/disk/by-id
ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419
ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419-part1
ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419-part2

# fdisk /dev/disk/by-id/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419

** Make partitions as follow

# fdisk -l /dev/disk/by-id/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419
                                                 Device Boot      Start         End      Blocks   Id  System
/dev/disk/by-id/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419-part1   *        2048      206847      102400   be  Solaris boot
/dev/disk/by-id/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419-part2          206848    16777215     8285184   bf  Solaris

Step 3:

# mke2fs -m 0 -L /boot/grub -j /dev/disk/by-id/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419-part1
# zpool create -o ashift=9 rpool /dev/disk/by-id/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419-part2

# zpool list
NAME    SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
rpool  7.88G   117K  7.87G     0%  1.00x  ONLINE  -

# zfs create rpool/ROOT
# zfs create rpool/ROOT/ubuntu-1
# zfs umount -a
# zfs set mountpoint=/ rpool/ROOT/ubuntu-1
# zpool export rpool

Step 4:

# zpool import -d /dev/disk/by-id -R /mnt rpool
# mkdir -p /mnt/boot/grub
# mount /dev/disk/by-id/scsi-SATA_disk1-part1 /mnt/boot/grub
# debootstrap trusty /mnt

WTF: ** System seems hung. I see on a different terminal there was a messages system restart required. Weird. If you get this after debootstrap you have to redo Step 1 and Step 4.1 then…Is this because of only 2G RAM?

Step 5:

# cp /etc/hostname /mnt/etc/
# cp /etc/hosts /mnt/etc/
# tail -1 /mnt/etc/fstab
/dev/disk/by-id/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419-part1  /boot/grub  auto  defaults  0  1

# mount --bind /dev  /mnt/dev
# mount --bind /proc /mnt/proc
# mount --bind /sys  /mnt/sys
# chroot /mnt /bin/bash --login

# locale-gen en_US.UTF-8
# apt-get update
# apt-get install ubuntu-minimal software-properties-common

# apt-add-repository --yes ppa:zfs-native/stable
# apt-add-repository --yes ppa:zfs-native/grub < - See below note on this command
# apt-get update
# apt-get install --no-install-recommends linux-image-generic linux-headers-generic
# apt-get install ubuntu-zfs
# apt-get install grub2-common grub-pc

Quick note on grub issues.  During the install I had to create soft links since I could not figure out the grub-probe failures.  From memory I think I created soft links as follow and purged grub2-common grub-pc and re-installed:

/dev/disk/by-id/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419 >>>> /dev/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419
/dev/disk/by-id/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419-part1 >>>> /dev/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419-part1
/dev/disk/by-id/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419-part2 >>>> /dev/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419-part2

Update 5.6.14:  After I had time to look at it closer I see my grub issues all came from the fact that there is no trusty grub ppa and the apt-add-repository command above is setting up a trusty repo.  Quickest way to fix this is after the apt-add-repository –yes ppa:zfs-native/grub command fix the file manually to use raring. As follow:

# more /etc/apt/sources.list.d/zfs-native-grub-trusty.list
deb http://ppa.launchpad.net/zfs-native/grub/ubuntu raring main

Now ready to continue on.

# apt-get install zfs-initramfs
# apt-get dist-upgrade
# passwd root

Step 6:

# grub-probe /
zfs
# ls /boot/grub/i386-pc/zfs*
/boot/grub/i386-pc/zfs.mod  /boot/grub/i386-pc/zfsinfo.mod

# update-initramfs -c -k all
update-initramfs: Generating /boot/initrd.img-3.13.0-24-generic

# grep "boot=zfs" /boot/grub/grub.cfg
	linux	/ROOT/ubuntu-1@/boot/vmlinuz-3.13.0-24-generic root=ZFS=rpool/ROOT/ubuntu-1 ro  boot=zfs
		linux	/ROOT/ubuntu-1@/boot/vmlinuz-3.13.0-24-generic root=ZFS=rpool/ROOT/ubuntu-1 ro  boot=zfs

# grep zfs /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="boot=zfs"

# update-grub

# grub-install $(readlink -f /dev/disk/by-id/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419)
Installation finished. No error reported.

# exit

Step 7:

# umount /mnt/boot/grub
# umount /mnt/dev
# umount /mnt/proc
# umount /mnt/sys
# zfs umount -a
# zpool export rpool
# reboot

Post First Reboot:
– Made a VB snapshot of course
– apt-get install ubuntu-desktop
** grub issues again so I remade the link again. Later fixed with the grub ppa repo pointing to raring instead.
– create a user
– install VB Guest Additions

TODO:
– Check into grub issue and having to create soft links. Something to do with grub not following soft links.

Auto Login and Sudo Security Cheat

Sometimes you have a VM that you just don’t care about security.  I do the following to cheat a little on login and sudo.

Update shadow password file will enable tools like gksudo to work.  gksudo is what is used for prompts you get when using System Administration etc…  You don’t have to type your password just hit enter.

It has to be this specific string “U6aMy0wojraho” you set.


# grep rrossouw /etc/shadow
rrossouw:U6aMy0wojraho:15910:0:99999:7:::

Give yourself some sudo privileges.  For instance sudo -s won’t need a password. Use visudo tool to update sudo policies.


# grep rrossouw /etc/sudoers
rrossouw ALL=(ALL) NOPASSWD:ALL

Enable Auto Login: System Settings -> User Accounts -> Unlock -> Authenticate (No need for password now) -> Click Automatic Login

I also disable my screensaver and password lock on the VM since my host has that enabled through an Active Directory policy already.

Virtualbox Guest Additions Linux

If you experience issues with installing the Virtualbox Guest Additions it could be that the build environment, dkms or kernel headers are not installed.

Messages typically look something like the following:

/tmp/vbox.0/Makefile.include.header:97: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR= and run Make again.  Stop

Install the following packages and retry the Guest Additions install:

# apt-get install build-essential dkms linux-headers-generic

Ubuntu root on ZFS upgrading kernels

Update 1:

On a subsequent kernel upgrade to 3.8.0.25 I realized that the zfs modules are getting compiled just fine when the kernel is upgraded.  On Ubuntu 13.04 anyhow.  So all you need to do is fix the grub.cfg file because of the bug mentioned below where “/ROOT/ubuntu-1@” is inserted twice.  Quick fix you could use sed but be careful to verify your temporary file before copying in place:

# sed 's/\/ROOT\/ubuntu-1\/@//g' /boot/grub/grub.cfg > /tmp/grub.cfg
# cp /tmp/grub.cfg /boot/grub/grub.cfg

I left the rest of the initial post below in case I ever need to really boot with a live CD and redo kernel modules from scratch.   Or maybe that would also work for upgrading the zfs modules from git I suppose.

Original post below:

This is a follow on to my running Ubuntu on a ZFS root file system http://blog.ls-al.com/booting-ubuntu-on-a-zfs-root-file-system/ article.  I decided to document how to do a kernel upgrade in this configuration.  It serves two scenarios A) user decided kernel upgrade or B) accidentally upgraded the kernel and now I can’t boot any longer.  I wish I could say I wrote this article in response to number 1 but no it was in response to number 2.

In this case the kernel was upgraded from 3.8.0.19 to 3.8.0.23.

Boot a live cd to start.

Install zfs module:

$ sudo -i
# /etc/init.d/lightdm stop
# apt-add-repository --yes ppa:zfs-native/stable
# apt-get update
# apt-get install debootstrap ubuntu-zfs

# modprobe zfs
# dmesg | grep ZFS:
ZFS: Loaded module v0.6.1-rc14, ZFS pool version 5000, ZFS filesystem version 5

Import pool, mount and chroot:

# zpool import -d /dev/disk/by-id -R /mnt rpool
# mount /dev/disk/by-id/scsi-SATA_VBOX_HARDDISK_VBb59e0ffb-68fb0252-part1 /mnt/boot/grub

# mount --bind /dev /mnt/dev
# mount --bind /proc /mnt/proc
# mount --bind /sys /mnt/sys
# chroot /mnt /bin/bash --login

Distribution Upgrade:

# locale-gen en_US.UTF-8
# apt-get update
# apt-get dist-upgrade

** At this point remove any old kernels manually if you want.

Fix grub:

# grub-probe /
 zfs

# ls /boot/grub/i386-pc/zfs*
 /boot/grub/i386-pc/zfs.mod /boot/grub/i386-pc/zfsinfo.mod

# update-initramfs -c -k all

# update-grub

# grep boot=zfs /boot/grub/grub.cfg

** Currently a bug in the Ubuntu 13.04 grub scripts. Look at boot lines there is a duplicated string /ROOT/ubuntu-1/@/ROOT/ubuntu-1@/ in there.

According to https://github.com/zfsonlinux/zfs/issues/1441 it can be fixed with grub-install below.  That did not work for me though I fixed it manually.

# grub-install $(readlink -f /dev/disk/by-id/scsi-SATA_VBOX_HARDDISK_VBb59e0ffb-68fb0252)
 Installation finished. No error reported.

Unmount and reboot:

# umount /mnt/boot/grub
# umount /mnt/dev
# umount /mnt/proc
# umount /mnt/sys
# zfs umount -a
# zpool export rpool

Nautilus Mount Windows Share

I have successfully used the Gnome Nautilus browser in the past to mount Windows as well as Microsoft DFS shares.

The File > Connect To Server > Windows Share and filling out the form should suffice for a normal server.  For a DFS mount I normally go to Bookmarks > Edit bookmarks and add a short cut:

Name: US
Location: smb://domain.com;rrosso@domain.com/corp/US

This should work fine.  However recently I had issues with this on Ubuntu 12.10 64-bit.  The Nautilus mount kept asking for the password.  If you do have this issue you can try using the command line first:

~$ smbclient \\\\server1\\Docs -U rrosso -W domain <your_password>

or

~$ gvfs-mount smb://server1/Docs

If that does work for you but Nautilus does not you might need to add one or all of the following settings to /etc/samba/smb.conf:

# more /etc/samba/smb.conf
 ...
 [global]
 client use spnego = no
 client lanman auth = yes
 client ntlmv2 auth = no
 ...