IBM Cloud: How do I see the newly attached block storage in a virtual server?

368 Views Asked by At

I created a virtual server but found that the space was too small, so I wanted to add additional disk space to it. After attaching it, I'm not able to see the newly attached disk using df -h in the virtual server. How can I see the newly attached disk?

2

There are 2 best solutions below

0
On BEST ANSWER

There are several commands that you can use: fdisk -l and lsblk.

The first disk drive should appear as xvda. Usually, there is a second disk drive xvdb that is used for swap. Your new disk will appear as xvdc. Note that naming is OS-specific.

You will need to partition the new disk, format a file system and then mount the file system to a directory. The exact steps are OS-dependent.

0
On

Note: Following steps may change wrt OS. Below example specfic to IBM VSI with ubuntu 18.04 LTS

First confirm the disk is attached to VSI(virtual server instance)and check the number of disk at the node by fdisk command.

fdisk -l | grep xvdc

Create a directory for new partition to be mounted

mkdir /data1 

Make the partition using fdisk command

fdisk /dev/xvdc

After the above command it will ask some info

n  # And then hit enter until it creates the partition.

Format the partition using mkfs command mkfs.ext4

mkfs.ext4 /dev/xvdc

Mount the partitoined on the new directory

mount /dev/xvdc /data1

Check the disk and its mounted points

df -h