Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/sites/s/sitracker.org/public_html/w/includes/MagicWord.php on line 902

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/sites/s/sitracker.org/public_html/w/includes/MagicWord.php on line 902

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /var/sites/s/sitracker.org/public_html/w/includes/MagicWord.php on line 876

Warning: Invalid argument supplied for foreach() in /var/sites/s/sitracker.org/public_html/w/includes/MagicWord.php on line 877

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /var/sites/s/sitracker.org/public_html/w/includes/MagicWord.php on line 881

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /var/sites/s/sitracker.org/public_html/w/includes/MagicWord.php on line 876

Warning: Invalid argument supplied for foreach() in /var/sites/s/sitracker.org/public_html/w/includes/MagicWord.php on line 877

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /var/sites/s/sitracker.org/public_html/w/includes/MagicWord.php on line 881

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/sites/s/sitracker.org/public_html/w/includes/MagicWord.php on line 902

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/sites/s/sitracker.org/public_html/w/includes/MagicWord.php on line 902

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/sites/s/sitracker.org/public_html/w/includes/MagicWord.php on line 902
Difference between revisions of "VM" - Sit

Difference between revisions of "VM"

From Sit
Jump to: navigation, search
m (Expanding the drive in Ubuntu)
(Prepare the new disk in ubuntu)
Line 165: Line 165:
 
* t  # Change the type of partition
 
* t  # Change the type of partition
 
* 8e # Choose the Linux LVM
 
* 8e # Choose the Linux LVM
 +
* p  # Display the chosen settings
 
* w  # Write the drive settings
 
* w  # Write the drive settings
  
Line 172: Line 173:
 
</pre></code>
 
</pre></code>
  
Create the VolumeGroup
+
Create the VolumeGroup named "database"
 
<code><pre>
 
<code><pre>
 
sudo vgcreate database /dev/sdc1
 
sudo vgcreate database /dev/sdc1
 
</pre></code>
 
</pre></code>
  
 +
Create the LVM partition named "mydatabase" in the volumegroup "database", with size almost 20GB
 +
<code><pre>
 +
sudo lvcreate -L19.99G -n mydatabase database
 +
</pre></code>
 +
 +
Format the new drive with ext4 filesystem
 +
<code><pre>
 +
sudo mkfs.ext4 /dev/database/mydatabase
 +
</pre></code>
 +
 +
Create a new directory that serves as a mountpoint for the new drive
 +
<code><pre>
 +
sudo mkdir /var/lib/mydatabase
 +
</pre></code>
 +
 +
Mount the disk to the newly created mountpoint, and check that it's mounted
 +
<code><pre>
 +
sudo mount /dev/database/mydatabase /var/lib/mydatabase
 +
sudo mount
 +
</pre></code>
 +
 +
You should now see a line saying : ''/dev/mapper/database-mydatabase on /var/lib/mydatabase type ext4 (rw)''
 +
 +
Edit fstab so this mount will happen in every boot
 +
<code><pre>
 +
sudo nano /etc/fstab
 +
</pre></code>
 +
 +
Go to the bottom, if it's a blank line start typing, if not go to the end of the current line and hit the enter key.
 +
<code><pre>
 +
/dev/database/mydatabase /var/lib/mydatabase ext4 rw 0 1
 +
</pre></code>
 +
 +
Hold down '''CTRL''' while pressing the '''X''' key, answer '''y''' and hit '''enter''' this will save and exit
 +
 +
Reboot and see if the drive automounts
 +
<code><pre>
 +
sudo reboot
 +
</pre></code>
 +
 +
* Login
 +
* Check if it's mounted
 +
<code><pre>
 +
sudo mount
 +
</pre></code>
  
 +
Now you can start moving the database
  
 
====Move the Database to the new disk====
 
====Move the Database to the new disk====

Revision as of 11:34, 20 February 2011

Personal tools
project