SCIENTIFIC-LINUX-USERS Archives

February 2006

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Michael Mansour <[log in to unmask]>
Reply To:
Michael Mansour <[log in to unmask]>
Date:
Sat, 18 Feb 2006 16:35:47 +1000
Content-Type:
text/plain
Parts/Attachments:
text/plain (43 lines)
Hi Ioannis,

> When I first installed SL 4, it used my two existing hard disks and 
> created an LVM2 volume. Is there any way to remove one of the hard 
> disks from this, reducing it to occupy only the first hard disk?

That's the beauty of volume groups, you can do what you want with them.

What you'll have to do first though is make sure there's no data occupying the
second disk, you can do this using:

lvdisplay -v /dev/lvolname

The extents should be "empty", if they are not, then you need to remove the
data on them somehow.

You'll also need to note what filesystem you have on the LV's, since when you
use lvreduce (to remove a PV from the LV), you'll also need to tell the
filesystem to reduce also (using ext2fs if ext2/3 used - each filesystem will
have its own tool for this). Note though that you'll need to backup your data
so when you reduce it, you can restore the data just in case.

Next step if the extents are empty, is to remove the disk from the LV
(lvreduce), then ext2fs (if you're using ext2/3) to reduce to the new size.

You'll have to read the man pages on each of these commands to know their
parameters.

Once the PV is removed from the VG, then it's a free disk (with a PV label).
You can remove the PV label using pvremove.

The danger here is that you cannot remove the data contained on that second
disk, which in turns means to backup your entire system (vdump or whatever),
reduce your fileysystem, remove the LV and then the PV from the VG, then
restore your data onto the new LV with only one PV.

I've done this plenty of times so it does work, but I recommend you try it on
a test system first (build it or build a virtual machine and play with LV's)
to really get familiar with all the commands and processes, and then do it on
your real machine.

Michael.

ATOM RSS1 RSS2