dd(1) performance when copiing a disk to another

Patrick Proniewski patpro at patpro.net
Sun Oct 2 09:34:34 PDT 2005


> Can u find out, if DMA transfers are enabled for those discs?
> What does dmesg say?

see end of mail for full dmesg output,

> What does "sysctl hw.ata.ata_dma" say?

hw.ata.ata_dma: 1

> Maybe atacontrol(8) says something useful about SATA discs, too
> (e. g. atacontrol mode 0)?

# atacontrol mode 0
Master = BIOSPIO
Slave  = BIOSPIO

> Can u try the following commands, when the system (especially the
> discs) is idle?
> #dd if=/dev/ad4 of=/dev/null bs=1m count=1000

# dd if=/dev/ad4 of=/dev/null bs=1m count=1000
1000+0 records in
1000+0 records out
1048576000 bytes transferred in 17.647464 secs (59417943 bytes/sec)

> #dd if=/dev/zero of=/dev/null bs=1m count=1000

# dd if=/dev/zero of=/dev/null bs=1m count=1000
1000+0 records in
1000+0 records out
1048576000 bytes transferred in 0.199381 secs (5259154109 bytes/sec)

> (Maybe you could find a way to copy /dev/zero to /dev/ad6 without
> destroying the previous work... :-))

well, not very easy both disk are the same size ;)

>> one more question: is dd(1) a good way to duplicate a boot
>> drive to make a bootable spare disk ?

> I say, is the file system on /dev/ad4 read only during the "dd"?
> If /dev/ad4 changes before "dd" completes, ad6 might need a fsck
> or ad6 might be useless...

well, ad4 is not read only, but I've shutdown every unnecessary  
services, and finally the ad6 hdd is bootable ! It boots ok and every  
things seems to work as well as on the ad4 disk. It's ok for me, it's  
just a spare emergency disk.



dmesg :

Copyright (c) 1992-2005 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
         The Regents of the University of California. All rights  
FreeBSD 5.4-RELEASE-p6 #0: Mon Aug 29 15:58:58 CEST 2005
     root at toto.patpro.net:/usr/obj/usr/src/sys/PATPRO-20050829
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Pentium(R) 4 CPU 3.00GHz (2994.90-MHz 686-class CPU)
   Origin = "GenuineIntel"  Id = 0xf41  Stepping = 1
   Hyperthreading: 2 logical CPUs
real memory  = 1072562176 (1022 MB)
avail memory = 1044230144 (995 MB)
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
cpu0 (BSP): APIC ID:  0
cpu1 (AP): APIC ID:  1
ioapic0: Changing APIC ID to 2
ioapic0 <Version 2.0> irqs 0-23 on motherboard
ioapic1 <Version 2.0> irqs 24-47 on motherboard
npx0: <math processor> on motherboard
npx0: INT 16 interface
acpi0: <IntelR AWRDACPI> on motherboard
acpi0: Power Button (fixed)
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x408-0x40b on acpi0
cpu0: <ACPI CPU> on acpi0
cpu1: <ACPI CPU> on acpi0
acpi_button0: <Power Button> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
pcib1: <ACPI PCI-PCI bridge> at device 3.0 on pci0
pci1: <ACPI PCI bus> on pcib1
em0: <Intel(R) PRO/1000 Network Connection, Version - 1.7.35> port  
0xc000-0xc01f mem 0xf2000000-0xf201ffff irq 18 at device 1.0 on pci1
em0: Ethernet address: 00:30:48:83:ef:8c
em0:  Speed:N/A  Duplex:N/A
pcib2: <ACPI PCI-PCI bridge> at device 28.0 on pci0
pci2: <ACPI PCI bus> on pcib2
uhci0: <UHCI (generic) USB controller> port 0xe100-0xe11f irq 16 at  
device 29.0 on pci0
usb0: <UHCI (generic) USB controller> on uhci0
usb0: USB revision 1.0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1: <UHCI (generic) USB controller> port 0xe000-0xe01f irq 19 at  
device 29.1 on pci0
usb1: <UHCI (generic) USB controller> on uhci1
usb1: USB revision 1.0
uhub1: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
pci0: <base peripheral> at device 29.4 (no driver attached)
pci0: <base peripheral, interrupt controller> at device 29.5 (no  
driver attached)
ehci0: <EHCI (generic) USB 2.0 controller> mem 0xf2100000-0xf21003ff  
irq 23 at device 29.7 on pci0
usb2: EHCI version 1.0
usb2: companion controllers, 2 ports each: usb0 usb1
usb2: <EHCI (generic) USB 2.0 controller> on ehci0
usb2: USB revision 2.0
uhub2: Intel EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub2: 4 ports with 4 removable, self powered
pcib3: <ACPI PCI-PCI bridge> at device 30.0 on pci0
pci3: <ACPI PCI bus> on pcib3
pci3: <display, VGA> at device 9.0 (no driver attached)
em1: <Intel(R) PRO/1000 Network Connection, Version - 1.7.35> port  
0xd100-0xd13f mem 0xf1000000-0xf101ffff irq 19 at device 10.0 on pci3
em1: Ethernet address: 00:30:48:83:ef:8d
em1:  Speed:N/A  Duplex:N/A
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel 6300ESB UDMA100 controller> port 0xf000-0xf00f, 
0x376,0x170-0x177,0x3f6,0x1f0-0x1f7 at device 31.1 on pci0
ata0: channel #0 on atapci0
ata1: channel #1 on atapci0
atapci1: <Intel 6300ESB SATA150 controller> port 0xe600-0xe60f, 
0xe500-0xe503,0xe400-0xe407,0xe300-0xe303,0xe200-0xe207 irq 18 at  
device 31.2 on pci0
ata2: channel #0 on atapci1
ata3: channel #1 on atapci1
pci0: <serial bus, SMBus> at device 31.3 (no driver attached)
acpi_tz0: <Thermal Zone> on acpi0
fdc0: <floppy drive controller> port 0x3f7,0x3f0-0x3f5 irq 6 drq 2 on  
sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10  
on acpi0
sio0: type 16550A
sio1: <16550A-compatible COM port> port 0x2f8-0x2ff irq 3 on acpi0
sio1: type 16550A
ppc0: <Standard parallel printer port> port 0x778-0x77b,0x378-0x37f  
irq 7 on acpi0
ppc0: Generic chipset (NIBBLE-only) in COMPATIBLE mode
ppbus0: <Parallel port bus> on ppc0
ppi0: <Parallel I/O> on ppbus0
atkbdc0: <Keyboard controller (i8042)> port 0x64,0x60 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
pmtimer0 on isa0
orm0: <ISA Option ROM> at iomem 0xc0000-0xc7fff on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on  
Timecounters tick every 10.000 msec
em0: Link is up 100 Mbps Full Duplex
ad4: 78167MB <Maxtor 6Y080M0/YAR51HW0> [158816/16/63] at ata2-master  
ad6: 194481MB <Maxtor 6L200M0/BANC1E00> [395136/16/63] at ata3-master  
SATA150  <-- this is _not_ the ad6 I've used dd on
             this is my regular ad6 storage disk.
SMP: AP CPU #1 Launched!
Mounting root from ufs:/dev/ad4s1a
em0: Link is up 100 Mbps Full Duplex
Accounting enabled
pflog0: promiscuous mode enabled
em0: Link is up 100 Mbps Full Duplex
em0: Link is up 100 Mbps Full Duplex

More information about the freebsd-performance mailing list