Skip to main content

Add a New Hard Disk Without Rebooting Guest



A rescan can be issued by typing the following command:
echo "- - -" > /sys/class/scsi_host/host#/scan
fdisk -l
tail -f /var/log/message


Replace host# with actual value such as host0. You can find scsi_host value using the following command:
# ls /sys/class/scsi_host
Output:

host0
Now type the following to send a rescan request:
echo "- - -" > /sys/class/scsi_host/host0/scan
fdisk -l
tail -f /var/log/message


How 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/delete

How 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/scsi
Where,
  • <H> : Host
  • <B> : Bus (Channel)
  • <T> : Target (Id)
  • <L> : LUN numbers
For e.g. add /dev/sdc with host # 0, bus # 0, target # 2, and LUN # 0, enter:
# echo "scsi add-single-device 0 0 2 0">/proc/scsi/scsi
# fdisk -l
# cat /proc/scsi/scsi

Sample 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/sdc3

Step #4: Create a Mount Point And Update /etc/fstab

# mkdir /disk3
Open /etc/fstab file, enter:
# vi /etc/fstab
Append as follows:
/dev/sdc3               /disk3           ext3    defaults        1 2
Save 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

Popular posts from this blog

How to reset HP ILO password without reboot when you forgot the admin (root) password: ESX, Windows & Linux

How to reset HP ILO password without reboot when you forgot the admin (root) password: ESX, Windows & Linux This is still a test subject and i gathered all the methods and pasting it here for future reference & need to check whether the below steps are working or not on ESX and ESXI.  I am sure its working for Linux and Windows if the ILO drivers installed. ESX: You can configure the ILO board when you reboot your server and press <F8> but all your VM’s will be powered down. The other way is installing hponcfg in the service console.First we need to download the below three rpm files from HP site. Then copy files to the tmp folder of your server console. Install the rpm files using the following command. [root@esxhost tmp]# rpm -ihv hponcfg-version.linux.rpm hpasm-version.rhel3.i386.rpm hprsm-version.rhel3.i386.rpm Create a Password_ILO_reset.xml file and copy it to your tmp folder. <RIBCL VERSION=”2.0″> <LOGIN USER_LOGIN=”Administ

Learning - AWS

Service Health Check  -------------- http://status.aws.amazon.com Region - Geographocal identify Region comprises of AV Zones AV Zone - AV zone comprises of physical infra (like DC, Network, Power, Physcial SErver, Stroage etc..) --------------------------- VPC - Virtual Private Cloud  - logically isolated on your network. Earlier : EC2-Classic - Comes with one single FLAT  N/W --------------- S3 - Simple Storage Service (ALL AMI  and Snapshot are Stored in S3 bucket )  EBS - Elastic Block Store - ( Where VOLUMES/Virtual Storage is created )  ( Root device type: ebs ) Virtualization type : hvm ( Hardware virutalization method ) Old method - Virtualization type : paravirtual. (  Instance Type -------------------------- General Purpose Compute Optimized GPU Instance Memory Optimized Storage Optimized -------------- A security group is a set of firewall rules that control the traffic for your instance.  you can add rules to allow specific traffic to reach your instance. There are Ingress(