Skip to content


Które dyski kontrolueje ten adapter?

Polska wersja wkrótce.

lsdev -Cc disk | grep 'OD-08'
hdisk14  Defined   0D-08-02     SAN Volume Controller Device
hdisk16  Available 0D-08-02     SAN Volume Controller Device
hdisk17  Available 0D-08-02     SAN Volume Controller Device
hdisk18  Available 0D-08-02     SAN Volume Controller Device
..................
for disk in `lsdev -Cc disk | grep '0D-08' | awk '{print $1}'`
do
lquerypv -h /dev/$disk > /dev/null
if [[ $? -eq 0 ]];then
echo "$disk size is `bootinfo -s $disk`mb. Its vg: `lspv | grep -w $disk | awk '{print $3}'`"
### The line above could also have the following shape (see comment from Ramon Barrios Lasca)
echo $disk size is `bootinfo -s $disk`mb. Its vg: `lspv | awk '$1=="'$disk'" {print $3}'`
fi
done
..................
hdisk15 size is 128000mb. Its vg: nsd_vpath1
hdisk16 size is 128000mb. Its vg: nsd_vpath2
hdisk17 size is 128000mb. Its vg: nsd_vpath3
hdisk18 size is 128000mb. Its vg: nsd_vpath4
hdisk19 size is 128000mb. Its vg: nsd_vpath5
hdisk22 size is 51200mb. Its vg: None
..................

So the answer is “YES, forty eight “real” disks are attached to fcs3. Unplugging its fiber cable may result in data loss or corruption”. Indeed, it is time for zones reconciliation.

Posted in Real life AIX, scripts.

Tagged with , , , , , , .


2 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Ramon says

    Hello. Nice blog entry.
    A suggestion: You can do anything grep can do with awk, for example you can replace
    lspv | grep -w $disk | awk ‘{print $3}’
    with
    lspv | awk ‘$1==”‘$disk'” {print$3}’
    and use one less command and process.

  2. MarkD:-) says

    Ramon,

    Do you see what you have done?
    Now, you made me look it up to figure out how it works….. .:-)
    It is always nice to receive a comment I can learn from!
    I wish, I got more.

    Thanks,

    MarkD:-)



Some HTML is OK

or, reply to this post via trackback.

WordPress Anti Spam by WP-SpamShield



Copyright © 2015 - 2016 Waldemar Mark Duszyk. - best viewed with your eyes.. Created by Blog Copyright.