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 connect an iSCSI target, create a Physical Volume and Volume Group on it.

Then I create an LV, and

mkfs.ext3 /dev/vg00/vm

and all that works great.

Then I disconnect the target

iscsiadm -m node -T iqn.2004-04.com.qnap:ts-509:iscsi.linux01.ba4731 -p 192.168.0.4 -u

login to another Linux server, and connect the target there

iscsiadm -m node -T iqn.2004-04.com.qnap:ts-509:iscsi.linux01.ba4731 -p 192.168.0.4 -l

and I get:

linux01:~ # lvdisplay 
  --- Logical volume ---
  LV Name                /dev/vg00/vm
  VG Name                vg00
  LV UUID                NBNRGV-FkSR-ZNZ9-9AVk-chLQ-j5nc-RazeBw
  LV Write Access        read/write
  LV Status              NOT available
      LV Size                17.00 GB
  Current LE             4352
  Segments               1
  Allocation             inherit
  Read ahead sectors     0

I can see that /dev/vg00/vm doesn't exist, as I would have expected.

What am I doing wrong?

share|improve this question
add comment

2 Answers

up vote 19 down vote accepted

You need to activate a volume group after you attached it.

To activate all the inactive volumes on the system you would use a command like vgchange -a y.

share|improve this answer
    
Thank you, you saved my day ;) –  dresende Apr 3 '12 at 18:02
add comment

When you connect the target to the new system, the lvm subsystem needs to be notified that a new physical volume is available. You may need to call pvscan, vgscan or lvscan manually. Or you may need to call vgimport vg00 to tell the lvm subsystem to start using vg00, followed by vgchange -ay vg00 to activate it. Possibly you should do the reverse, i.e., vgchange -an vg00; vgexport vg00 before detaching the target.

(I don't know anything about iSCSI, so maybe these steps are not necessary or should have been performed automatically by the iSCSI tools.)

share|improve this answer
add comment

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.