LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-10-2007, 10:15 AM   #1
madunix
LQ Newbie
 
Registered: Oct 2003
Posts: 25

Rep: Reputation: 0
expand LVM


I have created a vol. group on the entire /dev/sda device (HardwareRaid1) on 2x73GB with the following scheme am using native multipath:
[root@linux1 log]# df -kh
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
59G 2.4G 54G 5% /
/dev/sda1 99M 17M 77M 19% /boot
tmpfs 7.9G 0 7.9G 0% /dev/shm
/dev/dm-3 50G 180M 47G 1% /ftp3
/dev/dm-4 50G 180M 47G 1% /ftp4
/dev/dm-2 50G 180M 47G 1% /ftp2
what you recommend to extend vol. group with an attached LUN from the FC SAN.
do I need to unmount my LogVol00 before I add the /dev/dm-3..etc
[root@linux1 log]# fdisk -l

Disk /dev/sda: 72.7 GB, 72746008576 bytes
255 heads, 63 sectors/track, 8844 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 8844 70935007+ 8e Linux LVM

Disk /dev/sdb: 53.6 GB, 53687091200 bytes
64 heads, 32 sectors/track, 51200 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdd: 53.6 GB, 53687091200 bytes
64 heads, 32 sectors/track, 51200 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sdd doesn't contain a valid partition table

Disk /dev/sdf: 53.6 GB, 53687091200 bytes
64 heads, 32 sectors/track, 51200 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sdf doesn't contain a valid partition table

Disk /dev/sdh: 53.6 GB, 53687091200 bytes
64 heads, 32 sectors/track, 51200 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sdh doesn't contain a valid partition table

Disk /dev/sdj: 53.6 GB, 53687091200 bytes
64 heads, 32 sectors/track, 51200 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sdj doesn't contain a valid partition table

Disk /dev/sdl: 53.6 GB, 53687091200 bytes
64 heads, 32 sectors/track, 51200 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sdl doesn't contain a valid partition table

Disk /dev/dm-2: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-2 doesn't contain a valid partition table

Disk /dev/dm-3: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-3 doesn't contain a valid partition table

Disk /dev/dm-4: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-4 doesn't contain a valid partition table
[root@linux1 log]#

[root@linux1 log]# lvdisplay
/dev/sdc: read failed after 0 of 4096 at 0: Input/output error
/dev/sde: read failed after 0 of 4096 at 0: Input/output error
/dev/sdg: read failed after 0 of 4096 at 0: Input/output error
/dev/sdi: read failed after 0 of 4096 at 0: Input/output error
/dev/sdk: read failed after 0 of 4096 at 0: Input/output error
/dev/sdm: read failed after 0 of 4096 at 0: Input/output error
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID 9T9BcN-p9F9-UmNi-HvBt-vKqg-3nyw-rIhYBa
LV Write Access read/write
LV Status available
# open 1
LV Size 60.81 GB
Current LE 1946
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:0

--- Logical volume ---
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV UUID Mo7hqB-lP3y-ZzsI-EJ3d-RK9q-MpLi-6kUVry
LV Write Access read/write
LV Status available
# open 1
LV Size 6.81 GB
Current LE 218
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:1


my OS RHEL 5
2.6.18-8.1.15.el5 #1 SMP Thu Oct 4 04:06:39 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
 
Old 11-11-2007, 02:06 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
lvdisplay = Show Logical Volumes (LVs) - Does NOT show Volume Groups (VGs).

vgdisplay = Show VGs

If you want to add to a VG rather than an LV you do NOT need to unmount anything. You need to:

pvcreate <disk or partition>
vgextend <vgname> <disk or partition from prior step>

You can then create new LV using the increased space with:
lvcreate <options>
-OR- You can increase an existing LV using
lvextend <options>

Note that the LV is the "device" on which the "filesystem" is created. That is to say simply creating an LV doesn't make a filesystem so you have to use a command like mkfs to make a new filesystem on the LV. Depending on filesystem type there may be a way to extend the existing filesystem if you're trying to do lvextend and then extend the FS. (Do NOT run mkfs on an existing filesystem - it will overwrite what is there.)

You can type "man <command>" for the commands mentioned above to get more details on exact usage.
 
Old 11-12-2007, 01:04 AM   #3
madunix
LQ Newbie
 
Registered: Oct 2003
Posts: 25

Original Poster
Rep: Reputation: 0
[root@linux1 ~]# fdisk -l

Disk /dev/sda: 72.7 GB, 72746008576 bytes
255 heads, 63 sectors/track, 8844 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 8844 70935007+ 8e Linux LVM

Disk /dev/sdb: 53.6 GB, 53687091200 bytes
64 heads, 32 sectors/track, 51200 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Device Boot Start End Blocks Id System

Disk /dev/sde: 53.6 GB, 53687091200 bytes
64 heads, 32 sectors/track, 51200 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sde doesn't contain a valid partition table

Disk /dev/sdf: 53.6 GB, 53687091200 bytes
64 heads, 32 sectors/track, 51200 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Device Boot Start End Blocks Id System

Disk /dev/sdi: 53.6 GB, 53687091200 bytes
64 heads, 32 sectors/track, 51200 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sdi doesn't contain a valid partition table

Disk /dev/dm-2: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

Disk /dev/dm-3: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-3 doesn't contain a valid partition table
[root@linux1 ~]# df -kh
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
62G 2.5G 57G 5% /
/dev/sda1 99M 26M 69M 27% /boot
tmpfs 7.9G 0 7.9G 0% /dev/shm

[root@linux1 ~]# df -kh
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
62G 2.5G 57G 5% /
/dev/sda1 99M 26M 69M 27% /boot
tmpfs 7.9G 0 7.9G 0% /dev/shm

To extend a Volume Group and Logical Volume Group with new device mapper multipath
[root@linux1 mapper]# ls -al
total 0
drwxr-xr-x 2 root root 140 Nov 12 08:08 .
drwxr-xr-x 13 root root 4400 Nov 12 08:09 ..
crw------- 1 root root 10, 63 Nov 12 08:08 control
brw-rw---- 1 root disk 253, 2 Nov 12 08:08 mpath1
brw-rw---- 1 root disk 253, 3 Nov 12 08:08 mpath2
brw-rw---- 1 root disk 253, 0 Nov 12 08:08 VolGroup00-LogVol00
brw-rw---- 1 root disk 253, 1 Nov 12 08:08 VolGroup00-LogVol01

Can i do the following

# lvm
lvm>pvcreate /dev/mapper/mpath1
lvm>vgextend VolGroup00 /dev/mapper/mpath1
lvm>lvextend -L30G /dev/VolGroup00/LogVol00
lvm>exit

# ext2online /dev/VolGroup00/LogVol00
# df -h
 
Old 11-12-2007, 09:41 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
I'm not familiar with the "mpath" stuff - we use EMC PowerPath for multipathing rather than the native multipathing.

Do a "vgdisplay" to see which disks are in the existing volume group. Presumably you'd need the multipath master (called a pseudo-device in PowerPath) rather than the individual paths (/dev/sd...) for your pvcreate. The vgdisplay will show what you're already using as "disks" so should give a clue as to what should be used for new "disks" for pvcreate.
 
Old 11-12-2007, 10:31 AM   #5
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally Posted by jlightner View Post
lvdisplay = Show Logical Volumes (LVs) - Does NOT show Volume Groups (VGs).

vgdisplay = Show VGs

If you want to add to a VG rather than an LV you do NOT need to unmount anything. You need to:

pvcreate <disk or partition>
vgextend <vgname> <disk or partition from prior step>

You can then create new LV using the increased space with:
lvcreate <options>
-OR- You can increase an existing LV using
lvextend <options>

Note that the LV is the "device" on which the "filesystem" is created. That is to say simply creating an LV doesn't make a filesystem so you have to use a command like mkfs to make a new filesystem on the LV. Depending on filesystem type there may be a way to extend the existing filesystem if you're trying to do lvextend and then extend the FS. (Do NOT run mkfs on an existing filesystem - it will overwrite what is there.)

You can type "man <command>" for the commands mentioned above to get more details on exact usage.
Remember after running lvextend to extend an existing partition, you need to run ext2online command to actually add the new space.
 
Old 11-13-2007, 09:03 AM   #6
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Quote:
Originally Posted by trickykid View Post
Remember after running lvextend to extend an existing partition, you need to run ext2online command to actually add the new space.
Yep the OP had already figured that out as seen from his last post.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
add lvm to expand a full filesystem mariogarcia Linux - Software 3 04-27-2007 04:16 AM
LXer: Back Up (And Restore) LVM Partitions With LVM Snapshots LXer Syndicated Linux News 0 04-17-2007 11:16 AM
Help needed" Can someone expand this please heffo_j Ubuntu 4 04-02-2007 05:51 PM
Can I expand a reiserfs partition? LeftyAce Debian 4 12-13-2005 12:51 PM
ntfs expand edgefield Linux - General 6 10-23-2004 09:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration