Recovering LVM from a failed resize

I was recently doing a disk resize in VMWare and ran into a problem where LVM could no longer find the PV after I had done the fsck, even though I was sure I set the start sector correctly on the new partition I’d created.
It later became apparent that fdisk had been running with units set to “Cylinders” for some reason and put the partition start sector at a slightly different location, which meant LVM could no longer find the metadata for the PV and assumed it was missing.

Luckily I was able to correct this by looking at the partition table of a similar server, but this lead me to work on finding a way to locate the start position should I find myself needing to recover from such an issue again, I eventually came up with the below:

until pvck -vv --labelsector $SECTOR /dev/sda 2>&1 | grep "for sector 1";
done | awk '{sector=$9-$5; if (sector > 0) print "Partition starts at sector: "sector; }'

This will loop through looking for a valid LVM header then if/when it finds one it will output the location of the PVs start sector, you can then use fdisk to create a partition at that location.

If you have some idea of where the partition was, you can set the SECTOR variable to a sector number just before you expect your start sector to be, this should save a bunch of time from searching every sector on the disk up until that point.

To prevent this happening again I generally take a backup of the partition table using sfdisk, i,e

sfdisk -d /dev/sda | tee ~/sda.txt

Copy/Paste the output of this command to notepad or something similar, so that in the event of an issue, you can pipe the text back into sfdisk and restore the previous partition layout i.e

sfdisk /dev/sda < ~/sda.txt

Playing around with the 6502 Continued

My last post explained my initial successes (or so I thought) at this.

Since then I’ve switched to using Symon III which is feature packed and should greatly help me develop on my little system.

I also discovered that I screwed up the circuit design, leading me to run into random memory corruption because RW wasn’t being qualified by ∅2.
For some reason this only became apparent once I started using Symon, I guess Wozmon doesn’t really do enough for me to have noticed. and any code issue with software I had been writing I had assumed was my fault.

To work around this for a while I moved the RAM and ROM back to the breadboard and ran a bunch of wires while I played around with other things, because I wasn’t keen on spending the money on another board run so soon.

Offboard ROM/RAM

Not ideal…

I designed and received the Serial/Parallel IO boards but I messed up the design here too… I mixed up the Chip Select signals for my 6551 which meant it didn’t work at all…

This one was at least easier to resolve. Simply by cutting a trace or two and soldering some jumper wires on to correct the mistake.

Photo 1-02-2015 10 54 12 pm

Serial card dodgy!

After neglecting the project for months, I sent off my new revision of the CPU board with corrected ram/rom signalling so that it would actually work. but when I received the boards they didn’t work!.

Stupid me didn’t run ERC before submitting the design, assuming I had done so months ago and that it was all good to go. I was wrong and had to bring out the soldering iron to bodge up some more jumper wires…

cpu board bodge

Also included, TO-92 soldered to a sot-23 pad

Screen Shot 2015-01-29 at 10.08.14 pm

ERC check

Remember kids, always run ERC and DRC checks before submitting your boards to the fab…

It’s quite painful dealing with these issues on account of the turnaround time being 1-2 weeks before I receive my boards. It’s all been my own stupidity though.

Now that is all sorted though, and it’s working pretty perfectly! (it seems)

The next thing I’m working on is the keyboard controller which will be provided by an AVR, I know I said i’d prefer to do it in discrete logic but I wanted bidirectional communication with the keyboard.
Going forward I’m using KiCad instead of Eagle, which means that I should be able to bang out a single board design. this should theoretically help me Achieve higher clock speeds.


New Method for Creating a Lion/Mountain Lion USB stick

Recently I have tried to do a fresh install of Lion on my Macbook Pro,
When trying to restore InstallESD.dmg to the USB drive as I did the first time, I got an error in Disk Util which stated “Invalid Argument” at the end of the restore process.

After doing some searching I found that something has changed in a recent version of the InstallESD provided with the latest Mac OSX Installer, which prevents you from successfully restoring it to a usb drive. but I’ve found a way to do it anyway

To do this, simply format your disk with Disk Util with a single Mac Formatted partition, with the GUID Partition map type. name it something like “Lion USB Install”

Double-click your InstallESD.dmg file so it mounts, then open up a terminal and type

# sudo rsync -avlrHt “/Volumes/Mac OS X Install ESD/” “/Volumes/Lion USB Install”

This will copy all of the files required for the OSX installer to your USB drive, once that’s done run

# sudo bless --folder “/Volumes/Lion USB Install/System/Library/CoreServices” --bootefi

You should now be able to use the USB key to run the Lion installer

Thanks to Morten, who has confirmed that this same method works with Mountain Lion too.


Making your AFP server more Time Machine friendly

Yep, another post about Time Machine.

One of my earlier posts describes how to mount your unsupported time machine backup disk within the OSX Installer, allowing you to restore from a Time Machine backup.
well, now I’ve found a guide that tells you how to craft an Avahi service file that will allow you to avoid having to mount the share manually, making it appear to your mac as a standard time capsule
You can find the info on this here:

How to run Debian natively on the Motorola Xoom

Hey all,

I’ve seen a lot of people running linux on their xoom and other android devices but chrooted under android and using a VNC client to make use of the chrooted install. quite messy and less than efficient IMHO, so I set out to install it natively on my Xoom

I’ve managed to get Debian installed on my Xoom with the only issues being no sound and no Bluetooth, this is due to the proprietary nature of the sound drivers for the Tegra, and the lack of documentation for the BCM4329 Bluetooth under linux. if anyone has any tips with these I’d love to hear them.

Anyway, since the Xoom is an android device with an unlockable bootloader from the factory this wasn’t too difficult. the only issues were with the TegraFB and Touchscreen drivers. Thankfully Lilstevie from GalaxyLinux helped me out with the touchscreen driver and Robert Morell from NVidia provided a patch to Chromium for the FB which is here

(Todo: Add guide for using WIFI, upload prebuilt images)
(Update: Fixed the links)
(Update 14/2/12 Thanks to Thomas!)


Basically all you need to do is build a root fs and a kernel for your Debian install. this is actually quite easy. here’s how..

Continue reading

More Time Machine fun

Update: no longer needed, see Making your AFP server more Time Machine Friendly

My Macbook pro decided that it was time for some irrepairable partition corruption tonight. as such I’ve had to restore from a backup

This post is a followup to my previous post about Time machine on unsupported network drives.

if you wish to do a full restore of a Time Machine backup from what apple considers an unsupported time machine device from the OSX install DVD you will need to open up Terminal from the Utilities menu then type

mkdir /Volumes/TM

mount_afp afp://username:password@ipaddressoffileserver/timemachineshare /Volumes/TM

then exit the terminal, go to Utilities > Restore this system from a backup and it should now appear in your list.

Re: I am Not an Animal – I’m a Flash Developer

This is a response to an article on

Basically what we have here is an article on Flash by somebody who self taught and has no qualifications or experience with anything else.
So, as I read it, it becomes clear to me that this fellow is afraid of change. Possibly because he will be left behind if he doesn’t learn HTML5 and also because he doesn’t seem to understand where companies like Adobe will really fit in when HTML5 replaces flash. Let’s explore this.

Open source they cry! A world wide web free of proprietary formats and buggy plug-ins they say! HTML 5 is here and finally spelling the end for Flash. It sounds like an Apple fan boy’s wet dream. A text pad wielding code monkey’s paradise too perhaps? But does the Flash platform need to die in order to achieve online Zenith where we ascend to a magical place where JavaScript libraries and cascading style sheets run wild and free.

Perhaps the issue people have is that Flash isn’t at all stable on OSX let alone any mobile device and even when running its performance is horrendous.
Why use a buggy slow piece of shit plugin when our browsers are capable of the same things flash is? this is more than just code monkeys. this is users and code monkeys alike.

I hope not. I have a soft spot for Flash. Fundamentally because it’s one of the most empowering creative tools of the digital age. It was a huge catalyst for content creation in the early days of the web, but flash also played a key role in the emergence of Web 2.0 through YouTube and Flickr technologies. It showed the web could have more than just static text and pictures, things like atmosphere, transitions and graphic style unparalleled in any HTML sites.

This is true, but it’s 2010 and the times are a changin’.

We now have an HTML spec that is capable of providing cross platform media in a way never before possible. without any proprietary plugins and without any performance hit or browser crashing caused by buggy closed-source plugins that will never be fixed. Flash did do a great thing for the web. but unfortunately for some its days are coming to a close. it pioneered some aspects of web media but HTML5 is going to take us forward.

Youtube understands this, and now support HTML5

I’d like to see HTML 5 do this. I remember I used to get a hard disk over this kinda thing 10 years ago when I was learning Flash. It offered an incredible insight into the potential of the platform and gave new meaning to the web. Sites like would clearly translate well to the iPad given the obvious attention to detail and design. This is not possible with HTML 5 yet. Nothing the bashers have put forward argues otherwise.

Once Adobe releases their HTML5 designing tools. there shouldn’t be any problems with that.

Would HTML 5 be able to create TV shows like Quads or how about a full length feature Drawn Together movie.

HTML5 is a web technology, it’s focus is not to create Television shows. however the canvas functions should be more than capable of this. we’ll just have to wait and see.

The web is better with Flash. A richer, more inclusive experience.

HTML5 is capable of the same things Flash is.

What Adobe has done right is to plant the seeds of a very diverse and colourful ecosystem of content producers, tools, resources and libraries out there for free (mostly) to anyone who wants to learn.

That’s right, plant the seeds.

What Andrew doesn’t seem to realise is that anything that Flash could do with the web, HTML5 can do better.
Flash is a buggy, poorly performing pile of shit. Designing a site in flash makes it impossible for people link to things on the site, makes it impossible for blind customers to use your site. makes it impossible for a search engine to index any of the content on the page or for the site to work on a machine which is incapable of supporting flash.

It is not the duty of a web browser to support a site, it is the duty of the site to work on any browser. sure some functionality being lost due to small amounts of flash based content on a site but when you build a full site out of flash it’s your own problem when it comes to your customers being unable to view your site.

Any web designer that designs a whole website out of flash is a hack, it’s simply bad etiquette to build a site that relies on flash. Any designer that I work with that uses flash so heavily is usually the self-taught kind. Like I said, sites should be designed to support the browser not the other way around.

However if you’re not particularly feeling like a hack then you’ll have no problems. your friends at Adobe are going to make it through the whole HTML5 thing just fine.

What some people don’t seem to realise is that Adobe will be one of the companies that brings HTML5 development tools to the market.

This is how people will deliver content using things like Canvas. they will provide the HTML5 video players etc. they will make it easy for the average simpleton to move from flash to HTML5.
If you’re capable of learning new things you’ll be fine, Adobe will give you all of the nice tools to make HTML5 development a drag and drop affair.

UPDATED: Adobe is trying to fuck HTML5 in the ass while playing the innocent card.

While trying to be all happy and friendly towards HTML5  publicly they have lodged an objection on W3C mailing list in regards to the canvas property and haven’t publicly announced this.

The reason being that as it’s used for 2D Drawing and would be a direct competitor to the bloated, buggy crapware we’re forced to use now (flash)

Because of this objection, the spec will most likely be put on hold for now while this political bullshit of theirs is sorted.

Seriously Adobe, HTML5 will replace flash. you can either waste it’s last breaths thrashing around trying to survive or you can get in on the HTML5 pie with some tools that will allow people to make great HTML5 content.

(Source: Daring Fireball)


Adobe are claiming that they have in no way hindered HTML5 or any of it’s related specs

Quote by Larry Masinter – Adobe rep

No part of HTML5 is, or was ever, “blocked” in the W3C HTML Working Group — not HTML5, not Canvas 2D Graphics, not Microdata, not Video — not by me, not by Adobe.

Neither Adobe nor I oppose, are fighting, are trying to stop, slow down, hinder, oppose, or harm HTML5, Canvas 2D Graphics, Microdata, video in HTML, or any of the other significant features in HTML5.

Claims otherwise are false. Any other disclaimers needed?

Not sure if I believe it myself. but who knows.

STO: Star Trek Offline. The new MMO

Star Trek: Online

It could’ve been so much

Instead we get a half baked abortion of a game made by a company that seems hell bent on ignoring every support request their customers put in.

Well, almost all.

They seem to pop up in threads where some blind, neckbearded Star Trek nerd puts up a post praising the creators of the game and telling them it’s the best thing invented since cheetos. when one of those posts come up the GMs and Devs drop all their work and seem to suckle on the aforementioned neckbearded fellows cock.

You know, Cryptic would be better off spending less time sucking the dicks of religious star trek nerds who are blinded by their fetish for all things Star Trek and more time fixing the numerous bugs in the game, and replying to actual customers who have some valid input.

How about fixing the rego key issues? people (like me) can’t even apply their pre-order keys because the system claims not to recognise it.
There are extreme rubber banding issues
Regular disconnects and logouts
Missing items from the pre-order packs
Lack of content
Lack of diversity in missions. a majority of them are “go here, kill that”
Stop fucking bringing the servers down every night, during Australian Primetime.
Enough with the random disconnects, and the constant unplanned downtime
Give the game a death penalty, otherwise it’s like it is now, a never ending game of space lemmings where you keep going in to fight the valiant fight, die and then repeat.

Plenty of issues, instead we get bullshit patches for crap like spelling corrections.

I think the worst part is the community of unbathed blind neckbeard having e-heros who spend their time on the forums saying shit like “You should feel privileged to have a ST MMO” and to “stop whining”

Here’s an idea to those idiots, go fuck yourselves!

I paid something like $70 on the game, I’d like my moneys worth please! especially if these leeches want me to pay them monthly for a game based off of the star trek universe, even if they have physically violated it to the point they have and completely fucked with the canon.

The worst part is that I’ve essentially pissed away $70 on a game that I can’t play unless I want to give them more money for subscribing. 6 months down the track I might come back to it to see if the shit flinging monkeys at cryptic have managed to queef something out that resembles a playable game. right now we have a game that needs another year of development before it becomes playable. by then they could’ve gone bankrupt. making my $70 even more fucking wasted because I’ll never get a chance to play this bullshit.