- Table of contents
- Example SATA
Example SATA¶
Objectives¶
- Connect a SATA drive to the devkit
- Create a file system on a partition
- Mount the file system
- Run a performance test
Prerequisites¶
- SATA drive. For this example, a Kingston 120GB SSDnow Kc300 drive is being used.
- SATA data cable
- SATA power cable
- SATA power supply. For this example, a PC power supply was used.
Steps¶
Configure the hardware¶
- Turn the devkit and SATA power supply off
- Connect the data cable between the devkit SATA connector (J12) and the SATA drive
- Connect the SATA power cable between the SATA drive and the SATA power supply
- Turn the SATA Power supply on
- Turn the devkit on
Configure and mount file system¶
If the drive already has a file-system, it may automatically mount when the devkit boots up. Use the mount command to see if /dev/sda1 is mounted.
root@mitysom-am57x:~# mount | grep sda /dev/sda1 on /run/media/sda1 type ext4 (rw,relatime)
If the drive is mounted, unmount it so we can create our own file-system.
root@mitysom-am57x:~# umount /run/media/sda1/ root@mitysom-am57x:~# mkfs.ext4 /dev/sda1 mke2fs 1.44.3 (10-July-2018) /dev/sda1 contains a ext4 file system last mounted on Wed Aug 2 18:15:15 2023 Proceed anyway? (y,N) y 64-bit filesystem support is not enabled. The larger fields afforded by this feature enable full-strength checksumming. Pass -O 64bit to rectify. Discarding device blocks: done Creating filesystem with 29304832 4k blocks and 7331840 inodes Filesystem UUID: c243b869-6e91-4d19-bae4-18749eb307f4 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 (131072 blocks): done Writing superblocks and filesystem accounting information: done root@mitysom-am57x:~# mount -t ext4 /dev/sda1 /run/media/sda1 [ 129.208195] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null) root@mitysom-am57x:~# cd /run/media/sda1 root@mitysom-am57x:/run/media/sda1# ls lost+found
Run Benchmark¶
root@mitysom-am57x:/run/media/sda1# bonnie++ -d /run/media/sda1 -s 5G -n 0 -m MITYSOM-AM57x -f -b -u root Using uid:0, gid:0. Writing intelligently...done Rewriting...done Reading intelligently...done start 'em...done...done...done... Version 1.04 ------Sequential Output------ --Sequential Input- --Random- -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks-- Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP MITYSOM-AM57x 5G 155959 73 90982 46 237749 64 5895 42 MITYSOM-AM57x,5G,,,155959,73,90982,46,,,237749,64,5894.5,42,,,,,,,,,,,,,
The rates achieved for reading and writing will depend on the type of drive being used.
Conclusion¶
In this example, a file system was created on a SATA drive and a benchmark was run to measure the performance.
Go to top