当我将Sony摄像机插入Linux系统时,文件系统以只读方式挂载。我不能简单地挂载它的读写,我首先要使用“hdparm -r0”来使“设备”读写。为什么会这样,为什么“hdparm -r0”被认为是“危险的”?
“dmesg”输出如下。
- 将设备插入。
[ 1371.786740] usb 2-1.2: new full-speed USB device number 6 using ehci-pci
[ 1371.875813] usb 2-1.2: New USB device found, idVendor=054c, idProduct=0830
[ 1371.875822] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1371.875827] usb 2-1.2: Product: USB Bus-powered Device
[ 1371.875832] usb 2-1.2: Manufacturer: Sony
[ 1371.875835] usb 2-1.2: SerialNumber: ************
[ 1371.879120] input: Sony USB Bus-powered Device as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/input/input21
[ 1371.879552] hid-generic 0003:054C:0830.0006: input,hidraw4: USB HID v1.11 Device [Sony USB Bus-powered Device] on usb-0000:00:1d.0-1.2/input0
[ 1372.377533] usb 2-1.2: USB disconnect, device number 6
- 打开设备。
[ 1395.073294] usb 2-1.2: new high-speed USB device number 7 using ehci-pci
[ 1395.159821] usb 2-1.2: New USB device found, idVendor=054c, idProduct=08de
[ 1395.159831] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1395.159837] usb 2-1.2: Product: HDR-AS100V
[ 1395.159840] usb 2-1.2: Manufacturer: Sony
[ 1395.159844] usb 2-1.2: SerialNumber: ************
[ 1395.198826] usb-storage 2-1.2:1.0: USB Mass Storage device detected
[ 1395.198936] scsi6 : usb-storage 2-1.2:1.0
[ 1395.199078] usbcore: registered new interface driver usb-storage
[ 1396.202342] scsi 6:0:0:0: Direct-Access Sony Camcorder 1.00 PQ: 0 ANSI: 0
[ 1396.218549] scsi 6:0:0:1: Direct-Access Sony Camcorder 1.00 PQ: 0 ANSI: 0
[ 1396.219347] sd 6:0:0:0: Attached scsi generic sg2 type 0
[ 1396.220185] sd 6:0:0:1: Attached scsi generic sg3 type 0
[ 1396.305975] sd 6:0:0:0: [sdc] 123795456 512-byte logical blocks: (63.3 GB/59.0 GiB)
[ 1396.306358] sd 6:0:0:1: [sdd] 102400 512-byte logical blocks: (52.4 MB/50.0 MiB)
[ 1396.307338] sd 6:0:0:0: [sdc] Write Protect is on
[ 1396.307346] sd 6:0:0:0: [sdc] Mode Sense: 03 00 80 00
[ 1396.308599] sd 6:0:0:1: [sdd] Write Protect is on
[ 1396.308605] sd 6:0:0:1: [sdd] Mode Sense: 03 00 80 00
[ 1396.309579] sd 6:0:0:0: [sdc] No Caching mode page found
[ 1396.309586] sd 6:0:0:0: [sdc] Assuming drive cache: write through
[ 1396.310725] sd 6:0:0:1: [sdd] No Caching mode page found
[ 1396.310733] sd 6:0:0:1: [sdd] Assuming drive cache: write through
[ 1396.316948] sd 6:0:0:0: [sdc] No Caching mode page found
[ 1396.316965] sd 6:0:0:0: [sdc] Assuming drive cache: write through
[ 1396.317962] sd 6:0:0:1: [sdd] No Caching mode page found
[ 1396.317979] sd 6:0:0:1: [sdd] Assuming drive cache: write through
[ 1396.319865] sdc:
[ 1396.320881] sdd: sdd1
[ 1396.325818] sd 6:0:0:0: [sdc] No Caching mode page found
[ 1396.325831] sd 6:0:0:0: [sdc] Assuming drive cache: write through
[ 1396.325849] sd 6:0:0:0: [sdc] Attached SCSI removable disk
[ 1396.328067] sd 6:0:0:1: [sdd] No Caching mode page found
[ 1396.328077] sd 6:0:0:1: [sdd] Assuming drive cache: write through
[ 1396.328083] sd 6:0:0:1: [sdd] Attached SCSI removable disk
[ 1396.749464] SELinux: initialized (dev sdc, type fuseblk), uses genfs_contexts
[ 1396.782748] SELinux: initialized (dev sdd1, type vfat), uses genfs_contexts
- 安装设备读/写。
# mount -o rw,remount /dev/sdc
mount: cannot remount /dev/sdc read-write, is write-protected
# hdparm -r0 /dev/sdc
/dev/sdc:
setting readonly to 0 (off)
readonly = 0 (off)
# mount -o rw,remount /dev/sdc
#