SOLVED Can someone please tell me why this dd isn't working

NASbox

Guru
Joined
May 8, 2012
Messages
644
Sorry if this is off topic or in the wrong area. I am experimenting with a disk using dd and for some reason dd is not filling the whole disk. The disk in question is a bad disk removed from a pool due to smart errors and I want to try a couple of things in the FreeNAS shell before I pitch the disk. I don't know if I am using PV correctly, but I found this code on line, so maybe it's not correct or I'm doing something wrong. Given the size of the disk, I need some sort of progress (would be nice if FreeBSD would add status=progress like linux does).

I have set BS=27×4096=110592 and 110592×54264098 = 6001175126016 which is the size of the disk. The dd statement, and diskinfo output are below. Any assistance would be appreciated.

Code:
FN#>dd if=/dev/zero bs=110592 count=54264098 | pv | dd of=/dev/da2 bs=110592 count=54264098
0+54264098 records inMiB/s] [                                                       <=>                                               ]
27030945+1 records out
2989406334976 bytes transferred in 17674.077979 secs (169140723 bytes/sec)
2.72TiB 4:54:34 [ 161MiB/s] [                                                   <=>                                                   ]              



Code:
diskinfo -v /dev/da2
/dev/da2
        512             # sectorsize
        6001175126016   # mediasize in bytes (5.5T)
        11721045168     # mediasize in sectors
        4096            # stripesize
        0               # stripeoffset
        729601          # Cylinders according to firmware.
        255             # Heads according to firmware.
        63              # Sectors according to firmware.
        ATA WDC WD60EFRX-68M    # Disk descr.
        WD------------- # Disk ident.
        No              # TRIM/UNMAP support
        5700            # Rotation rate in RPM
        Not_Zoned       # Zone Mode
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
dd in FreeNAS supports status=progress. Try dd if=/dev/zero of=/dev/da2 conv=notrunc status=progress bs=4096.
 

NASbox

Guru
Joined
May 8, 2012
Messages
644
dd in FreeNAS supports status=progress. Try dd if=/dev/zero of=/dev/da2 conv=notrunc status=progress bs=4096.
Hi @Samuel Tai .... Thanks for the reply. Unfortuantely It doesn't work.

Code:
FN#>dd if=/dev/zero of=/dev/da2 bs=4096 conv=notrunc status=progress
dd: unknown status progress


Is status=progress just been added to 11.3? I'm running still FreeNAS-11.2-U8. I didn't see progress in the man page under option=
 

NASbox

Guru
Joined
May 8, 2012
Messages
644
Never figured out why, but this worked so I gave up.

Code:
FN#>dd if=/dev/zero bs=110592 conv=notrunc | pv | dd of=/dev/da2 bs=110592 conv=notrunc
dd: /dev/da2: end of device] [              <=>                                                                                       ]
0+109304308 records in
54264098+0 records out
6001175126016 bytes transferred in 42895.570172 secs (139901978 bytes/sec)
 

NASbox

Guru
Joined
May 8, 2012
Messages
644
I was doing some playing around and I had dd stop due to an I/O error. I think the issue might have been that | pv | was obscuring the error message.
 
Top