cubieboard 磁盘性能
今天把很早之前的 cubieboard 翻了出来,打算做 nas 。缺点是网卡是100M的。
现在的tf安装的 linaro server 14.04 系统。
tf卡是:三星(SAMSUNG)16GB UHS-1 Class10 TF(Micro SD)存储卡(读速48Mb/s)升级版
http://item.jd.com/763749.html
tf 卡速度为:
linaro@cubieboard:~$ sudo time dd if=/dev/zero bs=1024 count=1000000 of=/1Gb.file
1000000+0 records in
1000000+0 records out
1024000000 bytes (1.0 GB) copied, 106.254 s, 9.6 MB/s
0.83user 20.45system 1:46.26elapsed 20%CPU (0avgtext+0avgdata 640maxresident)k
8inputs+2000000outputs (1major+208minor)pagefaults 0swaps
linaro@cubieboard:~$ time dd if=/1Gb.file bs=64k |dd of=/dev/null
15625+0 records in
15625+0 records out
1024000000 bytes (1.0 GB) copied, 66.1161 s, 15.5 MB/s
2000000+0 records in
2000000+0 records out
1024000000 bytes (1.0 GB) copied, 66.1271 s, 15.5 MB/s
real 1m6.146s
user 0m2.350s
sys 0m17.540s
找了一块古董100g硬盘来做测试。
linaro@cubieboard:~$ sudo fdisk -l
....
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 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 identifier: 0xe467e467
Device Boot Start End Blocks Id System
....
fdisk 列出硬盘分区,硬盘的分区已经预先删干净了,下面新建一个主分区,并建立文件系统。
linaro@cubieboard:~$ sudo fdisk /dev/sda
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1):
Using default value 1
First sector (2048-312581807, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-312581807, default 312581807): +1G
Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p):
Using default response p
Partition number (1-4, default 2):
Using default value 2
First sector (2099200-312581807, default 2099200):
Using default value 2099200
Last sector, +sectors or +size{K,M,G} (2099200-312581807, default 312581807):
Using default value 312581807
Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): 82
Changed system type of partition 1 to 82 (Linux swap / Solaris)
Command (m for help): p
Disk /dev/sda: 160.0 GB, 160041885696 bytes
81 heads, 63 sectors/track, 61254 cylinders, total 312581808 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 identifier: 0xe467e467
Device Boot Start End Blocks Id System
/dev/sda1 2048 2099199 1048576 82 Linux swap / Solaris
/dev/sda2 2099200 312581807 155241304 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
linaro@cubieboard:~$ sudo mkswap /dev/sda1
Setting up swapspace version 1, size = 1048572 KiB
no label, UUID=d1ba1e55-5eac-4226-9a2d-cda6eec6a84e
linaro@cubieboard:~$ sudo mkfs.ext4 /dev/sda2
mke2fs 1.42.9 (4-Feb-2014)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
9773056 inodes, 39072470 blocks
1953623 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
1193 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, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks):
done
Writing superblocks and filesystem accounting information:
done
建立目录,挂载分区。
linaro@cubieboard:~$ sudo mkdir /mnt/100g
linaro@cubieboard:/mnt/100g$ cat /etc/fstab
# UNCONFIGURED FSTAB FOR BASE SYSTEM
tmpfs /tmp tmpfs size=20m 0 0
/dev/sda1 none swap defaults 0 0
/dev/sda2 /mnt/100g ext4 defaults,noatime 0 2
linaro@cubieboard:~$ sudo swapon /dev/sda1
linaro@cubieboard:~$ sudo mount -a
linaro@cubieboard:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 7.3G 1.5G 5.6G 21% /
devtmpfs 493M 4.0K 493M 1% /dev
none 4.0K 0 4.0K 0% /sys/fs/cgroup
tmpfs 20M 0 20M 0% /tmp
none 99M 244K 99M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 493M 0 493M 0% /run/shm
none 100M 0 100M 0% /run/user
/dev/sda2 147G 188M 140G 1% /mnt/100g
跑磁盘性能测试
linaro@cubieboard:/mnt/100g$ sudo time dd if=/dev/zero bs=1024 count=1000000 of=/mnt/100g/1Gb.file
1000000+0 records in
1000000+0 records out
1024000000 bytes (1.0 GB) copied, 52.1182 s, 19.6 MB/s
0.85user 20.33system 0:52.13elapsed 40%CPU (0avgtext+0avgdata 640maxresident)k
8inputs+2000056outputs (0major+217minor)pagefaults 0swaps
linaro@cubieboard:/mnt/100g$ time dd if=/mnt/100g/1Gb.file bs=64k |dd of=/dev/null
15625+0 records in
15625+0 records out
1024000000 bytes (1.0 GB) copied, 39.456 s, 26.0 MB/s
2000000+0 records in
2000000+0 records out
1024000000 bytes (1.0 GB) copied, 39.469 s, 25.9 MB/s
real 0m39.494s
user 0m2.220s
sys 0m20.660s
linaro@cubieboard:/mnt/100g$
性能并不好,不过由于网卡只有100M,NAS 瓶颈并不在磁盘,而是在网络…
参考:
linux测试硬盘读写速度
http://5iwww.blog.51cto.com/856039/432290
cubieboard的sata评测
http://raspiweb.ch/post-56.htm