Linux 下将sd格式化成ext2并挂载

2019-07-13 00:27发布

  sd卡在windows下格式化,只能格式化为FAT文件系统格式的,但是FAT文件系统在linux下不支持软链接。所以又必要将其格式化成linux下的文件系统格式,例如EXT2。 使用嵌入式linux中自带的工具命令mkfs.ext2。 root@target:~# mkfs.ext2 /dev/mmcblk0 
mke2fs 1.41.5 (23-Apr-2009)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
31360 inodes, 125440 blocks
6272 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
16 block groups
8192 blocks per group, 8192 fragments per group
1960 inodes per group
Superblock backups stored on blocks: 
8193, 24577, 40961, 57345, 73729


Writing inode tables:  0/16 1/16 2/16 3/16 4/16 5/16 6/16 7/16 8/16 9/1610/1611/1612/1613/1614/1615/16done                            
Writing superblocks and filesystem accounting information: done


This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
root@target:~# 
挂载sd卡 root@target:~# mount -t ext2 /dev/mmcblk0 /media/mmc1/
进入sd卡,出现“lost+found”表示已经挂载成功 root@target:~# cd /media/mmc1/
root@target:/media/mmc1# ls
lost+found