Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I use the tool "topas" to get a quick peek at CPU, memory, and disk statistics on an AIX machine. I understand the numbers on the disk section, but what I don't know is how to tell which filesystem(s) are on the disks shown in topas. Here is some sample output from the disk section:

Disk    Busy%     KBPS     TPS KB-Read KB-Writ
power123 72.6     2.9K  330.8     2.9K    0.0
disk1234 58.2     1.5K  169.7     1.5K    0.0
hdisk234 53.2     1.4K  161.2     1.4K    0.0
power345 40.8    262.7   65.7    262.7    0.0
...

Is there a command line tool to help me determine which filesystems are mounted on which disks?

I know the command lsdev -C -c disk, but that just lists all disks, not which filesystems go with which disks.

Thanks in advance!

EDIT In response to the comment below (thanks for the input!), here is some sample output of the "mount" command:

    node   mounted          mounted    vfs  date          options   over
    ----   -------          ---------  ---  ------------   -------  ---------
           /dev/hd0         /          jfs  Dec 17 08:04   rw, log  =/dev/hd8
           /dev/hd3         /tmp       jfs  Dec 17 08:04   rw, log  =/dev/hd8
           /dev/hd1         /home      jfs  Dec 17 08:06   rw, log  =/dev/hd8
           /dev/hd2         /usr       jfs  Dec 17 08:06   rw, log  =/dev/hd8
share|improve this question
    
I'm going to jump in w/ a guess, but not an "answer". I've actually used AIX about 5 or fewer times in my life. I recall that it's got a volume manager (I think LVM took some inspiration from it) that's fairly baroque, and that probably complicates matters somewhat. Out of curiosity, what does a "mount" command show you? –  Evan Anderson Jul 10 '09 at 12:37
    
I couldn't format the output in the comments, so I edited my post to show the output from mount. –  BrianH Jul 10 '09 at 12:48

5 Answers 5

up vote 3 down vote accepted

Okay - after a while of poking around, I think I found it.

First, I run lspv to get the list of disks and the volume group:

lspv
power123        pvg11        active
disk1234        pvg12        active
hdisk234        pvg12        active
power345        pvg14        active

Then I take a volume group, and run an lsvg on it:

lsvg -l pvg11
pvg11:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
varcorelv          jfs2       12203 12203  11   open/syncd    /var/core

It should be easy to write a script to combine these 2 steps.

Thanks to all who helped!

share|improve this answer
1  
lspv | awk '{print $1}' | xargs -n 1 lspv -l –  Bob Sep 1 '09 at 11:44

A more direct way to obtain a list of LVs on a specific PV is to script around this:

lspv -M hdisk14

basic output:

hdisk14:1-87
hdisk14:88 lv13:143
hdisk14:89 lv13:144
hdisk14:90 lv13:145
hdisk14:91 lv13:146
hdisk14:92 lv13:147

Generally the lines are the form of:

PVname:PPnum [LVname: LPnum [:Copynum] [PPstate]]

It is fairly easy to cut all the unneeded fields and leave only PVname and LVname. Then pipe to sort -u.

share|improve this answer

The answer's in the output from your mount command; these are AIX Journalled File Systems (jfs).

share|improve this answer
    
I see the relation to the filesystem with the mount (/tmp is mounted on /dev/hd3), but how do I relate the disk (hdisk234, for example) to the mount? –  BrianH Jul 10 '09 at 12:59

The simplest method by far is to just run

lspv -l hdisk0

It will list the logical volumes and filesystems on the PV (physical volume) that you pass it as a parameter

lspv -l hdisk0 hdisk0: LV NAME LPs PPs DISTRIBUTION MOUNT POINT hd5 2 2 02..00..00..00..00 /blv hd6 12 12 00..12..00..00..00 N/A hd1 1 1 00..00..01..00..00 /home hd9var 45 45 00..05..05..00..35 /var

The LPs and PPs columns refer to how many logical and physical partitions are allocated on that disk for each filesystem, as each filesystem can be spread over multiple PVs.

Ewan

share|improve this answer
    
But I want to know what mount points are on which disks. How can I know to run lspv -l "hdisk0" - do I just randomly pick hdisk0? There are more than 500 disks on this server hdisk0-hdisk500 (more actually) –  BrianH Sep 1 '09 at 10:59
    
The mount points can be spread over multiple disks as long as they are within the same volume group, so I'd start by running it across every hdisk and building a spreadsheet of the results. –  Ewan Leith Oct 29 '09 at 13:04

With the command mount you have the LV of your FS.

/dev/lv_titi ... /titi

With the command lslv -m you can see the map of the lv :

lslv -l lv_titi :

LP PP1 PV1 PP2 PV2 PP3 PV3 0001 0207 hdisk1 0002 0208 hdisk1 0003 0209 hdisk1 0004 0210 hdisk1 0005 0211 hdisk1 0006 0212 hdisk1 0007 0213 hdisk1 0008 0214 hdisk1

I made a script you give a VG as parameter on it will list the map of all LV of this vg :

if [[ ! $# -eq 1 ]]
then
        echo "Syntaxe : lvmap VG"
        exit 1
else

for i in `lsvg -l $1 | grep -v $1 | grep -v "LV NAME" |awk '{print $1}'`
do echo $i
lslv -m $i | awk '{print $3 "  " $5}' | sort | uniq
read
done
fi
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.