Tải bản đầy đủ (.pdf) (41 trang)

Configuring Storage

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (450.15 KB, 41 trang )

Chapter 6. Configuring Storage
In this chapter, we will look 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.
Introduction
The essence of the FreeNAS server is to provide
storage that is easily accessible from the network. To
this end, it is important to understand how FreeNAS
handles the storage or more specifically hard disks
and how they can be configured and used to provide
the best and most reliable storage for your network. In
this chapter, we shall use the words storage and hard
disk almost interchangeably. Technically, a hard disk
is a type of storage and there are many other types of
storage besides hard disks, but as FreeNAS is
primarily concerned with using hard disks as storage,
the two terms will at times seem like one. The only
exception to this will be when we look at iSCSI, as
iSCSI allows remote storage to be added to the
FreeNAS server as if it was a local hard disk. Of
course, ultimately the remote storage is also a hard
disk!
How FreeNAS Handles Data Disks
As mentioned in Chapter 2, adding storage to the
FreeNAS server is done in 4 steps:
1. 1. The FreeNAS server is "told" about a
physical hard disk.
2. 2. This disk is formatted.
3. 3. The resulting storage space is mounted
and made available internally.


4. 4. The mounted storage space is made
available on the network via services like
CIFS and NFS.
Step one, telling the FreeNAS server about the disks
at its disposal is handled in Disks: Management. On
opening this page, you will see a list of disks that are
already configured and using the add circle you have
the possibility to add more. To add a disk, click the
add circle and you will be taken to the Disks:
Management: Disk: Add page.
The most important field on this page is the Disk field
where you select which disk you want to add to the
FreeNAS configuration. You can select the disk using
a drop down box.
UNIX Device Names
In a UNIX type operating systems, including
FreeBSD, devices like hard disks are usually
referred to by a slightly cryptic name which looks
something like this:
/dev/ad0
It isn't actually all that difficult once you understand
how the name is made up. The first bit /dev is easy.
It is a special directory on the server that holds
information about all the devices on the system,
where dev is short for device. Therefore, all devices
start with /dev.
The second part is the device itself. Here, it can be a
bit more complicated, but ad0 means disk 0, or the
first hard disk as listed in the BIOS. Here is a table
with some common device names:

Free BSD device
name
Description
/dev/ad*
ATA and SATA hard
disks
/dev/da*
SCSI and USB flash
storage
/dev/acd* IDE CD drives
/dev/cd* SCSI CD drives
/dev/fd* Floppy disks
The * is a wild card, which in the real world is a
number starting from 0. So /dev/da2 is the 3
rd
(as it
starts from 0) SCSI hard disk in the system.
RAID Controllers
If you are using a hardware RAID
controller, for the disks attached it, don't
use the standard device names for each
disk. Instead, these RAID controllers
present a virtual disk for each RAID set,
using a device named after the RAID
controller driver. For example, the amr
driver (which supports controllers by
MegaRAID and some Dell and Intel
cards) presents its virtual disks as
/dev/amrd*. Also, some RAID cards
present their hard drives as /dev/da*

devices.
Adding the Disk
Once you have selected the right disk from the drop
down box, you can normally just go ahead and click
Add. However, there are some parameters that you
can tweak and the final field Preformatted FS needs
to be set correctly if this disk is already formatted and
has data on it.
Disk
parameter
Description
UDMA
mode
Normally, the interface speed of you
hard disk is automatically detected.
You can force interface speed (called
the UDMA mode) if you have
'UDMA_ERROR.... LBA' message
with your hard drive.
Hard
disk
standby
time
Puts the hard disk into standby mode
when the selected amount of time
after the last access has elapsed. Do
not use this with flash memory
devices.
Advanced
Power

Management
This allows you to lower the power
consumption of the drive, at the
expense of performance. Success
will vary depending on your BIOS and
hard disk. Do not use this with flash
memory devices.
Acoustic
level
This allows you to set how loud the
drive is while it's operating. Success
will vary depending on your BIOS and
hard disk. Do not use this with flash
memory devices.
Pre-
formatted
FS
This allows you to set the file system
type for pre-formated disk with data.
Leave 'unformatted' for an
unformatted disk and then use format
menu for format it.
Don't Erase Existing Data by
Mistake
If you have converted an existing server
into a FreeNAS server or you have put
disks in your FreeNAS server with data
already on them, then you need to be
sure you set the Preformatted FS field
correctly. Apart from the native UFS

format of the FreeBSD, FreeNAS
supports FAT32, NTFS, and EXT2.
Once you have selected the disk from the drop down
menu and set any of the optional parameters, you can
click the Add button. Don't forget you also need to
apply the changes.
The Disks: Management page will now show your
disk(s) in a table including information about the disk
name, size, and file system.
The next step is to format the disk.
Formatting a Newly Added Disk
Once the disk has been added to the FreeNAS
server, it needs to be formatted.
1. 1. Go to the Disks: Format page.
2. 2. Select which disk you wish to format. Only
the disks you have added in the Disks:
Management page are available to be
formatted. If the disk you want to format
doesn't appear in the drop down list, then
go back to the Disks: Management page
and check that your disk has been added
correctly.
3. 3. Next, you must choose the file system you
want to use on this disk. The default will be
UFS and unless you specifically need
FAT32 or EXT2, it is best to format the disk
with UFS.
UFS is Best
UFS is the NATIVE file format
for FreeBSD (the underlying

OS of FreeNAS). Attempting
to use other file formats such
as FAT, FAT32, EXT2, EXT3,
or NTFS can result in
unpredictable results, file
corruption, and loss of data!
4. 4. You can also enter an optional volume
label for the disk, but it isn't very useful as it
isn't used in the FreeNAS web interface.
5. 5. Leave the minimum free space
percentage at its default 8% as lowering the
threshold can adversely affect performance
and auto-defragmentation.
6. 6. The final option allows you to tweak the
way the disk is formatted, specifically to not
replace the Mater Boot Record (MBR) with
a new one during the format process.
Normally, this shouldn't be needed but some
hardware RAID cards store information in
the MBR. If you find that the drive doesn't
format correctly and you are using a
hardware RAID card, you can try formatting
the disk with the option enabled.
7. 7. Once you click Format Disk, you will
asked if you are sure that you wish to format
the disk. Click OK to proceed.
The output of formatting the disk will look something
like this:
The key is to look for the Done! comment at the end
and the long list of superblock numbers before it. If

you see that, then everything is OK. If the formatting
failed for some reason then before the Done!, you will
see an error message. For example if spaces aren't
permitted in the volume label, trying to format a disk
like this will result in the last lines of the output
reading:
newfs: bad volume label. Valid characters are alphanumerics.
Done!
Mounting Your Newly Formatted Disks
Once you have formatted the disk, you need to make
it available internally in the FreeNAS server. This
processing is called mounting the disk and is a term
left over from the early days of computing when an
operator had to mount a magnetic tape or hard disk
on a spindle before using it. Mounting a disk makes it
available for use within the server and only previously
added and formatted disks can be mounted.
1. 1. To mount a disk go to Disks: Mount
Point and click the add circle.
There are five important fields to fill in here:
Type, Disk, Partition, File System, and
Name.
Partitions
To partition a disk means to
divide it into parts. All disks
need at least one partition and
having a single partition
means using the whole disk. It
is also possible to partition a
disk into many parts. Under

FreeNAS, if you install the
server software on a hard disk,
then two partitions are created,
the first for the operating
system software and the
second for data. When
mounting disks, you need to
know which partitions you wish
to mount.
By default, FreeNAS doesn't
use the legacy method to
partition disks, which involved
storing the partition data in the
Mater Boot Record (MBR);
instead it used the GUID
Partition Table (GPT) which is
part of the Extensible
Firmware Interface (EFI)
standard proposed by Intel as
a replacement for the soon to
be obsolescent PC BIOS.
Type: Here, you can select if you want
to mount a disk or an ISO file. For new
physical disks, you need to select disk.
The ISO option is useful if you have an
.iso file and you wish to make its
contents available on your network.
Disk: Select the disk which you wish to
mount. This will be the same disk as you
used in the Disks: Management (to

add the disk) and Disks: Format (to
format it).
Partition: If you have just formatted this
disk using FreeNAS, then you will need
to select EFI GPT here. If your disk has
previous data on it then you need to
select which partition the data is on. If
you have installed FreeNAS on a disk
and you want to use the rest of the disk
for data then select 2.
File System: For disks that have been
formatted using FreeNAS, you need to
select UFS. If you have chosen to use
another file system format or the disk
already had data on it, you need to
select the appropriate file system type
(one of FAT, NTFS, EXT2).
Name: Each mounted disk needs a
name to distinguish it from other disks. It
does seem possible to use spaces in
the name but for safety I would
recommend using a simple single word
mount point name. The name specified
will used to mount the disk under the
/mnt directory on the FreeNAS server,
so if we used store2 then the disk will be
mounted on /mnt/store2 and that would
be the name used to share the disk on
the network using CIFS etc.
Description: You can fill in an optional

description for this mount point.
Read only: Tick this to mount the file
system as read-only, even the
Administrator account (super user/root)
may not write it.
Using Disks
Formatted under
Older Versions of
FreeNAS
If your disks were
configured using a
version of FreeNAS
prior to version
0.683b then you
need to manually
select partition 1 for
a UFS formatted
drive or software
RAID volume. The
File System type
should be set to
UFS.
2. 2. Once you have filled in all the data, click
the Add button.
3. 3. You will be shown a table with a list of the
mounted drives on the FreeNAS server.
Their status will be listed as Configuring.
4. 4. You now need to click Apply changes.
Once the changes have been applied, the
newly displayed table should include the

new mount point with the status of OK.
Making the New Disk Available on the
Network
Now that the new disk is formatted and mounted, it
can be made available on the network. To do this,
enable the appropriate network services like CIFS,
NFS, and AFP and if necessary, (for example with
CIFS) add the new disk as a shared resource. For
NFS and AFP, all mounted drives are automatically
shared. See chapter 4 for more details.
Configuring Software RAID on FreeNAS
FreeNAS has the ability to combine disks and either
use them in a concatenated manner (meaning they
are added together and will appear as one large
disk) or use them together for redundancy and
improved performance (by spreading the data across
several disks). Using many disks in a set like this is
called a RAID (Redundant Arrays of Inexpensive
Disks) configuration. We looked at RAID in some
detail in Chapter 3 but to save you from turning there
again, here is a summary (you will need to go back to
Chapter 3 if you need more details).
RAID is a system that divides and duplicates data
across several hard disks. Depending on which
scheme you use, your data is copied, in full or in part,
across other disks in the RAID set, and if one of
those disks fails, the other disks (with the copy of the
data) continue to work and the data as a whole
remains intact.
FreeNAS supports several different RAID

configurations that are called RAID levels:
JBOD (Just a Bunch of Disks): This is simple form of
disk concatenation, the resulting disk appears as one
large disk and there is no attempt to spread the data
across the two disks. Data that falls in the first half of
the RAID disk is written to disk 1, and data in second
half to disk 2. There is no fault tolerance.
RAID 0 (Striped set without redundancy): RAID 0 is a
way of joining two disks together to create one big
disk. The data is interleaved between the two disks
and so it improves performance but there is no fault
tolerance.
RAID 1 (mirroring): Here, two disks are used with
one disk mirroring the contents of the other disk. If
either of the disks fails, the RAID continues using the
remaining disk. When the faulty disk is replaced, the
new disk will be synchronized with the good disk and
the mirroring will continue as before.
RAID 5 (striped set with distributed parity): This is
one of the most popular and arguable one of the most
useful RAID levels. It allows you to combine a larger
number of physical disks, and still maintain some
redundancy. RAID 5 can be used on three or more
disks. If one disk fails, the data remains intact. RAID
5 can survive one disk failure.
RAID All Starts with Adding the Disks
The first step in configuring a RAID set is in the
adding of disks on the Disks: Management page.
Click the add circle and select the first disk you wish
to make part of a RAID set. You do this by selecting it

from the drop down box of available disks. You can't
use a disk that is already mounted.
The trick now is to set the Preformatted FS field to
Software RAID. This isn't instantly obvious as the
disk isn't pre-formatted and in fact, it will be formatted
later, but in essence what is happening is that this
disk is being marked as a disk available for software
RAID. Then, in the next step, when the RAID set is

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×