Re: How to check if same partition
- From: Michel Bardiaux <michel.bardiaux@xxxxxxxxxxx>
- Date: Mon, 29 May 2006 15:57:47 +0200
Nils O. Selåsdal wrote:
Michel Bardiaux wrote:I have to check whether 2 directories are on the same filesystem. I built a test case on a Linux debian woody (3.0) with kernel 2.4.28 with 1 directory on a local drive, the other on an NFS-mounted tree.Odd.
I tried statfs and statvfs, both reply that f_fsid is zero for both directories. I also tried plain stat, here st_dev is not zero, but still it is the same (very large number) for both.
I suppose parsing /proc/mounts would be a way, but that doesnt appeal at all!
Now I'm out of ideas. Suggestions? TIA.
Verify your code with the stat command atleast.
$ stat /proc
$ stat /
$ stat /your/nfs/directory
The line saying "Device: ... " are different for me.
Good advice. Have installed stat, it gives different "Device" for local and NFS directory, proving that *some* system call works. I'll have a look at the source code to see what "Device" is exactly. Thanks.
--
Michel Bardiaux
R&D Director
T +32 [0] 2 790 29 41
F +32 [0] 2 790 29 02
E mailto:mbardiaux@xxxxxxxxxxx
Mediaxim NV/SA
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles
http://www.mediaxim.com/
.
- Follow-Ups:
- Re: How to check if same partition
- From: Michel Bardiaux
- Re: How to check if same partition
- From: Måns Rullgård
- Re: How to check if same partition
- References:
- How to check if same partition
- From: Michel Bardiaux
- Re: How to check if same partition
- From: "Nils O. Selåsdal"
- How to check if same partition
- Prev by Date: Re: How to check if same partition
- Next by Date: Re: How to check if same partition
- Previous by thread: Re: How to check if same partition
- Next by thread: Re: How to check if same partition
- Index(es):
Relevant Pages
|
|