Results 1 to 7 of 7

Thread: [SOLVED] create vg independent of device name

  1. #1
    Join Date
    May 2008
    Location
    India
    Beans
    14
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    [SOLVED] create vg independent of device name

    Hi, All

    I have an external disk on of the partitions is under LVM control and there is a single LV on it.

    The disk is a pluggable USB drive.

    There is no problem when only this disk is connected to the computer or this is the first external disk. It is recognized as /dev/sdb and the PV is on /dev/sdb8.

    But when this disk is connected when another external disk is already connected to the system it is recognized as /dev/sdc and I am not able to use the partition under LVM control. mount fails as the vg is mapped with /dev/sdb8 and not sdc8

    How can I create a transparent PV i.e independent of device names.
    I am presently investigating on disk UUIDs, but this will be my first encounter with UUIDs and I hope I am on the right track.


    Thanks
    -Sri

  2. #2
    Join Date
    Feb 2005
    Location
    Melbourne, Australia
    Beans
    13,510
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: create vg independent of device name

    Quote Originally Posted by srimalik View Post
    .........
    How can I create a transparent PV i.e independent of device names.
    I am presently investigating on disk UUIDs, but this will be my first encounter with UUIDs and I hope I am on the right track.
    Use Disk Labels.
    Regards, David.
    Please use the Forum search and Wiki search for immediate help
    Please mark your thread as Solved when appropriate
    New to technical forums?: How To Ask Questions The Smart Way

  3. #3
    Join Date
    May 2008
    Location
    India
    Beans
    14
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: create vg independent of device name

    Thanks David

    It seems UUID are related to file system and not with partitions or LVs
    I will investigate disk labels and update .

    -Sri

  4. #4
    Join Date
    Dec 2007
    Location
    Idaho
    Beans
    4,976
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: create vg independent of device name

    UUID's should work just fine, as will labels.
    Last edited by jerome1232; October 28th, 2008 at 03:56 PM.
    "You can't expect to hold supreme executive power just because some watery tart lobbed a sword at you"

    "Don't let your mind wander -- it's too little to be let out alone."

  5. #5
    Join Date
    May 2008
    Location
    India
    Beans
    14
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: create vg independent of device name

    The problem is that I could not find the UUID of the LV.
    BTW, I have written two small scripts which will take care of the problem

    Here are those:
    $ cat activate-external-disk.sh
    #!/bin/sh
    vgimport vgdisk
    vgchange -a y /dev/vgdisk
    mount /dev/vgdisk/lvol0 /mnt/usb
    [krishan@l3-lr893 programs]$ cat remove-external-disk.sh
    #!/bin/sh
    sync
    umount /dev/vgdisk/lvol0
    vgchange -a n /dev/vgdisk
    vgexport vgdisk
    [krishan@l3-lr893 programs]$

  6. #6
    Join Date
    Dec 2007
    Location
    Idaho
    Beans
    4,976
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: create vg independent of device name

    will show logical volumes uuid's
    Code:
    lvdisplay
    "You can't expect to hold supreme executive power just because some watery tart lobbed a sword at you"

    "Don't let your mind wander -- it's too little to be let out alone."

  7. #7
    Join Date
    May 2008
    Location
    India
    Beans
    14
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: create vg independent of device name

    I think using UUID will not solve the issue, I have to anyway stop and export the volume group before I remove the disk. Else, there is not way for LVM to know about the change.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •