Wednesday, August 06, 2014

Adding new harddrive live to Ubuntu VMWARE image

Very useful after doing a repo sync on a gigantic repo...

Create the disks in the Virtual Infrastructure Client

Right click on the guest, click “Edit Settings…”

Under the “Hardware” tab, click “Add”

For the device type, select “Hard Disk”, click “Next”, and “Next” again

Specify the size of your disk, optionally enable Thin Provisioning, and click “Next”, “Next”, “Finish”, “Ok”

Re-scan the scsi bus for new hardware

cat /proc/partitions

Note the list of devices

sudo apt-get install scsitools


cat /proc/partitions

See what devices got added

Format the new disk

Format the newly detected drive using fdisk

fdisk /dev/sdb

    n (for new partition)

    p (for primary partition)

    1 (partition number)

    (keep the other values default)

    w (write changes)


sudo mkfs -t ext3 /dev/

Add the devices to /dev/disk/by-uuid/

sudo partprobe

sudo blkid /dev/

Note the UUID

Add the new mount to /etc/fstab, and mount the filesystem

sudo vi /etc/fstab

mount -a 

No comments: