Home Linux File Server with Software RAID and iSCSI (1/10)

Yays! Fun stuff in route!

Part of my 2018 goals is to be able to have a universally-accessible resource where I can be able to store all the data that I need to, and more, without worry of fault or loss. One of the ways to approach this is to create a File Server that I can mount from a majority of operating systems and be able to store anywhere in the world. So, I’ve come to the conclusion to build a Linux File Server, complete with a Software RAID5 (as opposed to a hardware RAID5), and make it so that we can use iSCSI to mount the LUNs.

We need to do this on a budget, too.

Read More

Upgrades and good grades

What is now:

 15:39:17 up  5:27,  1 user,  load average: 0.01, 0.04, 0.01

Ah, the uptime. One of the things we aspire to make as large as possible, and love every minute of it.

I did do a reboot today due to a mass of updates that I’ve lacked to do for 250+ days. Regardless, it’s a fresh uptime, and i’ll go with that.

With all these mass updates included SSL attacks such as poodle and heartbleed. I don’t typically run my server on https for public facing stuff, but right now I do for specific URLs and all that is presented is a self-signed certificate. You can go ahead and try https://www.unliterate.net to get the typical browser warnings.

So, with all the updates ssllabs SSL Server Test has given me a “T” (or A-), which I’m pretty proud of after reconfiguring. Maybe I’ll end up buying that cheap SSL cert and going for broke.

What used to be:

I happened to get really curious and find out if some old websites and documents existed from when I was originally fumbling around computers myself. Lo and behold, yes, I found ’em.

RBIL / Ralf Browns Interrupt List (wikipedia, cmu)

The de-facto bread and butter of my machine language learning. For every piece of hardware that downloaded its ROM into RAM, or any software that made hooks into the IVT, this list was just awesome.

I can’t recall how I located it back in the day, but what I do remember is that I was excited to get the updates to it online. Back in the modem days i’d wait upwards to 5 minutes to download 1 of the zip files, and then maybe an entire minute to load one of the text files into Windows 95’s notepad.

This list also got me into direct port access programming. Some of the interrupts and combinations needed for RS232 programming seemed slow to me, especially when trying to go faster than 9600 baud, so I had to turn to a different reference to learn to actually drive the serial controller.

Beyond Logic (retired)

Craig Peacock wrote awesome manuals on how to talk to the RS232 controller (specifically the 8250 and 16450/16550 UARTS), and also the Parallel Ports as well. It wasn’t until I read his manual about the parallel ports that realized that the bidirectional capability had quite a faster transfer rate over the cable than serial. His manuals helped deepened my knowledge on “how things worked”, cause who wouldn’t wanna know how things worked.

PHG Opcode (phg.chat.ru)

From Ralf Browns INTERRUP.LSTs came OPCODE.LST, which was a separate list created and maintained by Alex Potemkin. This list itself, when read entirely, gives you so much in-depth knowledge on how a processor works. From Intel and AMD, to Cyrix, you got instruction times, bugs, incompatibilities, and more than the whole nine yards. It was from this that I understood that 0F A2 means “Identity Yourself!”

From my memory this actually used to be at www.chat.ru/~phg, but as times change URLs have to change.

In a nutshell:

It’s been 20+ years that I’ve been using a keyboard and digging into computer guts, both software and hardware. I’ve been in and out of technology-related occupations, stepped into many hats, and accomplished so much, and I feel good about it.

Sometimes it feels good to take a step back and wonder how you got there, cause all you see is the progress you’ve had and know there is more to accomplish.

How to build an RPM from scratch with Centos 6.8

I’ve been completely curious on how to actually build an RPM for Redhat/Centos from since…well, I knew they existed. There are many articles out there on the interwebs, but I felt it necessary to dig on out and get it going from conception to death.

Virtual Hardware and Software:

To start, i’m gonna use Oracle VM Virtualbox (currently at 5.0.26 r108824) and a Centos 6.8 Minimal install. What better way to start this than from nothing.

I created the VM with 1GB of RAM and the standard 8GB Virtual Hard Drive. Made some minor modifications to the VM such as:

  • Disabled the Audio
  • Enabled NIC1 and bridged it to my Ethernet Adapter
  • Disabled the USB Controller

I mounted the ISO and booted it up for the install.

Operating System Installation:

Clicking Start >, I skipped media testing and sailed into Anaconda. I accepted all default options except for allowing my Network Interface to be configured On and DHCP enabled. This saves me configuration options later on for /etc/sysconfig/networking-scripts and /etc/resolv.conf. Made roots password, well, password, since i’ll be sudo’ing a user for good measure. 205 packages later I have my system ready to be SSH’d into.

First Boot:

Once everything was installed and configured from Anaconda there was a bit of cleanup I like to do. It’s not required on every installation, but it helps me do things in my development environments without issues later on.

More updates:

At the time of this writing, with a fresh ISO you still need to belt out a yum upgrade. There exists 1 package to install, 27 to upgrade, and 76M of data to download. Best to get this out of the way before changing system configurations and having them reset back to basics. shutdown -r now, and we’re back in business.

Disabling selinux:

Fairly easy to do, and there is a plethora of documents on the interwebs to do it. All done as root:

vi /etc/selinux/config
SELINUX=permissive

Firing the firewall:

Cleanly shutting off iptables just helps in debugging local and remote connection issues. Good thing we won’t come into this with making our RPMs, but I might want to use this development machine later on and I don’t want to have to assume I did it when debugging issues. All done as root:

service iptables save
service iptables stop
chkconfig iptables off

Making myself useful:

Still have to do the basic administration, and create my user and give it some god-like sudo permissions:

adduser mheick
passwd mheick
visudo
mheick ALL=(ALL) ALL

Finally, we do some minor shell-related things like setting our TERM=xterm-256color and finding out our ip address so we can SSH into it to get this party started.

Finding and following instructions:

So, we need a couple things that do not come with the minimum install to prepare for this journey:

1 – We need a user that we will /use/ to build things with. We’re gonna create one called builder:

sudo adduser robertbuilder
sudo passwd robertbuilder

2 – We are going to need rpm-build, devtools and their dependencies:

sudo yum install rpm-build rpmdevrools

Our data:

We’re gonna be a good sport and create some test data, and go ahead and tar it up:

mkdir data
chdir data
touch main
touch final
touch one
tar -czf myfirstrpm.tar.gz

This creates myfirstrpm.tar.gz, which we will use to extract these junky files somewhere.

Before making a .spec file, we must be prepared:

The heart and soul of an RPM is this specific file. It contains all the instructions on /what/ to do with the contents of the RPM, where to install things, what to say, etc. We’re going to start off getting our RPM over in robertbuilder‘s home folder, passing along ownership, and then becoming robertbuilder to continue on.

sudo cp myfirstrpm.tar.gz /home/robertbuilder/
sudo chown robertbuilder:robertbuilder /home/robertbuilder/myfirstrpm.tar.gz
sudo su robertbuilder

Our builder user needs a folder structure in order to store our files, test out our RPMs, store our other files, and do testing and funsies. We use what we’re given.

rpmdev-setuptree

This creates the ~/rpmbuild/(BUILD|RPMS|SOURCES|SPECS|SRPMS) folders so that we can actually make this build happen.

Getting the .spec into it

We need to hope into the ~/rpmbuild/SPECS folder and execute our spec-template creator

rpmdev-newspec myfirstrpm

This creates a basic .spec:

Name: myfirstrpm
Version:
Release: 1%{?dist}
Summary:

Group:
License:
URL:
Source0:

BuildRequires:
Requires:

%description


%prep
%setup -q


%build
%configure
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc

%changelog

We’re going to modify lines in that so that we can properly install our myfirstrpm.tar.gz

Now, we need HAAAALP!:

No worries. We have centos.org documentation!