On Sat, 2006-12-23 at 15:04 -0500, Kamaraju Kusumanchi wrote: > On Friday 22 December 2006 17:09, Kamaraju Kusumanchi wrote: > > I heard lvm can be used to have partitions whose sizes can be changed over > > time in non-destructive way as far as the data is concerned. > > > > Another basic question regarding the use of lvm. If I have traditionally > partitioned harddrive running debian Etch, can I make those partitions use > lvm without loosing any data? I have been reading the HOWTO at > http://www.tldp.org/HOWTO/LVM-HOWTO/ and it does not mention whether all > these commands vgcreate etc., work destructively or non-destructively. > > Any ideas?
Better have backups. The answer is DESTRUCTIVELY. pvcreate causes the Physical Volume to be "made ready for LVM' which means... wipeout anything there and clear it for use. vgcreate just put the pv you just created into a volume group. lvcreate then carves out logical volumes for you to use as filesystems or the like. Examples: princess:~# pvdisplay --- Physical volume --- PV Name /dev/sda1 VG Name miscVG PV Size 279.47 GB / not usable 0 Allocatable yes (but full) PE Size (KByte) 4096 Total PE 71545 Free PE 0 Allocated PE 71545 PV UUID fpBbEs-ZWAk-mfFQ-5fo2-HXzG-RUZ1-f3x1QE --- Physical volume --- PV Name /dev/sdb1 VG Name miscVG PV Size 279.47 GB / not usable 0 Allocatable yes (but full) PE Size (KByte) 4096 Total PE 71545 Free PE 0 Allocated PE 71545 PV UUID HqnFyL-scsV-8s6h-aaE3-KFMH-5J20-mEcK7Q --- Physical volume --- PV Name /dev/hdh1 VG Name miscVG PV Size 189.91 GB / not usable 0 Allocatable yes (but full) PE Size (KByte) 4096 Total PE 48618 Free PE 0 Allocated PE 48618 PV UUID sKP0S0-tJpj-okFQ-Zuo3-Deu5-rIkB-ppm0px princess:~# vgdisplay --- Volume group --- VG Name miscVG System ID Format lvm2 Metadata Areas 3 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 1 Max PV 0 Cur PV 3 Act PV 3 VG Size 748.86 GB PE Size 4.00 MB Total PE 191708 Alloc PE / Size 191708 / 748.86 GB Free PE / Size 0 / 0 VG UUID D2mpF3-G9Ax-Awb0-hr8L-w23Q-P2Ta-Qbimm9 princess:~# lvdisplay --- Logical volume --- LV Name /dev/miscVG/usrlocalLV VG Name miscVG LV UUID K7a0Dk-N5kp-NRP6-t0SW-lpuZ-k3AS-pSHSKp LV Write Access read/write LV Status available # open 1 LV Size 748.86 GB Current LE 191708 Segments 3 Allocation inherit Read ahead sectors 0 Block device 254:0 princess:~# df /usr/local Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/miscVG-usrlocalLV 785104896 288249284 496855612 37% /usr/local Hope that helps. -- greg, [EMAIL PROTECTED] The technology that is Stronger, better, faster: Linux
signature.asc
Description: This is a digitally signed message part