Bering-uClibc 4.x - User Guide - Advanced Topics - Setting Up a File Server
Advanced Topics - Setting Up a File Server | ||
---|---|---|
Prev | Bering-uClibc 4.x - User Guide | Next |
This material copied directly from http://leaf.sourceforge.net/doc/bucu-nas.html - needs to be checked/updated for Bering-uClibc 4.x!
Davidmbrooke 21:01, 16 November 2010 (UTC)
Contents
Introduction
This Howto provides a description about the packages and configurations to use Bering-uClibc 4.x as a NAS (Network-Attached Storage) and/or SAN (Storage Area Network) solution.
To be ready for this special usage, Bering-uClibc versions 3.0 and above have DMA enabled by default when available. This will speedup harddisk performance considerably.
Requirements
Base packages
The following basic packages are recommended to build a NAS or SAN solution:
hdsupp.lrp to setup and maintain harddisks
|
hdspind.lrp and hddma.lrp with some helper scripts.
|
|
|
hdsupp.lrp
currently contains the following programs: badblocks, e2fsck, e2label, fdisk, hdparm, syslinux, tune2fs, dosfsck, mke2fs, mkdosfs, mkfs.ext2, mkfs.ext3, mkfs. msdos, mkfs.vfat, mkswap, swapoff, swapon, fsck, fsck.ext2, fsck.ext3, fsck.msdos, fsck.vfat and losetup.
hdspindn.lrp
is a simple script package which put the harddisk(s) in standby mode using hdparm which is available in the hdsupp package.
hddma.lrp
is a simple script package which forces harddisk(s) in dma mode when it's not automatically recognised or a when a specific controller kernel module is necessary. hddma.lrp
also uses the hdparm program from the hdsupp package.
Configuring a NAS solution
The configuration procedure for a NAS server depends on which file sharing protocols will be used. With Bering-uClibc 4.x the supported protocols are:
- CIFS, also known as SMB, typically used by Microsoft Windows client machines.
- NFS, typically used by UNIX / Linux client machines.
- FTP
CIFS/SMB
Packages for CIFS/SMB
Package samba.lrp
(or samba22.lrp
) is required for CIFS/SMB support.
The standard samba package is based on samba version 2.0.10a, is small and will do in most cases. The samba22 package is based on samba version 2.2.12, which has more options, but is also much bigger.
Firewall Settings for CIFS/SMB
SMB uses TCP ports 137 and 139 and UDP ports 137 and 138. Direct hosted "netbios less" SMB traffic uses port 445 UDP and TCP (Samba22 only)
NFS
Note: NFS Server support is currently under development and not included in Bering-uClibc 4.0 Beta1 !
Packages and Modules for NFS
NFS support is a little more complicated than the other protocols:
- Most of the "work" is done by the Linux kernel, specifically kernel Module
nfsd.ko
(not to be confused withnfs.ko
which implements NFS client functionality.) - The kernel code is accessed via a set of user-space helper programs. These are provided by the
nfsutils.lrp
Package.- One of these helper programs,
rpc.idmapd
, relies on/usr/lib/libnfsidmap.so
from separate Packagelibnfsidmap.lrp
.
- One of these helper programs,
- NFS protocol versions 2 and 3 rely on the ONCRPC "port mapper" daemon which is provided by the separate Package
portmap.lrp
.- The port mapper is not required when supporting NFS protocol version 4 only.
Firewall Settings for NFS
NFSv4 uses only TCP port 2049.
NFSv3 uses:
- UDP port 111 for the port mapper daemon.
FTP
Packages for FTP
Package vsftpd.lrp
implements a small and secure FTP daemon.
Firewall Settings for FTP
FTP uses TCP ports 20 and 21 (for passive ftp only port 21 is used).
Configuring a SAN solution
Internet SCSI (iSCSI) is an official standard ratified on February 11, 2003 by the Internet Engineering Task Force that allows the use of the SCSI protocol over TCP/IP networks. iSCSI is a transport layer protocol in the SCSI-3 specifications framework. An iSCSI target is the server piece of an iSCSI SAN. The client piece/driver is called "initiator".
The iSCSI protocol uses TCP/IP for its data transfer. Unlike other network storage protocols, such as Fibre Channel (which is the foundation of most SANs), it requires only the simple and ubiquitous Ethernet interface (or any other TCP/IP-capable network) to operate. This enables low-cost centralization of storage without all of the usual expense and incompatibility normally associated with Fibre Channel storage area networks.
The SAN solution uses iSCSI extensively and recommends:
iscsid.lrp - an iscsi target daemon.
|
The iscsi target daemon can be used, together with an iscsi initiator on a host, as a SAN solution. The iscsi target daemon supports block devices, regular files, LVM and RAID. It uses the following kernel modules which are available in the kernel tarball: iscsi_trgt.o
and fileio.o
.
Configuration
An example iscsi target configuration (more information in the ietd.conf file) where the block device /dev/hdc is used:
############################################################ User joe secret # Targets definitions start with "Target" and the target name. # The target name must be a globally unique name, the iSCSI # standard defines the "iSCSI Qualified Name" as follows: # # iqn.yyyy-mm.<reversed domain name>[:identifier] # # "yyyy-mm" is the date at which the domain is valid and the identifier # is freely selectable. For further details please check the iSCSI spec. Target iqn.2006-08.network.private:storage.disk1 # Users, who can access this target # (no users means anyone can access the target) User joe secret # Lun definition Lun 0 /dev/hdc fileio ############################################################
To use a regular file, it first has to be created on the target disk with dd (this example assumes you mounted the harddisk under /home):
dd if=/dev/zero of=/home/nas.img bs=4k count=<some very big number>
Where the resulting size is count*bs.
The Lun definition would look like this:
Lun 0 /home/nas.img fileio
Firewall settings
If you run a firewall on the SAN box, you need to open tcp port 3260.
Links
Some iscsi clients (initiators): Windows:
http://www.microsoft.com/windowsserver2003/technologies/storage/iscsi/default.mspx
Linux:
http://unh-iscsi.sourceforge.net
http://linux-iscsi.sourceforge.net
Other iscsi links:
http://cuddletech.com/articles/iscsi/index.html
Additional information:
Network Attached Storage on wikipedia
Prev | Up | Next |