How to find disk is in use?
- From: "adar" <adar_ji@xxxxxxxxx>
- Date: 17 Oct 2006 15:23:28 -0700
I am looking for a system call or something similar to check whether
given disk (node /dev/sda, /dev/sdh etc) is in use. This will be
implemented in C language on Linux, so please suggest from C language
point.
For example,
#check-disk-in-use /dev/sda
Yes, in use
#check-disk-in-use /dev/sdh
Not in use
Please understand that user can provide only block device node, not a
partition.
Disk is use means:
A running application is born from this disk
A running application is reading/writing to this disk
Disk or disk partition is mounted and used
RAW read/write is happening on this disk
etc.
Basically if disk is used by any means from system/Linux this program
should be able to identifiy it. My system has 16 disks, and Linux OS
would be born from one of this disk and remaining 15 disk may be used
for data storage and for some application program.
Thanks,
-Adar
.
- Follow-Ups:
- Re: How to find disk is in use?
- From: phil-news-nospam
- Re: How to find disk is in use?
- From: Kaz Kylheku
- Re: How to find disk is in use?
- From: David Schwartz
- Re: How to find disk is in use?
- Prev by Date: Re: implementation of capability feature in linux
- Next by Date: Re: How to find disk is in use?
- Previous by thread: implementation of capability feature in linux
- Next by thread: Re: How to find disk is in use?
- Index(es):
Relevant Pages
|