在pcDuino V3上面使用sata接口

酸酸苹果汁 发布于 2014/05/14 16:49
阅读 1K+
收藏 3

5

pcDuino V3 上面的Sata接口不但可以用来存放东西,还可以用来装系统,这一节内容,主要介绍硬盘接口常识,还有在pcDuino存放东西等内容。

一,连接固态硬盘到pcDuino V3上面。

5我这里是将市面上一根普通的sata改装了,上面的黑线都是为地线,一般sata线为了满足机械硬盘的需要设计了5V和12V电源。具体的电源接口,我已经在图中详细的介绍了。这里使用的是固态硬盘,只是使用5V。在板子上的正负极也清晰的标明。下面就开始在系统里面使用这块固态硬盘。

1,先查看系统是否识别到了这块固态硬盘。

$sudo fdisk -l

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
ubuntu @ubuntu :~$ sudo fdisk -l
 
Disk /dev/nand:3984MB,3984588800bytes
255heads,63sectors/track,484cylinders, total7782400sectors
Units = sectors of1*512=512bytes
Sector size (logical/physical):512bytes /512bytes
I/O size (minimum/optimal):512bytes /512bytes
Disk identifier:0x00000000
 
Disk /dev/nand doesn't contain a valid partition table
 
Disk /dev/nanda:33MB,33554432bytes
255heads,63sectors/track,4cylinders, total65536sectors
Units = sectors of1*512=512bytes
Sector size (logical/physical):512bytes /512bytes
I/O size (minimum/optimal):512bytes /512bytes
Disk identifier:0x00000000
 
     Device Boot      Start         End      Blocks   Id  System
 
Disk /dev/nandb:16MB,16777216bytes
255heads,63sectors/track,2cylinders, total32768sectors
Units = sectors of1*512=512bytes
Sector size (logical/physical):512bytes /512bytes
I/O size (minimum/optimal):512bytes /512bytes
Disk identifier:0x69726373
 
Disk /dev/nandb doesn't contain a valid partition table
 
Disk /dev/nandc:16MB,16777216bytes
255heads,63sectors/track,2cylinders, total32768sectors
Units = sectors of1*512=512bytes
Sector size (logical/physical):512bytes /512bytes
I/O size (minimum/optimal):512bytes /512bytes
Disk identifier:0xcdcdcdcd
 
Disk /dev/nandc doesn't contain a valid partition table
 
Disk /dev/nandd:3900MB,3900702720bytes
255heads,63sectors/track,474cylinders, total7618560sectors
Units = sectors of1*512=512bytes
Sector size (logical/physical):512bytes /512bytes
I/O size (minimum/optimal):512bytes /512bytes
Disk identifier:0x00000000
 
Disk /dev/nandd doesn't contain a valid partition table
 
Disk /dev/mmcblk0:8054MB,8054112256bytes
4heads,16sectors/track,245792cylinders, total15730688sectors
Units = sectors of1*512=512bytes
Sector size (logical/physical):512bytes /512bytes
I/O size (minimum/optimal):512bytes /512bytes
Disk identifier:0x00000000
 
        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1           2048      34815      16384  83 Linux
/dev/mmcblk0p2          34816   15730687    7847936  83 Linux
 
Disk /dev/sda:120.0GB,120034123776bytes
255heads,63sectors/track,14593cylinders, total234441648sectors
Units = sectors of1*512=512bytes
Sector size (logical/physical):512bytes /512bytes
I/O size (minimum/optimal):512bytes /512bytes
Disk identifier:0x038c3144
 
   Device Boot      Start         End      Blocks   Id  System

可以看到系统已经识别到了是dev/sda

但是整个硬盘没有分区,没有指定文件系统,也就没有挂载。

下面先对硬盘分区。

$sudo fdisk  /dev/sda

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Disk /dev/nandb:16MB,16777216bytes
255heads,63sectors/track,2cylinders, total32768sectors
Units = sectors of1*512=512bytes
Sector size (logical/physical):512bytes /512bytes
I/O size (minimum/optimal):512bytes /512bytes
Disk identifier:0x69726373
 
Disk /dev/nandb doesn't contain a valid partition table
 
Disk /dev/nandc:16MB,16777216bytes
255heads,63sectors/track,2cylinders, total32768sectors
Units = sectors of1*512=512bytes
Sector size (logical/physical):512bytes /512bytes
I/O size (minimum/optimal):512bytes /512bytes
Disk identifier:0xcdcdcdcd
 
Disk /dev/nandc doesn't contain a valid partition table
 
Disk /dev/nandd:3900MB,3900702720bytes
255heads,63sectors/track,474cylinders, total7618560sectors
Units = sectors of1*512=512bytes
Sector size (logical/physical):512bytes /512bytes
I/O size (minimum/optimal):512bytes /512bytes
Disk identifier:0x00000000
 
Disk /dev/nandd doesn't contain a valid partition table
 
Disk /dev/mmcblk0:8054MB,8054112256bytes
4heads,16sectors/track,245792cylinders, total15730688sectors
Units = sectors of1*512=512bytes
Sector size (logical/physical):512bytes /512bytes
I/O size (minimum/optimal):512bytes /512bytes
Disk identifier:0x00000000
 
        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1           2048      34815      16384  83 Linux
/dev/mmcblk0p2          34816   15730687    7847936  83 Linux
 
Disk /dev/sda:120.0GB,120034123776bytes
81heads,63sectors/track,45941cylinders, total234441648sectors
Units = sectors of1*512=512bytes
Sector size (logical/physical):512bytes /512bytes
I/O size (minimum/optimal):512bytes /512bytes
Disk identifier:0x038c3144
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1           2048  234441647  117219800  83 Linux

将硬盘整个划分为主分区,最后写入分区表,最后格式化分区。这个可能要等一分钟

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
ubuntu @ubuntu :~$ sudo mkfs.ext2 /dev/sda1
mke2fs1.42(29-Nov-2011)
Discarding device blocks: done                           
Filesystemlabel=
OS type: Linux
Block size=4096(log=2)
Fragment size=4096(log=2)
Stride=0blocks, Stripe width=0blocks
7331840inodes,29304950blocks
1465247blocks (5.00%) reservedforthesuperuser
First data block=0
Maximum filesystem blocks=0
895block groups
32768blocks per group,32768fragments per group
8192inodes 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                           
Writing superblocks and filesystem accounting information: done

手动挂载到系统上面

$ sudo mount /dev/sda1 /mnt

查看挂载结果

?
1
2
3
4
5
6
7
8
9
10
11
12
ubuntu @ubuntu :~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p2 7.4G 1.3G 5.8G 19% /
none            438M 4.0K  438M  1% /dev
none            438M 4.0K  438M  1% /tmp
none             88M  252K   88M  1% /run
none           5.0M    0 5.0M  0% /run/lock
none            438M    0 438M  0% /run/shm
none            438M    0 438M  0% /var/tmp
none            438M  636K  438M  1% /var/log
/dev/mmcblk0p1   16M 6.3M 9.8M 40% /media/D87E-7AFD
/dev/sda1       111G   60M  105G  1% /mnt

 


linksprite学习中心

加载中
0
itbj00
itbj00
只有v3 版的支持。
0
冰点信
谢谢分享,我手头也有个,我试试
返回顶部
顶部