Quote:
Originally Posted by ic_torres
i have set up my LV partitions to /dev/hdc5 -- for my root
/dev/hdc10 -- for usr and /dev/hdc11 for home
/dev/hdc --- my entire HD
|
I'm a bit confused - you say you have set up LV's on hdc5, 10 and 11 but you haven't yet created any PV's so creating LV's is impossible.
What I
think you want to do is:
use all of hdc for LVM and create VG's for /usr, /home and / (root).
If this is wrong, I'll probably be sending you the wrong way!
Anyway, just to run through from the beginning... you need to partition your disk before trying to create anything to do with LVM.
So, using fdisk (or cfdisk if you prefer), create one huge partition and change its type from 83 (linux partition) to 8e (linux LVM partition). In your case this will make /dev/hdc1 and it will cover the whole disk.
If you want to make any swap space or regular partitions that
aren't in LVM, do them here and adjust the following accordingly.
Do 'pvcreate' on hdc1.
Then do 'vgcreate' to make your big VG e.g. vgcreate vg00 /dev/hdc1.
Then make your various LV's e.g. lvcreate -n usr -L 5G vg00.
I honestly can't remember now if you have to format the LV's (with ext2/3, xfs, reiserfs, etc) or whether that gets done for you in 'setup'.
---------------------
To give you some context, here's my setup (one 500GB SATA disk). It may help, it may not!!
Code:
root@slack# fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 12 96358+ 83 Linux
/dev/sda2 13 136 996030 82 Linux swap
/dev/sda3 137 260 996030 83 Linux
/dev/sda4 261 60801 486295582+ 8e Linux LVM
My sda1 is real small and contains /boot (I like to keep kernels on their own, don't know why!). It is ext2.
sda2 is swap. sda3 is / (root) and is ext3.
sda4 is for my PV.
Code:
root@slack# pvdisplay
--- Physical volume ---
PV Name /dev/sda4
VG Name vg
PV Size 463.77 GB / not usable 0
Allocatable yes
PE Size (KByte) 4096
Total PE 118724
Free PE 107716
Allocated PE 11008
PV UUID 2YIEMm-Nkhq-qClp-B2WE-KkCr-jFmq-UFsq0L
This is the only PV in my VG.
Code:
root@slack# vgdisplay
--- Volume group ---
VG Name vg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 6
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 4
Open LV 4
Max PV 0
Cur PV 1
Act PV 1
VG Size 463.77 GB
PE Size 4.00 MB
Total PE 118724
Alloc PE / Size 11008 / 43.00 GB
Free PE / Size 107716 / 420.77 GB
VG UUID bDmQv5-iy9Z-0iSu-oz4t-pB7w-8ym5-v0uJBT
As you can see, lots of space left!
I currently have /usr, /var, /tmp and /home set up as LV's (no need for this many, I just wanted to play!).
Code:
root@slack# lvdisplay
--- Logical volume ---
LV Name /dev/vg/usr
VG Name vg
LV UUID Q3Jc1T-MQRh-60ZH-hEwO-OVVy-WN89-Ov2bPW
LV Write Access read/write
LV Status available
# open 1
LV Size 5.00 GB
Current LE 1280
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:0
--- Logical volume ---
LV Name /dev/vg/var
VG Name vg
LV UUID ReV7nw-mTdd-L0jG-jaix-GImy-p8G9-6YP3em
LV Write Access read/write
LV Status available
# open 1
LV Size 3.00 GB
Current LE 768
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:1
--- Logical volume ---
LV Name /dev/vg/tmp
VG Name vg
LV UUID ACG9tL-mL2d-Y2XW-NfBK-8lZp-DLVE-X6IJ5Z
LV Write Access read/write
LV Status available
# open 1
LV Size 5.00 GB
Current LE 1280
Segments 2
Allocation inherit
Read ahead sectors 0
Block device 253:2
--- Logical volume ---
LV Name /dev/vg/home
VG Name vg
LV UUID 0xajHB-9ftd-Vymf-pciW-CwE6-UVM3-528exF
LV Write Access read/write
LV Status available
# open 1
LV Size 30.00 GB
Current LE 7680
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:3
You can see /tmp uses 2 segments. That's because I already grew it once from 2GB to 5GB. All my LV's are formatted with XFS so to grow I simply use 'lvextend' and 'xfs_growfs'.
Sorry for the huge post, hope this helps!