Difference between revisions of "VM"
From Sit
(→Expanding disk) |
(middle saving - creating a new drive) |
||
Line 129: | Line 129: | ||
You can move the database to another drive, but adding an additional to the VM while it's offline (newer versions of VM might be able to do this online). | You can move the database to another drive, but adding an additional to the VM while it's offline (newer versions of VM might be able to do this online). | ||
− | to | + | ====Add a new Disk==== |
+ | This guide is based on the VMWare Player v3, other versions might differ. | ||
+ | |||
+ | * To add a new disk in VM, first take the VM offline, by shutting down the VM. | ||
+ | * Go to the interface, and right click on SiT_v3.62 (or what the machine is called) and click '''Virtual Machine settings...''' | ||
+ | * Click the '''Add...''' in the Hardware pane (If you get a windows security popup here, click accept/yes) | ||
+ | * Choose '''Hard Disk''' and click Next | ||
+ | * Make sure '''Create a new virtual disk''' is selected (Advanced users may choose otherwise) and click Next | ||
+ | * Choose '''SCSI''' and click Next | ||
+ | * Choose your size of disk, I'll be choosing 20GB for this example, click next if the rest looks good to you. | ||
+ | * Choose a name for it so you can identify the disk later, my choice will be "SiT_v3.62_DB.vmdk" and click finish. | ||
+ | * Click OK to get back to the main screen, and turn on the SiT VM | ||
+ | |||
+ | |||
+ | ====Prepare the new disk in ubuntu==== | ||
+ | Figure out what the new disk is called | ||
+ | <code><pre> | ||
+ | sudo fdisk -l | ||
+ | </pre></code> | ||
+ | |||
+ | It should tell you: | ||
+ | * Disk /dev/sdc doesn't contain a valid partition table | ||
+ | |||
+ | Partition the new disk | ||
+ | |||
+ | <code><pre> | ||
+ | sudo fdisk /dev/sdc | ||
+ | </pre></code> | ||
+ | |||
+ | * n # New partition | ||
+ | * p # Primary partition | ||
+ | * 1 # First partition number | ||
+ | * <nowiki><enter></nowiki> # Choose first cylinder. default 1 | ||
+ | * <nowiki><enter></nowiki> # Choose last cylinder. default 2610 for my 20GB disk in this example. This will differ depending on your own size | ||
+ | * t # Change the type of partition | ||
+ | * 8e # Choose the Linux LVM | ||
+ | * w # Write the drive settings | ||
+ | |||
+ | Create the LVM partition | ||
+ | <code><pre> | ||
+ | sudo pvcreate /dev/sdc1 | ||
+ | </pre></code> | ||
+ | |||
+ | Create the VolumeGroup | ||
+ | <code><pre> | ||
+ | sudo vgcreate database /dev/sdc1 | ||
+ | </pre></code> | ||
+ | |||
+ | |||
+ | |||
+ | ====Move the Database to the new disk==== | ||
+ | |||
* Stop the mysql server | * Stop the mysql server | ||
<code><pre># sudo /etc/init.d/mysql stop</pre></code> | <code><pre># sudo /etc/init.d/mysql stop</pre></code> | ||
Line 141: | Line 192: | ||
* start the mysql server again | * start the mysql server again | ||
<code><pre># sudo /etc/init.d/mysql start</pre></code> | <code><pre># sudo /etc/init.d/mysql start</pre></code> | ||
− | |||
− | |||
===Expanding disk=== | ===Expanding disk=== |