On Tue, Feb 05, 2002 at 09:30:06AM -0700, M. Warner Losh wrote: > In message: <[EMAIL PROTECTED]> > Yar Tikhiy <[EMAIL PROTECTED]> writes: > : Could anyone point out at an ioctl or any other way to get a disk > : device size granted the device has no BSD label or PC slice table > : on it? Ways for both the userland and kernel are welcome. > > For userland, look at how fdisk and/or disklabel get it. > > For kernel, look at kern/subr_disk*.c
Thanks, the DIOCGDINFO ioctl is nearly what I was looking for. However, there seems to be a number of problems (or my misunderstandings?) about it. This ioctl can't be used against non-BSD slices; it fails on them with EINVAL due to code in kern/subr_diskslice.c. OTOH, invoking this ioctl on a partition (e.g. ad0s1a) will result in the parameters of the whole slice/disk (i.e. ad0s1.) Isn't all that a bit inconsistent? E.g. a filesystem layer doesn't need to distinguish between say ad0, ad0s1, and ad0s1a -- they're just disk devices for it. Or did I miss any important point? -- Yar To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message