VirtualBox: Add New Disk

Add a New Disk


* Make sure VM is shutdown.
* From VirtualBox Manager, open VM settings (right click your VM and select Settings)
* Click Storage on the left hand side panel
* Right click SATA Controller and select Add Hard Disk icon (right hand side icon)
* Click Create new disk
* Select VMDK and click Next
* Select Dynamically allocated and click Next
* Enter disk file location, e.g., C:\VirtualBox VMs\ODD_WLS_labs\WLS_ODD_labs-disk3.vmdk
* Select disk size, e.g. 20 GB
* Click Next then click Create
* Click OK

Partition New Disk

* Start virtual box and log in as root.

ls /dev/sd*
/dev/sda  /dev/sda1  /dev/sda2  /dev/sdb  /dev/sdb1  /dev/sdc
 
# Create partition
/sbin/fdisk /dev/sdc
######################
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2610, default 1): 
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-2610, default 2610): 
Using default value 2610
 
Command (m for help): w
The partition table has been altered!
 
Calling ioctl() to re-read partition table.
Syncing disks.
######################
 
 ls /dev/sd*
/dev/sda  /dev/sda1  /dev/sda2  /dev/sdb  /dev/sdb1  /dev/sdc  /dev/sdc1
 
# Create file system with label /u01
/sbin/mkfs.ext3 -L /u01 /dev/sdc1

Mount New Partition

Manual Mount

mkdir /u01
mount /dev/sdc1 /u01

Auto Mount

* Append to /etc/fstab

LABEL=/u01              /u01                    ext3    defaults        0 0

References

* Adding a New Disk Drive to an RHEL 5 System

This entry was posted in virtualbox. Bookmark the permalink.

Leave a Reply

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


*

This site uses Akismet to reduce spam. Learn how your comment data is processed.