* [linux-lvm] Removing a PV @ 2000-11-13 18:12 Rob Foehl 2000-11-13 18:58 ` Luca Berra 0 siblings, 1 reply; 10+ messages in thread From: Rob Foehl @ 2000-11-13 18:12 UTC (permalink / raw) To: linux-lvm If I want to completely pull a drive that belongs to a VG with an ext2 formatted LV in it, what's the correct procedure to avoid mangling the filesystem? I currently have a 130 gig partition spread over six drives.. about 74 gigs is in use, and I wanted to remove a single 20 gig drive from the volume.. I'm assuming I should shrink the filesystem by around 30 gigs or so (to be safe), then somehow also shrink the LV and move any used PEs on the 20 gig drive in question onto freed space on other drives.. Any suggestions would be greatly appreciated. -Rob ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [linux-lvm] Removing a PV 2000-11-13 18:12 [linux-lvm] Removing a PV Rob Foehl @ 2000-11-13 18:58 ` Luca Berra 2000-11-13 5:36 ` Andrew Clausen 2000-11-13 20:58 ` Rob Foehl 0 siblings, 2 replies; 10+ messages in thread From: Luca Berra @ 2000-11-13 18:58 UTC (permalink / raw) To: linux-lvm On Mon, Nov 13, 2000 at 01:12:23PM -0500, Rob Foehl wrote: > If I want to completely pull a drive that belongs to a VG with an ext2 > formatted LV in it, what's the correct procedure to avoid mangling the > filesystem? I currently have a 130 gig partition spread over six > drives.. about 74 gigs is in use, and I wanted to remove a single 20 gig > drive from the volume.. I'm assuming I should shrink the filesystem by > around 30 gigs or so (to be safe), then somehow also shrink the LV and > move any used PEs on the 20 gig drive in question onto freed space on > other drives.. Any suggestions would be greatly appreciated. ext2resize/resize2fs lvreduce pvmove vgreduce -- Luca Berra -- bluca@comedia.it Communication Media & Services S.r.l. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [linux-lvm] Removing a PV 2000-11-13 18:58 ` Luca Berra @ 2000-11-13 5:36 ` Andrew Clausen 2000-11-13 22:26 ` Andreas Dilger 2000-11-13 20:58 ` Rob Foehl 1 sibling, 1 reply; 10+ messages in thread From: Andrew Clausen @ 2000-11-13 5:36 UTC (permalink / raw) To: bluca; +Cc: linux-lvm Luca Berra wrote: > ext2resize/resize2fs or Parted ;-) www.gnu.org/software/parted ext2resize is basically unmaintained, separately from Parted. (ext2resize and fsresize merged to make Parted, about 1.5 years ago) So, most people will want to use Parted instead of ext2resize. The stable new version (1.4.0, out yesterday, hehe) is much more convienient for RAID and LVM. I haven't tried it out on LVM and RAID (it just goes through the raw devices), but it should be straight-forward. Actually, could someone check if the procedures in the documentation are correct? BTW: the LVM page suggests that we're still making Parted, and it isn't ready for use. This is incorrect. Parted is very stable :-) It has gone through 3 devel/stable cycles. Andrew Clausen ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [linux-lvm] Removing a PV 2000-11-13 5:36 ` Andrew Clausen @ 2000-11-13 22:26 ` Andreas Dilger 2000-11-13 7:27 ` Andrew Clausen 0 siblings, 1 reply; 10+ messages in thread From: Andreas Dilger @ 2000-11-13 22:26 UTC (permalink / raw) To: Andrew Clausen; +Cc: bluca, linux-lvm Andrew Clausen writes: > ext2resize is basically unmaintained, separately from Parted. > (ext2resize and fsresize merged to make Parted, about 1.5 years ago) This is totally untrue. I released a new version of ext2resize about a month ago. I don't think parted has any sort of facility for doing online filesystem resizing, so I don't think that ext2resize will be gone any time soon. > So, most people will want to use Parted instead of ext2resize. Cough.. Cheers, Andreas -- Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto, \ would they cancel out, leaving him still hungry?" http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [linux-lvm] Removing a PV 2000-11-13 22:26 ` Andreas Dilger @ 2000-11-13 7:27 ` Andrew Clausen 0 siblings, 0 replies; 10+ messages in thread From: Andrew Clausen @ 2000-11-13 7:27 UTC (permalink / raw) To: Andreas Dilger; +Cc: bluca, linux-lvm Andreas Dilger wrote: > > Andrew Clausen writes: > > ext2resize is basically unmaintained, separately from Parted. > > (ext2resize and fsresize merged to make Parted, about 1.5 years ago) > > This is totally untrue. I released a new version of ext2resize about > a month ago. I don't think parted has any sort of facility for doing > online filesystem resizing, so I don't think that ext2resize will be > gone any time soon. Well, Lennert said this. Are you maintaining Lennert's code? Sorry if I got this wrong! > > So, most people will want to use Parted instead of ext2resize. > > Cough.. Hehe, ok Andrew Clausen ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [linux-lvm] Removing a PV 2000-11-13 18:58 ` Luca Berra 2000-11-13 5:36 ` Andrew Clausen @ 2000-11-13 20:58 ` Rob Foehl 2000-11-13 22:07 ` Eric M. Hopper 2000-11-13 22:37 ` Andreas Dilger 1 sibling, 2 replies; 10+ messages in thread From: Rob Foehl @ 2000-11-13 20:58 UTC (permalink / raw) To: Luca Berra; +Cc: linux-lvm I'd assumed that was the correct command sequence, but does lvreduce ensure that the filesystem won't be damaged? Ie. does it only remove LE's from the end of the LV, or what? On Mon, 13 Nov 2000, Luca Berra wrote: > On Mon, Nov 13, 2000 at 01:12:23PM -0500, Rob Foehl wrote: > > If I want to completely pull a drive that belongs to a VG with an ext2 > > formatted LV in it, what's the correct procedure to avoid mangling the > > filesystem? I currently have a 130 gig partition spread over six > > drives.. about 74 gigs is in use, and I wanted to remove a single 20 gig > > drive from the volume.. I'm assuming I should shrink the filesystem by > > around 30 gigs or so (to be safe), then somehow also shrink the LV and > > move any used PEs on the 20 gig drive in question onto freed space on > > other drives.. Any suggestions would be greatly appreciated. > > ext2resize/resize2fs > lvreduce > pvmove > vgreduce > > > -- > Luca Berra -- bluca@comedia.it > Communication Media & Services S.r.l. > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [linux-lvm] Removing a PV 2000-11-13 20:58 ` Rob Foehl @ 2000-11-13 22:07 ` Eric M. Hopper 2000-11-22 12:54 ` Heinz J. Mauelshagen 2000-11-13 22:37 ` Andreas Dilger 1 sibling, 1 reply; 10+ messages in thread From: Eric M. Hopper @ 2000-11-13 22:07 UTC (permalink / raw) To: linux-lvm [-- Attachment #1: Type: text/plain, Size: 624 bytes --] On Mon, Nov 13, 2000 at 03:58:37PM -0500, Rob Foehl wrote: > I'd assumed that was the correct command sequence, but does lvreduce > ensure that the filesystem won't be damaged? Ie. does it only remove LE's > from the end of the LV, or what? Yes, you guessed it. :-) I'm not sure what happens with pvmove if the logical volume is striped though. I'd really like to know. :-) Have fun (if at all possible), -- The best we can hope for concerning the people at large is that they be properly armed. -- Alexander Hamilton -- Eric Hopper (hopper@omnifarious.mn.org http://www.omnifarious.org/~hopper) -- [-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [linux-lvm] Removing a PV 2000-11-13 22:07 ` Eric M. Hopper @ 2000-11-22 12:54 ` Heinz J. Mauelshagen 0 siblings, 0 replies; 10+ messages in thread From: Heinz J. Mauelshagen @ 2000-11-22 12:54 UTC (permalink / raw) To: Eric M. Hopper; +Cc: linux-lvm On Mon, Nov 13, 2000 at 04:07:25PM -0600, Eric M. Hopper wrote: > On Mon, Nov 13, 2000 at 03:58:37PM -0500, Rob Foehl wrote: > > I'd assumed that was the correct command sequence, but does lvreduce > > ensure that the filesystem won't be damaged? Ie. does it only remove LE's > > from the end of the LV, or what? > > Yes, you guessed it. :-) > > I'm not sure what happens with pvmove if the logical volume is > striped though. I'd really like to know. :-) You need to pvmove all PEs belonging to the stripe to another PV in order to keep up with the RAID0 constraints. > > Have fun (if at all possible), > -- > The best we can hope for concerning the people at large is that they > be properly armed. -- Alexander Hamilton > -- Eric Hopper (hopper@omnifarious.mn.org http://www.omnifarious.org/~hopper) -- -- Regards, Heinz -- The LVM guy -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Heinz Mauelshagen Sistina Software Inc. Senior Consultant/Developer Bartningstr. 12 64289 Darmstadt Germany Mauelshagen@Sistina.com +49 6151 7103 86 FAX 7103 96 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [linux-lvm] Removing a PV 2000-11-13 20:58 ` Rob Foehl 2000-11-13 22:07 ` Eric M. Hopper @ 2000-11-13 22:37 ` Andreas Dilger 2000-11-13 23:30 ` Rob Foehl 1 sibling, 1 reply; 10+ messages in thread From: Andreas Dilger @ 2000-11-13 22:37 UTC (permalink / raw) To: Rob Foehl; +Cc: Luca Berra, linux-lvm Rob Foehl writes: > I'd assumed that was the correct command sequence, but does lvreduce > ensure that the filesystem won't be damaged? Ie. does it only remove LE's > from the end of the LV, or what? Yes, the LEs are logically numbered, so they are always added to and removed from the end of the device. That makes it much easier on the filesystem because it doesn't need to ever deal with the blocks at the start of the filesystem changing. However, since they are "logical" blocks, they can be physically moved between disks without affecting the filesystem. As for removing a disk with a filesystem from an existing VG - you have to realize that there is still LVM information at the start of the disk even if you remove it from the VG, so you will not be able to use it as-is on another system. Rather than doing an lvreduce/pvmove/vgreduce (as previously suggested), you should do a pvmove to move all of the LEs from the desired filesystem into a single PV (it may already be this way) and also move all of the undesired LEs from this PV onto other PVs in the VG (use pvdisplay -v and lvdisplay -v to find out the layout). Then use vgsplit to create two new VGs - the new one being the single filesystem/disk you want to move. You can then export the VG from the current system and import it to the new system. If you are not going to use LVM on the new system, then simply pvmove all of the LEs from one of your disks and vgreduce this PV from the VG. Then use fdisk to make a new partition on the disk, and dd to copy from the old LV to the new partition. This way you will also have a backup of the data should anything go wrong (which you should probably have on tape as well). Cheers, Andreas > On Mon, 13 Nov 2000, Luca Berra wrote: > > > On Mon, Nov 13, 2000 at 01:12:23PM -0500, Rob Foehl wrote: > > > If I want to completely pull a drive that belongs to a VG with an ext2 > > > formatted LV in it, what's the correct procedure to avoid mangling the > > > filesystem? I currently have a 130 gig partition spread over six > > > drives.. about 74 gigs is in use, and I wanted to remove a single 20 gig > > > drive from the volume.. I'm assuming I should shrink the filesystem by > > > around 30 gigs or so (to be safe), then somehow also shrink the LV and > > > move any used PEs on the 20 gig drive in question onto freed space on > > > other drives.. Any suggestions would be greatly appreciated. > > > > ext2resize/resize2fs > > lvreduce > > pvmove > > vgreduce > > > > > > -- > > Luca Berra -- bluca@comedia.it > > Communication Media & Services S.r.l. > > > > -- Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto, \ would they cancel out, leaving him still hungry?" http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [linux-lvm] Removing a PV 2000-11-13 22:37 ` Andreas Dilger @ 2000-11-13 23:30 ` Rob Foehl 0 siblings, 0 replies; 10+ messages in thread From: Rob Foehl @ 2000-11-13 23:30 UTC (permalink / raw) To: Andreas Dilger; +Cc: linux-lvm Ok, that's kind of what I was expecting.. The drive being removed is going to get wiped anyway, I'm not trying to move any data with it, I just need space in another system and we're well below capacity on the current one.. The only thing I want to keep intact is the data on the existing filesystem. Thanks for the info.. I'll give it a try in the morning. On Mon, 13 Nov 2000, Andreas Dilger wrote: > Rob Foehl writes: > > I'd assumed that was the correct command sequence, but does lvreduce > > ensure that the filesystem won't be damaged? Ie. does it only remove LE's > > from the end of the LV, or what? > > Yes, the LEs are logically numbered, so they are always added to and removed > from the end of the device. That makes it much easier on the filesystem > because it doesn't need to ever deal with the blocks at the start of the > filesystem changing. However, since they are "logical" blocks, they > can be physically moved between disks without affecting the filesystem. > > As for removing a disk with a filesystem from an existing VG - you have > to realize that there is still LVM information at the start of the disk > even if you remove it from the VG, so you will not be able to use it as-is > on another system. > > Rather than doing an lvreduce/pvmove/vgreduce (as previously suggested), > you should do a pvmove to move all of the LEs from the desired filesystem > into a single PV (it may already be this way) and also move all of the > undesired LEs from this PV onto other PVs in the VG (use pvdisplay -v and > lvdisplay -v to find out the layout). Then use vgsplit to create two > new VGs - the new one being the single filesystem/disk you want to move. > You can then export the VG from the current system and import it to the > new system. > > If you are not going to use LVM on the new system, then simply pvmove all > of the LEs from one of your disks and vgreduce this PV from the VG. Then > use fdisk to make a new partition on the disk, and dd to copy from the > old LV to the new partition. This way you will also have a backup of the > data should anything go wrong (which you should probably have on tape as > well). > > Cheers, Andreas > > > > On Mon, 13 Nov 2000, Luca Berra wrote: > > > > > On Mon, Nov 13, 2000 at 01:12:23PM -0500, Rob Foehl wrote: > > > > If I want to completely pull a drive that belongs to a VG with an ext2 > > > > formatted LV in it, what's the correct procedure to avoid mangling the > > > > filesystem? I currently have a 130 gig partition spread over six > > > > drives.. about 74 gigs is in use, and I wanted to remove a single 20 gig > > > > drive from the volume.. I'm assuming I should shrink the filesystem by > > > > around 30 gigs or so (to be safe), then somehow also shrink the LV and > > > > move any used PEs on the 20 gig drive in question onto freed space on > > > > other drives.. Any suggestions would be greatly appreciated. > > > > > > ext2resize/resize2fs > > > lvreduce > > > pvmove > > > vgreduce > > > > > > > > > -- > > > Luca Berra -- bluca@comedia.it > > > Communication Media & Services S.r.l. > > > > > > > > > > -- > Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto, > \ would they cancel out, leaving him still hungry?" > http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert > ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2000-11-22 12:54 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2000-11-13 18:12 [linux-lvm] Removing a PV Rob Foehl 2000-11-13 18:58 ` Luca Berra 2000-11-13 5:36 ` Andrew Clausen 2000-11-13 22:26 ` Andreas Dilger 2000-11-13 7:27 ` Andrew Clausen 2000-11-13 20:58 ` Rob Foehl 2000-11-13 22:07 ` Eric M. Hopper 2000-11-22 12:54 ` Heinz J. Mauelshagen 2000-11-13 22:37 ` Andreas Dilger 2000-11-13 23:30 ` Rob Foehl
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.