4

The current setup on my Oracle Linux Server release 5.8:

/dev/sda2 (30GB)
Logical volume  /dev/VolGroup00/LogVol00    / 
Logical volume  /dev/VolGroup00/LogVol02    /home/app/oracle 
Logical volume  /dev/VolGroup00/LogVol04    /home/app/oracle/product/weblogic 
Logical volume  /dev/VolGroup00/LogVol03    /home/app/work
Logical volume  /dev/VolGroup00/LogVol01    swap 

/dev/sdb1 (60GB)
Logical volume  /dev/VolGroup01/Log2Vol00   /home/app/work/test/attachment 
Logical volume  /dev/VolGroup01/backup      /backup 

/dev/sdc1 (5GB)
Logical volume  /dev/VolGroup00/LogVol00    / 

/dev/sdd1 (5GB)
Logical volume  /dev/VolGroup00/LogVol04    /home/app/oracle/product/weblogic

As you can see there are 2 volume groups (VolGroup00 and VolGroup01) and 4 disks (sda2, sdb1, sdc1 and sdd1). Now I want to move sda2, sdc1 and sdd1 to a new disk and remove the old disks.

I was thinking about the following procedure:

  1. Create two new disks (one of 80GB and one of 120GB)
  2. extend VolGroup00 with the 80GB disk and extend VolGroup01 with the 120GB disk with vgextend
  3. move the filesystems from the old disk to the new disk with pvmove
  4. remove the old disks from the volumegroup with vgreduce

However, I'm having doubts about moving the swap and the / filesystem because I think it quite risky to move the core of the server to another disk. Is there any way that I can move those without chance of demolishing the server itself?

  • Are you talking about a live migration while the server is up, running and doing work? Are there raid configurations involved? You don't have to move the swap partition. Just replace it with another one. – Bananguin Mar 15 '16 at 14:02
  • i was thinking about live migration indeed but the server can be brought down if necessary. Good point about the swap, didn't think of that! No raid configuration – Noosrep Mar 15 '16 at 14:14
  • Then your task should be as easy as the second result when googling for "lvm online migration" tecmint.com/lvm-storage-migration – Bananguin Mar 15 '16 at 14:26
  • this look amost OK, have you thought about boot section (likely in /dev/sda1) ? – Archemar Mar 15 '16 at 14:33
  • @Bananguin: I did indeed find that link but it doesn't specify anything about moving your /. I'm probably too careful but I wanted a specific yes or no. – Noosrep Mar 15 '16 at 14:37
2

You can mirror the lvs, break them after the copy, test (with a reboot) and remove the data from the old disks. Just don't mirror the swap fs, it's better to create another.

In this link the guy has a case where he mirrors the root fs. He does for the swap, but is much better not to. There are addional steps related to the fstab and grub, wich are important for your machine to be able to boot from the new drives.

The advantage is that you can go back to the old disks at any point of the process. So don't remove the lv's from the other disks before you have everything working fine on the new disks.

You can test by setting the boot to your new disks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.