How do you determine what physical device a file in on?

david.r.connet dcon at cbnewsc.cb.att.com
Wed Jun 26 06:26:07 AEST 1991


In article <1991Jun25.174729.11481 at StarConn.com> dror at starnet.UUCP (Dror Matalon) writes:
>
>	I suspect that there are only machine dependent ways. Given 
>two files x and y. I want to determine if they're on the same PHYSICAL devie.
>(It's pretty easy to find out the logical device, you do an statfs on the 
>file). Is there a portable or a semi-portable way to do this or do I need to 
>go into every machine's disk drivers structures to find out. 
>

This is probably quite complex.  Especially since a filesystem may
reside on more than one partition on more than one disk.  Which means
the file may actually reside on more than one physical disk!  Aren't
virtual disks great!  (I even put 2 filesystems into 1 partition.)

Dave Connet
dcon at iwtng.att.com



More information about the Comp.unix.wizards mailing list