Gibbserv.net

Icon

A slow updating blog I write for no particular reason.

Discovering New Disks Without Rebooting

This is going to be a quick post. If you just added a disk to an online Linux node and you don’t have the luxury of rebooting so the system and discover the new disk you can simply run the following:

echo "- - -" > /sys/class/scsi_host/host#/scan

Replace host# with what appears in /sys/class/scsi_host/. Kicking off an fdisk -l will show your new unformatted disk.

I tend to use this when I need to grow an partition created under a logical volume on a Linux VM.

Online resize of Raid 6 post reshape

Previously I described the process I followed to move my Raid 5 to a newer version of CentOS as well as a newer version of MDADM. I outlined how I recovered the raid and LVM sitting on top of it and showed how to convert it to a raid 6. Now I am going to lay out the steps I took to grow the Logical Volume and resize the filesystem once the raid had completed the reshape process.

I started by resizing the physical volume:
# pvresize /dev/md127
Physical volume "/dev/md127" changed
1 physical volume(s) resized / 0 physical volume(s) not resized

I then verified that I could see Free Extents:
# pvdisplay
--- Physical volume ---
PV Name /dev/md127
VG Name lvm_data
PV Size 4.55 TiB / not usable 3.44 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 1192333
Free PE 238466
Allocated PE 953867
PV UUID VT8iLZ-3J04-mT0Z-S2dd-1lxS-vl5X-rcMlLo

Read the rest of this entry »

MDADM Raid5 + LVM migration to Centos 6.3

So time had come to do something about my raid.  I had been limping along for sometime now nursing 100GB free on my 4TB software raid and had purchased two additional WD 1TB Caviar Black drives bringing my device count up to 7 physical disks (the two new drives currently added as hot-spares).  It then dawned on me that maybe now would be a good time to migrate my raid level to raid6.  But as with most things in life, things eventually hit a speed bump.  Seems my trusty do-it-all storage server was unable to change the raid level of /dev/md0 due to a limitation between kernel and mdadm versions I was running on a dated Centos 5.8 install.  I decided to do several things.

  1. Move to Centos 6.3
  2. Run a newer version of MDADM (3.0+)
  3. Migrate current raid and LVM config to new install
  4. Not loose years of data.

Read the rest of this entry »

And Gibbling Sed “/s *Let their be non-standard ssh/Ports/”

We are working to automate as much as we can in regards to environment provisioning so naturally we began looking at some automation tools like Pupppy and Chef.  We hope to assign all the little things that need to be done to a fresh install of CentOS before we can give it to a team of devs.  One of these things is uncommenting Port 22 from /etc/ssh/sshd_config and configuring a nonstandard port.  With Chef I can have a recipe that can simply run a command or it can pulldown and install packages, modify attributes, generate users and a hell of alot more.  Depending on your Ruby knowledge you can automate almost anything.  I simply wanted to run a command to replace #Port 22 with Port 2202. This is where sed comes into play. I can simply have a recipe run sed -i.backup "s/^ *.*Port .*/Port 2202/" /etc/ssh/sshd_config and I’m that much closer to simply kicking off a knife bootstrap and watching all the little mundane things that need to be done to a minty fresh install.

Packet loss gifted by the gods of hate.

So after I spent an entire day cleaning my room and dismantling a old bunk bed, I was able to free up 40% of my room back.  This means I wont be sleeping on the floor but in a real bed.  It also means that I will be able to actually move around my room and store all my shit in an orderly fashion instead of my current Jenga like method where I need to pull the item I need carefully out of the giant stack I have been forced to store items in.

With all this new space on the right side of my room I could not keep the left side looking as bad as it was.  With two decomissioned servers being used as impromptu tables and old PC cases and a large 19in CRT monitor that had not seen the light of day in 8 years in a dust covered grave under my workbench, I decided to clean up everything on that side as well.  Starting with my workbench, I was able to strip and dispose of three PCs/cases and the monitor cleaning up all of the space under the desk and almost all of the workbench.  After a quick trip to Walmart to grab some plastic storage containers and I was able to tuck away all my spare parts and cables out of the way and out of sight under the desk.  Then it was a simple matter of re-arranging all the miscellaneous junk around and on my computer desk into a neat little set of drawers.  So while I had all this space and my two online servers in the same area I decided to relocate my 24 port Gigabit switch and my little embedded wrap board running pfSense.  So after some wire-fu I was able to get everything neat and clean looking but Oh No, I can’t hit anything with my browser.  A quick couple of pings confirmed that I was experiecing massive packet loss in the range of 50% – 75%.  I eventually narrowed it down to either the WAN port on the pfSense device or the ONT outside where the fiber terminates.  I luckily have two different ONTs outside each with a Cat5e handoff.  One was from residential TV server back in the day when they could not server TV VOD data over an account with a static IP.  I ran outside and swapped the network cables between the ONT’s and ran back upstairs to see if the cable was the issue.  I received the same massive amount of dropped packets.  Just to ease my mind I re-crimped the the shoddy job done on the Cat5e cables running outside to the ONT’s but no change in connectivity.  At this time it was 3am and time for me to give up for the night.

Read the rest of this entry »

We are going back.. to the future!

Hello and welcome back.  We had to take a short break due to the COMPLETE AND TOTAL LACK OF INTELLIGENCE of the Verizon billing robot.  That’s right!  The service that hosts this here site was suspended because some asshole at Verizon decided I would like the automatic billing I had setup to be disabled and my bill provided in paper form (which was never actually sent to me).  Of course the Verizon Retard Billing Bot 9000a said “okie dilly okie” and made the unwanted change to my account.  It then, like the dumbshit system it is, failed to notify me that the change was made (which would of allowed me to correct the situation with a simple 2 hour phone call) and I went along with my merry life thinking that my bill was in order as it had been for the last two years.

Read the rest of this entry »

MySQL vs Root

I’m an easy going guy, except for the uncontrollable rage I work everyday to suppress.  But I was extremely upset when I installed mysql on a slave server in my replication testbed and found I could not log into the mysql console.

[root@slave ~]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)

Luckily I found help on the MySQL forums.  Here are the steps I took to resolve this issue.

Read the rest of this entry »

Samba security and AD

I finally decided to get my two Linux servers integrated with my Windows domain. It was pretty straight forward if you follow the tutorial found here. I had to add an additional line of code to /etc/pam.d/login to have domain user home folders properly created when logging in via SSH. Edit the login file in /etc/pam.d/ if you recieve the “could not chdir to ‘homefolder'” when you login with a domain account via SSH. Place the line below before any other session entries. Thanks go out to rjerrido over at outsidaz.org for helping me out with that one.

session    required   pam_mkhomedir.so skel=/etc/skel/ umask=0022

Once you have everything setup and working fine and you can list domain groups and user accounts with:

> wbinfo -u

> wbinfo -g

Read the rest of this entry »

Organize your data :o

I finally received my replacement NAS from Newegg.com. They originally sent me a 320GB Lacie Mini NAS inside the box of the 500GB model. I tipped them off to the issue and they provided me with everything required to get the item back to them so they could issue a replacement. I shipped it out on a Friday and go it back a week later on Monday.

Now that I have a working 500GB model in my custody, I have begun to organize my data which currently spans multiple internal and external hard drives. I plan on putting all movies and TV shows on this 500GB Lacie NAS with Gigabit Ethernet. My 10/100 Ethernet NAS will house my music, pictures and games as well as any miscellaneous documents and files that don’t require the speed provided by Gigabit Ethernet.

Read the rest of this entry »

The Battle Against MythTV…

I spent a good portion of this weekend fighting MythTV. I have encountered many obstructions on the back roads of DVR supremacy. I am able to display live TV on my 27″ LCD HDTV but it is significantly smaller that the resolution on my TV. I have altered the MythTV GUI settings to accommodate the resolution of my TV but the image size never really changes. I will be investigating the capture card settings when I get home.

Read the rest of this entry »