加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

EMMC分区格式化

(2022-03-17 11:28:00)
#!/bin/sh #1.Determines whether the /data directory is mounted echo "Determines whether the /data directory is mounted" if mountpoint -q /data then echo "The /data directory has been mounted,will exit the shell" exit else echo "The /data directory not mounted" fi #2.Determine if /dev/mmcblk0p1 exists. If so, try mount it first echo "Determine if /dev/mmcblk0p1 exists. If so, try mount it first" if [ -e '/dev/mmcblk0p1' ] then echo "/dev/mmcblk0p1 already exist!" echo "do- mount /dev/mmcblk0p1 /data" mount /dev/mmcblk0p1 /data if [ "$?" = 0 ] then echo "mount /dev/mmcblk0p1 /data successful!!!" else echo "first mount failed,then do- mkfs.vfat -I /dev/mmcblk0p1" mkfs.vfat -I /dev/mmcblk0p1 echo "do- mount /dev/mmcblk0p1 /data" mount /dev/mmcblk0p1 /data fi exit fi #3.Partition the disk at /dev/mmcblk0 echo "Partition the disk at /dev/mmcblk0" echo "First enter: n" echo "Second enter: p" echo "Third enter: 1" echo "Fourth enter: 1" echo "Five enter 120832" echo "Six enter w" fdisk /dev/mmcblk0 << EOF n p 1 1 120832 w EOF if [ "$?" = 0 ] then if [ -e '/dev/mmcblk0p1' ] then echo "/dev/mmcblk0p1 exist!" else echo "/dev/mmcblk0p1 not exist!!!" fi else echo "The fdisk command failed" exit fi #4.Format the partition /dev/mmcblk0p1 and mount echo "Format the partition /dev/mmcblk0p1 and mount" echo "do-- mkfs.vfat -I /dev/mmcblk0p1" mkfs.vfat -I /dev/mmcblk0p1 echo "do-- mount /dev/mmcblk0p1 /data" mount /dev/mmcblk0p1 /data

0

阅读 收藏 喜欢 打印举报/Report
前一篇:C盘清理.bat
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有