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/migration
Enable the SMB Client Service
# svcadm enable svc:/network/smb/client:default
Mount 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 2011
OR
# cat /etc/mnttab | grep winfileserver //ALLANGLESIT;administrator@winfileserver/share /mnt/migration smbfs rw,intr,acl,xattr,dev=8d40002 1306349654
View the Remote Data Locally
# ls /mnt/migration/ data1 data2
Rsync 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
I have added updates to include:
1) Mounting the source data read only to prevent accidental deletion or overwrites.
2) Using the –delete-during tag to delete data on the receiving end which no longer exists on the source, for use with multiple rsyncs.
-matt
Why not mount the Solaris published CIFS Share on the Windows fileserver, then use Robocopy with the /mir option to clone all aspects of the Windows files (permissions, attributes, ownerships etc. etc. also, everything) from Windows to Solaris.
If the Solaris machine is part of Active Directory and the whole user-mapping story is configures correctly, then you have a perfect migration. Nothing gets lost.
Maybe i’m overlooking something but that’s how i do it on other Active Directory integrated NAS Solutions (NetApp, BlueArc, whatever CIFS).
Doing it from the windows fileserver perspective has major advantages because Robocopy (a Microsoft command-line tool) retains everything.
Hi Steven,
I didn’t do it that way because I simply hadn’t thought of it. It sure sounds like that might be a better way of doing it. I will do some testing of my own since and write it up if necessary.
-matt