Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have a LVM2 with 5 disks. Now i want to remove one hdd, which is empty. But i cannot achive that for some reason. Here is what i tried:
vgdisplay:
--- Volume group ---
VG Name system
System ID
Format lvm2
Metadata Areas 5
Metadata Sequence No 9
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 0
Max PV 0
Cur PV 5
Act PV 5
VG Size 1.36 TB
PE Size 4.00 MB
Total PE 357705
Alloc PE / Size 357705 / 1.36 TB
Free PE / Size 0 / 0
VG UUID RhX3Wr-PEC1-n8BA-2rMQ-iHwy-WvFr-1kVINF
/dev/hdi is the disk which i want to remove, was added last, so no data on it yet as this shows:
pvmove /dev/hdi:
No extents available for allocation
then i tried this:
vgreduce system /dev/hdi
Physical volume "/dev/hdi" still in use
So it doesnt want to remove it, saying its still in use ... I can`t figure it out from here on. Please help
as suggested on some lvm2 page, but i don`t know how to get that number 524288 (blocks) i want to remove, so if hdd is 300GB how many blocks does it have, or even better where do i see this ? I probably have to resize the filesystem on my group before removing, but i dont know how to get that block size
That number should actually be the new size of the filesystem, NOT the size you wish to truncate. So if you're reducing the filesystem from 1.36 TB by 300 GB then the new size is 1.06 TB or 1060 GB.
So the line would be like:
#resize2fs /dev/myvg/homevol 1060G (you can use a "G" suffix to specify it in gigabytes)
Hmm, not realy true. If i mount this volume group. It has about 450GB of free space left. And /dev/hdi was added last and after that nobody wrote to the hdd. So it should be empty. And other 3 full, and 4th hdd full like 60%. Dunno why it says it`s full.
Hmm, not realy true. If i mount this volume group. It has about 450GB of free space left. And /dev/hdi was added last and after that nobody wrote to the hdd. So it should be empty. And other 3 full, and 4th hdd full like 60%. Dunno why it says it`s full.
You don't mount volume groups, you mount logical volumes. Physical volumes are added to volume groups, and then the volume group is divided up into logical volumes which can be mounted. You may well have 450Gb of free space on some logical volume you created, but that 450Gb of space is still counted as "used" when talking about volume groups, and therefore the physical volumes that make up the volume group.
If there is a logical volume that is indeed unused, then you can unmount the filesystem using that logical volume, then delete the logical volume, and that MAY free up the space on your volume group to remove the physical volume hda1
I know this thread is old but I feel the initial question and the answers doesn't match..
So, wouldn't some lvm tool be able move all hard drive's extents content to empty extents on other drives?
I mean, the pvmove commands move extents to another drive that does not have extents assigned to the volume. What we want is to be able to move extents content to other extents on another drive, and be able to unassign those empty extents on the drive we wish to remove!
Per say you have one 100G and one 20G hard drive.
all the extents available from both drive have all been assigned to our logical volume, and the total date used is 70G. How would you remove the 20G hdd to replace it with a bigger one? Can't you just make sure you have enough space to hold the data without that drive, then move all data in that 20G to the 100G, then remove the 20G from the group?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.