Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Lets say I would like to make a large volume from external usb drives. I create the lvm volume on drives that have been given certain device names sdf sdg or whatever and at some point they are plugged in differently or in different ports will the volune still be mountable? will I have to change things to mount the volume ?

Perhaps it's possible to work around this using UUIDs at the physical volume level?

For bonus points is it possible to convert or migrate from device names to uuids ? I'm thinking perhaps through a sequence of pvmoves

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

Actually I found the answer eventually here: lvm2 Faq

They are identified by uuids always even if you create them using device names and so are resilient if devices are renamed due to renumbering of devices

I found that I needed to reboot when I changed drive numbers by changing usb devices to have the new positions used by lvm, running vgscan, lvscan or pvscan didn't update the volumes.

FWIW using LVM on multiple USB devices is a bad idea. I was only doing this because I was stuck and had no option.

share|improve this answer
1  
what about vgscan -ay , it should find it without a reboot. –  Hanan N. Nov 27 '11 at 22:19
    
@HananN.Did you mean a vgchange -ay ? –  tripledes Aug 8 '12 at 23:26
add comment

A short explanation to Hanan's comment:

vgscan -a y activates all volume groups that can be found, which is probably what you want. After this step, the logival volumes in your volume group should show up as /dev/mapper/VGNAME-LVNAME.

And as you found out already, LVM works with UUIDs, so fortunately the device name sd* does not matter after creation.

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.