Currently, I only have 1 hard drive :

[root@localhost ~]# fdisk -lDisk /dev/sda: 34.4 GB, 34359738368 bytes, 67108864 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00089987
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 67108863 33041408 8e Linux LVMDisk /dev/mapper/centos-root: 31.6 GB, 31637635072 bytes, 61792256 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/centos-swap: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

So, use your vSphere console to add a new one :

centos new disk

 

 

 

 

 

 

 

 

 

centos new disk1

centos new disk2

 

 

 

 

 

 

 

 

 

 

 

centos new disk3

 

 

 

 

 

 

 

 

 

 

 

 

Set disk size :

centos new disk4

 

 

 

 

 

 

 

 

 

 

 

centos new disk5

 

 

 

 

 

 

 

 

 

 

 

 

Then, finish :

centos new disk6

 

 

 

 

 

 

 

 

 

 

 

centos new disk7

 

 

 

 

 

 

 

 

 

 

 

 

 

Login to your CentOS virtual machine as “root”, and launch this magic loop :

[root@localhost ~]# for HOST in $(ls /sys/class/scsi_host) ; do echo '- - -'>"/sys/class/scsi_host/$HOST/scan" ; done

That will create a new device :

[root@localhost ~]# ls -l /dev/sdb
brw-rw----. 1 root disk 8, 16 Oct 26 16:50 /dev/sdb

Launch “fdisk” to create a full partition on this new drive :

[root@localhost ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x657a6d1b.
Command (m for help): n
Partition type:
 p primary (0 primary, 0 extended, 4 free)
 e extended
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-67108863, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-67108863, default 67108863):
Using default value 67108863
Partition 1 of type Linux and of size 32 GiB is set
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

You can now use “/dev/sdb1” for LVM

 

 

 

PDF24    Send article as PDF   

Leave a Reply

Your email address will not be published. Required fields are marked *


*