Testing LVM

sam01

New Member
Credits
12
Helo,
i have a script that testing if there is an LVM or nor in sdb partion but it dosen't work.
There is an LVM but the script can't see it. Could you explain me why please.
Here is the script :

Code:
# On recupere le nb de partition sur le HDISK
NB_PARTITION="$(parted -s /dev/${DISK} u MB p 2>/dev/null | awk '/^ [1-9]/ { print $0}' | wc -l )"
++ wc -l
++ awk '/^ [1-9]/ { print $0}'
++ parted -s /dev/sdb u MB p
+ NB_PARTITION=0
 
# On verifie que la partition sur lequel on travail est bien en mode lvm
if ! lsblk -f /dev/${DISK}${NB_PARTITION/0/} | egrep -q "^${DISK}${NB_PARTITION/0/}.*LVM2_member" ; then
    echo -n "Pas de LVM sur /dev/${DISK}${NB_PARTITION/0/} !!!"
    warning;echo; exit 4
fi
+ egrep -q '^sdb.*LVM2_member'
+ lsblk -f /dev/sdb
+ echo -n 'Pas de LVM sur /dev/sdb !!!'
Pas de LVM sur /dev/sdb !!!+ warning
+ local rc=0
I have this message:

Pas de LVM sur /dev/sdb
The following command :

lsblk -f /dev/sdb


give :

Code:
NAME                             FSTYPE LABEL UUID MOUNTPOINT
sdb
├─vg_data-lv_home (dm-2)                           /home
├─vg_data-lv_poldata (dm-3)                        /POLDATA
├─vg_data-lv_srv_dumps (dm-4)                      /srv/dumps
├─vg_data-lv_app_jbs (dm-5)                        /srv/app/jboss
├─vg_data-lv_data_jbs (dm-6)                       /srv/data/jboss
├─vg_data-lv_srv_jbs (dm-7)                        /srv/jboss
├─vg_data-lv_logs_jbs (dm-8)                       /srv/logs/jboss
└─vg_data-lv_logs_apm_jbs (dm-9)                   /srv/logs/apm/jboss


[\CODE]

thank's for your help
 

Members online


Latest posts

Top