linux SD 读写问题

来源:互联网 发布:raphaelmin.js 编辑:程序博客网 时间:2024/05/07 11:07
  • 请教一下大家 为什么 执行完 write2sd的下载脚本 linux 立刻不再识别sd卡
  • df已经看不到设备了)
  • 之后发现在dev目录下依旧有sdbx 还可以执行烧写脚本(不过烧完uoot只显示了OK。。。)
  • 在win7下依旧能识别 而只要随便添加个文件 再插回linux就又可以识别了
  • 求原因
  • 主要是可以弹出 不知道直接拔SD对其是否有很大影响
  • 还请不惜赐教  非常感谢 orz
  • write2sd内容如下:
  •  #!/bin/sh 
  • sudo dd iflag=dsync oflag=dsync if=./BL1/BL1.bin of=/dev/sdb1 seek=1 
  • sudo dd iflag=dsync oflag=dsync if=./BL2/lcd.bin of=/dev/sdb1 seek=49


。。。
。。。

后来发现 输出文件就应该是/dev/sdb 虽然df出来的sdb1 
但在插入sd后/dev目录下会多出sdb和sdb1

执行sudo fdisk sdb  输入密码后 输入 p   
(tip:p  print the partition table  
           q   quit without saving changes

显示如下
Disk sdb: 4076 MB, 4076863488 bytes
255 heads, 63 sectors/track, 495 cylinders, total 7962624 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot      Start         End      Blocks   Id  System
  sdb1             128     7962623     3981248    b  W95 FAT32

输入q 退出后

执行sudo fdisk sdb1  输入密码后 输入 
显示如下
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xfa884e87.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

所以输出设备对应的文件应该是/dev/sdb

换上新的SD卡  发现不会再无法识别  估计是卡的原因  
虽然旧卡不显示  但不影响烧写 (成功烧写uboot)
0 0
原创粉丝点击