Archive for April, 2009

Repartitioning modern Linux systems without reboot

Friday, April 17th, 2009 | galway, linux, useful tools, web | No Comments

This one is for my own future reference as much as anything. Ever since the move to udev in Linux 2.6, I’ve found it neccesary to do the very un-Linux like thing of rebooting before the appropriate device appeared under /dev. This was only an occasional hassle but still, you shouldn’t need to reboot Linux for such a thing.

Thanks to Robert for his Google magic in turning up partprobe, part of the GNU Parted package. As the Debian man page for partprobe says

partprobe is a program that informs the operating system kernel of
partition table changes, by requesting that the operating  system
re-read the partition table.

Excellent! Parted is normally installed on Debian and Ubuntu by default anyways, if not, simply, aptitude install parted and you’ll have access to the excellent partprobe.

We were trying to add some additional swap to a running system, the full series of commands needed as follows (I could have used parted to create the partition  but the cfdisk tool has a nice interface),

  1. sudo cfdisk /dev/sda (and create new partition of type FD, Linux RAID)
  2. sudo cfdisk /dev/sdb (and create new partition of type FD, Linux RAID)
  3. sudo partprobe
  4. sudo mdadm –create /dev/md3 -n 2 -x 0 -l 1 /dev/sda4 /dev/sdb4 (our swap devices are software RAID1 devices)
  5. sudo /etc/init.d/udev restart (this updates /dev/disk/by-uuid/ with the new RAID device)
  6. sudo mkswap /dev/md3
  7. sudo vi /etc/fstab (and add a new entry for /dev/md3 as a swap device)
  8. sudo swapon -a (to activate the swap device)
  9. sudo swapon -s (to verify it is working)

Tags: , , ,

Marketing 101 – Your business website

Thursday, April 16th, 2009 | business, web | 2 Comments

I’m probably the last guy in the world who should be blogging about sales and marketing, I’m a techie after all (and like most techies, for a long time, I thought if you did good technology the customers would follow without any persuasion required). But maybe some of what I say will resonate with other techies out there more than if it comes from a sales and marketing guy. This blog started out as Marketing 102 – Business cards but as I wrote the introductory paragraph I started talking a little about the preceeding step of preparing your business website and, well, here we are.

I’ll get back to the business cards in a later post including some recommendations for who to use to print a small volume of nicely finished cards and what you should put on the cards.

I guess for a technology company (large or small), I figure your first step in marketing should be putting together a website for your business, possibly accompanied by a blog (if you have the time and energy to write regularly and you have something useful to say). At a minimum, your website should answer the following questions,

  • Who
  • What
  • Why

The who involves telling the customer a little about you, your background as well as providing the obvious such as contact details (email, phone and physical address) and maybe some details on what your company’s mission is.

The what involves telling the customer what you actually do. When you start on this, if you’re a techie, you’ll enter a brief fugue state where you start spewing technical terms and concepts that only other level 7 nerds will understand (hey it’s ok, I’m one too, I understand). Once you get over this, step back, and translate these terms into plain english that a (non-technical) customer can understand (so, while Atlantic Linux can deploy a large-scale event management framework utilising SNMP, IPMI and active and passive agents to quantify the availability of your enterprise infrastructure – in plain english we do remote system monitoring or even Linux systems support).

The why is the little bit about why customers should be talking to you instead of the company down the road for the services they require. This is similar to what you do but more about the customer than you. It can be summed up in three words,

Benefits, not features

So, rather than telling the customer about your 20 years of experience with Linux, tell them about how that 20 years of experience means that you’ve seen all the things that can go wrong in their systems and you know how to fix them. Rather than talking about how you’ve used 15 different Linux distributions on 10 different types of computer, tell the customer about how you have enough knowledge of Linux distributions to know which one will suit their needs (obviously, if you’re a software developer or a Windows consultant then you might want to talk about software development or Windows rather than Linux but you get the idea).

Putting a good website together is a long, painstaking process and will involve frequent rewrites and pruning (I reckon it’s a good sign if you find yourself taking stuff out rather than putting stuff in). We’re still working on our one but I think we’re getting close now (for the last year or so :).

Tags: , ,

Subversion sparse checkouts

Tuesday, April 7th, 2009 | galway, software engineering, useful tools | 5 Comments

I’ve been using Subversion for a few years now but as with lots of technology I work with, I’ve learned enough about it to do the job I need to do but I’ve never dug into it exhaustively. It turns out a nice feature called sparse checkouts was introduced into Subversion 1.5. With Subversion,  you can either create one repository for each project or use a single repository for multiple projects. I like using a single repository for multiple projects but there are advantages and disadvantages to both approaches and it’s yet another source of religious debate and flamage so I won’t suggest which would suit your needs best.

One of the disadvantages of using a single repository for multiple projects is that any time you want to check out part of your repository, you either had to do something like this,

svn checkout http://www.example.com/svn/myrepo

to check out the whole repository (and if it’s a big repository, and you’re on a slow connection, you get to watch the world wide wait in action) or something like this

svn checkout http://www.example.com/svn/myrepo/oneofmyprojects

to just check out a teensie part of your repository which should happen faster than the former approach. The disadvantage to the second approach is that you end up with only part of the repository checked out and if you want another part in the future, you’ll have to check that out separately like

svn checkout http://www.example.com/svn/myrepo/anotheroneofmyprojects

Pretty soon, you’ll have a directory full of separately checked out projects, each of which you have to individually svn update, svn commit and so on. Hey, it starts looking like you have one repository for each project. Ideally, what you want to be able to do is to check out your entire repository but only the bits your are interested in, while keeping the option open of checking out other parts in the future and managing them all as the one repository that they are. Sparse checkouts introduced this functionality.

With svn’s sparse directory support, you can do the following,

svn checkout --depth=immediates http://www.example.com/svn/myrepo

This checks out the myrepo repository, but only to a depth of 1, that is, all files and directories immediately under myrepo but not any further subdirectories and files. So a directory listing of your checked out repository might look like,

oneofmyprojects/
anotheroneofmyprojects/
README.txt

This gives you an overview of the myrepo hierarchy without pulling all the files. Furthermore, it is sticky – any subsequent svn update commands you run will honour the scope you set in the first checkout.

If you now want to flesh out parts of the tree, you can do the following

svn update --set-depth=infinity myrepo/oneofmyprojects

This updates the contents of myrepo/oneofmyprojects with all children (files and subdirectories) ensuring you have a full copy of that part of the repository. If you subsequent run an svn update in myrepo – the behaviour for oneofmyprojects continues to be sticky and will result in an update of all files and subdirectories (while not checking out the children of any of  the other myrepo top-level directories).

Unfortunately, you cannot checkout a directory with depth=infinity and then update it to a reduced a depth (the behaviour only works in the direction of increasing depth for now).

More detail is available at http://svnbook.red-bean.com/en/1.5/svn.advanced.sparsedirs.html

I took a quick look at TortoiseSVN (a very nice graphical Subversion client for Windows) and if you do an SVN checkout it has an option  for Checkout Depth which I’m guessing provides the same functionality (but I haven’t tested it).

Tags: ,