[CentOS] How to add a HD to a LVM

Sun May 8 15:50:56 UTC 2011
Todd Cary <todd at aristesoftware.com>

On 5/8/2011 8:05 AM, Charlie Brune wrote:
> On 05/08/2011 09:37 AM, Todd Cary wrote:
>> On 5/8/2011 12:03 AM, Ken Smith wrote:
>>> Todd Cary wrote:
>>>> I have connected a HD that was a prior system drive (Centos 4.8)
>>>> and I am not sure of the command line procedures to find out if
>>>> it is recognized (I believe it is since it present in the GUI),
>>>> delete all data on it and finally add it to the LVM.
>>>>
>>>> I would like to use it as a backup data drive.
>>>>
>>>> Todd
>>>>
>>>>
>>> This is an excellent tutorial on LVM.
>>>
>>> http://tldp.org/HOWTO/LVM-HOWTO/
>>>
>>> Are you planning to join it to an existing Volume Group and then create
>>> a LV on it for backup? My preference would be to keep things simple and
>>> to aid recovery in the future, maybe just format the disk ext3 for
>>> backup. Then it is easy to plug into another box for recovery. But, I'm
>>> just guessing how you plan to use it.
>>>
>>> Ken
>>>
>> Ken -
>>
>> Thank you for your response.  What you suggested is exactly what
>> I would like to do: have an extra, stand alone, drive for
>> backup.  However, when I do
>>
>> fdisk -l
>>
>> I get the output below which has me concerned.  As a "Sunday
>> afternoon" user of Centos, I am not 100% sure of my
>> interpretation - that is - the drive is already been joined as
>> part of the LVM even though all I did was to plug it in as a slave.
>>
>> My installation of Centos 5.5 is new and I do not remember
>> specifying LVM (though that is what I had with my 4.8 system).
>> The /dev/hdc (250 GB) is the new system drive.  The /dev/hdd is
>> the old Centos 4.8 drive that I would like to have as an
>> independent drive e.g. /dev/hda or whatever it needs to be.
>>
>> What I DO NOT want to happen is for me to accidentally mess up my
>> new Centos 5.5 system :-)!!
>>
>> Questions:
>>
>> * Is it possible to "remove" /dev/hdd from the LVM - at least it
>> appears to be part of it
>> * Once removed, format it as EXT3 and mount it as /dev/hda (or
>> /dev/hdd)
>>
>> For this I am swimming in unknown waters.
>>
>> Todd
>>
>> Disk /dev/hdc: 251.0 GB, 251000193024 bytes
>> 255 heads, 63 sectors/track, 30515 cylinders
>> Units = cylinders of 16065 * 512 = 8225280 bytes
>>
>>       Device Boot      Start         End      Blocks   Id  System
>> /dev/hdc1   *           1          13      104391   83  Linux
>> /dev/hdc2              14       30515   245007315   8e  Linux LVM
>>
>> Disk /dev/hdd: 163.9 GB, 163928604672 bytes
>> 255 heads, 63 sectors/track, 19929 cylinders
>> Units = cylinders of 16065 * 512 = 8225280 bytes
>>
>>       Device Boot      Start         End      Blocks   Id  System
>> /dev/hdd1   *           1          13      104391   83  Linux
>> /dev/hdd2              14       19929   159975270   8e  Linux LVM
>>
>> Disk /dev/sda: 81.9 GB, 81964302336 bytes
>> 255 heads, 63 sectors/track, 9964 cylinders
>> Units = cylinders of 16065 * 512 = 8225280 bytes
>>
>>       Device Boot      Start         End      Blocks   Id  System
>> /dev/sda1               1        9964    80035798+   7  HPFS/NTFS
>>
>>
> For working with LVM's, I've found that the "system-config-lvm" GUI tool
> is excellent. It's really great for when I want to reduce a logical
> volume, since it handles resizing both the file system and the volume
> group for you).
>
> It will display all of your drives/partitions and let you adjust them
> for what you describe.
>
> Please take a look at it and feel free to post any questions.
>
> Charlie
>
> P.S. I'm a Unix Admin, so I love the command line ... this is one of the
> few times where I recommend a GUI tool over typing the commands.
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
>
I am off for a ten day trip, but when I return I'll take a look 
at it.

Todd

-- 
Ariste Software
Petaluma, CA 94952

http://www.aristesoftware.com