# Increasing VM capacity with a new disk

**URL:** https://forum.opennebula.io/t/increasing-vm-capacity-with-a-new-disk/2152
**Category:** Product Support
**Created:** [April 26, 2016, 10:51am UTC](https://forum.opennebula.io/t/increasing-vm-capacity-with-a-new-disk/2152 "2016-04-26T10:51:04Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![malfonso](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@malfonso](https://forum.opennebula.io/u/malfonso)
#### Post date: [April 26, 2016, 10:51am UTC](https://forum.opennebula.io/t/increasing-vm-capacity-with-a-new-disk/2152/1 "2016-04-26T10:51:04Z")

</div>

Hi,

I’ve an OpenNebula 4.14 installation where I deployed a VM with Debian 7. Since I wanted to attach a new disk to the VM I made the following steps:

1. Create a new image (datablock) of 100 GB (persistent because is for security copies purpose) and ext4.
2. Shutdown the VM and attach the image.
3. Start the VM and create a partition with fdisk (primary partition).
4. Format the partition with mkfs.ext4
5. Mount it in a specific directory.
6. Check the new capacity with df -h

My problem is that there’re always some errors (all the same) on the last block of the disk:

[15489.082112] Buffer I/O error on device sdb, logical block 209715200  
[15489.103363] sd 1:0:0:0: [sdb] Result: hostbyte=DID\_OK driverbyte=DRIVER\_SENSE  
[15489.103365] sd 1:0:0:0: [sdb] Sense Key : Aborted Command [current] [descriptor]  
[15489.103377] sd 1:0:0:0: [sdb] Add. Sense: No additional sense information  
[15489.103380] sd 1:0:0:0: [sdb] CDB: Read(10): 28 00 0c 80 00 00 00 00 01 00

This error starts happening after attaching the disk through SunStone interface and starting the VM but remains even if I create the partition on the disk and I mount it.

Something that I saw is that independently on the disk size this always happens with the last sector.

Thank you very much.

Best regards.

---

<div class="post-metadata">

### Author: ![anandharaj](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@anandharaj](https://forum.opennebula.io/u/anandharaj)
#### Post date: [April 28, 2016, 8:53am UTC](https://forum.opennebula.io/t/increasing-vm-capacity-with-a-new-disk/2152/2 "2016-04-28T08:53:35Z")

</div>

Can you show the image details? eg oneimage show \<image\_id\>

---

<div class="post-metadata">

### Author: ![malfonso](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@malfonso](https://forum.opennebula.io/u/malfonso)
#### Post date: [April 28, 2016, 9:30am UTC](https://forum.opennebula.io/t/increasing-vm-capacity-with-a-new-disk/2152/3 "2016-04-28T09:30:10Z")

</div>

Hi,

Yes, this is the output:

oneimage show 3

IMAGE 3 INFORMATION  
ID : 3  
NAME : par2  
USER : oneadmin  
GROUP : oneadmin  
DATASTORE : default  
TYPE : DATABLOCK  
REGISTER TIME : 04/25 12:35:30  
PERSISTENT : Yes  
SOURCE : /var/lib/one//datastores/1/8f88bfa9af1dbfdf923066e23c7ce6ce  
FSTYPE : ext4  
SIZE : 100G  
STATE : used  
RUNNING\_VMS : 1

PERMISSIONS  
OWNER : um-  
GROUP : —  
OTHER : —

IMAGE TEMPLATE  
DEV\_PREFIX=“hd”

VIRTUAL MACHINES

ID USER GROUP NAME STAT UCPU UMEM HOST TIME  
20 oneadmin oneadmin debian7 runn 1.0 2G ONE1 2d 17h49

---

<div class="post-metadata">

### Author: ![anandharaj](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@anandharaj](https://forum.opennebula.io/u/anandharaj)
#### Post date: [April 28, 2016, 9:33am UTC](https://forum.opennebula.io/t/increasing-vm-capacity-with-a-new-disk/2152/4 "2016-04-28T09:33:11Z")

</div>

In my case, i never set FSTYPE. I will create either raw/qcow2 image and format the disk once attached to a VM.

---

<div class="post-metadata">

### Author: ![malfonso](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@malfonso](https://forum.opennebula.io/u/malfonso)
#### Post date: [April 28, 2016, 11:16am UTC](https://forum.opennebula.io/t/increasing-vm-capacity-with-a-new-disk/2152/5 "2016-04-28T11:16:34Z")

</div>

Hi, thank you very much for your response.

Unfortunately, this error remains in the disk after attached, formated, etc. when I make the changes you specified.

I tried to make some read or write file operations and everything is ok however I wouldn’t like to take the risk to storing security copies in that image with this kind of error.

Best regards

---

<div class="post-metadata">

### Author: ![malfonso](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@malfonso](https://forum.opennebula.io/u/malfonso)
#### Post date: [April 28, 2016, 12:46pm UTC](https://forum.opennebula.io/t/increasing-vm-capacity-with-a-new-disk/2152/6 "2016-04-28T12:46:14Z")

</div>

Hi, I found a solution.

After checking the creation of the new disk with raw format, as you said I wanted to try with the qcow2 format.

I created a datablock in Sunstone interface with qcow2 driver but I couldn’t launch the VM I attached the new image to.

After that I created an image from command line like this:

qemu-img create -f qcow2 sample.qcow2 10G

Then I created an image through SunStone interface from the sample.qcow2 and I attached it to the VM.

Now I can format the new disk and there are no I/O errors when starting OS.

Thank you very much

Regards
