5

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
BrianH
  • 263
  • 1
  • 3
  • 9
  • 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

6 Answers6

3

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!

BrianH
  • 263
  • 1
  • 3
  • 9
2
lspv | awk '{ print $1, $3 }' | while read hd vg
do
        lspv -l $hd                     \
                | grep -v "N/A"         \
                | grep -v ":"           \
                | grep -v NAME          \
                | awk -v vg="$vg" -v hd="$hd" '{ print "HD: ", hd, "VG: ", vg, " VOL: ", $1, " Mount: ", $5 }'
done

I built the above script based on the information found on this page.

It outputs a list like the one below:

HD:  hdisk0 VG:  rootvg  VOL:  hd1  Mount:  /home
HD:  hdisk0 VG:  rootvg  VOL:  hd3  Mount:  /tmp
HD:  hdisk0 VG:  rootvg  VOL:  hd9var  Mount:  /var
HD:  hdisk0 VG:  rootvg  VOL:  hd2  Mount:  /usr
HD:  hdisk0 VG:  rootvg  VOL:  hd4  Mount:  /
HD:  hdisk0 VG:  rootvg  VOL:  livedump  Mount:  /var/adm/ras/livedump
HD:  hdisk0 VG:  rootvg  VOL:  hd11admin  Mount:  /admin
HD:  hdisk1 VG:  rootvg  VOL:  hd4  Mount:  /
HD:  hdisk1 VG:  rootvg  VOL:  fslv00  Mount:  /ora01
HD:  hdisk2 VG:  volumegroup1  VOL:  data02lv  Mount:  /oradata02
HD:  hdisk2 VG:  volumegroup1  VOL:  undolv  Mount:  /oraundo
HD:  hdisk2 VG:  volumegroup1  VOL:  fslv01  Mount:  /QueueMessages
HD:  hdisk3 VG:  volumegroup1  VOL:  redo01lv  Mount:  /oraredo01
HD:  hdisk3 VG:  volumegroup1  VOL:  data03lv  Mount:  /oradata03
HD:  hdisk3 VG:  volumegroup1  VOL:  arclv  Mount:  /oraarcredo
HD:  hdisk4 VG:  volumegroup1  VOL:  redo02lv  Mount:  /oraredo02
HD:  hdisk4 VG:  volumegroup1  VOL:  data01lv  Mount:  /oradata01
HD:  hdisk4 VG:  volumegroup1  VOL:  data04lv  Mount:  /oradata04
HD:  hdisk5 VG:  volumegroup2  VOL:  imagelv  Mount:  /oraimages
HD:  hdisk6 VG:  volumegroup2  VOL:  imagelv  Mount:  /oraimages
HD:  hdisk7 VG:  volumegroup2  VOL:  imagelv  Mount:  /oraimages
HD:  hdisk8 VG:  volumegroup2  VOL:  imagelv  Mount:  /oraimages
1

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.

kubanczyk
  • 13,502
  • 5
  • 40
  • 55
0

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

Maximus Minimus
  • 8,937
  • 1
  • 22
  • 36
  • 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
0

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

Ewan Leith
  • 1,695
  • 8
  • 7
  • 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 01 '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
0

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
Falcon Momot
  • 24,975
  • 13
  • 61
  • 92
Le_Tolier
  • 11
  • 1