I recently moved my CentOS 4.5 disk from a Lenovo ThinkCentre M52 (3.2 GHz Pentium 4) to a Lenovo ThinkCentre M55 (3.4 GHz Core 2 Duo). I had to install the SMP kernel, but other than that everything just worked. I did have an issue with accidentally initializing my /boot partition, but that was my own fault.
But the system was not feeling right. Some things just seemed to be slower, but I couldn't put my finger on it. Today, I noticed that disk I/O was very slow to one of the disks (the boot drive, /dev/ hda). It took over 18 minutes to unzip a set of files that used to take just under 2 minutes on the old system. Sure enough, if I copied the files to the second drive (/dev/sda), I was able to unzip them in under 2 minutes again.
When I accidentally clobbered the /boot partition, I learned that there were two IDE controllers on this motherboard, which explained why one SATA drive was named /dev/hda and the other SATA drive /dev/ sda. But I find it hard to believe that there would be such a performance difference between the two controllers/drivers/disks. And I know the slow disk worked just fine before I moved it to the new system.
Any ideas what could cause a drive to be so slow? Could it be that DMA is disabled on the drive (see the output of hdparm below)? Also, why does hdparm work for one disk but not the other?
Thanks for any pointers, Alfred
# lspci 00:00.0 Host bridge: Intel Corporation 82Q963/Q965 Memory Controller Hub (rev 02) 00:01.0 PCI bridge: Intel Corporation 82Q963/Q965 PCI Express Root Port (rev 02) 00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Contoller #4 (rev 02) 00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 02) 00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 02) 00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 02) 00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 02) 00:1c.4 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 5 (rev 02) 00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 02) 00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 02) 00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 02) 00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 02) 00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev f2) 00:1f.0 ISA bridge: Intel Corporation 82801HB/HR (ICH8/R) LPC Interface Controller (rev 02) 00:1f.2 IDE interface: Intel Corporation 82801H (ICH8 Family) 4 port SATA IDE Controller (rev 02) 00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 02) 00:1f.5 IDE interface: Intel Corporation 82801H (ICH8 Family) 2 port SATA IDE Controller (rev 02) 01:00.0 VGA compatible controller: nVidia Corporation G70 [GeForce 7300 GT] (rev a1) 03:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5755 Gigabit Ethernet PCI Express (rev 02) 0a:0a.0 Serial controller: NetMos Technology PCI 9835 Multi-I/O Controller (rev 01)
00:1f.2 IDE interface: Intel Corporation 82801H (ICH8 Family) 4 port SATA IDE Controller (rev 02) (prog-if 8a [Master SecP PriP]) Subsystem: Lenovo: Unknown device 1011 Flags: bus master, 66Mhz, medium devsel, latency 0, IRQ 177 I/O ports at <unassigned> I/O ports at <unassigned> I/O ports at <unassigned> I/O ports at <unassigned> I/O ports at 30d0 [size=16] I/O ports at 30c0 [size=16] Capabilities: [70] Power Management version 3
00:1f.5 IDE interface: Intel Corporation 82801H (ICH8 Family) 2 port SATA IDE Controller (rev 02) (prog-if 85 [Master SecO PriO]) Subsystem: Lenovo: Unknown device 1011 Flags: bus master, 66Mhz, medium devsel, latency 0, IRQ 185 I/O ports at 3428 [size=8] I/O ports at 341c [size=4] I/O ports at 3420 [size=8] I/O ports at 3418 [size=4] I/O ports at 30f0 [size=16] I/O ports at 30e0 [size=16] Capabilities: [70] Power Management version 3
# hdparm /dev/hda /dev/hda: multcount = 16 (on) IO_support = 0 (default 16-bit) unmaskirq = 0 (off) using_dma = 0 (off) keepsettings = 0 (off) readonly = 0 (off) readahead = 256 (on) geometry = 24792/255/63, sectors = 203928109056, start = 0
# hdparm /dev/sda /dev/sda: HDIO_GET_MULTCOUNT failed: Inappropriate ioctl for device IO_support = 0 (default 16-bit) readonly = 0 (off) readahead = 256 (on) geometry = 9730/255/63, sectors = 80032038912, start = 0
From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Alfred von Campe
I recently moved my CentOS 4.5 disk from a Lenovo ThinkCentre M52 (3.2 GHz Pentium 4) to a Lenovo ThinkCentre M55 (3.4 GHz Core 2 Duo). I had to install the SMP kernel, but other than that everything just worked. I did have an issue with accidentally initializing my /boot partition, but that was my own fault.
But the system was not feeling right. Some things just seemed to be slower, but I couldn't put my finger on it. Today, I noticed that disk I/O was very slow to one of the disks (the boot drive, /dev/ hda). It took over 18 minutes to unzip a set of files that used to take just under 2 minutes on the old system. Sure enough, if I copied the files to the second drive (/dev/sda), I was able to unzip them in under 2 minutes again.
When I accidentally clobbered the /boot partition, I learned that there were two IDE controllers on this motherboard, which explained why one SATA drive was named /dev/hda and the other SATA drive /dev/ sda. But I find it hard to believe that there would be such a performance difference between the two controllers/drivers/disks. And I know the slow disk worked just fine before I moved it to the new system.
Any ideas what could cause a drive to be so slow? Could it be that DMA is disabled on the drive (see the output of hdparm below)? Also, why does hdparm work for one disk but not the other?
Thanks for any pointers, Alfred
See if the drive supports DMA and 32-bit IO and if it does set it with hdparm (put in the hdparm.conf to do so across reboots).
And look into getting a SATA replacement, the PATA on these boards are really meant for DVD/CD-ROMs, etc.
# lspci 00:00.0 Host bridge: Intel Corporation 82Q963/Q965 Memory Controller Hub (rev 02) 00:01.0 PCI bridge: Intel Corporation 82Q963/Q965 PCI Express Root Port (rev 02) 00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Contoller #4 (rev 02) 00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 02) 00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 02) 00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 02) 00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 02) 00:1c.4 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 5 (rev 02) 00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 02) 00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 02) 00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 02) 00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 02) 00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev f2) 00:1f.0 ISA bridge: Intel Corporation 82801HB/HR (ICH8/R) LPC Interface Controller (rev 02) 00:1f.2 IDE interface: Intel Corporation 82801H (ICH8 Family) 4 port SATA IDE Controller (rev 02) 00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 02) 00:1f.5 IDE interface: Intel Corporation 82801H (ICH8 Family) 2 port SATA IDE Controller (rev 02) 01:00.0 VGA compatible controller: nVidia Corporation G70 [GeForce 7300 GT] (rev a1) 03:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5755 Gigabit Ethernet PCI Express (rev 02) 0a:0a.0 Serial controller: NetMos Technology PCI 9835 Multi-I/O Controller (rev 01)
00:1f.2 IDE interface: Intel Corporation 82801H (ICH8 Family) 4 port SATA IDE Controller (rev 02) (prog-if 8a [Master SecP PriP]) Subsystem: Lenovo: Unknown device 1011 Flags: bus master, 66Mhz, medium devsel, latency 0, IRQ 177 I/O ports at <unassigned> I/O ports at <unassigned> I/O ports at <unassigned> I/O ports at <unassigned> I/O ports at 30d0 [size=16] I/O ports at 30c0 [size=16] Capabilities: [70] Power Management version 3
00:1f.5 IDE interface: Intel Corporation 82801H (ICH8 Family) 2 port SATA IDE Controller (rev 02) (prog-if 85 [Master SecO PriO]) Subsystem: Lenovo: Unknown device 1011 Flags: bus master, 66Mhz, medium devsel, latency 0, IRQ 185 I/O ports at 3428 [size=8] I/O ports at 341c [size=4] I/O ports at 3420 [size=8] I/O ports at 3418 [size=4] I/O ports at 30f0 [size=16] I/O ports at 30e0 [size=16] Capabilities: [70] Power Management version 3
# hdparm /dev/hda /dev/hda: multcount = 16 (on) IO_support = 0 (default 16-bit) unmaskirq = 0 (off) using_dma = 0 (off) keepsettings = 0 (off) readonly = 0 (off) readahead = 256 (on) geometry = 24792/255/63, sectors = 203928109056, start = 0
# hdparm /dev/sda /dev/sda: HDIO_GET_MULTCOUNT failed: Inappropriate ioctl for device IO_support = 0 (default 16-bit) readonly = 0 (off) readahead = 256 (on) geometry = 9730/255/63, sectors = 80032038912, start = 0
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.
On Aug 31, 2007, at 12:20, Ross S. W. Walker wrote:
See if the drive supports DMA and 32-bit IO and if it does set it with hdparm (put in the hdparm.conf to do so across reboots).
I guess that is what I am asking. How do I do set the appropriate parameters with hdparm?
And look into getting a SATA replacement, the PATA on these boards are really meant for DVD/CD-ROMs, etc.
The are all SATA drives (2 HDDs and 2 optical drives). But because there are two controllers, one of the HDDs shows up as /dev/hda and the other as /dev/sda.
Alfred
On 8/31/07, Alfred von Campe alfred@von-campe.com wrote:
The are all SATA drives (2 HDDs and 2 optical drives). But because there are two controllers, one of the HDDs shows up as /dev/hda and the other as /dev/sda.
If it's showing up as /dev/hda, it's probably being accessed in legacy IDE compatibility mode or some such thing. Check your BIOS.
(With CentOS 3, any time I upgrade the kernel, I have to switch my SATA drives into legacy mode before lilo will write the boot sector properly, and then switch them back again when rebooting.)
From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Bart Schaefer
On 8/31/07, Alfred von Campe alfred@von-campe.com wrote:
The are all SATA drives (2 HDDs and 2 optical drives). But because there are two controllers, one of the HDDs shows up as /dev/hda and the other as /dev/sda.
If it's showing up as /dev/hda, it's probably being accessed in legacy IDE compatibility mode or some such thing. Check your BIOS.
(With CentOS 3, any time I upgrade the kernel, I have to switch my SATA drives into legacy mode before lilo will write the boot sector properly, and then switch them back again when rebooting.)
Yes, I was going to say this too, make sure the SATA settings in the BIOS are all set to SATA operation and not "legacy", then you should see /dev/sda and /dev/sdb and all DMA, IO size, NCQ and multiple sector settings will be properly negotiated at start-up.
To set these via hdarpm:
hdparm -c 1 /dev/hda (for 32-bit) hdparm -d 1 /dev/hda (for DMA) hdparm -m 16 /dev/hda (multiple sector IO = 16 sectors)
These can be combined to: hdparm -c 1 -d 1 -m 16 /dev/hda
-Ross
______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.
Yes, I was going to say this too, make sure the SATA settings in the BIOS are all set to SATA operation and not "legacy", then you should see /dev/sda and /dev/sdb and all DMA, IO size, NCQ and multiple sector settings will be properly negotiated at start-up.
I bit the bullet and rebooted my system. I couldn't find anything in the BIOS regarding this. However, while the system was down, I simply swapped the SATA connections of one of the optical drives with the slow hard disk. Upon reboot, the slow disk formerly at /dev/hda disk was now /dev/sda (and the former /dev/sda was now /dev/sdb) and the two optical drives are /dev/hda and /dev/hdb. Moreover, the disk drive now performs as before.
So why does a simple swap like this cause such a performance difference (almost an order of magnitude!)?
To set these via hdarpm:
hdparm -c 1 /dev/hda (for 32-bit) hdparm -d 1 /dev/hda (for DMA) hdparm -m 16 /dev/hda (multiple sector IO = 16 sectors)
These can be combined to: hdparm -c 1 -d 1 -m 16 /dev/hda
Now that the drive is /dev/sda, hdparm doesn't work. Is there a similar utility to change these settings on SATA drives that show up as /dev/sdx? Is this even needed? In my case, I'm happy to get back the previous performance, but if there is a way to increase it even further, I'd like to know.
Alfred
From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Alfred von Campe
Yes, I was going to say this too, make sure the SATA settings in the BIOS are all set to SATA operation and not "legacy", then you should see /dev/sda and /dev/sdb and all DMA, IO size, NCQ and multiple sector settings will be properly negotiated at start-up.
I bit the bullet and rebooted my system. I couldn't find anything in the BIOS regarding this. However, while the system was down, I simply swapped the SATA connections of one of the optical drives with the slow hard disk. Upon reboot, the slow disk formerly at /dev/hda disk was now /dev/sda (and the former /dev/sda was now /dev/sdb) and the two optical drives are /dev/hda and /dev/hdb. Moreover, the disk drive now performs as before.
So why does a simple swap like this cause such a performance difference (almost an order of magnitude!)?
Well most desktop motherboards these days provide for 2 SATA devices and 2 emulated PATA devices. Though the emulated PATA devices will probably end up using PIO instead of DMA for transfers which is slow and processor intensive, so these are usually reserved for optical drives, which are slow.
I would still have the 2 optical drives hda/hdb set for DMA transfer too as watching DVDs will be choppy and burning CDs/DVDs may be fraught with failures.
You may want to set the multiple sector transfer too to what the drives support in their specs.
If all your devices are fully SATA compliant I would dig through the vendor docs for your motherboard to see if there is a non- intuitive option in the BIOS to set all connectors to SATA mode.
To set these via hdarpm:
hdparm -c 1 /dev/hda (for 32-bit) hdparm -d 1 /dev/hda (for DMA) hdparm -m 16 /dev/hda (multiple sector IO = 16 sectors)
These can be combined to: hdparm -c 1 -d 1 -m 16 /dev/hda
Now that the drive is /dev/sda, hdparm doesn't work. Is there a similar utility to change these settings on SATA drives that show up as /dev/sdx? Is this even needed? In my case, I'm happy to get back the previous performance, but if there is a way to increase it even further, I'd like to know.
Most cases this isn't needed, but if you want to view and access information on SATA/SAS/SCSI disks you can google for 'sdparm', but it isn't as user-friendly as hdparm and not all options are implemented for SATA drives as they support a limited SCSI command spec.
-Ross
______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.
Well most desktop motherboards these days provide for 2 SATA devices and 2 emulated PATA devices. Though the emulated PATA devices will probably end up using PIO instead of DMA for transfers which is slow and processor intensive, so these are usually reserved for optical drives, which are slow.
Thanks, Ross, that certainly explains it. I wonder why the motherboard isn't labeled more clearly that not all SATA connectors are treated the same.
I would still have the 2 optical drives hda/hdb set for DMA transfer too as watching DVDs will be choppy and burning CDs/DVDs may be fraught with failures.
I'll keep that in mind.
Most cases this isn't needed, but if you want to view and access information on SATA/SAS/SCSI disks you can google for 'sdparm', but it isn't as user-friendly as hdparm and not all options are implemented for SATA drives as they support a limited SCSI command spec.
I'll check out sdparm.
Thanks again, Alfred