Skip to content

Linux - 7. page

Anything Linux related.

Expanding & Resizing an LVS Partition / Group on Ubuntu 14.04 LTS

I have a server dedicated to the purpose of hosting an ownCloud instance. OwnCloud 8 to be exact. It’s an Ubuntu 14.04 LTS virtual machine, on an ESXi 5 hypervisor. This is my own server, and not any sort of revenue generating customer service. It has become a “Dropbox” replacement for myself, and a few select friends and family. Recently, I found the original 1TB I allocated to be filling up quickly. So, I started doing some google searches to see how I could go about resizing, or expanding, an LVM group (like a partition). I found an enormous wealth of information, much of it conflicting. As I started going through a guide, that closely matched my configuration (everything was the same, actually, except the size of the disk), I instantly faced problems with commands not working. It was frustrating. Eventually I navigated through it and successfully expanded the Logical Volume. I figured I would go ahead and document my troubles so that I can make others lives a little easier.

Firstly, you need to run a couple commands to see what you’re working with. These commands are df and fdisk -l. You should see something like this:

mike@cloud:~$ df
Filesystem                  1K-blocks     Used Available Use% Mounted on
/dev/mapper/cloud--vg-root 1048254140 65112056 929870740   7% /
none                                4        0         4   0% /sys/fs/cgroup
udev                          4077252        4   4077248   1% /dev
tmpfs                          817700      524    817176   1% /run
none                             5120        0      5120   0% /run/lock
none                          4088496        0   4088496   0% /run/shm
none                           102400        0    102400   0% /run/user
/dev/sda1                      240972    67164    161367  30% /boot


mike@cloud:~$ sudo fdisk -l
[sudo] password for mike:

Disk /dev/sda: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 cylinders, total 2147483648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c9595

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          501758  2147481599  1073489921    5  Extended
/dev/sda5          501760  2147481599  1073489920   8e  Linux LVM

Disk /dev/mapper/cloud--vg-root: 1090.7 GB, 1090661646336 bytes
255 heads, 63 sectors/track, 132598 cylinders, total 2130198528 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/cloud--vg-root doesn't contain a valid partition table

Disk /dev/mapper/cloud--vg-swap_1: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders, total 16777216 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Click here to see the entire post!!

Installing Proxmox VE 3 from a USB Thumb Drive

I recently decided to venture into the Proxmox virtualization world. Being a VCP, i’ve always used VMWare based virtualization for just about everything. I have played around with Xen before, but most all of my virtualization endevours have been purely hypervisor “bare-metal” based. When I found out the Proxmox seems to be the best of both worlds, with hypervisor and container based virtualization in one package, I was intrigued. So, I looked for a quick how-to on creating a bootable thumbdrive to install Proxmox (I don’t have a CD drive on the server, nor any of my servers now that I think about it). I’m using OSX as my primary OS, so I was happy to find that the .ISO could be copied to a USB thumbdrive with one simple command (works on OSX and Linux):

dd if=pve-cd.iso of=/dev/XYZ bs=1M

I plugged in an 8GB USB thumbdrive and needed to figure out what the /dev/ device name was, so I could format the command properly. So, google search it was. I felt pretty stupid when I found out that running this single command, would give me the info I needed:

$ mount

Click here to see the entire post

Tons and tons of awesome links

I always come across pages, links, and things that I don’t want to forget about, and I want to share with the world. So, I decided to create a post with nothing but links. From time to time I will update this post with new links. I’ve tried to categorize everything as much as possible. Be sure to hit the break below to get the full list. Enjoy!

Web Development – Coding, Design, Templates, Etc.

HTML5 Boilerplate – HTML5 Front-End Template  –  http://html5boilerplate.com/

Initializr – HTML5 Template Generator (Based on Biolerplate)  –  http://www.initializr.com/

Smashing Magazine Freebie Icons  –  http://www.smashingmagazine.com/tag/icons/

1001 Free Fonts  –  http://www.1001freefonts.com/

 

Web Hosting – Control Panels, Web Servers, Modules, Etc.

Kloxo – Fully featured hosting control panel (like directadmin/cpanel)  –  http://lxcenter.org/software/kloxo/

ZPanelCP – Fully featured hosting control panel that supports linux as well as Windows (LAMP)  –  http://www.zpanelcp.com/about/

Click here to keep reading this post

Problems enabling server side encryption on ownCloud 8

When enabling encryption on an ownCloud 8 installation and the user already has files in account, those files will be encrypted on the first login.  A message will display saying “Initial encryption started.  This can take a while…. Please wait.”  If, for some reason the account gets stuck in this mode, it is because the migration_status value for the users account has been set to -1, instead of 1.  When all the files have been encrypted, this value is set to 1.  When set to 0, the initial encryption runs.  To update this value, log into mysql and perform the following steps:

#mysql -u root -p

use owncloud

SELECT * FROM oc_preferences WHERE configkey="migration_status";

(the command just entered will show the migration_status value for all accounts)

Click here to keep reading this post

How to install Fail2Ban on CentOS 7 – Step by Step Guide

This is a how to on installing Fail2Ban on CentOS 7.  Fail2Ban is an incredibly useful, and often necessary, package that will automatically block IP addresses attempting to brute-force attack your server(s). For instance, with Fail2Ban installed, if an IP address attempts to brute-force login user “root” on your server, one a certain number of attempted logins is reached within a designated time period, it will automatically insert an IPtables rule into your firewall to block all access from that IP address for a specified period of time. Of course, you set all of these variables in the configuration file, which I’ll go into later on. I have yet to have a public facing server be online more than a day before a brute force attack of some sort is encountered. The best practice is to use secure passwords, with upper case, lower case, numbers and a few symbols. Never use dictionary based passwords. With effective, secure passwords it would take a very, very long time to gain access to a server by means of brute force, but it is possible. Regardless, it’s best to block these attacks from the beginning. It is all automated with Fail2Ban.

This guide assumes you have a CentOS 7 installation and have ran yum update.  It requires you have root SSH access to the server.

First, you need to install the EPEL repository.  Fail2Ban is not available from CentOS, with the available repositories.

cd /tmp

rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/epel-release-7-5.noarch.rpm

Click here to keep reading this post