LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-01-2011, 02:58 PM   #1
boxyzzy
LQ Newbie
 
Registered: Mar 2008
Location: Virginia
Distribution: Red Hat, Ubuntu, OpenSUSE
Posts: 12

Rep: Reputation: 0
Question LVM: Preserving volume groups across an install


I plan to upgrade a Debian system with three volume groups on three disks to Ubuntu. vgdisplay -v shows the device/partition associated with each volume group. How do I preserve (or remap)the volume groups and the associated logical volumes; while, of course, preserving the data? I'm thinking vgscan is my friend, right?
 
Old 12-02-2011, 05:14 AM   #2
_bsd
Member
 
Registered: Jan 2010
Location: Velveeta, USA
Distribution: Xen, Gentoo,Ubuntu,openSUSE,Debian,pfSense
Posts: 98

Rep: Reputation: 9
You did not mention whether or not you plan on putting any part of the OS, root, home on LVM.

If the VG disks are only data disks then the following is safe.

VG metadata is stored on disk.

This approach is not necessary, but it's always better to be safe than sorry.
Make a backup copy of /etc/lvm to a USB stick (just in case). copies of LVM metadata are stored there and may be used in the event of any metadata corruption (should not happen).

Turn off computer, unplug disks with VG/LV.
Install Ubuntu, then apt-get install lvm2
Turn off computers, reattach VG disks, boot the computer and the Volume Groups should be there.

They may not be active by default you may have to activate them with
Code:
vgchange -ay vgname
Make mount points and mount the logical volumes, add them to /etc/fstab and you're done.

Always make a complete backup before major upgrades, changes.

Last edited by _bsd; 12-02-2011 at 05:42 AM.
 
Old 12-02-2011, 08:37 AM   #3
boxyzzy
LQ Newbie
 
Registered: Mar 2008
Location: Virginia
Distribution: Red Hat, Ubuntu, OpenSUSE
Posts: 12

Original Poster
Rep: Reputation: 0
LVM: Preserving volume groups across an install

Thanks for your guidance - it helps!

To further explain, see the (edited) output of "fdiak -l" and the output of "df -h" below.

As shown, I need to preserve the appsvg VG on the boot volume; and the VGs, sasvg and satavg, each on separate devices.

Added to my situation, is the unusable small size of /usr. Prior to the install, I plan to:
1) reduce the size of LV appsvg-apps
2) create LV apps-usr to be used as /usr

During the install I plan to use the existing layout for /, /tmp, /var, /opt.

Question:

Will the installer "honor" the LVM space of appsvg, and (from the metadata?) present me an opportunity to specify the apps-usr LV to be used for /usr?

Is there a better/safer approach?

From your previous comments, how risky is it to leave the apps-sas and apps-sata attached during the install process?

Again, many thanks for your guidance,

Mike

-----

fdisk -l /dev/sda

Disk /dev/sda: 72.7 GB, 72746008576 bytes
255 heads, 63 sectors/track, 8844 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 62 497983+ 83 Linux ............................ /
/dev/sda2 63 1035 7815622+ 82 Linux swap / Solaris
/dev/sda3 1036 1157 979965 83 Linux ............................ /tmp
/dev/sda4 1158 8844 61745827+ 5 Extended
/dev/sda5 1158 1279 979933+ 83 Linux ............................ /usr
/dev/sda6 1280 1401 979933+ 83 Linux ............................ /var
/dev/sda7 1402 1523 979933+ 83 Linux ............................ /opt
/dev/sda8 1524 8844 58805901 8e Linux LVM ........................ appsvg


df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 471M 156M 292M 35% /
tmpfs 7.9G 0 7.9G 0% /lib/init/rw
udev 10M 84K 10M 1% /dev
tmpfs 7.9G 0 7.9G 0% /dev/shm
/dev/mapper/appsvg-apps
55G 12G 41G 23% /apps
/dev/mapper/appsvg-home
1008M 205M 752M 22% /home
/dev/sda7 942M 208M 687M 24% /opt
/dev/sda3 942M 18M 877M 2% /tmp
/dev/sda5 942M 717M 178M 81% /usr
/dev/sda6 942M 508M 388M 57% /var
/dev/mapper/sasvg-sas
536G 1002M 508G 1% /apps/sas
/dev/mapper/satavg-sata
8.9T 5.2T 3.8T 59% /apps/sata
 
Old 12-02-2011, 04:05 PM   #4
_bsd
Member
 
Registered: Jan 2010
Location: Velveeta, USA
Distribution: Xen, Gentoo,Ubuntu,openSUSE,Debian,pfSense
Posts: 98

Rep: Reputation: 9
Code:
Will the installer "honor" the LVM space of appsvg, and (from the metadata?) present me an opportunity to specify the apps-usr LV to be used for /usr?
In the section where you specify advanced partitioning I think it's something like "Something Else"
you can choose from the existing partitions and logical volumes, specifying whether or not they are to be used, their filesystem type(s), whether or not the filesystems needs to be (re)formatted, and their mount points.

I don't trust these installers for more complicated partioning and/or LVM use as I have had one (vmware) clobber my data LVs without first asking permission/confirmation. So, I'm probably appropriately paranoid.

Quote:
Is there a better/safer approach?
Always.
Do you have enough space to make backups of everything prior to upgrading? If so, do so.

Quote:
From your previous comments, how risky is it to leave the apps-sas and apps-sata attached during the install process?
As I said, you do get a chance to specify all that I've mentioned.

May I play devil's advocate and ask the reason for switching from Debian to Ubuntu?

Is this a server or desktop?

I have an Ubuntu 10.04.3 LTS server with 2 10TB VGs, each with several logical volumes for data, however the OS is installed on its own disk and backed up to one the logical volumes using fsarchiver and sysrescuecd.

I also recommend eliminating the extended partitions and use a GPT partition table instead.
 
Old 12-02-2011, 05:32 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,130

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Quote:
Originally Posted by _bsd View Post
I don't trust these installers for more complicated partioning and/or LVM use as I have had one (vmware) clobber my data LVs without first asking permission/confirmation. So, I'm probably appropriately paranoid.

...
Always.
Do you have enough space to make backups of everything prior to upgrading? If so, do so.
Hard to argue with any of that.
I never trust the partitioning front-ends shipped with installers. Also the result of being bitten. I pre-allocate everything as I wish, mount them where I want ... and pray if you want anything not formatted.
Just yesterday I had a situation where a (non-Debian based) upgrade wouldn't allow me to mount the root and not format it. An upgrade, not (clean) re-install ... Distro devs always seem to have fixed ideas about how we as users should use their stuff.

Don't trust nobody.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
When to use multiple LVM Volume Groups koenigj3 Linux - Newbie 11 02-04-2010 06:20 PM
Advice on LVM planning. Disadvantage to more Volume Groups? Vanyel Linux - Server 5 04-28-2009 07:46 PM
shutting down LVM volume groups aztek Debian 2 06-02-2006 09:58 PM
Can I delete LVM Volume Groups? second_existence Linux - Newbie 1 01-24-2006 10:20 PM
Activating LVM Volume Groups at startup TomF Linux - Newbie 0 05-05-2004 05:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration