Re: [webmin-l] Edit Volume Group in Webmin

Caspar Smit <[email protected]>
Newsgroups gmane.comp.web.webmin.general
Message-ID <CADvHm=YUMybf9GE4TBg8Lky9_xdKhD5dJ11ut5Bb6J9omvGTJg@mail.gmail.com>
2016-10-31 14:43 GMT+01:00 Kris Deugau <[email protected]>:

> Jamie Cameron wrote:
> > On 28/Oct/2016 09:05 Marcos Rubinstein <[email protected]> wrote ..
> >> I see that in "Edit Volume Group" it's possible to change the name of
> the
> >> Volume Group....
> >>
> >> my question...
> >>
> >> I will like to use the Disk Drive from one server (and all of the
> >> information on it) and mount it in another server... but, both servers
> have
> >> the same Volume Group name (VG)... and I think that would be a
> problem...
> >> then, once I put the drive from the old server in the new server..
> .before
> >> mounting it, I guess I would need to change the Volume Group Name
> (probably
> >> not the Logical Volume names)...
> >>
> >> My question... it will be as simple as change the Volume Group Name
> using
> >> "Edit Volume Group" before mounting the old disk? (and then mount
> it?)...
> >> Could I do that (mounting included) without rebooting the new server?
> >
> > Honestly, I don't know if moving a disk to another system will cause the
> VG
> > to just automatically show up .. that would be a question for LVM
> experts.
>
> Not an expert, but I got tripped up by this a while back.
>
> If you have a disk from system A, with the same VG name as a disk in
> system B, do not put that disk from system A into system B until you
> have renamed one of the volume groups.  It will NOT work, and you will
> probably have trouble even booting.  LVM metadata is read well before
> any filesystem mounts.
>
>
Exactly, do not use two VG's with the same name in a single system, ever!

First of all, LVM is perfectly capable of renaming a VG with mounted
filesystems, even the root (/) filesystem!
So Webmin too is capable of renaming a VG with a mounted filesystem,
however for some reason the volume group rename routine in webmin does a
"vgchange -an" and "vgchange -ay" (Deactivate all logical volumes of the VG
and then re-activate them again) AFTER the rename. Those vgchange commands
are obsolete and should be removed from the webmin code (My guess is that
those commands were needed with old LVM versions).

So if you want to rename your root filesystem VG:

Just rename the VG with webmin, it will throw an error saying it can't
deactivate the volumes but you can ignore that, the actual rename his
already succeeded.

Tested the above with:

Webmin 1.730
LVM 2.02.116
Kernel 4.4.19

Kind regards,
Caspar



> -kgd
>
> ------------------------------------------------------------
> ------------------
> The Command Line: Reinvented for Modern Developers
> Did the resurgence of CLI tooling catch you by surprise?
> Reconnect with the command line and become more productive.
> Learn the new .NET and ASP.NET CLI. Get your free copy!
> http://sdm.link/telerik
> -
> Forwarded by the Webmin mailing list at webadmin-list@lists.
> sourceforge.net
> To remove yourself from this list, go to
> http://lists.sourceforge.net/lists/listinfo/webadmin-list
>

------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik

-
Forwarded by the Webmin mailing list at [email protected]
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.