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

Re: LVM question



Clear, thanks :)

On Mon, Apr 20, 2015 at 11:46:38AM +0100, Darac Marjal wrote:
> On Mon, Apr 20, 2015 at 12:05:17PM +0200, Dark Victorian Spirit wrote:
> > I hope i can ask a question on top of this one,
> > what if i have a PV which is configured and in use for a while,
> > but i found out that i forgot to set the pertition type on LVM.
> > 
> > Can i still change this without data loss or risk?
> > And if i don't will i face issues of another kind?
> 
> I believe so. Under Linux, partition types are mostly bookkeeping.
> According to wikipedia, some partition types imply certain access
> schemes (such as saying that a XENIX root partition (type 02h) should
> only be accessed using CHS, not LBA), but no such restrictions apply to
> Linux partitions. The Partition Type doesn't constrain the data stored
> on the partition - that is, you can put an NTFS filesystem into a
> "Linux" partition, even though there's a different code for NTFS.
> 
> To cut a long story short, yes, you should be fine. Nothing's ever
> entirely risk-free, though so A) "if it ain't broke, don't fix it" and
> B) backup before you change it :)
> 
> > 
> > 
> > On Mon, Apr 20, 2015 at 10:33:13AM +0100, Darac Marjal wrote:
> > > On Mon, Apr 20, 2015 at 09:26:54AM +0200, Petter Adsen wrote:
> > > > Is it possible to have two VGs on the same PV?
> > > 
> > > I don't believe so. The VG is the mapping layer in the LVM stack. It
> > > maps the LVs to the PVs. If you were to share a PV between VGs, then
> > > you'd need some way to tell the VGs which parts of the PV they can use
> > > (letting them battle it out and potentially over-commit the PV is not
> > > really a good idea). The easiest idea is to split the underlying device
> > > into multiple PVs (e.g. use partitions).
> > > 
> > > > 
> > > > If so, how can I make a VG with lots of free space smaller? I'm
> > > > suspecting that the answer to my first question is "no", since this
> > > > doesn't seem possible from the man pages.
> > > 
> > > A quick bit of searching suggests the incantation would be:
> > >  * Boot from a rescue/live disc
> > >  * Activate your VG
> > >  * (You say you've got unallocated space in your VG, so resizing
> > >     filesystems/LVs won't be covered)
> > >  * "lvm pvs" should, at this point, indicate some PFree, which is how
> > >     much you can shrink the PV
> > >  * Run "lvm pvresize /dev/whatever --setphysicalvolumesize 50G"
> > >    (Where /dev/whatever is the PV device and 50G is the new size to
> > >    resize to)
> > >  * Finally, resize the PV's partition appropriately.
> > > 
> > > At this point, you will have a smaller PV and less unallocated space in
> > > your VG. You can now create another partition, PV that and add it to a
> > > second VG.
> > > 
> > > > 
> > > > Petter
> > > > 
> > > > -- 
> > > > "I'm ionized"
> > > > "Are you sure?"
> > > > "I'm positive."
> > > 
> > > 
> > 
> > 
> > 
> > -- 
> > To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
> > with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> > Archive: [🔎] 20150420100517.GA5944@kernelbug.org">https://lists.debian.org/[🔎] 20150420100517.GA5944@kernelbug.org
> > 



Reply to: