IDE hard drives

I just lent two 80G IDE drives to a friend, and he re-paid me with 160G drives. Generally I don’t mind people repaying hardware loans with better gear (much better than repaying with the same gear after a long delay and depreciation), but this concerns me.

My friend gave me the 160G drives because he can’t purchase new 80G drives any more, his supplier has nothing smaller than 160G. I have some very reliable machines that I don’t want to discard which won’t support 160G drives – I’m not even sure that they would boot with them! Now I’m going to have to stock-pile 40G disks.

The machines I am most concerned about are my Cobalt machines. They are nice little servers that are quiet and use only 20W of electricity!

It’s a pity that there aren’t any cheap flash storage devices that connect to an IDE bus. If I could get my Cobalt machines running with flash storage they would be even more quiet and energy efficient while not being at risk of mechanical damage, and I doubt that flash storage will exceed 40G of capacity for a while.

Update: I’ve set a new personal record for rapid comments on a blog entry, all telling me that it is possible to get CF to IDE adapters. Thanks for the information, I appreciate it and will consider it for some machines. The problem however is that the price of a CF to IDE adapter plus the cost of a CF card of suitable size is moderately high (more than the cheaper hard drives), while CF capacity generally is only just usable for a mainstream Linux distribution.

These factors combine to make CF-IDE devices an option for only certain corner cases, not really an option to replace all the hard drives in machines that matter to me. I will probably use it for at least one of my Cobalt machines though.

Update2: Julien just informed me of the new Samsung flash-based laptop drives that will have capacities up to 16G (or 32G according to other web sites). I’m now trying to discover where to buy them.

xen

I’m currently working on a little Debian Xen server, and I encountered a few problems that aren’t documented.

The first problem I found was that serial ports don’t work with a default Xen setup (as documented in a previous blog entry). However the solution to this turns out to be putting xencons=off on the kernel command-line for the dom0 kernel. This allows the dom0 kernel to see all the serial hardware. If I had wanted to use the serial ports from a domU then something else would need to be done, but as I have no need for this I didn’t investigate the matter any further. Thanks to Brian May for discovering this for me.

Next in the early test relreses of etch the udev hotplug interface isn’t enabled. So I had to add kernel.hotplug=/sbin/udevsend to the /etc/sysctl.conf file. A newer version of udev appears to fix this without modifications to the kernel.hotplug setting though. The symptom of this was the error “Error: Device 768 (vbd) could not be connected. Hotplug scripts not working” where 768 is the number for /dev/hda (the same message would occur with number 769 if you use /dev/hda1). I choose to use unpartitioned virtual disks such as /dev/hda and /dev/hdb in Xen because there is no benefit in partitions (my Xen instances are not doing enough to need more filesystems than there are virtual IDE disks) and because I don’t desire the fake partition table thing that Xen apparently does.

Hans Reiser

According to this article in the San Francisco Chronicle Hans Reiser pled “not guilty” to the charge of murdering his wife. This isn’t particularly exciting news as all previous indications were that he was going to do so.

However one noteworthy fact from the article is that they are setting up an education fund for his children. Regardless of whether Hans is convicted or not, his children will still be in a bad situation and in need of assistance. While there are plenty of other worthy charities needing donations, if you are considering donating towards a Linux related cause then you might want to consider the children of a kernel coder.

1

economics of a computer store (why they don’t stock what you want)

day 39 of the beard

In some mailing list discussions recently some people demonstrated a lack of knowledge of the economics of a shop. Having run a shop for a few years (an Internet Cafe) I have some practical knowledge of this. I will focus on small businesses in this article, but the same economic principles apply to large corporations too.

When running a shop the main problem you have is in managing stock. There are two ways of getting stock, one is to have wholesalers give it to you for a period in which you can try to sell it and you pay for it when it’s sold, this is probably quite rare (I don’t know of an example of it being done – and probably no retailer wants to talk about it in case they lose it). Often retailers consider themselves to be privileged if they are permitted to pay for hardware one month after they receive it! The more common way of getting stock is simply to buy it and hope you can sell it in a reasonable period of time (often the wholesaler will offer to buy the stock back at a 10% discount if you can’t sell it).

To buy stock you need money, this can come from money that has accrued in the business account (if things are going really well) or from a mortgage taken out by the business owner if things aren’t going so well. For small businesses things usually don’t go so well so the money used to buy stock is borrowed at an interest rate of about 7% or 8% (I’m using numbers based on the current economic conditions in Australia, different numbers apply to different countries and different times but the same principles apply). The ideal situation is when there is money in the company bank account to cover the purchase of all stock, this means that the cost of owning stock is that you miss out on the 5.5% interest that the money will get in a term deposit.

Almost all stock has a use-by date of some form. Some items have a very short expiry (EG milk used to make hot chocolate in an Internet cafe, some have a moderate expiry date (computer systems become almost unsellable in about 18 months and lose value steadily month after month), but in the computer industry nothing has a long expiry date.

Let’s assume for the sake of discussion that you want to run a small computer store that is open to passing trade (this means that you must have stock for an immediate sale). Let’s assume that all items of computer hardware lose half their value over the period of 20 months at a steady rate of 2.5% of the original price per month (I think that most computer hardware loses value faster than that, but it’s just an assumption to illustrate the point).

The next major issue is the profit margin on each sale. If you can make a 20% profit on a sale then an item that has lost 10% of it’s value while gathering dust in your store will still be profitable. However the profit margins on computer sales are very small due to having a small number of major manufacturers (Intel, AMD, nVidia, ATI, Seagate, and WD) that have almost cartel positions in their markets and there being little to differentiate the stores apart from price. I have been told that 3% profit is typical for retail computer hardware sales by the small companies nowadays! Now if the stock will lose 2.5% of it’s value per month, you pay 0.5% interest per month and you make a 3% profit then if an item remains in stock for a month then you lose money. So on average (by value) you need to have stock spending significantly less than a month in your store. Cheap items such as low-quality cases and PSUs can stay in stock for a while. More expensive items such as new CPUs and the motherboards to house them must be moved quickly.

What’s the first thing that you do to reduce stock? You can keep stocks low, but there is a limit to how low you can go without losing sales. The next thing to do is to not stock items that customers won’t often buy or items where there is a similar item that you can stock as a substitute. The classic example of this is hard drives, a customer will want a certain capacity for a certain price – if their preferred brand is not in stock they will almost always take a different brand if it has the same capacity at the same price. Stores often advertise prices on multiple brands of hard drive in each capacity, but often only try to keep one brand in stock.

Of course this is a problem for the more fussy buyer. If you want to buy two identical parts from the same store on different days you might discover that they don’t have the stock on the second day and that they instead offer you something equivalent. Not only do retailers have issues with managing their investment in stock but wholesalers have the same problem. So if a retailer runs out of WD drives and discovers that their preferred wholesaler has also run out of WD drives then they just buy a different brand – most customers don’t care anyway.

There are some companies I deal with that have a business model based on services. One of them sells hardware to customers at cost, but charges them for the time spend assembling them, transporting them, etc. The potential for a 3% profit on the hardware isn’t worth persuing, they prefer to just charge for work and also save themselves the sales effort. Another company I know operates almost exclusively on the basis of ordering parts when customers request them (but still make a small profit margin on the sales), this means that the customer can be invoiced as soon as the hardware arrives. The down-side to this is that wholesalers have the same stock issues and they sometimes have excessive delays before the wholesaler can deliver the hardware.

Dell is the real winner out of this. As they operate by mail-order they don’t need to have the stock immediately available, they have a few days to deliver it which gets them time to arrange the supply. They can also have a central warehouse per region which reduces the stock requirements again. A 3% profit on items that rapidly decrease in value makes it almost impossible to sustain a small business. But an organization such as Dell can sustain a successful business at that level.

Of course the down-side for the end-user is that Dell doesn’t want to have too many models as that just makes it more complex for the sales channel. Also they have deals with major suppliers which presumably give them deep discounts in exchange for not selling rival products (this is why some brands of parts are conspicuously absent from Dell systems).

10 years ago there used to be a small computer store in every shopping area. Now in Australia there are a few large stores (which often only have a small section devoted to computers) and mail-order. There seems to be much less choice in computer hardware than there was, but it is much cheaper.

PS I’ve attached a picture of day 39 of the beard.

flash for main storage

I was in a discussion about flash on a closed mailing list, so I’ll post my comments here.

I believe that flash will soon be suitable for main storage on most desktop and laptop machines (which means replacing the vast majority of the hard drive market). Flash survives mechanical wear much better than hard drives (flash storage in a camera will usually survive the destruction of the camera), it produces less heat and less noise, and it has better seek times. It is more expensive, although the price is coming down and the main problem now is the number of writes that can be made.

Flash is widely regarded as being slow for bulk IO (benchmark results I have seen approach 10MB/s – while 60MB/s is common for cheap desktop IDE disks). I am not sure how much of this is inherent to flash technology and how much is due to the interface used to access the flash. I often work with Gig-E networks, but for my home use I only have 100baseT, so I have little need for more than 10MB/s IO rates at home.

It is generally regarded that a sector of flash storage wears out at between 10,000 and 1,000,000 writes depending on how recent the hardware is and who you talk to (some vendors are more optimistic than others regarding the usable life of their devices).

Let’s assume that you have a 32G flash module running JFFS2 with an average of 2G free (30G of long-term data that doesn’t change and 2G of space that is used for new files). Let’s assume that the most pessimistic prediction for flash reliability of 10,000 writes happens to be correct. So if 10,000 writes are to be made to that 2G of space that means 20T of data written! If we assume that the machine will be obsolete in 5 years then that allows us an average of just over 10G of data written per day (20,000/365/5=10.9). On my laptop iostat reports the following after 5 days of uptime:

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
hda               1.94         9.94        20.33    4614118    9439808

I believe that this means an average of 20 blocks were written per second over the last 5 days with a block size of 4K (page size), this means 6.6G per day. Clearly something is wrong with my laptop as there should not be so many writes, but even so I wouldn’t expect it to wear out within 5 years if I used only flash storage. Incidentally I do a lot of travelling and generally find that I’m lucky if a laptop hard drive lasts three years. So I could expect flash to last longer than a hard drive for my laptop use.

When flash fails I believe that only a small part of the data will be lost, which is better than the hard drive failure condition which is often to lose everything!

Also there is nothing preventing you from creating a RAID-1 of flash devices. Last time I checked the JFFS2 kernel code didn’t support such things but that could be fixed if there was suitable hardware.

Note that JFFS2 is vastly preferable to using Ext3 or similar filesystems on a flash device. Flash needs wear-levelling (spreading the write load over all parts of the disk) for sane operation. JFFS2 has this built in to the filesystem, while Ext3 etc are designed to repeatedly write the same parts of the disk. This means that to use Ext3 you need a mapping layer that does wear-levelling which causes inefficiency. Also JFFS2 has compression built in (same method as gzip). This is good for smaller flash devices (EG the 32M storage that was common in iPaQs), and also reduces the wear on larger storage.

The biggest problem for me in using flash at the moment is the lack of support for XATTRs (needed for SE Linux) in JFFS2. KaiGai Kohei has been working on this, it’s been a while since I checked on the progress so I’m not sure if it’s got into the kernel.org repository yet.

Another problem with flash is that it is totally unsuitable for use as a swap device. This means that you need to have so much RAM that swap is not needed. Fortunately desktop machines with 2G of RAM are becoming common.

Sell a Band

day 29 of the beard

sellaband.com has an interesting business model. If you want to make money from your band you can sign up to their site and create a web site with some sample tracks. Then wait for 5,000 believers to each pay $10 for a share which grants the band a recording contract. The $10 gets them a share of advertising royalties (which seems extremely unlikely to recover the $50,000) and also a first-edition CD from the band ($10 is cheap for a CD). If there is an unpublished band you like then all you need to do is to find 5,000 people who can each spare $10.

The main advantage of the site seems to be as a central advertising point. Sure it would be better to record your own CD and sell it for $10 per copy (which is not difficult to do with little expense nowadays), but finding the 5,000 people who want to pay will be difficult.

It’s a pity that sellaband relies extensively on Flash, so I can’t use their site. Maybe someone else will copy the idea and use standard web pages that display in all browsers.

PS I’ve attached a picture of day 29 of the beard.

religious requirements for free software development

day 24 of the beard

Relgions commonly require contributions to charitable causes and helping other people. Developing free software without expecting a reward seems to fit that criteria.

If my primary religious belief (atheism) turns out to be incorrect then I am certain that whatever deity might exist would want me to do Free Software development.

It seems to me that denying people the ability to contribute to Free Software development or forcing them to use proprietary software is therefore an infringement of their rights to freely practice their religion.

Prisoners should be permitted to do Free Software development. Kevin Mitnik was prevented from using computers while incarcerated and after being released (which is wrong in so many ways). It has been recently announced that pagan prisoners in the UK are being given time off prison duties for haloween. I think that allowing free software development for people who believe that it is a religious requirement deserves at least the same protection.

Also government agencies should not require the use of MS file formats or IE for communication.

PS Day 24 of the beard is depicted above.

Xen and serial ports

Currently there is a serious problem with Xen. Fedora Core 5 with kernel 2.6.18-1.2200.fc5xen and Debian/unstable with kernel 2.6.18-1-xen-686 will not recognise both PC serial ports, and it appears that the one port that is recognised is only usable for a console not for a modem.

The Fedora bugzilla #204825 covers this and I have just filed Debian bug #396169.

The PC serial port is a fairly significant piece of hardware that is used for many things. The total lack of support for it in Xen builds is a significant impediment to Xen use. I believe that one of the potential benefits of Xen is to have applications that are exposed to attack run in a domU so that if a compromise is suspected then the memory can be dumped. Implementing this requires running Xen almost everywhere, which will not be possible if essential hardware is not supported.

I have also discovered a couple of other bugs in Xen in FC5 which I am in the process of verifying and reporting. One is that on a P3 system the plain-text console displays as black on black and the other is that Xorg on a PentiumD system will go into an infinite loop when OpenOffice is started.

day 8 of the beard

day 8 of the beard

The beard is still growing steadily, and I’m still waiting for the beardly powers that some of the bearded delegates at LCA 2006 assured me that I would develop.

debate via wiki

Lars Wirzenius seems to be seconding my idea for using wikis to solve contentious issues.

My latest idea in this regard is to have several wiki pages, one for each opposing view and one for agreed facts. If an issue has multiple parties debating it then there could be multiple pages for the areas on which different sub-groups agree.

The plan is that each faction edits their own page along with email discussion with other factions and then the page of agreed facts is updated when agreement is reached on some points.

Wikipedia is the canonical use of Wikis for contentious issues at the moment. It is based on having a page for each topic and a discussion page for that page where the history is discussed. This works for Wikipedia because the aim is merely to generate web pages. If the generation of web pages is incidental to the purpose of resolving a dispute then it is a little more tricky. Entire areas of disputed content can be left out of Wikipedia pages without any real loss. But often in online debates the key points are the ones most hotly disputed.

I plan to set up a wiki and do some experiments to see how well this works.