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

linux下SD 报只读的问题解决方法

(2013-01-25 12:17:26)
标签:

杂谈

在部分Linux下使用SD卡的时候老是会报卡只读的问题:

mount -t vfat /dev/mmcblk0p1 /mnt/sd/
/dev/mmcblk0p1 is write-protected, mounting read-only

查了一下后发现解决办法如下:

原文来自:http://ubuntuforums.org/archive/index.php/t-341241.html

Mount my SD card writable

I have a SD card reader integrated in my laptop. I followed the procedure described at ThinkWiki (http://www.thinkwiki.org/wiki/Ho ... .10_.27edgy_eft.27:) so the card is auto mounted when inserted.

But it is mounted as readable only. So I unmounted the device and tried to mount it writable:

/media$ sudo mount /dev/mmcblk0p1 mmcdisk/ -rw
mount: block device /dev/mmcblk0p1 is write-protected but explicit `-w' flag given

And the card is not mounted.

However, I know it is not write-protected because my camera can write photos on it!

So, how am I supposed to make this card writable with Ubuntu?

1. 更换命令继续尝试
mount -t vfat /dev/mmcblk0p1 /media/mmcdisk -o iocharset=utf8,umask=000 仍然报错。

2. 查看硬盘及分区类型
And you think it's vfat/fat32! What's the output of this command from a terminal?
fdisk -l

Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 9331 74951226 83 Linux
/dev/hda2 9332 9729 3196935 5 Extended
/dev/hda5 9332 9729 3196903+ 82 Linux swap / Solaris

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sda doesn't contain a valid partition table

Disk /dev/mmcblk0: 252 MB, 252968960 bytes
16 heads, 32 sectors/track, 965 cylinders
Units = cylinders of 512 * 512 = 262144 bytes

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 1 965 246989+ 6 FAT16

说明SD卡的格式是fat16,不是ntfs,没问题。

3. 修改fstab,以rv选择mount,成功!
Remount SD card with rv options.
mkdir /media/sdcard
chmod u+w /media/sdcard

then edit /etc/fstab, and add the following:

/dev/mmcblk0p1 /media/sdcard auto umask=0,rw,user,auto 0 0

mount -o remount -o rv /dev/mmcblk0p1

That's what I've just done and it's working.

0

阅读 收藏 喜欢 打印举报/Report
  

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

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

新浪公司 版权所有