RE: block ioctl to read/write last sector

Date: Wed Feb 14 2001 - 08:26:47 EST

> I have one additional user space only idea:
> have you tried raw-io? bind a raw device to the partition, IIRC raw-io
> is always in 512 byte units.

Steven Tweedie responded to my question about that:

> Raw IO is subject to the same limits as other IO, because
> ultimately it uses the same route through the kernel
> to get to the low-level disk IO drivers.

This was confirmed by my testing. Reading/writing via /dev/raw/rawX fails
exactly the same way as for /dev/[sh]dX.

> Accessing /dev/sg ought to work fine, but of course it
> places much more load on the application programmer
> and removes a ton of kernel safety-nets.

I believe using ide-scsi would work, but you must pass "hdc=ide-scsi" at
boot time, which isn't a big deal for accessing CD-ROMs, but to be used for
arbitrary disks, makes life much more difficult. Now all your IDE disks
need to think they're SCSI disks, at least for the boot in which you want to
change the partition table. I wouldn't want to suggest to customers that
they run this additional layer of abstraction all the time just in case they
want to examine and/or change the partition table of just one disk at some


Matt Domsch
Dell Linux Systems Group
Linux OS Development

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to More majordomo info at Please read the FAQ at

This archive was generated by hypermail 2b29 : Thu Feb 15 2001 - 21:00:24 EST