Skip to contentSkip to conversation

removing a pv from an lv formatted xfs

linux-lvm Ken Savich 2 participants 2 messages Jan 13, 2002 1 message not in the archive

lore
Share & tools
lore

Ken Savich

author
#1 lore raw
In reply to a message not in the archive

I did do an xfs_growfs to the fs, unfortunately.

Can I ask you, if I do add another disk, is it okay for me to add one that is not the same size, but big enough to deal with any data that may be on the bad disk? If so, what happens to the fs when I remove the bad disk and the lv is no longer as large as it was?

If I can just pvmove everything from the bad disk to one of the existing pv's, and remove it thereafter, would this work as well?

I guess this all boils down to how does xfs deal with being shrunken, even if there is still plenty of free space.

on Sun, 13 Jan 2002, Theo Van Dinter digitally scribbled:

Quoted 30 lines · Ken Savich
Quoted 7 lines

now going bad with tons of errors
on umount from the kernel. I need to remove it but I cannot shrink the xfs partition that the lv it belongs
to is on. How can I remove this disk? If I remove hdb from the lv without shrinking the filesystem, will it whack
my data? Is there any way around this? I'm sure there is only data on hde, the original first disk of the vg.

It wasn't clear from your note, but I'm assuming that you not only added the disks to the LV but also did xfs_growfs to give the filesystem all of the space?

If so, you have two options that I can see. The first is easiest: Add a disk to replace the failing one. Put it in the VG, and do a pvmove to get the data moved to the new disk. When that's complete, and 'pvdisplay -v' shows no PEs allocated from that device, you can remove it from the VG and then physically remove the disk.

The second is really more annoying: backup the filesystem, remove the lv ad failing pv, remove/replace the disk, recreate the pv and lv, then restore the FS.

--
Randomly Generated Tagline:
Oh my God, someone's trying to kill me! Oh wait, it's for Bart.

(quoted diff) +0 -0
 		-- Homer Simpson
 		   Cape Feare
#2 lore raw
Quoted 4 lines · Ken Savich

Can I ask you, if I do add another disk, is it okay for me to add one that is not the same size, but big enough to deal with any data that may be on the bad disk? If so, what happens to the fs when I remove the bad disk and the lv is no longer as large as it was?

You need the LV to remain the same size. You can add a new disk that's diferently sized from the failing one, but it must be at least the same size. There's nothing you can do to shrink the FS (save for backup/recreate/restore), but you can move the data off of the failing disk onto another one.

Quoted 2 lines

If I can just pvmove everything from the bad disk to one of the existing pv's, and remove it thereafter, would this work as well?

If you still have space available on the other PVs that would work fine. Just pvmove the PEs from the failing disk to the other PVs and then remove the failing disk from the VG. (this is the same as adding a new disk to the VG, doing the move, and removing the failing disk...)

Does this make sense?

Quoted 2 lines

I guess this all boils down to how does xfs deal with being shrunken, even if there is still plenty of free space.

You can't shrink the filesystem, so you shoot yourself in the foot if you shrink the LV that the filesystem is living on. Don't do that. :)

Signature · 3 lines
Randomly Generated Tagline:
I did this 'cause Linux gives me a woody.  It doesn't generate revenue.
 (Dave '-ddt->` Taylor, announcing DOOM for Linux)