Creating a separate VMWare hard disk for a Linux virtual server

A mini How-To detailing how I created a separate virtual partition for my local dev server:

I halted the virtual machine and then under VMWare settings I select Hard Disks then add. Once the disk is created and saved out I re-start the machine.

Initally we have to partition the disk and make it a recognised file system. Once logged in as root I type:

[code]fdisk /dev/sdb[/code]

I select ‘n’ for new partition, then primary and partition number 1, then via the other screens select the maximum space available. I enter w to write the partition table then exit.

I edit /etc/fstab to mount the partition on /export

[code]#
proc /proc proc defaults 0 0
/dev/sda1 / ext3 defaults,errors=remount-ro 0 1
/dev/sdb1 /export ext3 defaults,errors=remount-ro 0 1
/dev/sda5 none swap sw 0 0
/dev/hdc /media/cdrom0 iso9660 ro,user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0[/code]

I also create the filesystem, the mount point and then refresh the partition table

[code]
mkfs.ext3 /dev/sdb1
mkdir /export && mount -a
[/code]

Finally we can check that it worked:

[code]df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 3.8G 934M 2.7G 26% /
tmpfs 126M 0 126M 0% /dev/shm
/dev/sdb1 9.9G 33M 9.4G 1% /export
[/code]

all I need do is copy my files (in this case the home directories and subversion repositories) and then symlink them, if applicable.


Comments

Leave a Reply

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