Wednesday, February 19, 2014

Increase Ubuntu Hard Drive Size in VMWare ESXi

I have only done this with my Ubuntu virtual machine so far, so I can't tell you if this works for any other form of linux.  I will have to test it some time to find out.

My situation:  Koha library system loaded on a Ubuntu Server 13.10.  I had originally set it up as a test server so I only gave it 2Gb of ram and a 30 Gb hard drive.

Logs can fill up fairly quickly with everything going on, and the database takes space when you have 20,000 book records and 500 student records.

I followed these instructions to increase the hard drive size of my server, on the fly and it worked perfectly, now I have storage space again and the system is working again!

First step is to increase the hard drive to the virtual machine.  I had lots of space, and could add more, but I thought 80Gb would be a good amount for now.  So I increased it by 50Gb to make it 80Gb in total size.

Then access the machine with PuTTy.

List all partitions
$ ls -la /dev/sda*

Create new partition using fdisk:
$ sudo fdisk /dev/sda
p - to list all partitions
n - to create a new partition
l - for "logical"
Accept the default start and end blocks, as that is the new section that has been allocated.
t - to change the partition type
8e - set the type to Linux LVM
p - to list the new partition table
w - to write the changes

A warning message will say that the new drive won't be available until you restart, or use this command:
$ sudo partprobe

Now it is time to create the partition, extend the current volume and reprobe the partition table.

Create partition on new disk - (mine was /dev/sda4, yours might be different)
$ sudo pvcreate /dev/sda4

Display the current volume group and get the name
$ sudo vgdisplay - "VG Name" is what you are looking for here

Extend the volume group with the new partition
$ sudo vgextend VGName /dev/sda4

Get the name of the main logical volume
$ sudo lvdisplay - "LV Name" is what you are looking for here

Extend the logical volume by X Gbs
$ sudo lvextend -l -XG LVName

Resize the file system to account for the new space
$ sudo resize2fs LVName

You can now check to see if the total space is much larger
$ sudo df -hT

This should be all that you need, I did another
$ sudo partprobe
to verify that the system was aware of all the space.

I had some services crash and wouldn't start because of the lack of hard drive space, Apache2 and MySql5 wouldn't start.  After this process I was able to sudo service start and they both came up fine.

Monday, February 10, 2014

Monthly Board Reports

Our School Board has gone Google and paperless with Google Drive.  Starting a year ago we purchased Chromebooks for the board members to use.

These instructions are for how the drive is organized and what to do each month for the board members.

The Google Drive was formed and shared using the tech user account.  This way any staff member with access can go in with full rights.  It is not tied to a specific staff member.

PSD School Board ->
     Consent Agenda
     SB Reports ->
          Elem Principal
          Food Services
          HS Principal

Inside each is a folder for the past school years, for organizational purposes.  Add a new folder each year and move the files into those folders to keep it clean.

The Archive folder is where all past meeting files are organized.  These are links to the files also stored elsewhere in the drive.

The meeting folder is used by the board for easy access to all files stored throughout the drive.  Each month I create a link to the files in this folder.  To create a link find the original click the Move To folder button and press and hold the Ctrl key when clicking the Meeting folder.  The Ctrl key allows for multiple locations.  Then click OK to create the link.  Keep all files in the original locations, but add a link to the meeting folder.

At the end of the meeting from the meeting folder, select all files and folders except the policy folder and move these to the Archive folder for that month.  To move, but keep the other links you press the Ctrl key and uncheck the meeting folder check and while still holding the Ctrl key click the archive month folder.

All files are named as such:
     2014 02C Technology Report
     Year | Month | Section of the agenda | Title
Agenda header items are A, Administrative reports are B, Supervisor reports are C

The board group is given view access.  Each supervisor has been granted edit rights to the SB Reports folder that corresponds to their position.

Friday, February 7, 2014

Update Linux Servers

I like to do these steps on each server listed once a month.  You can do it as often or as little as you like.

These steps are specific to my servers, but only in terms of Debian and Ubuntu.  Some things are specific for the setup here at Potlatch SD.

I have blanked out any passwords and usernames, those can be retrieved from documentation.

Web Server/Piler Server
Use Putty, it is the easiest SSH software out there.

At the initial prompt you need to su to do the update process.

$ su

apt-get update
apt-get upgrade
apt-get autoclean
apt-get autoremove

When that is complete then you can type exit twice to close out.

Koha Server
This is similar to above, but since it is Ubuntu you can use sudo instead of su at the beginning.

$ sudo apt-get update
$ sudo apt-get upgrade

If Koha was upgraded then you have to go and adjust the Circulation file to allow the scanners to work properly.  instead of programming the scanners or changing the barcodes on every book now, I have modified the programming to adjust the barcode after scan at the elementary.  The instructions are found on this blog under PSD Koha Circulation Barcode Modification.

$ sudo apt-get autoclean
$ sudo apt-get autoremove

When that is complete then you can type exit to close out.

PFSense Firwall/Gateway Server
This server checks for updates and will display if an update is needed on the dashboard.  To upgrade you can click on the link and follow the instructions, the server will upgrade in place without much major interruption.  I have done the update during the school day and only had the network disconnect for a few seconds while the service restarts.  Some major updates require a restart so those should be done at the end of the day.
The Packages can be updated at anytime as well.  These are add-ons that have been used to increase the effectiveness of the server.  When you click on System -> Packages the next screen shows you what is installed.  Anything that is highlighted in the version column has an update.  To load that update click on the PKG button next to the row.  That will install the update automatically.