Discover millions of ebooks, audiobooks, and so much more with a free trial

Only €10,99/month after trial. Cancel anytime.

Learning FreeNAS
Learning FreeNAS
Learning FreeNAS
Ebook530 pages4 hours

Learning FreeNAS

Rating: 3.5 out of 5 stars

3.5/5

()

Read preview

About this ebook

In Detail

FreeNAS is free software that turns a PC into a Network Attached Storage (NAS) server. It supports client connections from Microsoft Windows, Apple OS X, Linux, and FreeBSD. It has a web interface for administration and includes support for RAID (0, 1, 5), iSCSI, drive encryption, and UPnP. Based on FreeBSD, it has modest system requirements but is scalable for the enterprise.

This book will show you how to work with FreeNAS and set it up for your needs. You will learn how to configure and administer a FreeNAS server in a variety of networking scenarios. You will also learn how to plan and implement RAID on the server as well as how to use Storage Area Network technologies like iSCSI. The standard FreeNAS documentation walks you through the basic configuration, but this book will tell you exactly what you should do to plan, work, and deploy FreeNAS. This book has a comprehensive troubleshooting section that will point you in the right direction whenever you need help.

This book is a comprehensive guide to building and using resilient network-attached storage solutions for your business using FreeNAS. Written in an accessible style and filled with facts you need to know, this book will show you how to get things done the right way.

Approach

This book has been written from the system administrator's perspective, tackling the topics that will be most important to help you understand FreeNAS, and get it set up as securely and quickly as possible. You will just see how to get the job done.

Who this book is for

This book is for systems administrators who want a low cost, simple way to provide large amounts of network-attached storage. It does not assume knowledge of BSD, and will work for people using FreeNAS in any network environment.

LanguageEnglish
Release dateAug 22, 2008
ISBN9781847194695
Learning FreeNAS

Related to Learning FreeNAS

Related ebooks

Information Technology For You

View More

Related articles

Reviews for Learning FreeNAS

Rating: 3.5 out of 5 stars
3.5/5

1 rating0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Learning FreeNAS - Gary Sims

    (missing alt)

    Table of Contents

    Learning FreeNAS

    Credits

    About the Author

    About the Reviewer

    Preface

    What This Book Covers

    What You Need for This Book

    Conventions

    Reader Feedback

    Customer Support

    Errata

    Piracy

    Questions

    1. All About NAS and FreeNAS

    Network Attached Storage

    What is FreeNAS?

    Features

    What Does FreeNAS Do for Me and My Business?

    How FreeNAS Meet These Needs

    Practical Uses for the FreeNAS Server

    Consolidation

    Summary

    2. Preparing to Add FreeNAS to Your Network

    Planning Your NAS

    Capacity Planning

    Choosing Your Hardware

    CPU

    Disks

    Buses

    Drives

    Multiple Disk Drives

    Memory, Network Card, PCI, and USB

    Planning for Backup

    What is RAID? And, Do I Need It?

    Hardware or Software RAID

    Network Considerations

    Switch or Hub?

    What About Wireless?

    Summary

    3. Exploring FreeNAS

    Downloading FreeNAS

    What Hardware Do I Need?

    Warning

    Quick Start Guide For the Impatient

    Burning and Booting

    Configuring

    Sharing with Windows Machines

    Testing the Share

    Detailed Overview of Installation

    Making the FreeNAS CD

    Booting from CD

    Phoenix BIOS

    Phoenix-Award BIOS

    AMI BIOS

    First Look at FreeNAS

    Configuring the Network

    What is a LAN IP Address?

    Basic Configuration

    FreeNAS Web Interface

    System

    Interfaces

    Disks

    Services

    Access

    Status

    Diagnostics

    Advanced

    Adding a Disk

    Accessing the Disk via CIFS

    Testing the Share

    Accessing via FTP

    Testing FTP Access

    Installing to Hard Disk

    Embedded versus Full

    Upgrading FreeNAS from a Previous Version

    Summary

    4. Connecting to the FreeNAS

    Introduction

    Connecting via CIFS

    Configure CIFS on the FreeNAS Server

    CIFS Settings Explained

    CIFS Advanced Settings

    Options when Adding Shares

    What does It Mean to Map a Network Drive?

    Connecting with CIFS via Windows Millennium

    Using CIFS with Windows XP

    FreeNAS, CIFS, and Windows Vista

    Accessing the FreeNAS via CIFS from Linux

    A CIFS Connection from OS X

    FTP

    Using the Command Line FTP Client

    Using a Web Browser for FTP

    NFS

    Using NFS from OS X

    Mount FreeNAS via NFS on Linux

    RSYNCD, Unison, AFP, and UPnP

    Using RSYNC for Backups

    Using Unison for Backups and Synchronization

    Connecting to FreeNAS via AFP

    Streaming Media with UPnP

    iSCSI Target

    Testing the iSCSI Target with Another FreeNAS Server

    Testing the iSCSI Target with Windows Vista

    Accessing Your Files Using HTTP and the Built-In Web Server

    Summary

    5. User and System Administration

    Introduction

    Local User Management

    Using CIFS with Local Users

    FTP and User Login

    Authenticating AFP Users

    Connect to the FreeNAS Server via SSH

    Services that Don't Use Local User Accounts

    Using FreeNAS with the Microsoft Active Directory

    System Admin

    How to Change the Web GUI User Name and Password

    Rebooting and Shutting Down

    How to Set the Hostname of the Server

    Configuring the Web Interface to use HTTPS

    Changing the Web Interface Port

    How to Set a DNS Server

    How to Set the Language for the Web Interface

    Date and Time Configuration

    How to Disable Console Menu

    How to Stop the Startup and Shutdown Beeps

    Adding Predefined Network Hosts

    Reset the Server to the Factory Defaults

    Simple Network Administration

    Disabling Bonjour/ZeroConf

    Getting Status Information About the Server

    Sending Status Report by Email

    Summary

    6. Configuring Storage

    Introduction

    How FreeNAS Handles Data Disks

    UNIX Device Names

    Adding the Disk

    Formatting a Newly Added Disk

    Mounting Your Newly Formatted Disks

    Making the New Disk Available on the Network

    Configuring Software RAID on FreeNAS

    RAID All Starts with Adding the Disks

    Configuring RAID 1

    Configuring RAID 5

    Configuring JBOD or RAID 0

    Nested RAID Configurations

    Configuring RAID 1+0

    Configuring RAID 0+1

    Configuring RAID 5+0

    Configuring RAID 5+1

    RAID 10+0 and Beyond

    iSCSI Initiator

    Summary

    7. Backup Strategies

    Backup Your FreeNAS Using Windows XP's Built-In Backup Utility

    Setting Scheduled Backups with XP's Built-In Backup Utility

    Restoring a FreeNAS Backup Made with XP's Built-In Backup Utility

    Backing Up the FreeNAS Configuration Files

    Backup Configuration

    What is XML?

    Restore Configuration

    Using Another FreeNAS Server as a Backup Server

    Debugging Your RSYNC Setup

    RSYNC Internal Backup

    Debugging Your Internal RSYNC Setup

    Mirroring vs Conventional Backups

    Summary

    8. Advanced System Configuration

    Disk Encryption

    Encrypting a Disk in FreeNAS

    Entering the Password When You Reboot

    Encryption Tools

    How to Unlock an Encrypted Disk—Attach and Detach

    How to Change the Password on an Encrypted Disk—setkey

    Checking the Status of an Encrypted Disk—list and status

    Advanced Hard Drive Parameters (S.M.A.R.T)

    Enabling and using S.M.A.R.T of the FreeNAS

    File System Consistency Check—FSCK

    Advanced OS Tweaking

    Tweaking the Network Settings

    MTU, Device Polling, Speed, and Duplex

    Adding a Static Route

    Using Wireless

    Adding a Swap File

    Enabling Secure Shell Connections (SSH)

    Allow Root Login

    Types of SSH Authentication

    Summary

    9. General Troubleshooting

    Where to Look for Log Information

    Diagnostics: Logs

    Understanding Diagnostics—Logs: System

    Converting between Device Names and the Real World

    Networking Problems

    General Connection Problems

    Using Ping

    Using Ping from within the Web Interfaces

    Using ARP Tables to Solve Network Problems

    Gigabit Transfers are Slow

    Problems Connecting to Shares (via CIFS)

    Windows Vista Asks for My Username and Password for Anonymous Shares

    There are Two FreeNAS Servers on the Network, but Windows Can only See One

    Turning On Logging to Help Solve Windows Networking Problems

    Diagnostics: Information

    Replacing a Failed Hard Drive in a RAID Set

    Rebuilding a RAID 1 Array After Disk Failure

    Rebuilding a RAID 5 Array After Disk Failure

    Where to Go for More Help

    Summary

    10. FreeBSD and Command Line Tools

    Introduction to FreeBSD

    Your First FreeBSD Commands

    Print the Working Directory with pwd

    Directory Listings (ls)

    Change Directory with cd

    Copy a File and Change Its Permissions (cp and chmod)

    Connecting to FreeBSD Using Putty

    Monitoring your FreeNAS Server from the Command Line

    See Which Disks are Mounted with mount

    Check Disk Space Usage with df

    Discover the Size of Directories Using du

    Process Monitoring Using ps and top

    Advanced FreeBSD Commands for FreeNAS

    Starting and Stopping Services

    Getting Drastic with kill and killall

    RAID Command Line Tools

    Warning

    List and Status Commands

    JBOD and gconcat

    RAID 0 and gstripe

    RAID 1 and gmirror

    RAID 5 and graid5

    Where the FreeNAS Stores Things

    Miscellaneous & Sundries

    Using ping and arp from the Command Line

    Creating Directories and Deleting Things

    Editing Files Using nano

    Shutting Down Using the Command Line

    Summary

    Index

    Learning FreeNAS

    Gary Sims


    Learning FreeNAS

    Copyright © 2008 Packt Publishing

    All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

    Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, Packt Publishing, nor its dealers or distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

    Packt Publishing has endeavored to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

    First published: August 2008

    Production Reference: 1130808

    Published by Packt Publishing Ltd.

    32 Lincoln Road

    Olton

    Birmingham, B27 6PA, UK.

    ISBN 978-1-847194-68-8

    www.packtpub.com

    Cover Image by Michelle O'Kane (<michelle@kofe.ie>)

    Credits

    Author

    Gary Sims

    Reviewers

    Dan Merschi

    Nathan Yocom

    Robert La Gesse

    Senior Acquisition Editor

    David Barnes

    Development Editor

    Nikhil Bangera

    Technical Editor

    Ajay Shanker

    Editorial Team Leader

    Mithil Kulkarni

    Project Manager

    Abhijeet Deobhakta

    Project Coordinator

    Neelkanth Mehta

    Indexer

    Rekha Nair

    Proofreader

    Camille Guy

    Production Coordinator

    Aparna Bhagat

    Cover Work

    Aparna Bhagat

    About the Author

    Gary Sims is a freelance Linux/FreeBSD consultant and writer from the UK and has been working with open-source software since the mid 1990s. He first saw Linux while completing his degree in Business Information Systems at Portsmouth University. Then while working for Digital Equipment Corp he came in to contact with DEC's Ultrix and later Digital UNIX (formerly OSF/1). While developing enterprise software for DEC on its UNIX platforms he became more and convinced of the benefits of open source and open-source Unix-like operating systems like Linux and FreeBSD. After leaving DEC he became a software contractor and after moving to Romania in 2003 he became a freelance Linux/FreeBSD consultant and writer and started publishing articles for the Open Source Technology Group (owners of Linux.com and SourceForge.net). This then led to him writing his first book with Packt

    I would like to thank my Mum and Dad for their support and enthusiasm while I was writing this book. I would also like to thank my wife for her patience and encouragement and my children for their frequent, but yet, welcome interruptions. I would also like to thank the FreeNAS community, specifically, Olivier Cochard-Labbé, Volker Theile, and Dan Merschi, without them FreeNAS wouldn't exist. I also owe a debt of gratitude to David Barnes (and all the people at Packt) for making this book possible.

    About the Reviewer

    Nathan Yocom is an accomplished software engineer with a focus on network security, identity, access control, and data integrity applications. With years of experience working at the system level, his involvement in the industry has ranged from creation of software like the open source Windows authentication project pGina (http://www.pgina.org), to Bynari Inc's Linux/Outlook integration suite (http://www.bynari.net), to working on Centrify Corporation's ground breaking Active Directory integration and auditing products (http://www.centrify.com).

    Nathan's own publications have included several articles in trade journals such as SysAdmin Magazine, and co-authoring the Apress book The Definitive Guide to Linux Network Programming (ISBN: 1590593227).

    When not hacking at code, Nathan enjoys spending time at home in the Seattle, WA area with his wife Katie, daughter Sydney, and son Ethan. Nathan can be contacted via email at: <nate@yocom.org>.

    Preface

    FreeNAS is a free piece of software that turns a PC into Network Attached Storage (NAS). It supports connections from Microsoft Windows, Apple OS X, Linux, and FreeBSD. It supports RAID, has a simple web GUI, and modest system requirements. Since FreeNAS is an embedded operating system, it is compact, efficient, and dedicated to just one task.

    This book shows system administrators, as well as home network users, how to quickly install and configure FreeNAS.

    FreeNAS has a full range of advanced features including support for Redundant Array of Independent Disks (RAID), Microsoft Active Directory, and iSCSI. The goal of this book is to show administrators how to use these advanced features and exploit the full potential of the FreeNAS software.

    The FreeNAS software is suitable for home use as well as enterprise deployment and as such this book also covers the planning and administration tasks for both types of environment. This book also has a chapter dedicated to problem solving, and much more...

    What This Book Covers

    Chapter 1 is a high level look at Network Attached Storage (NAS), and more specifically, the FreeNAS software. We will cover the basic idea behind NAS and the philosophy of the FreeNAS server. This chapter is less hands-on than the others in this book, but it is important to understand the concepts of Network Attached Storage and where the FreeNAS server fits into your business.

    Chapter 2 will look at the basic planning points including: Capacity planning, Hardware requirements, Planning for backup, Redundancy needs, and Network infrastructure.

    Chapter 3 will install the FreeNAS server, and we'll start looking at the basic configuration.

    Chapter 4 shall look at the different services and protocols supported by FreeNAS, and we'll also see examples of how various platforms like Windows, OS X, and Linux can use the FreeNAS server for file sharing, backup, and streaming multimedia.

    Chapter 5 will look at the different system administration tasks for the FreeNAS server as well as user administration.

    Chapter 6 will look at how to manage hard disks in the FreeNAS server and how to configure them to form RAID sets that improve fault tolerance and increase drive performance.

    Chapter 7 shall explore the different options that exist to back up the data on the FreeNAS server including using RSYNC to a second local disk as well as to a remote machine.

    Chapter 8 looks at Advanced System Configuration like disk encryption, adding a swap space, and tweaking FreeBSD.

    Chapter 9 is a guide on how to solve problems with your FreeNAS server. It covers where to look for information about the problem as well as how to hunt down problems by being methodical. It also looks at the common problems people have with their FreeNAS servers including networking problems and problems with RAID.

    Chapter 10 will look at some simple FreeBSD commands and also some fundamental FreeBSD administration tasks, including stop and starting different services as well as controlling RAID from the command line.

    What You Need for This Book

    To get the most from this book you will need a copy of the FreeNAS server software and one or more PCs on which to install it. You will need the ability to burn a CDROM and you will possibly need a USB flash disk. You will need a network and a separate client PC with a web browser. The client PC can use Windows, OS X, Linux or any other OS that support web browsing. FreeNAS can be administered using almost any web browser including Firefox, Safari or Internet Explorer.

    Since the FreeNAS server is configured via a web interface, it is assumed that the reader has a basic knowledge of using browser software.

    Conventions

    In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

    Code words in text are shown as follows: We can include other contexts through the use of the include directive.

    A block of code will be set as follows:

         

            192.168.1.251

            24

            192.168.1.254

    Any command-line input and output is written as follows:

    Apr 1 11:06:00    kernel: real memory = 268435456 (256 MB)

    Apr 1 11:06:00    kernel: avail memory = 252907520 (241 MB)

    New terms and important words are introduced in a bold-type font. Words that you see on the screen, in menus or dialog boxes for example, appear in our text like this: clicking the Next button moves you to the next screen.

    Note

    Important notes appear in a box like this.

    Tip

    Tips and tricks appear like this.

    Reader Feedback

    Feedback from our readers is always welcome. Let us know what you think about this book, what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

    To send us general feedback, simply drop an email to <feedback@packtpub.com>, making sure to mention the book title in the subject of your message.

    If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or email .

    If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

    Customer Support

    Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

    Errata

    Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in text or code—we would be grateful if you would report this to us. By doing this you can save other readers from frustration, and help to improve subsequent versions of this book. If you find any errata, report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata added to the list of existing errata. The existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

    Piracy

    Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide the location address or website name immediately so we can pursue a remedy.

    Please contact us at <copyright@packtpub.com> with a link to the suspected pirated material.

    We appreciate your help in protecting our authors, and our ability to bring you valuable content.

    Questions

    You can contact us at <questions@packtpub.com> if you are having a problem with some aspect of the book, and we will do our best to address it.

    Chapter 1. All About NAS and FreeNAS

    The first chapter is a high level look at Network Attached Storage (NAS), and more specifically, the FreeNAS software. We will cover the basic idea behind NAS and the philosophy of the FreeNAS server. This chapter is less hands-on than the others in this book, but it is important to understand the concepts of Network Attached Storage and where the FreeNAS server fits into your business. The main topics for this chapter include:

    What is Network Attached Storage?

    What is FreeNAS?

    What are the features of FreeNAS?

    What does FreeNAS do for me and my business?

    Network Attached Storage

    In the mid 80s, two popular computer companies independently started to work on ways to access files, over the network, on another computer as if the hard drive of that remote computer was attached to the local machine. These two companies were Sun Microsystems and Microsoft. The Sun Microsystems method, which was for their UNIX operating system, is known as the Network File System (NFS) and was subsequently implemented in almost all versions of the UNIX operating system including Linux. The Microsoft solution (which they actually joint developed with IBM in the initial stages) became known as SMB (Server Message Block) but in later years was renamed as the Common Internet File System (CIFS).

    The general functionality of NFS and CIFS are very similar, and with either installed on a networked computer, it can read and write to the file system on another networked computer. Windows users are most used to this concept via the Network Neighborhood (Windows 95/98) or My Network Places (Windows ME, 2000 and XP) or more recently Network and Sharing Center (Vista). Here, you can browse the local network for other PCs and read and write files on that machine as long as the owner shared it with you.

    This ability to use a remote computer (a fileserver) to store files led to many companies deploying large centralized NFS Servers or Windows Servers that were accessed by hundreds and maybe thousands of UNIX workstations or PC clients. Users would then be encouraged to store all important files on these servers as the IT staff would back up the servers regularly and so back up the important user files.

    Storage space has always been an important aspect of computer systems. Today, more than ever, hard disk space is in demand. Back in the 1960s, storage was measured in bytes (8 binary digits, taking a value of either 0 or 1) and kilobytes. Then, as computers advanced, storage (including hard disks) grew to the size of megabytes (1024 kilobytes) and then gigabytes (1024 megabytes) and today with the 21st century well underway, computer storage is into the realm of terabytes (1024 gigabytes).

    With modern needs for video and audio, combined with high speed local networks and the access protocols of CIFS and NFS, a new kind of storage solution has appeared: Network Attached Storage or NAS for short. A NAS server is similar to a traditional file server in many ways, especially in respects to the hardware side of the server. But a NAS server is much more specialized than a traditional office or departmental server in that it only provides access to storage via the network. It is not designed to run other applications such as databases or email servers, which other types of server might. Normally, NAS servers don't require a keyboard, mouse or monitor permanently connected to them and for day-to-day administration, a web interface is used instead.

    Here is an example of the FreeNAS web interface:

    Network Attached Storage

    To access the data on the server, a typical NAS will support multiples access protocols and so allow Microsoft Windows clients, Apple OS X clients, and UNIX (including Linux) clients to connect and use the data on the server.

    NAS servers normally contain one or more hard disks, and these hard disks can be combined to create large contiguous areas of storage or used in a way to create redundancy. In a redundancy set-up, if a hard disk fails then the system keeps working and your data isn't lost.

    NAS servers come in all shapes and sizes. There are several companies that offer compact NAS servers with an embedded operating system and space for maybe two hard drives. These units are relatively cheap but offer limited room for expansion. At the other end of the scale, are dedicated NAS servers that look more like traditional file servers with good processing power and space for several hard disks (which can make the NAS capable of hosting several terabytes of data).

    Here is how a NAS might fit into your network environment:

    Network Attached Storage

    Network Attached Storage has several advantages over a traditional file server in that:

    NAS offers better security. As the server is only running a dedicated operating system for providing the access to your data, there

    Enjoying the preview?
    Page 1 of 1