[ N O C T E R N I T Y ] Contributing to the general pollution of the internet

20Oct/110

Criminal incompetence

I have a lot of work to do, and many posts I'd like to write, but that will have to wait. I need to vent some frustration right now.

I am currently on a systems administration mission where I need to inspect and fix (if necessary... lol!) a few virtual servers.

Let's start with the documentation. Oh wait, I can't really start from there. There's nothing. A bunch of IP addresses, a few very weak passwords. A list of a few shell commands, out of the blue. A list of stuff that's been done, or at least I suppose that's what it's supposed to be (the list contains entries such as "Access phpmyadmin", followed by "Change init level"). Nothing to see here, let's move on.

The server's list of virtual hosts includes a SSH gateway, from which you're supposed to connect to the server's other VMs. Well, that sounded fine to me, as it may have meant I wouldn't need to go there and could simply log on through that gateway. Of course, since the "existing" documentation doesn't really list the VM's IP addresses, it's a bit messy. Especially since most ICMP packets seem to be blocked, somewhere, somehow. Oh, and some of the VMs do not listen on port 22. Has it been changed to some other port? Is it being blocked by iptables rules? No fucking clue. In addition, it was possible to log in as root (using a password that wasn't much better than "test") on the gateway.

For now, I've been able to find 3 out of the 11 VMs I'm supposed to take a look at,  including the aforementioned gateway. Each host includes the full Gnome desktop, as well as a random assortment of useless stuff (laptop-detect? Dude, it's a VM!). Of course, since the... person... who did this decided to use Ubuntu Server, it's not even possible to remove dbus, because upstart depends on it. Still, I was able to remove a few gigabytes of crap on the servers I could access.

I expect more bad surprises as I keep on working on that. In the meantime, my opinion is that whoever committed this in the first place should seriously think about giving up on systems administration and looking for a career in, oh, I don't know, floor wiping. Or something like that.

14Oct/112

Installing Debian GNU/Linux on a LaCie NAS

Since I recently set up Azathoth's 6th revision, I had the old LaCie NAS on a shelf, completely useless. I had to do something with it; however, the system which comes pre-installed on that thing is definitely not too customisable beyond the basics, so I decided to try and install Debian GNU/Linux on it.

The NAS, with its cover removed

One important thing about this old NAS - it uses an Intel EM7210 motherboard, with an Intel 80219 CPU. As it happens, that board is more or less supported by Debian.

The NAS's EM-7210 motherboard

However, it is necessary to access the system's RedBoot bootloader, which is only possible using a serial cable whose connector is directly on the motherboard.

IDC10 serial connector on the motherboard

Building the cable

The serial cable that allows access to the system's console needs to be plugged on an IDC10 connector. While it might have been possible to use the connector from an old PC along with a null-modem cable, I no longer possess either of these items, so I built my own cable. This is what you need to connect:

Female DE9 Female IDC10
2 5
3 3
5 9

And if you need a picture for the IDC10 side (I had to look it up, so I might not be the only one in this case):

Pins on the motherboard's IDC10 connector

I hadn't done any soldering for 16 years, so I was a little anxious about that. As it turns out, soldering was the easy part; the wires I used were apparently a little too big for my IDC10 connector, and I broke it. I had to rip connectors from an unused audio front panel and solder them to my wires instead. In addition, since none of my computers here have RS232 interfaces, I had to use an USB<->RS232 adapter.

I should really be ashamed

Minicom settings

The next step was to connect to the NAS's console using Minicom (any serial terminal would do, but I'm used to this one). The settings that need to be used are:

  • transfer rate: 115200 bps
  • data bits: 8
  • parity: none
  • stop bits: 1

It is also important to make sure that both hardware and software flow control are turned off.

 Booting the Debian installer

Obviously, the next thing to do is to try and start the Debian installer.

In order to do that, it is necessary to boot into the NAS's bootloader, which can be achieved by pressing Ctrl+C in the console before the bootloader's script starts executing (you need to be rather quick, as you only have one second to do so). This leads you to a command prompt.

You will also need to download kernel and RAM disk images for the architecture. Both images can be found on Debian's server (you need to download zImage and initrd.gz).

Once you are ready to proceed, you will need to upload the images to the NAS through the serial cable. Start by telling the bootloader that you want to load the RAM disk image:

load -v -r -b 0x1800000 -m ymodem ramdisk.gz

The bootloader will then expect you to send it the RAM disk's data (the initrd.gz file mentioned above) using YMODEM. In Minicom, that can be done by pressing Ctrl+A followed by S, then selecting "ymodem" in the list, and finally selecting the file to send.

(Wait. Wait some more. Wait even more.)

When that transfer has been completed, you will also need to send it the kernel image by typing

load -v -r -b 0x1008000 -m ymodem zImage

and then sending the zImage file.

(Wait. Wait some more. Wait even more.)

Once both files have been uploaded, you are ready to start the installer. The following command will do just that:

exec -c "console=ttyS0,115200 rw root=/dev/ram mem=256M@0xa0000000" -r 0x01800000
Completing the installation

I've skipped the part about installing Debian, because that's pretty much the usual process. However, there's one additional operation to perform once the installer is done running, as the system will not boot without that. You need to edit the boot script.

In order to do that, when the installer reboots, enter the bootloader by pressing Ctrl+C, then enter the following command:

fconfig boot_script_data

The prompt will change to >> to indicate that you are editing the configuration. You need to set the boot script to this:

fis load -b 0x01800000 ramdisk.gz
fis load -b 0x01008000 zImage
exec -c "console=ttyS0,115200 rw root=/dev/ram mem=256M@0xa0000000" -r 0x01800000

Don't forget to exit the boot script editor by finishing with an empty line. RedBoot will ask you to confirm the changes then write the configuration to flash memory.

A few notes
  1. I initially removed the HDDs from the box while trying to boot it in order to avoid unnecessary power cycles. However, if you try to insert them while the Debian installer is running, they will not be detected, and you will end up having to reboot anyway.
  2. Setting up the partitions takes an awful lot of time, and so does RAID array resynchronisation if that's what you want to use.