web
Setting UUIDs on new partitions
If you take a look at /etc/fstab on a recent Linux installation, you may notice it’s using lines like
UUID=663f1349-3d37-4633-af59-849eda89bae4 / ext3 defaults 0 1
instead of the more traditional
/dev/sda1 / ext3 defaults 0 1
These universally unique identifiers (UUIDs) can be generated by the uuidgen command and can reasonably be considered unique among all UUIDs created on the local system, and among UUIDs created on other systems in the past and in the future (from the uuidgen(1) man page).
Why would you want to use a UUID rather than the far more readable /dev/sda1 (well, readable if you’re somewhat comfortable with Linux anyway)? The problem with traditional device names (like /dev/sda1) is that they are assigned by the Linux kernel at boot-time and depend on the order in which devices are found. So /dev/sda is the name the Linux kernel assigns to the first SCSI or SATA hard drive it finds, /dev/sdb is the name used for the second SCSI or SATA hard drive and so on.
This works very well until the Linux kernel detects your devices in a different order to the usual. In practice, this is a relatively rare event but it is certainly possible when moving between kernel versions and if you make changes to your system hardware (such as adding in a second SATA controller). If your device order does change, all of a sudden, your root device which used to be known as /dev/sda1 becomes /dev/sdb1 or similar. Normally this will cause a kernel panic at boot time as your Linux system attempts to mount a filesystem which doesn’t exist or which doesn’t contain the expected filesystem.
One solution to this is the use of UUIDs. When you create a new filesystem, a UUID is generated and written to the filesystem’s superblock. The /etc/fstab then refers to this UUID which will remain constant regardless of what kernel you are running or how the drive is connected to your system (indeed, if you move the drive to an entirely different system, the UUID will still be valid).
If you only create partitions during the initial installation of your OS – you won’t have to deal with creating UUIDs for your partitions, the installer should take care of it automatically.
If you create any new partitions though, you will need to assign UUIDs to those partitions manually if you wish to refer to those partitions in your /etc/fstab by UUID (you can continue to use a mix of /dev/sda1 type entries and UUID based entries in /etc/fstab if you wish). To assign new UUIDs you need to
- Generate new UUIDs with uuidgen
uuidgen f15f8aed-0073-4d2f-abec-aa5da4f72e8c
- Write this uuid to your new partition (WARNING: Do not run these commands against an existing partition),
for ext2, ext3 or ext4:sudo tune2fs -U f15f8aed-0073-4d2f-abec-aa5da4f72e8c /dev/sdc5
for xfs:
sudo xfs_admin -U f15f8aed-0073-4d2f-abec-aa5da4f72e8c /dev/sdc5
for reiserfs:
reiserfstune -u f15f8aed-0073-4d2f-abec-aa5da4f72e8c /dev/sdc5
Update: When you create a new filesystem on a device, the command seems to allocate a uuid at that stage. To view existing uuids (in order to use them in your fstab and so on, run the blkid command).
Repartitioning modern Linux systems without reboot
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),
- sudo cfdisk /dev/sda (and create new partition of type FD, Linux RAID)
- sudo cfdisk /dev/sdb (and create new partition of type FD, Linux RAID)
- sudo partprobe
- sudo mdadm –create /dev/md3 -n 2 -x 0 -l 1 /dev/sda4 /dev/sdb4 (our swap devices are software RAID1 devices)
- sudo /etc/init.d/udev restart (this updates /dev/disk/by-uuid/ with the new RAID device)
- sudo mkswap /dev/md3
- sudo vi /etc/fstab (and add a new entry for /dev/md3 as a swap device)
- sudo swapon -a (to activate the swap device)
- sudo swapon -s (to verify it is working)
Marketing 101 – Your business website
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 :).
Categories
Archives
- September 2010
- February 2010
- November 2009
- September 2009
- August 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- November 2007
- September 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- September 2006
- July 2006
- June 2006
- April 2006