Currently I have been working on a method of migrating some of our data from Windows file servers to Solaris ZFS CIFS servers, of course trying to retain as much feature parity as possible. Permissions are an issue, however I have worked through most of those issues (look for this article in the future), now it is time to migrate data from Windows onto ZFS. This first crack will be about 1TB of data. Enter rsync. The “easiest” way to do this would be to use a Linux box in the middle to mount both the Solaris CIFS share and with Windows CIFS share and perform the rsync from there. A far more efficient way would be to mount the Windows CIFS share on the Solaris box or vice versa and perform the rsync between the two boxes. This article will document how to mount a Windows CIFS file share onto the local file system of the Solaris 11 Express box.
Make the Migration Directory
mkdir /mnt/migrationEnable the SMB Client Service
svcadm enable svc:/network/smb/client:defaultMount the Remote Windows Share in the Local Directory
mount -F smbfs "//ALLANGLESIT;administrator@winfileserver/share" /mnt/migration/
Password:A better way would be to mount the data on your production server as read only in case of any syntax issues.
mount -F smbfs -o ro "//ALLANGLESIT;administrator@winfileserver/share" /mnt/migration/
Password:Verify the Mount
mount | grep winfileserver
/mnt/migration on //ALLANGLESIT;administrator@winfileserver/share remote/read/write/setuid/devices/rstchown/intr/acl/xattr/dev=8d40002 on Wed May 25 11:54:14 2011OR
cat /etc/mnttab | grep winfileserver
//ALLANGLESIT;administrator@winfileserver/share /mnt/migration smbfs rw,intr,acl,xattr,dev=8d40002 1306349654View the Remote Data Locally
ls /mnt/migration/
data1 data2Rsync the Data
Above I mentioned this is for the purpose of migrating data from Windows CIFS to Solaris CIFS, of course I would be remiss not to mention the command I use to perform the rsync. However this is not the purpose of this article, so you are on your own for the proper switches for your environment. This will perform a recursive sync, no acls or anything are carried over just the files and the timestamps. I will be reapplying the appropriate permissions once they land.
rysnc -rt --modify-window=1 /mnt/migration/data1 /tank/cifs/share1/If you are performing a migration which will require the use of “incremental” rsyncs you will most likely want to use the –delete-during option so that non-existent data will be deleted on the receiving end. This is most common when you have a file deleted or renamed on the original location between your rsyncs.
rysnc -recursive --times --delete-during --modify-window=1 /mnt/migration/data1 /tank/cifs/share1/Unmount the Mounted File System
umount /mnt/migration