Rename Hard Disk

Rename Hard Disk in Unix

ubuntu@ubuntu:~$ ll /sys/block/sda/device
lrwxrwxrwx 1 root root 0 Feb  4 14:45 /sys/block/sda/device -> ../../../2:0:1:0/
ubuntu@ubuntu:~$ ll /sys/block/sda/device/delete
--w------- 1 root root 4096 Feb  4 14:55 /sys/block/sda/device/delete
ubuntu@ubuntu:~$
ubuntu@ubuntu:~$ ll /sys/block/sdb/device
lrwxrwxrwx 1 root root 0 Feb  4 14:45 /sys/block/sdb/device -> ../../../3:0:1:0/
ubuntu@ubuntu:~$ ll /sys/block/sdb/device/delete
--w------- 1 root root 4096 Feb  4 14:57 /sys/block/sdb/device/delete
ubuntu@ubuntu:~$
sudo -i
echo offline > /sys/block/sda/device/state
echo offline > /sys/block/sdb/device/state

 

echo 1 > /sys/block/sda/device/delete
echo 1 > /sys/block/sdb/device/delete
scan this hosts hard disks
echo "- - -" > /sys/class/scsi_host/host2/scan   ( /dev/sda for my ref )
echo "- - -" > /sys/class/scsi_host/host3/scan   ( /dev/sdb for my ref )

Reference :

http://fibrevillage.com/storage/279-hot-add-remove-rescan-of-scsi-devices-on-linux

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s