[linux-lvm] Newbie of LVM

Matthew Gillen me at mattgillen.net
Fri Dec 9 19:42:11 UTC 2005


Matthew Gillen wrote:
> Way Loss wrote:
> 
>>Hi all,
>>
>>   I am very new to LVM. Here is the detail of my
>>current fs.
>>Filesystem            Size  Used Avail Use% Mounted on
>>/dev/md1              9.4G  2.5G  6.5G  28% /
>>/dev/md2              9.4G  7.6G  1.4G  85% /home
>>/dev/md3              9.4G  6.6G  2.4G  74% /var
>>/dev/md4              958M   18M  892M   2% /tmp
>>/dev/md5              153G  119G   27G  82% /www
>>
>>    My md5 is almost full and I wanna use LVM to merge
>>my md5 with a new partition from a new hdd. I wanna
>>ask if this possible for LVM to merge 2 partition
>>together while one of them have data on it? I can't
>>suffer any data loss and want to make sure that LVM
>>works perfectly to what I want.
>>   Thanks all.
> 
> 
> You're out of luck.  You can't take an existing partition and keep the
> data yet switch it over to LVM.  It's like RAID that way: you need to
> set up the lower level stuff *before* you format the disk/partition with
> your filesystem and start putting data on it.
> 
> To do what you want is possible, provided that you created an LVM from
> the beginning that had md5 as a PhysicalVolume, then created your
> filesystem on the Logical Volume.  But it seems clear from your fstab
> that you didn't do that.

Well, you're not totally out of luck, assuming the other disk is as big
or bigger than /dev/md5:
You could create an LVM with the new disk, create your filesystem, copy
the contents of md5 to the new LVM filesystem (via tar/cpio or something
that will preserve symlinks etc), then add md5 to the LVM setup (thereby
destroying the data on md5) and resize your filesystem.
--Matt




More information about the linux-lvm mailing list