Add a new drive to Centos Virtualbox Guest

I run into this a lot and always forget what the steps are…

With the guest powered off you will need to open VBx manager, right click on your guest name that you want to add the drive to and go to SETTINGS.

Click STORAGE and then either click IDE or SATA controller to highlight it. Then you will click the little drive icon next to it. I always choose new disk at the next little pop up. Follow the prompts….
If you get to this step and that icon is ghosted out make sure your guest is powered off. As of right now I dont think there is a way to hot-add a drive in VBx.

I choose VDI and DYNAMICALLY ALLOCATED, give it a name and a size. I ususally go with about 50GB since all of my VMs are for experimental use and I likely wont use that whole amount.

From here thats all you have to do in VBx itself. Next you will want to start up your gest and mount the drive…

Once you get logged in follow these steps…
sudo fdisk -l
Make sure you see your new drive here. It might be listed as something like /dev/sdb Then do the following….

mkdir /mnt/newdisk
mount -t ext3 /dev/sdb1 /mnt/newdisk
cd /mnt/newdisk
df

to mount automatically on boot, add disk to /etc/fstab my /etc/fstb for example, i added last line

LABEL=79d3d2d4 / ext4 defaults,noatime 0 0
LABEL=e21a3e10 /boot ext3 defaults,noatime 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
/dev/sdb1 /mnt/newdisk ext3 defaults 0 0

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s