dd if=/dev/rdisk12 of=/dev/zero (OT, since macOS)

1 view
Skip to first unread message

Christoph Kukulies

unread,
Nov 1, 2025, 10:11:02 AM (11 days ago) Nov 1
to freebsd-...@freebsd.org
Hi co-readers,

excuse me for coming up with a non FreeBSD question but I'm sure many "also macOS" users are here.
I got an SSD external drive today from China. It's supposed to have 10TB and has the name "SEAGATE" engraved on the cover which I haven't opened
yet, also because it's clipped together - no screws.

Anyway, I tried


# dd if=/dev/rdisk12 of=/dev/zero

on it (in a macOS terminal window.

I'm getting 

$ sudo dd if=/dev/rdisk12 of=/dev/zero bs=512

Password:

dd: /dev/rdisk12: Invalid argument

0+0 records in

0+0 records out

0 bytes transferred in 0.000036 secs (0 bytes/sec)


also without the bs=512 not any better.

An ideas what might be wrong?

--
Christoph

signature.asc

Christoph Kukulies

unread,
Nov 1, 2025, 10:39:33 AM (11 days ago) Nov 1
to freebsd-...@freebsd.org, Odhiambo Washington
No no, direction is intentionally read. I just want to read the disk once to get the exact count of bytes and see its integrity.




Christoph Kukulies



Am 01.11.2025 um 15:32 schrieb Odhiambo Washington <odhi...@gmail.com>:



You want to wipe the disk, right? So, you write zeros to the raw device, not the other way round.
So it should be something like this:

dd if=/dev/zero of=/dev/rdisk12   bs=16M count=1000 status=progress



--
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
 In an Internet failure case, the #1 suspect is a constant: DNS.
"Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)

signature.asc

Christoph Kukulies

unread,
Nov 1, 2025, 10:43:09 AM (11 days ago) Nov 1
to freebsd-...@freebsd.org, paul beard
As already said, I do want to read the device. My problem is the "Invalid argument"

--
Christoph



Am 01.11.2025 um 15:33 schrieb paul beard <paul...@gmail.com>:

not sure what you are trying to do here but at first glance it looks like if and of are reversed, if you are trying to write /dev/zero to the device. is /dev/rdisk12 what diskutil list returns? 
--
Paul Beard / www.paulbeard.org/

signature.asc

Marco Moock

unread,
Nov 1, 2025, 10:49:49 AM (11 days ago) Nov 1
to ques...@freebsd.org
Am 01.11.2025 um 15:42:30 Uhr schrieb Christoph Kukulies:

> As already said, I do want to read the device. My problem is the
> "Invalid argument"

Which output does

ls -la /dev/rdisk12
give?



--
Gruß
Marco

Send unsolicited bulk mail to 1762008...@cartoonies.org

Christoph Kukulies

unread,
Nov 1, 2025, 11:09:06 AM (11 days ago) Nov 1
to freebsd-...@freebsd.org

No, I don't want to use diskutil. I wanted to know why my dd command returns "Invalid argument".
Yes, I know it's OT, sorry for that. The suspicion comes up that I'm fallen victim a fake. So I anted to physically read the device once.
A program like diskutil or system information USB section only transports the faked information.

Is "Invalid argument" already a consequence of the drive being a fake?

--
Christoph


Am 01.11.2025 um 16:00 schrieb paul beard <paul...@gmail.com>:

Ah. So you want to verify what 'diskutil info rdisk12' returns? 
signature.asc

Einar Indridason

unread,
Nov 1, 2025, 11:43:56 AM (11 days ago) Nov 1
to Christoph Kukulies, freebsd-...@freebsd.org
try using /dev/null as your output. instead of /dev/zero

paul beard

unread,
Nov 1, 2025, 1:01:43 PM (11 days ago) Nov 1
to freebsd-...@freebsd.org
So I wanted to physically read the device once.

Have you written to it? It's not clear to me what you have done, if you have assumed it was a working device that could be used R/W and now you are just verifying size or if you are just trying to work with the raw device, unformatted/initialized. 

newfs_
newfs_apfs   newfs_exfat  newfs_fskit  newfs_hfs    newfs_msdos  newfs_udf

newfs and friends are all there to use as you would in FreeBSD, not relying on macos-specific tools like diskutil. 

Christoph Kukulies

unread,
Nov 1, 2025, 6:12:59 PM (11 days ago) Nov 1
to freebsd-...@freebsd.org, Einar Indridason

Christophs-MBP:~ root# ls -al /dev/rdisk12

crw-r-----  1 root  operator  0x100001e Nov  1 23:02 /dev/rdisk12

Christophs-MBP:~ root# dd if=/dev/rdisk12 of=/dev/null

dd: /dev/rdisk12: Invalid argument

0+0 records in

0+0 records out

0 bytes transferred in 0.000052 secs (0 bytes/sec)

Christophs-MBP:~ root# 




The drive is new and I haven't done nothing else than mounting it on my macOS. Never written to it. My suspicion is that it is fake hardware.
Einar, die idea that I /dev/zero is wrong for using in the output direction just came to me a couple of minutes before, but it didn't change anything.

Paul, I just wanted to read every byte from the drive into the kitchen sink. After that dd would write out the number of bytes read. That should be 

10.485.760.000.000 Bytes

Christoph Kukulies

unread,
Nov 1, 2025, 6:20:21 PM (11 days ago) Nov 1
to freebsd-...@freebsd.org
I unmounted the device from the macOS and inserted a 120GB Corsair.
The dd commands works with both, /dev/zero, /dev/null.
No "Invalid argument".

So it must be faulty hardware.

Thanks. I think we can close the case :-)

--
Christoph

Christoph Kukulies

unread,
Nov 2, 2025, 4:10:05 AM (10 days ago) Nov 2
to freebsd-...@freebsd.org
A last word on the actual error message (Invalid argument) that occured:

giving the command the blocksize 4096 makes it pass without an error message.

dd if=/dev/rdisk12 of=/dev/null bs=4096

It came to memory again when I recalled that I had a similar problem with the attempt to dump (dd) a CD device.
One has to specify bs=2048 with CDROMs.
--
Christoph

Marco Moock

unread,
Nov 2, 2025, 4:22:14 AM (10 days ago) Nov 2
to ques...@freebsd.org
Am 02.11.2025 um 10:09:17 Uhr schrieb Christoph Kukulies:

> It came to memory again when I recalled that I had a similar problem
> with the attempt to dump (dd) a CD device. One has to specify bs=2048
> with CDROMs.

This is rather strange, as I experienced under Linux that reading block
devices (CD is character dev in Linux) is possible with a different
block size from the size the device reports to the storage controller.

The actual block size of the device might be different from those that
is being reported to the storage controller, see 512e disks.

--
Gruß
Marco

Send unsolicited bulk mail to 1762074...@cartoonies.org

Christoph Kukulies

unread,
Nov 2, 2025, 5:57:30 AM (10 days ago) Nov 2
to ques...@freebsd.org
The dd is working on the character device, not block device.
I tried it out on a CD on my Mac right before:

cr--r-----  1 root   operator        0x1000032 Nov  2 11:35 rdisk14s0

cr--r-----  1 kuku   operator        0x1000031 Nov  2 11:35 rdisk14

br--r-----  1 root   operator        0x1000032 Nov  2 11:35 disk14s0

br--r-----  1 kuku   operator        0x1000031 Nov  2 11:35 disk14



e.g: 

Christophs-MBP:~ root# dd if=/dev/rdisk14s0 of=/dev/null bs=2048 count=2

2+0 records in

2+0 records out

4096 bytes transferred in 1.509344 secs (2714 bytes/sec)

Christophs-MBP:~ root# 

Frank Leonhardt

unread,
Nov 3, 2025, 8:43:49 AM (9 days ago) Nov 3
to ques...@freebsd.org
On 02/11/2025 10:56, Christoph Kukulies wrote:
The dd is working on the character device, not block device.
I tried it out on a CD on my Mac right before:

cr--r-----  1 root   operator        0x1000032 Nov  2 11:35 rdisk14s0

cr--r-----  1 kuku   operator        0x1000031 Nov  2 11:35 rdisk14

br--r-----  1 root   operator        0x1000032 Nov  2 11:35 disk14s0

br--r-----  1 kuku   operator        0x1000031 Nov  2 11:35 disk14



e.g: 

Christophs-MBP:~ root# dd if=/dev/rdisk14s0 of=/dev/null bs=2048 count=2

2+0 records in

2+0 records out

4096 bytes transferred in 1.509344 secs (2714 bytes/sec)

Christophs-MBP:~ root# 


This is a FreeBSD vs Mac compatibility issue. On a Mac you can actually write to /dev/zero as well as reading from it as long as you know the password. With FreeBSD the only bitbucket is /dev/null unless you're using zfs, in which case you can create a zvoid device - a bit like a zvol but write-only. It's very popular with organisations that need to keep files for a long time buyt never want to read them. Linux has a similar filing system called btrfs, but it's buggy and occasionally you can read some of the files back at a later date.

But your big mistake was going for the 10Tb model. For an extra $5 the 25Tb version is much faster and doesn't have this problem.

Regards, Frank.


Christoph Kukulies

unread,
Nov 3, 2025, 8:56:02 AM (9 days ago) Nov 3
to ques...@freebsd.org
Absolutely right  😅
🙈

Regards, Frank.



Reply all
Reply to author
Forward
0 new messages