[CentOS] How to add a HD to a LVM

Sun May 8 22:03:52 UTC 2011
Ken Smith <kens at kensnet.org>


Todd Cary wrote:
> On 5/8/2011 7: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
>>
>>
>>      
> Whether I use the lvm command line or the GUI, I am not sure if I
> am suppose to remove the logical first as in
>
> lvm lvremove LogVol01
>
> Using the GUI, I get
>
> Logical volume LogVol01 contains swap filesystem. All data on it
> will be lost! Are you quite certain that you wish to remove
> logical volume LogVol01?
>
>    

Before you delete any LV's could you please post what the result of the 
"mount" command says.

Thanks, Ken



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.