your_shadow03 |
12-15-2009 04:46 AM |
Thanks evo2 that was superb docs.
I followed the link and am now stuck at the resizing point.
Ho can I do it online.
Code:
ADDING A NEW SPACE TO LVM
----------------------------------------------------
[root@localhost ~]# fdisk /dev/sdb
Command (m for help): p
Disk /dev/sdb: 6442 MB, 6442450944 bytes
255 heads, 63 sectors/track, 783 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-783, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-783, default 783): +300MB
Command (m for help): p
Disk /dev/sdb: 6442 MB, 6442450944 bytes
255 heads, 63 sectors/track, 783 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 37 297171 83 Linux
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (38-783, default 38): 37
Value out of range.
First cylinder (38-783, default 38):
Using default value 38
Last cylinder or +size or +sizeM or +sizeK (38-783, default 783): +300
Command (m for help): p
Disk /dev/sdb: 6442 MB, 6442450944 bytes
255 heads, 63 sectors/track, 783 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 37 297171 83 Linux
/dev/sdb2 38 338 2417782+ 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@localhost ~]# fdisk /dev/sdb
Command (m for help): p
Disk /dev/sdb: 6442 MB, 6442450944 bytes
255 heads, 63 sectors/track, 783 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 37 297171 83 Linux
/dev/sdb2 38 338 2417782+ 83 Linux
Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)
Command (m for help): p
Disk /dev/sdb: 6442 MB, 6442450944 bytes
255 heads, 63 sectors/track, 783 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 37 297171 8e Linux LVM
/dev/sdb2 38 338 2417782+ 83 Linux
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 8e
Changed system type of partition 2 to 8e (Linux LVM)
Command (m for help): p
Disk /dev/sdb: 6442 MB, 6442450944 bytes
255 heads, 63 sectors/track, 783 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 37 297171 8e Linux LVM
/dev/sdb2 38 338 2417782+ 8e Linux LVM
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@localhost ~]#
[root@localhost ~]# pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created
[root@localhost ~]# pvcreate /dev/sdb2
Physical volume "/dev/sdb2" successfully created
[root@localhost ~]# fdisk -l
Disk /dev/sda: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 391 3036285 8e Linux LVM
Disk /dev/sdb: 6442 MB, 6442450944 bytes
255 heads, 63 sectors/track, 783 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 37 297171 8e Linux LVM
/dev/sdb2 38 338 2417782+ 8e Linux LVM
[root@localhost ~]# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name VolGroup00
PV Size 2.90 GB / not usable 21.12 MB
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 92
Free PE 0
Allocated PE 92
PV UUID 3SFLy5-8aup-WXuH-EGj0-V2Zz-jqq1-fqHdtM
"/dev/sdb1" is a new physical volume of "290.21 MB"
--- NEW Physical volume ---
PV Name /dev/sdb1
VG Name
PV Size 290.21 MB
Allocatable NO
PE Size (KByte) 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID 1lZhYP-tNoD-2wCL-5IQJ-DOe6-yK1E-eH10fR
"/dev/sdb2" is a new physical volume of "2.31 GB"
--- NEW Physical volume ---
PV Name /dev/sdb2
VG Name
PV Size 2.31 GB
Allocatable NO
PE Size (KByte) 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID EtOdWR-JfG2-l3a9-V6eg-haLY-1jO0-myL80M
[root@localhost ~]#
[root@localhost ~]# vgextend VolGroup00-LogVol00 /dev/sdb1
Volume group "VolGroup00-LogVol00" not found
[root@localhost ~]# vgextend VolGroup00 /dev/sdb1
Volume group "VolGroup00" successfully extended
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
2.4G 2.1G 125M 95% /
/dev/sda1 99M 9.5M 85M 11% /boot
none 125M 0 125M 0% /dev/shm
[root@localhost ~]# vgextend VolGroup00 /dev/sdb2
Volume group "VolGroup00" successfully extended
[root@localhost ~]# pvscan
PV /dev/sda2 VG VolGroup00 lvm2 [2.88 GB / 0 free]
PV /dev/sdb1 VG VolGroup00 lvm2 [288.00 MB / 288.00 MB free]
PV /dev/sdb2 VG VolGroup00 lvm2 [2.28 GB / 2.28 GB free]
Total: 3 [5.44 GB] / in use: 3 [5.44 GB] / in no VG: 0 [0 ]
[root@localhost ~]#
|