M.2 to 4x SATA ModuleVoipac webshop

From Voipac Wiki
Revision as of 14:03, 19 February 2025 by Voipac (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

SATA

Input: Plug sata disk to M2 extension board and power on
Output: Sata device is recognized

Verify that disk is detected:

root@imx8mq-voipac:~# dmesg | grep -i 'sata\|ata1\|sda'
[2.715730] ahci 0000:01:00.0: AHCI 0001.0000 32 slots 4 ports 6 Gbps 0xf impl SATA mode
[2.764131] ata1: SATA max UDMA/133 abar m2048@0x20100000 port 0x20100100 irq 239
[2.764139] ata2: SATA max UDMA/133 abar m2048@0x20100000 port 0x20100180 irq 239
[2.764144] ata3: SATA max UDMA/133 abar m2048@0x20100000 port 0x20100200 irq 239
[2.764150] ata4: SATA max UDMA/133 abar m2048@0x20100000 port 0x20100280 irq 239
[3.076332] ata4: SATA link down (SStatus 0 SControl 300)
[3.087794] ata2: SATA link down (SStatus 0 SControl 300)
[3.148725] ata1: SATA link down (SStatus 0 SControl 300)
[3.315573] ata3: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[3.341751] ata3.00: ATA-9: 8GB SATA Flash Drive, SFDK003A, max UDMA/100
[3.382232] scsi 2:0:0:0: Direct-Access     ATA      8GB SATA Flash D 003A PQ: 0 ANSI: 5
[3.398313] sd 2:0:0:0: [sda] 15649200 512-byte logical blocks: (8.01 GB/7.46 GiB)
[3.407367] sd 2:0:0:0: [sda] Write Protect is off
[3.417888] sd 2:0:0:0: [sda] Mode Sense: 00 3a 00 00
[3.417941] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, does not support DPO or FUA
[3.446160]  sda: sda1
[3.450188] sd 2:0:0:0: [sda] Attached SCSI removable disk
root@imx8mq-voipac:~#
root@imx8mq-voipac:~# ls -la /dev/sda
brw-rw---- 1 root disk 8, 0 Feb 22 07:13 /dev/sda

Run speed test - write

root@imx8mq-voipac:~# time dd if=/dev/urandom of=/dev/sda bs=4096 status=progress count=200000
#NOTE: "of=/dev/sdb" is correct? + Consider using a printout from testing a better SATA disk - higher speeds were achieved.
812093440 bytes (812 MB, 774 MiB) copied, 29 s, 28.0 MB/s
200000+0 records in
200000+0 records out
819200000 bytes (819 MB, 781 MiB) copied, 34.1491 s, 24.0 MB/s
real    0m 34.15s
user    0m 0.30s
sys     0m 12.74s

Run speed test - read

root@imx8mq-voipac:~# time dd if=/dev/sda of=/tmp/test.bin bs=4096 status=progress count=100000
#NOTE: "if=/dev/sdb" is correct? + Consider using a printout from testing a better SATA disk - higher speeds were achieved.
364503040 bytes (365 MB, 348 MiB) copied, 4 s, 91.1 MB/s
100000+0 records in
100000+0 records out
409600000 bytes (410 MB, 391 MiB) copied, 4.5828 s, 89.4 MB/s
real    0m 4.79s
user    0m 0.06s
sys     0m 2.15s

We achieved a write speed ~ 24MB/s and read speed ~90MB/s

Partitions creation

Example how to create partitions on SATA disc

root@imx8mq-voipac:~# umount /dev/sda
umount: /dev/sda: not mounted.
root@imx8mq-voipac:~# fdisk /dev/sda

The number of cylinders for this disk is set to 44457.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): m
Command Action
a       toggle a bootable flag
b       edit bsd disklabel
c       toggle the dos compatibility flag
d       delete a partition
l       list known partition types
n       add a new partition
o       create a new empty DOS partition table
p       print the partition table
q       quit without saving changes
s       create a new empty Sun disklabel
t       change a partition system id
u       change display/entry units
v       verify the partition table
w       write table to disk and exit


Command (m for help): d
Selected partition 1

Command (m for help): n
Partition type
   p   primary partition (1-4)
   e   extended
p
Partition number (1-4): p
Partition number (1-4): 1
First sector (16-15649199, default 16): 16384
Last sector or +size{,K,M,G,T} (16384-15649199, default 15649199): +32M

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table
[  421.600720]  sda: sda1
root@imx8mq-voipac:~# fdisk /dev/sda

The number of cylinders for this disk is set to 61129.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p
Disk /dev/sda: 7641 MB, 8012390400 bytes, 15649200 sectors
61129 cylinders, 16 heads, 16 sectors/track
Units: sectors of 1 * 512 = 512 bytes

Device  Boot StartCHS    EndCHS        StartLBA     EndLBA    Sectors  Size Id Type
/dev/sda1    46,12,1     232,15,16        16384      81919      65536 32.0M 83 Linux

Command (m for help): n
Partition type
   p   primary partition (1-4)
   e   extended
p
Partition number (1-4): 2
First sector (16-15649199, default 16): 81920
Last sector or +size{,K,M,G,T} (81920-15649199, default 15649199):
Using default value 15649199

Command (m for help): p
Disk /dev/sda: 7641 MB, 8012390400 bytes, 15649200 sectors
61129 cylinders, 16 heads, 16 sectors/track
Units: sectors of 1 * 512 = 512 bytes

Device  Boot StartCHS    EndCHS        StartLBA     EndLBA    Sectors  Size Id Type
/dev/sda1    46,12,1     232,15,16        16384      81919      65536 32.0M 83 Linux
/dev/sda2    320,0,1     1023,15,16       81920   15649199   15567280 7601M 83 Linux

Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): l

 0 Empty                  1b Hidden Win95 FAT32     9f BSD/OS
 1 FAT12                  1c Hidden W95 FAT32 (LBA) a0 Thinkpad hibernation
 4 FAT16 <32M             1e Hidden W95 FAT16 (LBA) a5 FreeBSD
 5 Extended               3c Part.Magic recovery    a6 OpenBSD
 6 FAT16                  41 PPC PReP Boot          a8 Darwin UFS
 7 HPFS/NTFS              42 SFS                    a9 NetBSD
 a OS/2 Boot Manager      63 GNU HURD or SysV       ab Darwin boot
 b Win95 FAT32            80 Old Minix              b7 BSDI fs
 c Win95 FAT32 (LBA)      81 Minix / old Linux      b8 BSDI swap
 e Win95 FAT16 (LBA)      82 Linux swap             be Solaris boot
 f Win95 Ext d (LBA)      83 Linux                  eb BeOS fs
11 Hidden FAT12           84 OS/2 hidden C: drive   ee EFI GPT
12 Compaq diagnostics     85 Linux extended         ef EFI (FAT-12/16/32)
14 Hidden FAT16 <32M      86 NTFS volume set        f0 Linux/PA-RISC boot
16 Hidden FAT16           87 NTFS volume set        f2 DOS secondary
17 Hidden HPFS/NTFS       8e Linux LVM              fd Linux raid autodetect
Hex code (type L to list codes): c
Changed system type of partition 1 to c (Win95 FAT32 (LBA))

Command (m for help): p
Disk /dev/sda: 7641 MB, 8012390400 bytes, 15649200 sectors
61129 cylinders, 16 heads, 16 sectors/track
Units: sectors of 1 * 512 = 512 bytes

Device  Boot StartCHS    EndCHS        StartLBA     EndLBA    Sectors  Size Id Type
/dev/sda1    46,12,1     232,15,16        16384      81919      65536 32.0M  c Win95 FAT32 (LBA)
/dev/sda2    320,0,1     1023,15,16       81920   15649199   15567280 7601M 83 Linux

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table
[  624.001635]  sda: sda1 sda2
root@imx8mq-voipac:~#