[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: (problem) LVM + USB drive



Hello,

2011/6/2 Itay <debian@itayf.fastmail.fm>
On Mon, 30 May 2011, Itay wrote:

I'd like to set up a USB drive using LVM.  Could someone knowledgable confirm that the following recipe should allow me to hot-plug the USB drive without rendering the LVM file-systems inaccessible?

The recipe has a problem in the vgcreate step (below,
marked with '***********').
The physical volume is not listed in /dev/disk/by-uuid/...

Can someone suggest how to fix the recipe, or suggest a different workflow for working with lvm on hot-pluggable USBs?


Actually, you should be able to use the partitions directly to create the VG. An example that applies to your case is even in the manpage of vgcreate:
EXAMPLES
       To create a volume group named test_vg using physical volumes /dev/sdk1, and /dev/sdl1 with default physical extent size of 4MB:

            vgcreate test_vg /dev/sdk1 /dev/sdl1

 Thus, as alternative to the vgcreate and vgextend steps, the following command should do it in a single step:
Regards,
Roland


Recipe follows:

Set up:
#  (Actual number of partitions, etc., is not important here.)

#  Assume attached disk is /dev/sdc and it has an extended partition #+ that covers that whole disk.

#  Prepare partitions for LVM (say, 2 partitions)
       $ parted /dev/sdc mkpart logical START1 END1
       $ parted /dev/sdc mkpart logical START2 END2
#  Create Physical Volumes
       $ pvcreate /dev/sdc1
       $ pvcreate /dev/sdc2
#  Identify the Physical Volumes' UUIDs
       $ blkid
#  Create Volume Groups using  PVs **UUIDs**
***********'
       $ vgcreate [options] myVG /dev/disk/by-uuid/UUID-OF-PART-1
***********'
       $ vgexted  [options] myVG /dev/disk/by-uuid/UUID-OF-PART-2
#  From this point I can "forget" that I deal with a USB drive, and #+ continue the set up as with built in drives; right?

[snip]

Thanks,
Itay


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: [🔎] alpine.DEB.2.00.1106021024350.5816@frodo1.weizmann.ac.il" target="_blank">http://lists.debian.org/[🔎] alpine.DEB.2.00.1106021024350.5816@frodo1.weizmann.ac.il



Reply to: