Wednesday, March 22, 2006

Using Pricewatch Effectively

Summary: I ordered a disk drive from a small distributer, and got what i wanted, when it was expected, at the price offered - roughly half the costs elsewhere, and without rebates or other nonsense. Can't beat that with a stick.

Last week, i ordered a 160 GB hard disk through Pricewatch. I settled on an offering from a company called 3btech. They had the low bid, and are reasonably nearby. Next day delivery from a big name on-line store would have been twice as costly, as was a local store (a big chain). The idea is that instead of buying into a nationwide distribution chain, go with a mom and pop shop within the range that UPS ground can cope. 3btech happens to be about two hours by car from my house. Indeed, the disk drive was ordered on Friday afternoon, and arrived on Tuesday, as expected, and hoped.

The disk drive itself does not come from a big name company. I had never heard of White Label Magnetic Data Tech. The disk drive comes with a six month warranty, so infant death can be avoided. That's as much or more than expected elsewhere.

It turns out that i already own a Western Digital 160 GB hard disk. It's about three years old, and it has been fine. Two ideas are of note. First, disk drives are really reliable for about the age of this WD drive for 24x7 use. Second, only a small fraction of my data is on backed up somewhere. So, either the new drive will be production and the old drive the mostly-offline backup, or i'll implement software mirroring. For now, i'll use the mostly-offline backup idea.

OEM drives come with zero documentation. A sticker on the drive shows the drive selection jumper settings. Once the WD drive was set to master, and this new drive to slave, the BIOS saw them both, and Linux was happy. That's all that matters.

The new drive is identical to my Western Digital 160 GB drive in size. It has the same disk geometry. This will allow easy mirroring.

The new drive appears to be the same speed as my old one. I set them both to use 32 bit DMA transfers in my system startup with a command like:

hdparm -c 1 /dev/hda

On 3btech's web site, this White Label drive says it has a 2 MB on-disk cache, rather than the WD's 8 MB cache. Will this be an issue? No. On-drive cache hit ratios are tiny under Unix systems. The OS checks its own cache first and has much more RAM. I ran studies of this in the 1980's. On-drive caches were new, and software could query the drives for cache hit statistics. On a 9 MB RAM Unix system, a 1 MB RAM on-disk cache got quite poor cache hit ratios. One could think of the on-disk cache as the 2nd MB of cache in a 2 MB cache system. The first MB gives you most of the advantage. My Linux box has 512 MB RAM, and typically allocates over 250 MB to the disk cache. After 250 MB of cache, it matters little if there is an additional 2 MB or 8 MB. The important thing for the drive is that is has RAM for track reads and writes, and perhaps read ahead and write behind (if power reserves allow guaranteed writes through power failure). Consider that after traversing an entire mounted CD, further accesses are instant, and the drive light doesn't even light up. On-disk caches were very important for DOS, and probably important for Windows 3.x, 95, 98, and Millennium. They are probably unimportant for Windows NT, 2000, XP and Vista. For best speed, go with a 15000 RPM SATA or SCSI drive, buy lots of RAM for your system, and consider RAID options. If you need speed, be prepared to pay for it. I just want space and reliability at low cost.

My requirements are for maximum space per dollar, not maximum speed. The tune2fs -l /dev/hda1 command can be used to find out how the old filesystem was built. Then, an examination of the mke2fs man page can yield other ideas. For years, my filesystems have had zero bytes reserved for root. The 5% default space requirement is, in my opinion, a pointless tax. On a 160 GB filesystem, that amounts to 8 GB. The reserve seems to be a holdover from the 4.2 BSD filesystem development studies from the early 80s. Performance tests under Linux have shown that filesystem performance is approximately the same speed when using the last 5% as it is for the rest of the drive. Another holdover is logical disk block size. The Red Hat 9 default block size is 4 KB. However, mke2fs supports the creation of filesystems with 1 KB blocks. As files are generally completely contiguous, and performance generally comes from track reads and writes, it seems reasonable that block size is irrelevant. Smaller blocks waste less space at the ends of files. The more files, the more wasted space. Finally, a quick check of the number of files (inodes) actually used can help you tune the new filesystem. Use df -i. My filesystem had 18,000,000 inodes, but used just over 1,000,000. Inodes take up space, weather used or not. Journaling is a cheap way to gain reliability. So, the command for generating the new filesystem was:

mke2fs -j -b 1024 -m 0 -N 2000000 /dev/hdb1

Once the data was copied from the old drive to the new identically sized partitions, the 6 GB partition had 1 GB more free space, and the 145 GB partition had 3 GB more free space. Compared with default values, these options yield about 7% more space, or 12 GB.

Conclusion

Great deals can be had through services like Pricewatch and low overhead vendors. Just be sure that the overhead you skip isn't overhead you need. Maybe you really need overnight delivery, vendor support, manufacturer support, or documentation. If so, my advice is to buy it. However, if you can manage to educate yourself, you can get what you want cheaper. As Harry Potter fans know, knowledge is power.

2 comments:

Anonymous said...

VERY IMPRESSIVE I MUST ADD Steve!! Your Still Realy Young,Thought You Were atleast in 20`s But After Looking at Your Picture? Keep Up The Good Work By 21 They`ll Be NOTHING You Won`t Be Able to CONQURE,If You Aren`t Doing It Now!!Take Care,God Bless Buddy, David{Security Inc.} Pgh,PA. rinkydink176@yahoo.com

Stephen said...

My profile has my correct age and stats. It gets my Chinese zodiac incorrect, however. It uses one's birth date, but it doesn't know the exact date for the Chinese new year. In 1959, it was in February, and i was born in January. The Chinese calendar is based on the Moon, not the Sun, so the new year drifts from year to year. So, it says i'm a dog, but i'm really a pig; snort, snort.

Seriously, i do exercise, and try to eat right. Heart disease runs in my family, so i have a low fat intake, watch my cholesterol like a hawk. My Dad had a 6 way bypass at 70, so should be good into his 90's. Not everyone in my family makes it to my age. Those that do can live into their 90's, anyway. My ambition is to live to be old enough to plan my own surprise birthday party. Well, it beats the alternative.

My son (9) is brilliant, but hasn't gotten into computers, science, etc. as yet. He is, however, a much better violinist than i am.

At 16, i could divide one 9 digit number by another, in my head, in about a minute. I can't do it anymore, but it is a technique i can teach. I've started teaching my son.

I'd like to think that i can do anything, but my wife thinks that it means i can do everything. She runs me ragged.