間違いだらけの備忘録

このページの内容は無保証でありこのページの内容によって直接、または間接に損害を受けられたとしても私は責任を取りません。

SATAリムーブ/ホットプラグ

内蔵SATAの認識解除

# dmesg | grep sda
[    8.174968] sd 3:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/465 GiB)
[    8.175018] sd 3:0:0:0: [sda] Write Protect is off
[    8.175021] sd 3:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    8.175054] sd 3:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    8.206876]  sda: sda1 sda2
[    8.207222] sd 3:0:0:0: [sda] Attached SCSI disk
# echo 1 > /sys/class/scsi_device/3\:0\:0\:0/device/delete 
# dmesg 
[66753.410915] sd 3:0:0:0: [sda] Synchronizing SCSI cache
[66753.411194] sd 3:0:0:0: [sda] Stopping disk
[66753.995860] ata3.00: disabled
# fdisk -l

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x9bdbf079

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1         154     1228800    7  HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sdb2             154       60801   487153970+   7  HPFS/NTFS
Partition 2 does not end on cylinder boundary.

再認識させて追加

# echo - - - > /sys/class/scsi_host/host3/scan 
# dmesg
[67785.665101] scsi 3:0:0:0: Direct-Access     ATA      WDC WD5000BEVT-0 01.0 PQ: 0 ANSI: 5
[67785.665400] sd 3:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/465 GiB)
[67785.665447] sd 3:0:0:0: Attached scsi generic sg2 type 0
[67785.665490] sd 3:0:0:0: [sdb] Write Protect is off
[67785.665496] sd 3:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[67785.665537] sd 3:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

参考
http://d.hatena.ne.jp/dayflower/20091218/1261113963
http://h50146.www5.hp.com/products/software/oe/linux/mainstream/support/faq_hard/hard_fibre.html

ESATAの電源断

# dmesg | grep sdb
[  352.512813] sd 0:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/465 GiB)
[  352.512924] sd 0:0:0:0: [sdb] Write Protect is off
[  352.512931] sd 0:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[  352.512981] sd 0:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  352.521851]  sdb: sdb1
[  352.522291] sd 0:0:0:0: [sdb] Attached SCSI disk
# ls /sys/class/scsi_device/0\:0\:0\:0/device/
block   device_blocked  evt_media_change  iodone_cnt     modalias  queue_depth           rescan       scsi_disk     state      type          vendor
bsg     dh_state        generic           ioerr_cnt      model     queue_ramp_up_period  rev          scsi_generic  subsystem  uevent
delete  driver          iocounterbits     iorequest_cnt  power     queue_type            scsi_device  scsi_level    timeout    unload_heads
# ls /sys/class/scsi_device/3\:0\:0\:0/device/
block   device_blocked  evt_media_change  iodone_cnt     modalias  queue_depth           rescan       scsi_disk     state        timeout  unload_heads
bsg     dh_state        generic           ioerr_cnt      model     queue_ramp_up_period  rev          scsi_generic  subsystem    type     vendor
delete  driver          iocounterbits     iorequest_cnt  power     queue_type            scsi_device  scsi_level    sw_activity  uevent
# echo 1 > /sys/class/scsi_device/3\:0\:0\:0/device/delete 
# dmesg | tail
[  352.512813] sd 0:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/465 GiB)
[  352.512924] sd 0:0:0:0: [sdb] Write Protect is off
[  352.512931] sd 0:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[  352.512981] sd 0:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  352.521851]  sdb: sdb1
[  352.522291] sd 0:0:0:0: [sdb] Attached SCSI disk
[39570.026358] cfg80211: Found new beacon on frequency: 5220 MHz (Ch 44) on phy0
[66753.410915] sd 3:0:0:0: [sda] Synchronizing SCSI cache
[66753.411194] sd 3:0:0:0: [sda] Stopping disk
[66753.995860] ata3.00: disabled
# echo 1 > /sys/class/scsi_device/0\:0\:0\:0/device/delete 
# dmesg
[66912.755007] sd 0:0:0:0: [sdb] Synchronizing SCSI cache
[66912.755281] sd 0:0:0:0: [sdb] Stopping disk
[66913.338713] ata1.00: disabled

hdd power down

[67060.735562] ata1: exception Emask 0x10 SAct 0x0 SErr 0x80000 action 0xe frozen
[67060.735568] ata1: irq_stat 0x00140010, PHY RDY changed
[67060.735573] ata1: SError: { 10B8B }
[67060.735582] ata1: hard resetting link
[67062.812036] ata1: SATA link down (SStatus 0 SControl 0)
[67062.812049] ata1: EH complete

hdd power on

[67159.096692] scsi 0:0:0:0: Direct-Access     ATA      WDC WD5000BEVT-2 01.0 PQ: 0 ANSI: 5
[67159.097058] sd 0:0:0:0: Attached scsi generic sg1 type 0
[67159.097223] sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/465 GiB)
[67159.097328] sd 0:0:0:0: [sda] Write Protect is off
[67159.097334] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[67159.097378] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[67159.106521]  sda: sda1 sda2
[67159.107013] sd 0:0:0:0: [sda] Attached SCSI disk

めも。

このページにはhatena以外のサービスからのコンテンツが埋め込まれています。 hatenaによりGoogle AdSense 広告が埋め込まれています。