Add / Remove single disk device in Linux

How to Delete a Single Device ?

In addition to re-scanning the entire bus, a specific device can be added or existing device deleted using the following command:

# echo 1 > /sys/block/devName/device/delete

E.G

# echo 1 > /sys/block/sdc/device/delete


or

# echo "scsi remove-single-device  " > /proc/scsi/scsi
# fdisk -l

How to Add a Single Device ?

Some time if you know your device path which your are going to add then you can use below method to add it in server.

To add a single device explicitly, use the following syntax:

# echo "scsi add-single-device " > /proc/scsi/scsi

Where,

    : Host
    : Bus (Channel)
    : Target (Id)
    : LUN numbers


For e.g. add /dev/sdb with host # 0, bus # 0, target # 1, and LUN # 0,

 enter:

# echo "scsi add-single-device 0 0 1 0">/proc/scsi/scsi
# fdisk -l
# cat /proc/scsi/scsi




0 comments:

Post a Comment

Blogger Tips and TricksLatest Tips And TricksBlogger Tricks