digital西行庵 wiki  Index  Search  Changes  PageRank  RSS  Login

digital西行庵 wiki - Mount SDHC on sheevaplug Diff

  • Added parts are displayed like this.
  • Deleted parts are displayed like this.

!SDカードをマウントしてみる
SC08GADK2A1SHCM(BUFFALO)8GB SDHC CLASS6 をマウントしてみよう。

ざくっと挿して、まづは、パーテションを切って、フォーマット。
root@SheevaPlug:~# fdisk /dev/mmcblk0
   :
Command (m for help): p

Disk /dev/mmcblk0: 8204 MB, 8204058624 bytes
108 heads, 6 sectors/track, 24727 cylinders
Units = cylinders of 648 * 512 = 331776 bytes
Disk identifier: 0x00000000

         Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1              13       24728     8007680    b  W95 FAT32

Command (m for help): d
Selected partition 1

Command (m for help): p

Disk /dev/mmcblk0: 8204 MB, 8204058624 bytes
108 heads, 6 sectors/track, 24727 cylinders
Units = cylinders of 648 * 512 = 331776 bytes
Disk identifier: 0x00000000

         Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
    e   extended
    p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-24727, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-24727, default 24727):
Using default value 24727

Command (m for help): p

Disk /dev/mmcblk0: 8204 MB, 8204058624 bytes
108 heads, 6 sectors/track, 24727 cylinders
Units = cylinders of 648 * 512 = 331776 bytes
Disk identifier: 0x00000000

         Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1               1       24727     8011545   83  Linux

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

Calling ioctl() to re-read partition table.
Syncing disks.
root@SheevaPlug:~# mkfs.ext2 /dev/mmcblk0p1
mke2fs 1.41.3 (12-Oct-2008)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
500960 inodes, 2002886 blocks
100144 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2051014656
62 block groups
32768 blocks per group, 32768 fragments per group
8080 inodes per group
Superblock backups stored on blocks:
         32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

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

This filesystem will be automatically checked every 27 mounts or 180 days, whichever comes first.  Use tune2fs -c or -i to override.
root@SheevaPlug:/home/nitobe#
お・遅い。異様に遅い。

次にファイルの読み書き。
root@SheevaPlug:/home/nitobe# mount /dev/mmcblk0p1 /mnt
root@SheevaPlug:/home/nitobe# cd /mnt
root@SheevaPlug:/mnt# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                  519168    196776    322392  38% /
tmpfs                   257816         0    257816   0% /lib/init/rw
varrun                  257816        36    257780   1% /var/run
varlock                 257816         0    257816   0% /var/lock
udev                    257816        12    257804   1% /dev
tmpfs                   257816         0    257816   0% /dev/shm
tmpfs                   257816         0    257816   0% /var/cache/apt
/dev/mmcblk0p1         7885736    148796   7336364   2% /mnt
root@SheevaPlug:/mnt#
root@SheevaPlug:/mnt# time dd if=/dev/zero of=/mnt/test bs=1M count=128
128+0 records in
128+0 records out
134217728 bytes (134 MB) copied, 53.1529 s, 2.5 MB/s

real    1m1.068s
user    0m0.010s
sys     0m1.370s
root@SheevaPlug:/mnt# time dd if=/mnt/test of=/dev/null bs=1M count=128
128+0 records in
128+0 records out
134217728 bytes (134 MB) copied, 0.592085 s, 227 MB/s

real    0m0.603s
user    0m0.010s
sys     0m0.590s
Write:2.5MB/s Read:227MB/s 遅い。Writeが異様に遅い。

現在、2.6.22.18 のカーネルを、2.6.30-rXにアップデートすると改善するらしい。
!カーネルアップデート
別ページを作ったので参照しちくり。

[[Update of kernel on sheevaplug|http://www.saigyo.net/hiki/?Update+of+kernel+on+sheevaplug]]
!2.6.30-r8で再計測
仕切り直しだ。パーテイショニングとフォーマットは省略。
!!内臓 NAND Flash
root@SheevaPlug:~# time dd if=/dev/zero of=/mnt/test bs=64k count=2k
2048+0 records in
2048+0 records out
134217728 bytes (134 MB) copied, 21.024 s, 6.4 MB/s

real    0m21.142s
user    0m0.020s
sys     0m19.600s
root@SheevaPlug:~# time dd if=/mnt/test of=/dev/null bs=64k count=2k
2048+0 records in
2048+0 records out
134217728 bytes (134 MB) copied, 0.597294 s, 225 MB/s

real    0m0.610s
user    0m0.010s
sys     0m0.600s
root@SheevaPlug:~# time rm /mnt/test

real    0m0.109s
user    0m0.010s
sys     0m0.100s
!外付け SD カード
SC08GADK2A1SHCM(BUFFALO)8GB SDHC CLASS6
root@SheevaPlug:~# dmesg
   :
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new high speed SDHC card at address 0002
mmcblk0: mmc0:0002 SD    7.64 GiB
  mmcblk0: p1
root@SheevaPlug:~# mount /dev/mmcblk0p1 /mnt
root@SheevaPlug:~# time dd if=/dev/zero of=/mnt/test bs=64k count=2k
2048+0 records in
2048+0 records out
134217728 bytes (134 MB) copied, 12.4273 s, 10.8 MB/s

real    0m12.441s
user    0m0.000s
sys     0m1.760s
root@SheevaPlug:~# time dd if=/mnt/test of=/dev/null bs=64k count=2k
2048+0 records in
2048+0 records out
134217728 bytes (134 MB) copied, 0.571348 s, 235 MB/s

real    0m0.584s
user    0m0.010s
sys     0m0.580s
root@SheevaPlug:~# time rm /mnt/test

real    0m0.601s
user    0m0.000s
sys     0m0.140s
root@SheevaPlug:~# umount /mnt
!外付け USB Flash
{{attach_view(aya.gif)}}[[RUF2-SWT2G-PAR (BUFFALO) 綾波レイ|http://buffalo.jp/products/catalog/flash/swattears/ruf2-swt-par/]]
root@SheevaPlug:~# dmesg
   :
usb 1-1: new high speed USB device using orion-ehci and address 2
usb 1-1: configuration #1 chosen from 1 choice
scsi0 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 2
usb-storage: waiting for device to settle before scanning
scsi 0:0:0:0: Direct-Access     BUFFALO  USB Memory       4000 PQ: 0 ANSI: 0 CCS
sd 0:0:0:0: Attached scsi generic sg0 type 0
usb-storage: device scan complete
sd 0:0:0:0: [sda] 3915776 512-byte hardware sectors: (2.00 GB/1.86 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Assuming drive cache: write through
  sda: sda1
sd 0:0:0:0: [sda] Attached SCSI removable disk
root@SheevaPlug:~# mount /dev/sda1 /mnt
root@SheevaPlug:~# time dd if=/dev/zero of=/mnt/test bs=64k count=2k
2048+0 records in
2048+0 records out
134217728 bytes (134 MB) copied, 4.63065 s, 29.0 MB/s

real    0m4.643s
user    0m0.000s
sys     0m1.470s
root@SheevaPlug:~# time dd if=/mnt/test of=/dev/null bs=64k count=2k
2048+0 records in
2048+0 records out
134217728 bytes (134 MB) copied, 0.587955 s, 228 MB/s

real    0m0.600s
user    0m0.000s
sys     0m0.600s
root@SheevaPlug:~# time rm /mnt/test

real    0m0.328s
user    0m0.000s
sys     0m0.320s
root@SheevaPlug:~# umount /mnt
!外付け USB-HDD
HD-PF160U2-BK(BUFFALO)
root@SheevaPlug:~# dmesg
   :
usb 1-1: new high speed USB device using orion-ehci and address 3
usb 1-1: configuration #1 chosen from 1 choice
scsi1 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 3
usb-storage: waiting for device to settle before scanning
scsi 1:0:0:0: Direct-Access     WDC WD16 00BEVT-22ZCT0         PQ: 0 ANSI: 2
sd 1:0:0:0: Attached scsi generic sg0 type 0
usb-storage: device scan complete
sd 1:0:0:0: [sda] 312581808 512-byte hardware sectors: (160 GB/149 GiB)
sd 1:0:0:0: [sda] Write Protect is off
sd 1:0:0:0: [sda] Mode Sense: 38 00 00 00
sd 1:0:0:0: [sda] Assuming drive cache: write through
sd 1:0:0:0: [sda] Assuming drive cache: write through
  sda: sda1
sd 1:0:0:0: [sda] Attached SCSI disk
root@SheevaPlug:~# mount /dev/sda1 /mnt
root@SheevaPlug:~# time dd if=/dev/zero of=/mnt/test bs=64k count=2k
2048+0 records in
2048+0 records out
134217728 bytes (134 MB) copied, 2.82488 s, 47.5 MB/s

real    0m2.882s
user    0m0.000s
sys     0m1.710s
root@SheevaPlug:~# time dd if=/mnt/test of=/dev/null bs=64k count=2k
2048+0 records in
2048+0 records out
134217728 bytes (134 MB) copied, 0.561543 s, 239 MB/s

real    0m0.574s
user    0m0.010s
sys     0m0.560s
root@SheevaPlug:~# time rm /mnt/test

real    0m0.147s
user    0m0.000s
sys     0m0.140s
root@SheevaPlug:~# umount /mnt

||Kernel||Media||Write||Read|| ||
||2.6.30-r8||内臓NAND Flash||6.4 MB/s||225 MB/s||64k*2k||
||2.6.22.18||外付SD||2.5 MB/s||227 MB/s||1M*128||
||2.6.30-r8||外付SD||10.8 MB/s||235 MB/s||64k*2k||
||2.6.30-r8||外付USB Flash||29.0 MB/s||228 MBs||64k*2k||
||2.6.30-r8||外付USB HDD||47.5 MB/s||239 MB/s||64k*2k||

綾波レイが予想外に速い。
本来、数回実行して平均を求めるところだが、ざっくりわかればいいので、一発勝負だ。あくまで、傾向・・・ってことで。神経質な方は自分で計測してください。