A rescan can be issued by typing the following command:
echo "- - -" > /sys/class/scsi_host/host#/scan
 fdisk -l
 tail -f /var/log/messageReplace host# with actual value such as host0. You can find scsi_host value using the following command:
 # ls /sys/class/scsi_host
 Output:host0Now type the following to send a rescan request:
echo "- - -" > /sys/class/scsi_host/host0/scan
 fdisk -l
 tail -f /var/log/messageHow Do I Delete a Single Device Called /dev/sdc?
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
 # echo 1 > /sys/block/sdc/device/deleteHow Do I Add a Single Device Called /dev/sdc?
To add a single device explicitly, use the following syntax:# echo "scsi add-single-device <H> <B> <T> <L>" > /proc/scsi/scsiWhere,
- <H> : Host
 - <B> : Bus (Channel)
 - <T> : Target (Id)
 - <L> : LUN numbers
 
# echo "scsi add-single-device 0 0 2 0">/proc/scsi/scsi
 # fdisk -l
 # cat /proc/scsi/scsiSample Outputs:
Attached devices: Host: scsi0 Channel: 00 Id: 00 Lun: 00 Vendor: VMware, Model: VMware Virtual S Rev: 1.0 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi0 Channel: 00 Id: 01 Lun: 00 Vendor: VMware, Model: VMware Virtual S Rev: 1.0 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi0 Channel: 00 Id: 02 Lun: 00 Vendor: VMware, Model: VMware Virtual S Rev: 1.0 Type: Direct-Access ANSI SCSI revision: 02
Step #3: Format a New Disk
Now, you can create partition using fdisk and format it using mkfs.ext3 command:# fdisk /dev/sdc
 # mkfs.ext3 /dev/sdc3Step #4: Create a Mount Point And Update /etc/fstab
# mkdir /disk3Open /etc/fstab file, enter:
# vi /etc/fstabAppend as follows:
/dev/sdc3 /disk3 ext3 defaults 1 2Save and close the file.
Optional Task: Label the partition
You can label the partition using e2label. For example, if you want to label the new partition /backupDisk, enter# e2label /dev/sdc1 /backupDisk
Comments
Post a Comment