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

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
(added first info on how to expand the logical drive from the VM)
(2. Expanding the drive in Ubuntu)
Line 158: Line 158:
  
 
====2. Expanding the drive in Ubuntu====
 
====2. Expanding the drive in Ubuntu====
{{draft}}
+
First of all, ''Make sure that you've backed up all the data from /var/www''
 +
 
 +
This is a step by step guide that works with partitions, so be very careful, and keep in mind that though this is a guide and it's been tested, it's not guaranteed that it'll work on your system, (make a backup of your VM just to be safe).
 +
 
 +
This guide will only show how to expand the original 60GB disk where the SiT website + attachments are stored.
 +
 
 +
In this example I'll upgrade the drive to 80GB. I've typed in 80GB in the VM player editing the Hard Disk 2, see how above.
 +
 
 +
Start by checking that the OS actually sees the new size.
 +
<code><pre>
 +
sudo fdisk -l
 +
</pre></code>
 +
 
 +
Alot of text is output, but I see on one of the lines
 +
<code><pre>
 +
Disk /dev/sdb 85.9 GB, 85899345920 bytes
 +
</pre></code>
 +
 
 +
Start by unmounting the extended drive
 +
<code><pre>
 +
sudo umount /var/www
 +
</pre></code>
 +
 
 +
Delete the partition and remake it again (all data should still be there when done)
 +
<code><pre>
 +
sudo fdisk /dev/sdb
 +
</pre></code>
 +
 
 +
* d  # This will delete the partition
 +
* n  # Create new partition
 +
* p  # Create primary partition
 +
* 1  # Choose partition number 1
 +
* <nowiki><enter></nowiki>  # Select first cylinder (default) 1
 +
* <nowiki><enter></nowiki>  # Select last cylinder (default) 10443 (this size might differ depending on your choice of size)
 +
* w  # Write changes to disk
 +
 
 +
If you get an error that there device is busy, reboot the VM.
 +
<code><pre>
 +
sudo reboot
 +
</pre></code>
 +
 
 +
Resize the physical volume, to its maximum (other options are available but not explained here)
 +
<code><pre>
 +
sudo pvresize /dev/sdb1
 +
</pre></code>
 +
 
 +
Resize the LVM drive (choosing 80GB you'll need 1 extend, which is why I've chosen 79.99GB, another option is to ''sudo lvextend -L+20GB /dev/wwwroot/www''
 +
<code><pre>
 +
sudo lvextend -L79.99GB /dev/wwwroot/www
 +
</pre></code>
 +
 
 +
Now the last thing we need to do is resize the filesystem
 +
<code><pre>
 +
sudo resize2fs /dev/wwwroot/www
 +
</pre></code>
 +
 
 +
Now we can see if it's actually the chosen size
 +
<code><pre>
 +
sudo df -h
 +
</pre></code>
  
 
==Pros and Cons==
 
==Pros and Cons==

Revision as of 12:10, 19 February 2011

Personal tools
project