# extremely low write speed on 1 of 3 hdd



## Bat (May 5, 2010)

8.0 release amd64.

There are 3 SATA hard drives in system. 120G and 320G Seagate and 1.5T WD. All ok with 120 and 320. With 1.5T - write speed ~4-7Mb/sec (read speed seems ok >50Mb/sec). Tested with UFS / ZFS and various ports/cables.
How it looks: 2-3 sec high speed. gstat shows busy < 50%. After it - freeze. gstat shows busy >100%. etc...
On another windows mashine this drive shows write speed ~50-90Mb/sec (with NTFS).

I dont know what to do


----------



## mav@ (May 5, 2010)

Check drive surface with SMART or MHDD. Too much relocated sectors could make driver very slow. Freezes also could be caused by commands timeouts. Make sure that there is no any error messages in systems logs. Check/replace cables.


----------



## Bat (May 5, 2010)

Prompt please how to check error messages related with hdd?


----------



## Bat (May 5, 2010)

btw: m.b. problem related with 4k sector size?


----------



## jb_fvwm2 (May 5, 2010)

Cannot answer your post above, which you posted just as
I posted this...

/usr/ports/sysutils/smartmontools  1st...
2nd...

```
smartctl -s on /dev/[hard drive]
smartctl -t short /dev/[hard drive] 
(scroll back up in the results)
```
if Reallocated Sector Count is above (say) ten, AND
increasing (daily or weekly) , you drive is about to fail likely.
(You can use it attached as a WRKDIRPREFIX. (maybe).  Other 
operating systems, you'd likely want it discarded)
If it is zero (the last value in the line), it
is some other issue...


----------



## jem (May 5, 2010)

Is the 1.5TB drive a:

1. WD15EADS
2. WD15EARS

The latter model number has the 4kb sector size and partitions need to be specially aligned with 4kb sector boundaries to avoid performance loss.


----------



## Bat (May 5, 2010)

Yes, WD15EARS.

I make like here
http://forums.freebsd.org/showpost.php?p=76148&postcount=38
And after 
`newfs -S 4096 -b 32768 -f 4096 -O 2 -U -m 8 -o space -L datadrive /dev/ad4`
I got:

```
/dev/ad6
/dev/ad6a
```

And

```
# mount /dev/ad6a /mnt
mount: /dev/ad6a : Invalid argument
```
Whats wrong?


----------



## DutchDaemon (May 5, 2010)

@Bat, format your posts, please.


----------



## Matty (May 5, 2010)

Bat said:
			
		

> Yes, WD15EARS.
> 
> I make like here
> http://forums.freebsd.org/showpost.php?p=76148&postcount=38
> ...


did you tried to mount /dev/ad4 since you made newfs on /dev/ad4 as well. 
or /dev/ufs/datadrive


----------



## Bat (May 5, 2010)

Thanks. Now much better. But anyway freezes time to time.
This is large file uploading over samba.





when I copy files from 1 local hdd to this - same situation.


----------



## sub_mesa (May 6, 2010)

EARS are 4K sector drives, so you either:
- do not use partitions or disk labels
- use an aligned partition (offset=64 sectors instead of 63)
- use an aligned bsd label (offset=1 + 63 from partition = 64)
- don't align and have lower performance


----------



## Bat (May 6, 2010)

I made the following:

`# bsdlabel -R  /dev/ad6 datadrive.cfg`

where datadrive.cfg

```
8 partitions:
#         size      offset     fstype     [fsize     bsize    bps/cpg]
a:  2930212864           1     4.2BSD       4096     32768
```

`# newfs -S 4096 -b 32768 -f 4096 -O 2 -U -m 8 -o space -L datadrive /dev/ad6`

Btw: what about ZFS with this hdd?


----------



## sub_mesa (May 6, 2010)

Easiest would be to pass ZFS whole-disks, or geom_label'ed disks, such as:


```
glabel label disk1 /dev/ada0
glabel label disk2 /dev/ada1
zpool create tank mirror label/disk{1..2}
```


----------



## Bat (May 7, 2010)

And ZFS will use 4k sectors?


----------

