• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

remove a hard drive from LVM group

contractcooker

Junior Member
Hello all,
I'm a linux newbie so please forgive my ignorance. I've spent the last couple of hours looking around for an answer but haven't found one yet. I want to remove a hard drive from a server that I have set up.

I have LVM set up on ubuntu server 64-bit. I have 2 VGs spread over 5 disks. vg00 contains my system and swap partitions as well as a partition for my music. vg01 contains a video partition. I just added the 5th disk to the video logical volume today. It's a 750GB drive. What I want to do is remove a 300GB drive from the system but no matter what I've tried it won't let me. It seems to me that I need to do:

pvmove /dev/sdd1

sdd1 is the 300GB drive that I want to remove. But when I run pvmove I get an error that there are no physical extents available.

Thanks in advance.

tb
 
I have another 750GB hard drive I want to add. Could someone please tell me the steps to:

1. Add the new hard drive to the VG
2. Transfer information off the smaller hard drive
3. Remove the smaller hard drive

I'm pretty sure that I know how to do steps 1 and three already but I can't figure out 2. I have a feeling I should have tried pvmove before I added the hard drive to the LV. Is this right? Also, if there's any information that would be helpful (vgdisplay, pvscan.... etc.) I'll happily post it. I'm just not sure what information is needed to help me solve my problem.

Thanks again.
 
Some googling suggests (related to your first post) that you need to reduce the lv/vg such that there's 300 GB available within the physical extents it covers. So you'd need to lvresize existing logical volumes within your VG until there's 300 GB (+ some amount extra), and then you should be free to pvmove.

With the extra hard drive, you can pvcreate, then vgextend to tag the new pv onto your existing vg. That should provide more than enough space to pull the old 300 GB drive out.

As always, YMMV. I've rarely done any vg/lv modifications once the partitions are established.
 
Back
Top