Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
A user asked how to reliably tell whether an existing raw device on Solaris 10 is in use by a process, or whether it already contains user data, since dd alone didn't answer the question. Suggestions from the list: dump the first part of the device with dd (e.g. bs=256k count=4) and inspect it with od -c to see if data is present; use Solaris' format command to check each device; use lsof to see which processes have the device open; and monitor activity with iostat -Mx or DTrace scripts such as iotop. The poster said he would try them, but no definitive answer was recorded.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Hi everyone. Does anyone know of a full-proof way of determining whether or an
existing raw device on a Solaris 10 machine is currently being used by a
process? or better yet...if it contains any user data (IE: it was used at some
point and was written to?). I thought I could use dd but it looks like that
does not answer the question. If anyone has any ideas I would appreciate it.
One way to see what's on the partition:
(as root)
dd if=/dev/raw/partition_name of=/tmp/disk_dump bs=256k count=4
od -c /tmp/disk_dump | more
will let you look at the 1st MB of that partition.
Bob
----- Original Message -----
From: "WILL LANDSTROM" <willlandstrom@yahoo.com>
To: ids@iiug.org
Sent: Tuesday, October 27, 2009 11:26:57 AM GMT -05:00 US/Canada Eastern
Subject: RAW device question on Solaris [17773]
Hi everyone. Does anyone know of a full-proof way of determining whether or an
existing raw device on a Solaris 10 machine is currently being used by a
process? or better yet...if it contains any user data (IE: it was used at some
point and was written to?). I thought I could use dd but it looks like that
does not answer the question. If anyone has any ideas I would appreciate it.
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
↪ replying to WILL LANDSTROM
MIKE MAGIE — — source: IIUG Forums & Mailing Lists
This may be kind of tedious but you could use the format command and then
select each device (one at a time) to see if the device is in use or not.
MM
↪ replying to MIKE MAGIE
MIKE MAGIE — — source: IIUG Forums & Mailing Lists
There is also a tool - I don't think it comes with the core Solaris install,
called 'lsof' that might help you.
MM
Mike. Thanks for the suggestions. I will check them out.
↪ replying to WILL LANDSTROM
CESAR MARTINS — — source: IIUG Forums & Mailing Lists
- lsof :
show open files/devices
- iostat -Mx 5 1000 | awk '$2 != "0.0" || $3 != "0.0"'
show the I/O for each device every 5 seconds...
more information: man iostat
- iotop
A nice shell (DTrace) I get here: http://www.brendangregg.com/DTrace/iotop
↪ replying to CESAR MARTINS
CESAR MARTINS — — source: IIUG Forums & Mailing Lists
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.