What Distro to use

Kevin Buettner kev@primenet.com
Thu, 2 Nov 2000 20:35:46 -0700


On Nov 2,  7:16pm, Hawke wrote:

> I whole heartedly agree.
> Redhat has been more of a nuisance than not.
> they even changed the hdparm command in such a way that if you
> turn on dma, you hose your filesystem (no recovery).

Hawke,

If you check the newsgroups, I am sure you'll be able to find folks
who've "hosed their filesystems" with hdparm who are running other
distros as well.

I've just looked over the Red Hat patches for hdparm in Red Hat 7
and they are really quite minimal.  Here's a summary of what they
do:

    hdparm-3.3.sparc.patch
	- fixes a byte order problem; This patch looks correct to me,
	  but even if it were wrong, it only affects the output from
	  a printf() statement.
    hdparm-3.9-kernel23.patch
	- In hdparm.c, include sys/mount.h instead of linux/fs.h.
	  This undoubtedly fixes a build problem from a missing
	  header file.  I don't see a problem with this patch either.

These patches are so short that I've appended them to the bottom
of the mail so that you can look at them for yourself.

There's an additional Red Hat specific file called hdparm-sysconfig
which gets installed as /etc/sysconfig/harddisks.  If you look at
this file, you'll see the following:

    # Set this to 1 to enable DMA. This might cause some 
    # data corruption on certain chipset / hard drive
    # combinations. This is used with the "-d" option

    # USE_DMA=1

I really think it's unfair to blame Red Hat for your system corruption
as a result of using hdparm.  Face it, some of the tools that you can
use to tune your system are dangerous and should be used with care.

Kevin

--- hdparm-3.9/hdparm.c.kernel23	Sun Apr  9 04:17:02 2000
+++ hdparm-3.9/hdparm.c	Sun Apr  9 04:17:13 2000
@@ -16,7 +16,7 @@
 #include <sys/times.h>
 #include <sys/types.h>
 #include <linux/hdreg.h>
-#include <linux/fs.h>
+#include <sys/mount.h>
 #include <linux/major.h>
 
 #define VERSION "v3.9"

--- hdparm-3.3/hdparm.c.~1~	Tue Jul 30 18:16:03 1996
+++ hdparm-3.3/hdparm.c	Tue Apr 21 22:44:57 1998
@@ -124,7 +124,13 @@
 	if (!(id->field_valid&1))
 		printf(" (maybe):");
 	printf(" CurCHS=%d/%d/%d, CurSects=%d",
-		id->cur_cyls, id->cur_heads, id->cur_sectors, *(int *)&id->cur_capacity0);
+		id->cur_cyls, id->cur_heads, id->cur_sectors,
+#ifdef BIG_ENDIAN
+	       (id->cur_capacity0 << 16) | id->cur_capacity1
+#else /* LITTLE_ENDIAN */
+	       (id->cur_capacity1 << 16) | id->cur_capacity0
+#endif
+	       );
 	printf(", LBA=%s", YN(id->capability&2));
 	if (id->capability&2)
 		printf(", LBAsects=%d", id->lba_capacity);