Technological Wanderings - linux http://www.technologicalwanderings.co.uk/taxonomy/term/46 en iPhone 3.0 tethering with Linux http://www.technologicalwanderings.co.uk/node/65 <div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Keywords:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/taxonomy/term/46">linux</a></div><div class="field-item odd"><a href="/taxonomy/term/78">iphone</a></div></div></div><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>iPhone tethering uses standard Bluetooth protocols, so you can tether from Linux. I'm not aware of how you'd do this over USB - for my situation (using the iPhone as connectivity for my CarPC) Bluetooth is ideal.</p> <p>First install Bluetooth utilities on Linux and ensure you are running a kernel with all Bluetooth support compiled in or otherwise available as modules.<br /> Make sure you have something on Linux that'll prompt you for the PIN - kbluetooth or similar for graphical desktops. Pair the phone and the computer - I did this from the iPhone end - and enter the same PIN on each end. Ensure tethering is enabled and switched on on the iPhone.</p> <p>You can get the iPhone's address on Bluetooth using 'hcitool scan' while the iPhone is in discovery mode.</p> <p>On Linux:<br /><code><br /> modprobe bnep<br /> pand --connect [IPHONE_ADDRESS] --service NAP --autozap<br /></code></p> <p>You should now see a new interface connected:<br /><code><br /> ifconfig bnep0<br /></code></p> <p>Depending on your Linux distribution, it may automatically run DHCP (this is how the iPhone gives your computer a NAT'd IP). Otherwise:<br /><code><br /> dhclient bnep0<br /></code></p> <p>(or whatever you use normally)</p> <p>All done, have fun with Internet everywhere :-)</p> </div></div></div> Sat, 20 Jun 2009 08:32:23 +0000 techuser 65 at http://www.technologicalwanderings.co.uk http://www.technologicalwanderings.co.uk/node/65#comments London Stock Exchange http://www.technologicalwanderings.co.uk/node/41 <div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Keywords:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/taxonomy/term/46">linux</a></div><div class="field-item odd"><a href="/taxonomy/term/81">microsoft</a></div></div></div><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>Microsoft: Get the Facts on the London Stock Exchange:<br /><a href="http://www.microsoft.com/uk/getthefacts/lse.mspx">http://www.microsoft.com/uk/getthefacts/lse.mspx</a></p> <p>Well, a few months ago the LSE was sending out incorrect data. Trading data was wrong. The graphs on the BBC were showing random static instead of value data.</p> <p>Now it's completely fell apart, on possibly one of the most important trading days of the year (bye bye another big bank):<br /><a href="http://news.bbc.co.uk/1/hi/business/7603981.stm">http://news.bbc.co.uk/1/hi/business/7603981.stm</a></p> <p>Ah, lovely, somebody has a grab of one of the MS adverts on the LSE:<br /><a href="http://tipotheday.com/2008/09/08/microsofts-foot-in-mouth-london-stock-exchange/">http://tipotheday.com/2008/09/08/microsofts-foot-in-mouth-london-stock-e...</a></p> <p>Microsoft pushing f**king reliability... Jesus... I changed my job recently and a big thing is not being woken at 3am whenever Microsoft deliberately cause a failure on an Server 2003 machine (aka enforced Windows updates reboot).<br /> Or the mornings after a MS update is pushed out to client machines and two dozen of our customers lose their email or file store or whatever MS have f**ked up that time.<br /> Still, it ensures the client is more willing to pay an extra couple of grand for the support contract to keep their machines running (or at least, running most of the time). MS at least cause movement of money.</p> <p>Now I work with Linux, BSD and Mac. So much happier.</p> </div></div></div> Tue, 16 Sep 2008 20:55:40 +0000 techuser 41 at http://www.technologicalwanderings.co.uk http://www.technologicalwanderings.co.uk/node/41#comments Recovering Linux RAID5 with mdadm http://www.technologicalwanderings.co.uk/node/33 <div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Keywords:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/taxonomy/term/13">raid</a></div><div class="field-item odd"><a href="/taxonomy/term/15">mdadm</a></div><div class="field-item even"><a href="/taxonomy/term/46">linux</a></div><div class="field-item odd"><a href="/taxonomy/term/63">raid5</a></div></div></div><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>If a Linux box has hardware troubles and you temporarily loose a disk or two on a RAID5, you might get into a state where mdadm --assemble does not work. This might happen with a controller failure, or if you have faulty cabling.<br /> You're seeing stuff like:<br /><code><br /> mdadm: failed to run array /dev/md7: Input/output error<br /> md: pers-&gt;run() failed<br /></code><br /> Don't panic yet!<br /> First step, ensure you have good backups and use dd or another tool to clone the hard disks.</p> <p>What you need to do is recreate the RAID. This will work in most cases to get your data back, but need to be done carefully to ensure you don't destroy it in the process.</p> <p>This doesn't really matter for RAID1, as your data is always consistent on both disks - you can put one disk in and resync everything from that to any other disk.</p> <p>For RAID5, the data is held across all disks. The thing to realise here is that the order of the disks in the array really matters. The trick to recreating a RAID5 and having it work is to get the order right.</p> <p>Problems:<br /> 1. What if the order is not obvious?<br /> 2. Resyncing.</p> <p>If you add the disks in the wrong order and start the array in a working state, it will perform an initial sync of the array. This will destroy your data as RAID5 starts to write checksum data across it.<br /> There may be a trick with mdadm to determine the correct order, but I do not know it (yet).</p> <p>You must create the array in a degraded state with a disk missing. This will allow you to mount the disk, but will not cause a resync attempt.</p> <p>So, here's the scenario. There are three disks in an array, hda, hdd, hdg. One failed completely (hdg) a while ago and you had to wait for new disks to be delivered. While waiting, there was an IDE failure and another disk was lost temporarily. Oh dear, we've got a broken array.</p> <p>You bring the disk back online but the array won't auto-reassemble and mdadm --assemble isn't working. So we move on to recreating.</p> <p>What you will do is attempt to create the array using two disks. The other will be marked as missing (even though we now have the replacement sitting on the workbench ready).<br /> But we don't know what order the disks belong in the array - maybe we'll get lucky and they are alphabetical, maybe we won't.</p> <p>This is what we'll do:<br /><code><br /> $ mdadm --create /dev/md7 --level=5 --raid-devices=3 -f /dev/hda1 /dev/hdd1 missing<br /> $ cat /proc/mdstat<br /> md7 : active raid5 hda1[2] hdd1[1]<br /> 240121472 blocks level 5, 64k chunk, algorithm 2 [3/2] [_UU]<br /></code></p> <p>So far so good, the RAID5 is running and has not touched the data by any resync attempt. So try to mount it readonly and see what happens.</p> <p>It if worked, great. Backup your data and carry on your life. If not, stop the array try another order. Treat 'missing' like any other disk and move it around also. Perhaps get out a bit of paper and work out all the possible combinations to try.<br /><code><br /> $ mdadm -S /dev/md7<br /> $ mdadm --create /dev/md7 --level=5 --raid-devices=3 -f /dev/hda1 missing /dev/hdd1<br /></code></p> <p>Keep repeating this until the array successfully mounts your file system.</p> <p>When it has finally worked, and you've backed up, you can add your new disk back in. The array will resync your data across all three disks (or whatever number you have) and everything will be back to normal.</p> </div></div></div> Sat, 07 Jun 2008 09:11:06 +0000 techuser 33 at http://www.technologicalwanderings.co.uk http://www.technologicalwanderings.co.uk/node/33#comments Dell Poweredge 1950 with Intel Quad Port Ethernet http://www.technologicalwanderings.co.uk/node/25 <div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above"><div class="field-label">Keywords:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/taxonomy/term/43">1950</a></div><div class="field-item odd"><a href="/taxonomy/term/44">pcie</a></div><div class="field-item even"><a href="/taxonomy/term/45">intel</a></div><div class="field-item odd"><a href="/taxonomy/term/46">linux</a></div><div class="field-item even"><a href="/taxonomy/term/47">2950</a></div><div class="field-item odd"><a href="/taxonomy/term/48">dell</a></div><div class="field-item even"><a href="/taxonomy/term/49">quad port</a></div><div class="field-item odd"><a href="/taxonomy/term/50">ethernet</a></div></div></div><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>I've spent the last couple of days configuring a batch of new Dell servers, 1950 rackmounts. A couple of them have Intel four port cards fitted (PRO/1000 Quad Port) and need to run Linux (the rest, FreeBSD).</p> <p>The servers were bought from Dell on the understanding that they'd be immediately compatible with a bog-standard Linux install.</p> <p>Well, I've been bitten by that before. Do NOT let sales people to spec a computer. Do NOT trust Windows users to spec a Linux machine.</p> <p>Before we get to the add-in card, let's look at the internal pair of ethernet ports. With FreeBSD these were fine - FreeBSD's driver support is surprisingly robust. Something for Linux developers to take a look at perhaps?</p> <p>Under Linux I had a significant problem: they did not work.<br /> To cut a long and arduous tale short (this was a WHOLE day wasted):</p> <p>1. The Dell machines ship with TOE (traffic offload engine) enabled. No good. Firstly, it doesn't work with Linux. Secondly, when they do work, it's with binary drivers. Thirdly, when your machine is going to be a firewall, you don't want some feature-sparse hardware taking over from the highly tuned Linux firewall stack you're using.</p> <p>To disable TOE is fairly simple: pop the top off the machine, and somewhere around where the power plugs into the motherboard is a little dongle, a little like an ethernet jack. Remove it. The hardware is built into the motherboard, but somehow we seem to have been sold the dongles - I assume they're like licenses.</p> <p>2. The ports are reversed! eth0 attaches to port 2, eth1 to port 1. I can see this being a support issue in years to come.</p> <p>Onwards to the add in card: again, did not work. Thank you Dell, I suppose zero out of two isn't bad really. It could have exploded when I plugged it in?</p> <p>There is no support in the Linux kernel for this new Intel card. Intel's own site takes you to the e1000 driver modules. Well, I thought - maybe that's because they're an updated version compared to the e1000 in the latest 2.6.24 kernel patches? No. Still did not work.</p> <p>Eventually I find my way here: <a href="http://sourceforge.net/projects/e1000">http://sourceforge.net/projects/e1000</a><br /> Sourceforge.net has a newer version of Intel's own e1000 driver, .5 verses .4!<br /> But also I find that there is a new driver for the newest gigabit hardware: igb. Aha, maybe this is what I need? Yes, one rapid download and 'make install' later, the ports fire into life. "igb" is the driver to try if you have a new Intel quad port card. Hopefully this will make its way into the kernel otherwise supporting the machine with kernel upgrades is bound to fail eventually when someone forgets to put the drivers back on - thankfully this is part of a high-availability firewall, using Heartbeat (and lots of bash/ifconfig/ip/tc/iptables scripting). An identical second machine will come online within seconds when the first fails.</p> </div></div></div> Wed, 19 Mar 2008 19:57:37 +0000 techuser 25 at http://www.technologicalwanderings.co.uk http://www.technologicalwanderings.co.uk/node/25#comments