Welcome!

Linux Authors: Gilad Parann-Nissany, Maureen O'Gara, Glenn Rossman, Hovhannes Avoyan, RealWire News Distribution

Related Topics: Linux

Linux: Article

Migrating File and Print Services from Windows to Linux

An overview

Most organizations provide their users with the ability to print, store, and access files on network servers. Accessing and saving files to network drives and printing to shared network printers is probably something administrators don't spend much time thinking about unless it's to help users install print drivers or assist them in accessing shared network directories.

If your organization has moved to Linux in the data center (or in some of your business workgroups), migrating Windows file and print services to Linux is a good next step. Obviously, before embarking on a migration, you'll want to make sure your technical staff has the necessary skills to implement and maintain file and print services in a Linux environment. For any migration, consider professional consulting and training options. Oftentimes, the money spent on consulting and training outweighs the man-hours and productivity costs of a migration gone to hell.

As a preamble, let's briefly make a case for migrating file and print services to Linux. According to a PC Magazine lab test, Linux print serving provides up to 60% better throughput than printing under Windows and that, from a performance perspective, Linux has more than 100% better average response time than printing under Windows. According to an IT Week lab test, Linux running Samba was twice as fast as a Windows 2000 Server and 2.5 times faster than Windows 2003. An IBM study of a corporation with 1,100 users (and 140 file and print servers) realized a 59% cost savings migrating from Windows NT to Linux. Of particular interest in this study was the 16:1 ratio of Windows servers to server administrators. According to a study done by Robert Francis Group, that ratio on Linux servers is as high as 44:1 ("Total Cost of Ownership for Linux Web Servers in the Enterprise" September 2002, Robert Francis Group). Though this is compelling information, it's only fair to mention other testers and analysts have documented vastly different test and research results.

Moving Files from Windows Using Samba
The easiest way to transfer files from Windows to Linux is via Samba. Samba is an open source implementation of the SMB protocol that runs on Linux and Unix (renamed by Microsoft to Common Internet File System [CIFS]). The CIFS protocol is the foundation of Windows networking. Running Samba as a file and print server allows Windows clients (Windows 9x, NT, 2000, and XP) to print and access shared network resources. Most Linux distributions include the Samba client, which is all that is necessary to browse Windows shares.

One of your first tasks should be setting up a location for storing files, usually in a location that normal users don't have rights to edit. You can complete this file transfer via the command line or by using the graphical tools built in to your Linux distribution, such as Nautilus or Konqueror. Due to space limitations and the fact that the GUI is different depending on the Linux distribution, I'll focus on the command line.

Open up a terminal and then type "su" to become root. Now, create a folder to keep your hosted files, with the command "mkdir /srv/samba". You can use the tool smbclient to copy files, but I find that smbmount is easier for large file transfers. Make a new mount point for the original share, "mkdir ~/smbmount", and then mount with "smbmount //server/share ~/smbmount" (where //server/share is the original Windows server and share name). Now, copy the directory (and all subdirectories) with "cp -r ~/smbmount /srv/samba/share" (where share is the name of the share point). This will take a while, and provides no feedback to the user, so be patient (one of the drawbacks of using command line tools is little or no user feedback). Once the copy finishes, you can unmount the original share with "smbumount ~/smbmount", and repeat the process for all share points you are migrating.

Restore Equivalent Rights and Ownership
After the files are transferred, file permissions will need to be reset. Linux file system permissions are different from those used by Microsoft Windows systems and are not as granular. This is particularly apparent for directories where multiple groups have access to the data within a file. On Linux file systems, this is not possible. You will need to find an alternate method to ensure that the proper permissions are set for transferred files. Linux file systems keep track of permissions for user, group, and other. Permissions include read (r), write (w), and execute (x). A dash in the rights notation usually means that the permission is not set.

Consider the permissions in Table 1 as a starting point.

Configure the Samba Server
To configure Samba, you can use one of numerous graphical tools (such as Webmin, SWAT, YaST, and GNOME System Tools) depending on your distribution, but due to space constraints, I'll talk about the one thing that is consistent: manual editing of the smb.conf file.

As root, open up smb.conf with your favorite text editor. The path will most likely be /etc/smb.conf or /etc/samba/smb.conf. The format of the file is an INI file, which is hopefully familiar to Windows users.

Your distribution has most likely configured some of smb.conf for you. The most important section is the "globals" section, which should look something like:

[global]
netbiosname=SERVER
server string=A Samba Server
workgroup=WORKGROUP
security=DOMAIN

Where "netbios name" is the name of the server (if there is no such value, the default is the host name of the server), "server string" is the description string that also shows up in Windows Explorer, and "workgroup" is the workgroup or domain the machine is part of, and "security" specifies whether to authenticate via a Windows Domain or against local users. (Note that even in a domain environment, you still use the "workgroup" value to set the domain name.)

To add a share, you need only add a new INI section to smb.conf. Here is an example:

[share]
path=/srv/samba/share
browseable=yes
public=yes
writable=no

where [share] specifies the name of the sharepoint and /srv/samba/share is the server directory to share. The value "browseable" allows user to browse via Windows Explorer, "public" allows even anonymous users to access the share, and "writable' controls share-level security. You should configure these settings as appropriate. The complete description of this file is available online, or via "man smb.conf".

Setting Up Linux Printing Using CUPS
Setting up printing on Linux is best considered a configuration, not a migration; you will need to re-create the Windows printing environment on Linux rather than porting the printing environment from one system to the other. Most Linux distributions install CUPS (Common UNIX Printing System), a UNIX-based standard for printing that is also used for printing under Linux. The CUPS Linux print server uses the Internet Printing Protocol (IPP) to manage print jobs. CUPS provides network printer browsing and PostScript printer-based options for Linux. The LPD, SMB, and AppSoctket/JetDirect protocols are supported.

More Stories By Jon Walker

Jon Walker serves as CTO of Versora, an ISV providing Microsoft to Linux migration software. Mr. Walker recently has co-authored 2 whitepapers with Novell titled Migrating from IS Web Servers to Apache SUSE LINUX Enterprise Server 9.0 and Migrating File and Print Servers from Windows to SUSE LINUX Enterprise Server 9. Prior to Versora, Mr. Walker was CTO/VP of Engineering for Miramar Systems. Software developed under his direction at Miramar has been deployed to over 20 million computers worldwide. Mr. Walker has also served as senior technologist for Nortel and Xing Technology (now Real Networks).

Comments (1) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
Jon Walker 07/13/05 08:11:16 PM EDT

Most organizations provide their users with the ability to print, store, and access files on network servers. Accessing and saving files to network drives and printing to shared network printers is probably something administrators don't spend much time thinking about unless it's to help users install print drivers or assist them in accessing shared network directories. If your organization has moved to Linux in the data center (or in some of your business workgroups), migrating Windows file and print services to Linux is a good next step. Obviously, before embarking on a migration, you'll want to make sure your technical staff has the necessary skills to implement and maintain file and print services in a Linux environment. For any migration, consider professional consulting and training options. Oftentimes, the money spent on consulting and training outweighs the man-hours and productivity costs of a migration gone to hell. As a preamble, let's briefly make a case for migrating file and print services to Linux. According to a PC Magazine lab test, Linux print serving provides up to 60% better throughput than printing under Windows and that, from a performance perspective, Linux has more than 100% better average response time than printing under Windows.