Unable to write to drive

Rick C. Petty rick-freebsd at kiwi-computer.com
Tue May 27 04:23:33 UTC 2008


On Thu, May 22, 2008 at 01:24:49PM -0600, Marauder wrote:
> 
> I have a problem that is driving me crazy. Hopefully I'm submitting this question to the correct place. 
> 
> My problem is... I have opened the drive /dev/ad0 with open("/dev/ad0", O_WRONLY) and it return's a valid file descriptor. The I attempt to write using the file descriptor returned. The write fails with errno=22 (EINVAL)

What does your write instruction look like?  I don't know if this still
applies, but writes used to fail if not an integer multiple of 512 bytes in
length.

> I have attempted to first open /dev/io with READ/WRITE access to see if that help's. No luck

I believe the io(4) device is used to directly access the I/O ports via the
assembly instructions IN, INS, OUT, OUTS, CLI, and STI.  This device is not
used to gain privs on other devices.

-- Rick C. Petty


More information about the freebsd-geom mailing list