Showing posts with label FreeNAS. Show all posts
Showing posts with label FreeNAS. Show all posts

Monday, October 24, 2016

[CentOS - iSCSI Server / Client]: iSCSI Server installation Providing Remote block storage

iSCSI Server installation Providing Remote block storage

iSCSI Server installation and configuration RHEL7 Providing Remote Block Storage
iSCSI means Internet Small SCSI System Interface, We will use iSCSI connectivity because it is cost effective compare to FC connection. Fibre Connection required separate Hardware such as like FC switch (SAN Switch) FC switch is more cost compare to normal network switch. To provide iSCSI based storage we do not required any extra environment because we can make use of existing Network switches. Let’s see how this technology is going to work for us iscsi server installation and configuration RHEL 7 providing remote block storage.
We have different types of storage’s such as
  1. DAS – Directly attache storage
  2. NAS – Network Attached Storage
  3. SAN – Storage Area Network
iSCSI protocol comes under SAN (Storage Area Network) To allocate remote block storage to clients below are the steps we have to follow
  1. Create one Partition
  2. Create LVM using that partition (Don’t format)
  3. Install iSCSI Utilities if not available
  4. Create LUN and Map to iSCSI client
  5. iSCSI server = Target. iSCSI Client = Initiator.
Let’s see below is the process of creating and mapping the iSCSI LUN from iSCSI server to Client.
Environment
Server IP =192.168.4.27
Client IP = 192.168.4.13
By Installing and configuring this iSCSI Server, We are Turing Linux box as SAN.  

Creating Partition

Here i have new HDD called /dev/sdb 10GB with no partitions
[root@iSCSIServer ~]# fdisk -l /dev/sdb

Disk /dev/sdb: 10.7 GB, 10737418240 bytes, 20971520 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xea9e3f19

Device Boot Start End Blocks Id System
Standard partition creation and converting standard to LVM
[root@iSCSIServer ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n
Partition type:
 p primary (0 primary, 0 extended, 4 free)
 e extended
Select (default p):
Using default response p
Partition number (1-4, default 1):
First sector (2048-20971519, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-20971519, default 20971519): +2G
Partition 1 of type Linux and of size 2 GiB is set

Command (m for help): p

Disk /dev/sdb: 10.7 GB, 10737418240 bytes, 20971520 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xea9e3f19

Device Boot Start End Blocks Id System
/dev/sdb1 2048 4196351 2097152 83 Linux

Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'

Command (m for help): p

Disk /dev/sdb: 10.7 GB, 10737418240 bytes, 20971520 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xea9e3f19

Device Boot Start End Blocks Id System
/dev/sdb1 2048 4196351 2097152 8e Linux LVM

Command (m for help): wq
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
Update to Kernel when we create new partition, partition table should be up-to date other wise partition will not be listed, use below command to update
[root@iSCSIServer ~]# partprobe /dev/sdb
Creating Physical Volume, Volume Group and Logical Volume
[root@iSCSIServer ~]# pvcreate /dev/sdb1
 Physical volume "/dev/sdb1" successfully created

[root@iSCSIServer ~]# vgcreate VG0 /dev/sdb1
 Volume group "VG0" successfully created
[root@iSCSIServer ~]# vgs
 VG #PV #LV #SN Attr VSize VFree
 VG0 1 0 0 wz--n- 2.00g 2.00g
 rhel 1 2 0 wz--n- 39.51g 44.00m

[root@iSCSIServer ~]# lvcreate -l 100%FREE -n iscsilv VG0
WARNING: ext4 signature detected on /dev/VG0/iscsilv at offset 1080. Wipe it? [y/n]: y
 Wiping ext4 signature on /dev/VG0/iscsilv.
 Logical volume "iscsilv" created.

iSCSI Server Installation Providing Remote block storage

As per above output we just created Logical Volume but we did no formatted, Means we did not created any file system in it.
[root@iSCSIServer ~]# yum install targetcli*

Installed:
 targetcli.noarch 0:2.1.fb37-3.el7

Dependency Installed:
 pyparsing.noarch 0:1.5.6-9.el7 python-configshell.noarch 1:1.1.fb14-1.el7 python-kmod.x86_64 0:0.9-4.el7 python-rtslib.noarch 0:2.1.fb50-1.el7 python-urwid.x86_64 0:1.1.1-3.el7

Complete!
Targetcli is the command to enter into iscsi console
targetcli command
targetcli command
Create Storage Object and Create IQN (iSCSI Qualified Name) to map LUN. This IQN we should take from iSCSI client machine, either we can create our own.
/> /backstores/block create LUN /dev/VG0/iscsilv

/> /iscsi create iqn.2017-03.com.arkit:iSCSIClient1
Creating Storage Object
Creating Storage Object

Go to iSCSI Client Side

Client side we have to install iscsi utilities to connect iscsi server. 
Install iscsi-initiator-utils-iscsiuio-6.2.0.873-29.el7.x86_64 rpm in iSCSI client
[root@iSCSIClient ~]# yum install iscsi*
Get IQN number from Client machine and add to server for mapping disk from server.
[root@iSCSIClient ~]# cat /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.1994-05.com.redhat:ba1abe3b1a4
Enable and Start iscsid service
[root@iSCSIClient ~]# systemctl enable iscsid.service
ln -s '/usr/lib/systemd/system/iscsid.service' '/etc/systemd/system/multi-user.target.wants/iscsid.service'
[root@iSCSIClient ~]# systemctl start iscsid.service

[root@iSCSIClient ~]# systemctl status iscsid.service
iscsid.service - Open-iSCSI
 Loaded: loaded (/usr/lib/systemd/system/iscsid.service; enabled)
 Active: active (running) since Sun 2016-10-23 19:19:49 IST; 11s ago
 Docs: man:iscsid(8)
 man:iscsiadm(8)
 Process: 4144 ExecStart=/usr/sbin/iscsid (code=exited, status=0/SUCCESS)
 Main PID: 4146 (iscsid)
 CGroup: /system.slice/iscsid.service
 ├─4145 /usr/sbin/iscsid
 └─4146 /usr/sbin/iscsid

Oct 23 19:19:49 iSCSIClient iscsid[4145]: iSCSI daemon with pid=4146 started!
Oct 23 19:19:49 iSCSIClient systemd[1]: Started Open-iSCSI.

Come Back to iSCSI Server side

Now add client IQN in server so that we can map LUN
/> /iscsi create iqn.1994-05.com.redhat:ba1abe3b1a4
Created target iqn.1994-05.com.redhat:ba1abe3b1a4.
Created TPG 1.
Global pref auto_add_default_portal=true
Created default portal listening on all IPs (0.0.0.0), port 3260.
/> /iscsi/iqn.1994-05.com.redhat:ba1abe3b1a4/tpg1/acls create iqn.1994-05.com.redhat:ba1abe3b1a4
Created Node ACL for iqn.1994-05.com.redhat:ba1abe3b1a4
Create New LUN using existing LVM and map to client
/> /iscsi/iqn.1994-05.com.redhat:ba1abe3b1a4/tpg1/luns create /backstores/block/LUN
Created LUN 0.
Created LUN 0->0 mapping in node ACL iqn.1994-05.com.redhat:ba1abe3b1a4
Portal Creation in Server to map
/> /iscsi/iqn.1994-05.com.redhat:ba1abe3b1a4/tpg1/portals create 192.168.4.14
Using default IP port 3260
Could not create NetworkPortal in configFS.
If your able to see above error while creating portal then do delete default port 0.0.0.0 then create new
/> /iscsi/iqn.2017-03.com.arkit:iscsiclient1/tpg1/portals delete 0.0.0.0 ip_port=3260
Deleted network portal 0.0.0.0:3260
/> /iscsi/iqn.1994-05.com.redhat:ba1abe3b1a4/tpg1/portals create 192.168.4.14
Using default IP port 3260
Created network portal 192.168.4.14:3260.
Save the configuration 
/> saveconfig
Last 10 configs saved in /etc/target/backup.
Configuration saved to /etc/target/saveconfig.json
Exit from the Console
/> exit
Global pref auto_save_on_exit=true
Last 10 configs saved in /etc/target/backup.
Configuration saved to /etc/target/saveconfig.json

Allow Firewall Port to communicate with iSCSI Client

3260 iscsi default port 
[root@iSCSIServer ~]# firewall-cmd --permanent --add-port=3260/tcp
success
[root@iSCSIServer ~]# firewall-cmd --permanent --add-port=3260/udp
success
[root@iSCSIServer ~]# firewall-cmd --reload
success

Client Side to connect iSCSI LUN

[root@desktop4 ~]# iscsiadm -m discovery -t st -p 192.168.4.27
192.168.4.27:3260,1 iqn.1994-05.com.redhat:ba1abe3b1a4

[root@desktop4 ~]# iscsiadm -m node -T iqn.1994-05.com.redhat:ba1abe3b1a4 -p 192.168.4.27 -l
Logging in to [iface: default, target: iqn.1994-05.com.redhat:ba1abe3b1a4, portal: 192.168.4.27,3260] (multiple)
Login to [iface: default, target: iqn.1994-05.com.redhat:ba1abe3b1a4, portal: 192.168.4.27,3260] successful.
After successful mapping of LUN now you can create file system on LUN, To Create file system repeat Step 1 (Creating Partition)
[root@iSCSIClient ~]# partprobe /dev/sda
[root@iSCSIClient ~]# mkfs.ext4 /dev/sda1
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=1024 blocks
327680 inodes, 1308672 blocks
65433 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1340080128
40 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
 32768, 98304, 163840, 229376, 294912, 819200, 884736

Allocating group tables: done 
Writing inode tables: done 
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

[root@iSCSIClient ~]# mkdir /ravi


[root@iSCSIClient ~]# vim /etc/fstab 
[root@iSCSIClient ~]# cat /etc/fstab |grep sda
/dev/sda1 /ravi ext4 _netdev 0 0
[root@iSCSIClient ~]# mount -a
[root@iSCSIClient ~]# df -h |grep ravi
/dev/sda1 2.0G 20M 2.0G 1% /ravi
Enjoy…………….

Monday, July 18, 2016

[Quick Install: NAS-XPEnology]: XPEnology - NAS Box setup

XPEnology - NAS Box setup

XPEnology.me

Download from : http://xpenology.me/downloads/

DSM

The heart of the device is its Synology operating system DSM (Disk Station Manager), which is used in all devices produced by Synology. It is a well-optimized Linux kernel, most of the changes which aims to work with hard disk drives (full list of compatible discs) and Raid arrays. As well it is composed of many Open source packages, details of which you will find just the manufacturer’s website. Let respects the company’s Sinology! They did a great job – their products are the best and we will tell why. Thanks to them!
DSM loved by many, but unfortunately Sinology not released a version for PC, the operating system is not compatible with the hardware of many PCs and servers are not produced by Synology.

WARNING

Despite the fact that the development team was able to release the bootloader, allowing DSM run on almost any computer, we strongly recommend that you refrain from using a bootloader on production and buy it from the above-mentioned original products from Synology.
Use it at your own risk! we will not be held responsible for any data loss or broken machine.

What is XPEnology

DSM is loaded on a synology Device with USB flash drive, soldered on the motherboard, the operation system and all applications located are in special slice of the hard disk drives (on each) this method allows to increase the service life of the boot flash and increase productivity.
XPEnology is a bootloader as IMG image. XPEnology compiled from the source code provided Sinology under license GNUXPEnology and does not contain the operating system.
In addition to the kernel in the boot loader included some scripts and driver packages to work on most particular hardware platforms.
XPEnoboot is published by a team of contributors:
  • Vortex
  • Sancome
  • Kali
  • Jman
  • Poechi
XPEnoboot is similar with Nanoboot, but added more drivers and fix some problems, the most important is that it support DSM5.1 installation (special thanks to Vortex).
You can download it from Sancome website nanoboot.eu.org, or this website. Also Poechi website xpenology.nl

Friday, November 13, 2015

[FreeNAS]: Hardware Compatibility and naming Conventions

Hardware Compatibility and naming Conventions

 What is the hardware naming convention under FreeNAS(FreeBSD)?


ad0 is the first hard-drive, the Operatin System drive. ad1,ad2,ad3 .... ad999 are the second et .......storage drives.
ad0s1 is the first partition on the first drive, and ad5s4 is the fourth partition of the sixth drive. 
fd0 is the first flopy drive.
acd0 is the first ATAPI (IDE) CDROM drive.
cd0 is the first SCSI CDROM drive.
da0 is the first SCSI direct access disk-drive(can be USB drive).
da0s1 is the first partition on the first SCSI direct access disk-drive, and da5s4 is the fourth partition of the sixth SCSI direct access disk-drive. 

Warning: Drive names may change as drives are added or removed.

---------------------------------------------------------------------------------------------------------------------------------------

What is the best hardware solution for your own FreeNAS server?


Before you do the math:
Think about your data storage requirements
► How important it is to you (personal or business data)
► Can it be easily replaced or is it replicated elsewhere?
► How often you access/change the information
► What is the expected growth rate of data (will I max out the storage media and how do I expand it?)
The Performance
  • How many users access the information
  • What your network infrastructure is (the old 10/100/1000 debate)
  • Cables,
  • Switches (and hubs),
  • Routers
  • (some have multiport routers with wireless and are talking about GigE (why? wirless does not do GigE and the switch ports will more than likely be 10/100)
  • Accessability and Security
  • Will you be accessing the data locally, or via a WAN?
            and finally
The budget
Do I have any/some/no existing hardware that can be used to build my FreeNAS platform?
How much money have I got to spend?
 
Note: by draggaj


Hard Drive
Replacement: Hard drives are the most important parts of data storage devices.If the drive fails there are no replacements 
Performance: Size, drive speed, transfer speed, buffer memory, brand and model are just some characteristics on witch depend your system performance.
Failure: If your system breakdown you can replace the failed parts, reinstall FreeNAS or move the hard drive to a different system to recover your data. If your hard drive die, the information on the drive is lost forever.
Size: You can use hard drives up to 2TB under FreeNAS(FreeBSD ), but you must keep in mind that you need a hard drive supported buy BIOS to boot FreeNAS from hard drive.
Motherboard
Replacement: Motherboards can be replaced or upgraded without any data lost. 
Performance: 
    P2 motherboards
    P3 motherboards are the good choice, old but not too old.
    P4 motherboards

Processor
Replacement: Processors can be replaced or upgraded without any data lost. L1 and L2 cache size of the processor can make a difference.
Performance:
    P2
  • P3 it’s a good choice, for the server reliability and SoftwareRAID.
    P4
    Multi-Processors
RAM
Replacement: memory can be replaced or upgraded without any data lost.
    128MB:
  • 256MB: can be a good decision for small system < 1 TB.
    512+MB :
Network Cards
Replacement: Network cards can be replaced or upgraded without any data lost. 
    10Mb
  • 100Mb NIC’s, cheap cables and switches are the best solution for the money.
    1Gig
                What is the point of having one single gigabit connection to one single computer on your LAN?
                Full upgrade to gigabit include industrial grade cables (home made cables are too noisy), gigabit switches, gigabit routers, gigabit NIC’s, in one word the whole network.
                Once you upgrade everything, you wrongfully believe that your network will work at Gigabit speed? Wrong!
                If your workstation access the internet you must setup the maximum MTU to 1500, like that you can’t take advantage of higher “jumbo frames” MTU 9000. If your server use MTU 9000 and your workstations use MTU 1500,  packet fragmentation will slow down your network.
                What about the hard drives transfer speed? 

If you don't have a need for more speed than 100BaseT gives you, there's no reason to spend bigger bucks for gigabit upgrade.
Here is the math calculation:

1 x 1 x 1 x 0 x 1 x 1 x 1 x 1 = 0
For any zero in your formula the network upgrade results will be zero.


[FreeNAS acces freeNAS console remotely]: Can I acces freeNAS console remotely over the network?

Can I access freeNAS console remotely over the network?


You can access the console remotely using Putty or .. ssh client on your *Nix system.

1. On FreeNAS   WebGUI :Services: SSH enable SSHd service
  1. Enable SSH service
  2. Set the port , default port is 22 however you should consider using a different port between 10000 and 65535, see http://www.iana.org/assignments/port-numbers.
  3. For the beginning allow 'root' login if you are behind a router/firewall but consider to disable 'root' login in the future.
  4. Enable keyboard-interactive authentications, make sure that you have a complex admin/root password .
  5. Not cover by this howto.
  6. Enable compression. For internet transfer only.
  7. Server Private key. Not cover by this howto.
  8. When you finish click on "Save and Restart" to apply changes.
  9. If everything is OK you should receive the message that "changes have been applied successfully"


2. Download PuTTy (ssh client)  from : http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe


3. Run PuTTy and set the connection parameters and click Open.
  1. Enter FreeNAS IP or FreeNAS host name, on this example we use the default IP 192.168.1.250
  2. FreeNAS SSHd port, on this example we use the default port 22
  3. Select SSH protocol
  4. You can save the session now or later for future use. I chose to save the session under "freenas" name.
  5. If you chose the save the session click "Save"
  6. Now to open a remote connection  click  "Open"
  7. Latter you can get back and set advanced connection option, please read the PuTTy  manual. Not cover by this howto.



4.  First time when you connect to a remote server you will see a similar pop-up box. If you accept to connect to the server click Yes. The server key will be cached for future use.




5. On this example we use the user 'root' (the super user or Administrator).




6. The password is the FreeNAS admin password ( the WebGUI password).




7. If everything is OK you should get the shell prompt.


[FeeeNAS]: Can I mount a FreeNAS server(slave) to a second FreeNAS server(master)?

Can I mount a FreeNAS server(slave) to a second FreeNAS server(master)?



Yes.
On the slave FreeNAS (10.10.10.2) you have to:
a. enable the NFS server.
b. map all user to root: NO
c. authorised network: 10.10.10.1 & netmask /1. 

On your master FreeNAS(10.10.10.1) box from WebGUI -> Diagnostics -> Commands:
a. mkdir /mnt/MyShare/slave
b. mount -t nfs 10.10.10.2:/mnt/YourShare /mnt/MyShare/slave
c. ls /mnt/MyShare/slave

Warning: FreeNAS startup script don't include the support of mounting NFS share at boot time.

[FreeNAS Disable "Opportunistic Locking".]: Disable "Opportunistic Locking".

Disable "Opportunistic Locking".


smbd[xxx]: read_data: read failure for 4 bytes to client XXX.XXX.XXX.XXX Error = Connection reset by peer

Did you see this error message in your log's?


What Operating Systems are Affected?

All server computers running Windows operating systems in the NT family, Windows NT, Windows 2000, Windows XP and Windows 2003 Server.

All workstation computers running Windows operating systems in the 9X family , this includes Windows 98 and Windows ME.

Link : 
Solutions:

1. Server side(FreeNAS )
The safe way will be the server side(FreeNAS), however not confirmed for the moment.
On WebGUI : Services: CIFS /SMB : Settings > “Auxiliary parameters” you can add:
Dave suggested on this thread https://sourceforge.net/forum/message.php?msg_id=4849132  , that setting only  oplocks = no fix the problem for him (clients Win XP and 2003).

level2 oplocks = no 
kernel oplocks = no

Note:
  • Changing the configuration on the server side will affect all clients connected to that specific server(CIFS/SMB only).
  • No restart required.
  • Safer that editing window registry.

2. Client side(Windows only).

Important This article contains information about how to modify the registry. Make sure that you back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry see: http://support.microsoft.com/kb/256986/

Disabling Read Caching on Windows Workstations (All Windows operating systems in the 9X family) 

The Windows registry entry that controls read caching on Windows network clients is:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VxD\VREDIR
DiscardCacheOnOpen REG_BINARY 0 or 1
Default: 0 (not disabled)
To disable read caching, the value of DiscardCacheOnOpen must be set to 1.

You can verify (or change or add, if necessary) this Registry value using the Windows Registry Editor (regedit.exe).
If you do change this Registry value, you will have to reboot the PC to ensure that the new setting goes into effect.

Please read the Microsoft disclaimer regarding editing of the Windows registry here.

STEPS:

1. Start > Run > Regedit.exe
2. Click on the + (plus sign) next to HKey_Local_Machine
3. Click on the + (plus sign) next to System
4. Click on the + (plus sign) next to CurrentControlSet
5. Click on the + (plus sign) next to Services
6. Click on the + (plus sign) next to VxD
7. Click on the VREDIR entry on the left-hand side of Registry Editor

8. If the DiscardCacheOnOpen registry value already exists (on the right-hand side of Registry Editor), ensure that its value is 1

9. If the DiscardCacheOnOpen value already exists but its value is not 1, double-click on DiscardCacheOnOpen to change its value to 1

10. If the DiscardCacheOnOpen entry does not exist, right-click in the white space of the right-hand side of Registry Editor
11. Select New > Binary value
12. Rename the value to DiscardCacheOnOpen
13. Double-click on DiscardCacheOnOpen to change its value to 1

Disabling Opportunistic Locking on Windows Servers ( Windows NT, Windows 2000, Windows XP and Windows 2003 Server).

There are 2 Windows registry entries that control opportunistic locking (oplocks) on Windows network servers:

1. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters EnableOpLockForceClose
2. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters EnableOplocks

1. EnableOpLockForceClose

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters
EnableOpLockForceClose REG_DWORD 0 or 1
Default: 0 (not disabled)

To disable oplocks, the value of EnableOpLockForceClose must be set to 1.

You can verify (or change or add, if necessary) this Registry value using the Windows Registry Editor (regedit.exe).
If you do change this Registry value, you will have to reboot the PC to ensure that the new setting goes into effect.

Please read the Microsoft disclaimer regarding editing of the Windows registry here.

STEPS:

1. Start > Run > Regedit.exe
2. Click on the + (plus sign) next to HKey_Local_Machine
3. Click on the + (plus sign) next to System
4. Click on the + (plus sign) next to CurrentControlSet
5. Click on the + (plus sign) next to Services
6. Click on the + (plus sign) next to LanManServer
7. Click on the Parameters entry on the left-hand side of Registry Editor

8. If the EnableOpLockForceClose registry value already exists (on the right-hand side of Registry Editor), ensure that its value is 1

9. If the EnableOpLockForceClose value already exists but its value is not 1, double-click on EnableOpLockForceClose to change its value to 1

10. If the EnableOpLockForceClose entry does not exist, right-click in the white space of the right-hand side of Registry Editor
11. Select New > DWORD value
12. Rename the value to EnableOpLockForceClose
13. Double-click on EnableOpLockForceClose to change its value to 1

[FreeNAS Slow Network]: Slow Network

Slow Network FreeNAS

502. Slow network.

 
Views: 15800
Votes: 8
Posted on Tuesday, December 19, 2006 by Tim Fehlman
http://www.dailycupoftech.com/category/freenas /

I had deployed a new network with a server and a number of workstations. Everything worked fine and the network connectivity was there but everything was painfully slow. All the network applications took forever to come up and file transfers were ridiculous. After about two weeks, I finally discovered the problem.

When I created the images for the workstations, I built the image with the network card set to a speed of 100 Mbits and full duplex. At the last minute, we switched from a managed switch to an unmanaged switch. Most unmanaged switches have their speed duplexing set to autonegotiation. It was at this point that I made a bad assumption.

And I assumed that since the network cards on each workstations were hard coded to 100/full, the switch would automatically recognize this and set each port to 100/full as well. In reality, I had created a duplex mismatch. Essentially, the network cards were looking for a 100/full link on the other end of their patch cable while the switch was expecting an autonegotiation session. Neither got what they were looking for and trouble ensued!

The long and the short of it is that you have to be sure that what is on one end of a patch cable is the same on the other end of the patch cable. That also goes for autonegotiation. Both devices need to be set to autonegotiation. If only one is set that way, then you will experience all types of network slowdowns! So remember:

10 to 10
100 to 100
1000 to 1000
half to half
full to full
auto to auto
Make sure that all of your speed and duplex match on all of your devices.
Quick Summary

  • Auto-negotiation is not 100% reliable, but it does generally work.
  • Links with a duplex mismatch will operate, but will generate large numbers of errors, and can slow down busy networks.
  • For most interfaces, both speed and duplex need to be set to auto for full auto-negotiation to work.
  • Forcing a Catalyst switch port to a specific speed disables auto-negotiation for the duplex setting.
  • Full-duplex mode can be achieved only if both sides of the link are either set to auto-negotiate or manually configured to use full-duplex.
  • Full-duplex will work only if a host is connected directly to a switch or other device, with no repeaters or hubs in-between.
  • If auto-negotiation is enabled on only one side of the link, it will always default to half-duplex, regardless of what the other side of the link is forced to.
  • If one side of a link is forced to full duplex and the other is set to auto-negotiation, a duplex mismatch will occur.
  • You can force a new auto-negotiation by simply unplugging a host cable for 10 seconds.
  • Most 10 Mb interfaces can run only in 10Mb half-duplex mode.
  • Most 10/100 Mb interfaces can do auto-negotiation. Most 10/100 Mb interfaces with RJ-45 twisted pair jacks can run in full-duplex mode.
  • Any network connected via an AUI port (with an external transceiver, for example) can run only in 10Mb half-duplex mode.

[FreeNAS Boot Failure]: If the boot device, HHD or USB drive, fails, how do you get FreeNAS up?

If the boot device, HHD or USB drive, fails, how do you get FreeNAS up?



 Power Off the system.

 Disconnect your boot drive and all data hard-drives from the system.

 Connect only your new boot drive, setup the drive on BIOS and reinstall FreeNAS on the new drive (hard drive, compact flash, USB ).

► Reboot the system and check if the FreeNAS installation is OK.

 Power Off the system, connect you data hard-drives back on the system.

► Start FreeNAS.
► If you have a back-up configuration file, you can restore it but you must remove the old mount point for your first drive/second partition and remove the old first drive.
► If you don’t have a back-up configuration file, just add all your drives, YOU DON’T NEED TO FORMAT ANY DRIVES and create the mount points for each drive.
Software RAID : If previously you use Software RAID, just add your drives on disks management, DON’T FORMAT THE DRIVES, built your Software RAID in the same way as before (DON’T FORMAT THE RAID ARRAY) and create the mount point for the RAID array.
 Setup the groups, users, services and you are back online.