Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
[root@localhost ~]# vgdisplay
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 2.88 GB
PE Size 32.00 MB
Total PE 92
Alloc PE / Size 92 / 2.88 GB
Free PE / Size 0 / 0
VG UUID IQj7ho-fYeh-Le0g-RNvf-dVJ7-7W2i-jmICey
[root@localhost ~]#
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 ~]#
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.