Koozali.org: home of the SME Server

How2add a drive to the root lvm group?

paul_sc

How2add a drive to the root lvm group?
« on: April 03, 2006, 01:29:52 AM »
Hello, I have a new/clean 7.0 rc1 install and I would like to add a second drive (and a 3rd in the near future) to gain capacity. All of these are standard ide pata drives. I know how to do it as instructed in the howto
http://mirror.contribs.org/smeserver/contribs//mblotwijk/HowToGuides/AddExtraHardDisk.htm
, but, I would like to take advantage of LVM2 built into sme7

I installed 7 with the second drive unplugged, configured the server as I like and now I would like to add more storage to the setup.

If I understand what I have read correctly, 7 configures the drive(s) on initial install as an lvm mirror. I would like a linear lvm (i think) with system capacity increasing  as I add drives to the group.

I don't want to move the 'ibay(s)' over to the new drive as was the traditional method with v6 because then I end up wasting about 150gigs on the root drive or spend time managing directories over the 2, or 3 drives juggling directories, template fragments etc as my requirements change.

 I believe I need to
 connect the second drive
 boot from a cd that has lvm support,
 create the pv on the new drive,
 add the new drive to the volume group,
 unmount the primary volume,
 extend the file systems, and
 remount the extended volumes.

http://www.tldp.org/HOWTO/LVM-HOWTO/index.html
 
I tried this last week with sme 7 rescue, boot cd, hold shift key, type text rescue, no network, but I got some error with only restart as an option. On a subsequent attempt while running in sme I some how unsync'ed the drives and caused a kernel panic as I learned you cannot unmount a root volume.  :hammer:

Being a green horn, I am just exploring by trial and error. If any one has some pointers on how to add the drive to the primary vg and make the root a linear lvm, I would be appreciative.

paul

paul_sc

How2add a drive to the root lvm group?
« Reply #1 on: April 04, 2006, 02:53:32 AM »
Thanks Shads

Quote from: "slords"
Be warned that playing with the setup can mess up your entire setup.  Also unless you are familiar with lvm on raid you might loose your redundancy by expanding your lvm.  With that said here are a few pointers to get you going.

- First partition your hard drive and set the type correctly (fd or 8e).
- If you want raid then create a raid device (mdadm).
- Note: This can be a degraded array if limited on drives.
- Create a physical volume (pvcreate) on the md device or partition.
- Extend the volume group (vgextend).
- Move logical volumes from one drive to another (pvmove).
- Note: If you are moving the logical volume that contains /usr and /lib then you will need to be in rescue mode (boot of CD).
- Remove old drive from volume group (vgreduce).
- Extend logical volume to take advantage of extra space (lvextend).
- Resize ext3 filesystem to take advantage of extra space (ext2online).

If you plan on removing the old drive be sure to also re-create and copy over the /boot partition.  This can not reside on a LVM.  It can reside on a raid device.  You will also have to install grub and initialize the bootloader correctly or system won't boot.

If you aren't familiar with these commands or aren't willing to risk your data playing with them then I'd advise against trying any of this.

Offline eiceic

  • ****
  • 118
  • +0/-0
    • http://www.eicsoftware.com
Additional Drive
« Reply #2 on: July 17, 2006, 03:05:44 PM »
Will the old method still work with 7.x  the same way it worked with 6.x?

http://mirror.contribs.org/smeserver/contribs//mblotwijk/HowToGuides/AddExtraHardDisk.htm

Thanks,

Chris Buechler