pidora で NAS (ラズパイ1)

イントロダクション

pidora で NAS を動かす。




本題

結果から
遅い、書き込み3MB/s 24Mbpsくらい。168GBで13時間とかでてる\(^o^)/
どうやら、ntfs より ext4 のほうが早いみたいので切替する。
ext4 だと 10MB/s くらいでNICの限界くらいはでる。

■ext4 へ変更
# umount /dev/sda2
# fdisk /dev/sda
パーティション2つ削除
Command (m for help): d
Command (m for help): d
適用
Command (m for help): w


# fdisk /dev/sda
Command (m for help): n
Partition number (1-128, default 1): 
First sector (34-11721045134, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-11721045134, default 11721045134): 

Created a new partition 1 of type 'Linux filesystem' and of size 5.5 TiB.

Command (m for help): p
Disk /dev/sda: 5.5 TiB, 6001175126016 bytes, 11721045168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 14B42CD2-CFE9-4B67-8A39-8D25D0BC2A84

Device    Start          End   Size Type
/dev/sda1  2048  11721045134   5.5T Linux filesystem

Command (m for help): w

ext4 でフォーマット
# mkfs.ext4 /dev/sda1

マウント
[root@pidora01 samba]# cat /etc/fstab | grep sda1
/dev/sda1           /mnt/hdd6tb             ext4    nofail 0 0

■samba 設定
インストール
# yum install samba
自動起動
# systemctl enable smb
ユーザー追加 例 test
# pdbedit -a test
確認
# pdbedit -L
削除
# pdbedit -x test
conf
# cat /etc/samba/smb.conf
### ここから
[global]
workgroup = WORKGROUP
server string = SAMBA SERVER Version %v
netbios name = fs
security = user
passdb backend = tdbsam
dos charset = CP932
wins support = yes
load printers = no
disable spoolss = yes
server min protocol = SMB2


[Share]
comment = Share Folder for All Users
path = /mnt/hdd6tb
browsable = yes
read only = no
### ここまで

Windows10 は SMB2 の部分が無いとアクセスできない。

まとめ

ざっくりこれで、10MB/sでるNASが手に入る。
ラズパイ3で 35MB/s くらい???
ラズパイ4だと100MB/s でるのかな???

ものが無いことには検証できないので購入すると思います。

USBで1GB NIC 付けると早いのかな?

■OS情報
# uname -a
Linux pidora01.local 3.12.26-1.20140808git4ab8abb.rpfr20.armv6hl.bcm2708 #1 PREEMPT Fri Aug 8 17:13:15 EDT 2014 armv6l armv6l armv6l GNU/Linux
# free -h
             total       used       free     shared    buffers     cached
Mem:          435M       381M        54M       972K       9.7M       175M
-/+ buffers/cache:       195M       239M
Swap:         511M         0B       511M

# cat /proc/cpuinfo
processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
Features        : swp half thumb fastmult vfp edsp java tls 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2708
Revision        : 0010

■純粋な書き込みは、 21.3MB/s っぽい。
[root@pidora01 hdd6tb]# dd if=/dev/zero of=benchmark bs=64K count=32K conv=fdatasync
32768+0 records in
32768+0 records out
2147483648 bytes (2.1 GB) copied, 100.669 s, 21.3 MB/s
[root@pidora01 hdd6tb]# pwd
/mnt/hdd6tb

■USB NIC
Bus 001 Device 005: ID 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet
Device Descriptor:
  idVendor           0x0b95 ASIX Electronics Corp.
  idProduct          0x1790 AX88179 Gigabit Ethernet
  bcdDevice            1.00
  iManufacturer           1 ASIX Elec. Corp.
  iProduct                2 AX88179

コメント