by Pedro M. S. Oliveira | Feb 29, 2016 | Linux
Sometimes a software/hardware error will lock your SATA device/controller. You may just reboot your OS and wish for the best, but you may also only reset the affected device, not the full system, bellow is how you can achieve this.
Before you apply the following commands make sure you are not using the SATA/SCSI devices (ex. mounted filesystem, part of a RAID, LVM, BTRFS or ZFS volume). If the device is still in use please take action to stop it before you delete the device node or reset the SATA bus.
A device name of
/dev/sdb is assumed.
- Find out which controller the device is attached to (we’ll need this later):
# readlink /sys/block/sdb/device
The interesting part if the answer is
host1, which identifies the controller.
# echo 1 > /sys/block/sdb/device/delete
This will remove the device from the bus (logically). Look in
dmesg for confirmation.
# echo "- - -" > /sys/class/scsi_host/host1/scan
host1 is the identifier from step one. Again,
dmesg should show the device being rediscovered.
by Pedro M. S. Oliveira | Mar 9, 2012 | Linux
About a year ago I’ve setup some linux RHEL 6 with multipath access to an HP EVA storage.
Today I needed to do it again, and to do so i needed to list all the path available to the storage device, here’s my command line (hope it helps someone else) to list all the path and volumes:
ls /dev/sd* | grep -E -v '[0-9]' | while read D ; do F=$(echo $D) ; \
echo -n $F ; echo -n " " ; scsi_id --page=0x83 --whitelisted --device=$F | \
sort -k 2 ; done | sort -k 2
The output should be something like this:
As you can see I’ve one available disk on this server, actually this one is a RAID1 (HW) config (sda), 16 paths to my storage device, that delivers 4 different volumes (4 paths to each volume).
Sometime later I’ll discuss the multipath configuration but for now i just wanted to leave the command line that help me list all the paths ids.