Solved

Extend Volume using LVM is a logical volume manager

Posted on 2011-02-17
17
1,242 Views
Last Modified: 2012-06-22

Hi,

I would like to extend a Volume using LVM is a logical volume manager on my RAID.

I’m I right in thinking; If I go in to the Logical Volume management, select the logical volume, click edit and increase the bar below and press OK. It will increase my disk space?
Do you know if it will require a reboot?

Has any one done this before on live production data? and did it go all OK?


Thanks,

LVM.png
0
Comment
Question by:mce-man-it
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
  • 3
  • +1
17 Comments
 
LVL 14

Expert Comment

by:Monis Monther
ID: 34917705
I have done it many times and all goes well BUT I have never used the LVM manager I always depend on the command line and its very easy

Provide more info and I will post the commands for you.

Dont forget you need to resize the filesystem also to ocupy the new extended space (this is easy).

No reboot is required and you can do it live without unmounting.
0
 
LVL 4

Expert Comment

by:l4ncel0t
ID: 34917970
You can extend online, no need to umount the filesytem or to reboot the server.
check the fs size before and after to be sure everything is ok.
Shrinking can't be done online, you need to umount de fs before.
0
 
LVL 12

Expert Comment

by:upanwar
ID: 34918308
For shrinking you need to unmount the FS and for precaution you should keep the backup as well. For extending the volume no need to unmount the FS and reboot is also not required.

But be careful while extending or reducing the FS. Because I have bad experience with both the situation. My one colleague have curropted the complete FS with 2 TB data while extending the FS so be careful in both the situation.

cheers...
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:mce-man-it
ID: 34924140
Hi all,

Thanks for your reponse.

I do not know linux code. That why I wanted to use a gui.

Is there a step by step guide I can follow anywhere?

Also what do you mean I have to resize the filesystem also to ocupy the new extended space? is that not what Im doing?

Thanks,
0
 
LVL 12

Expert Comment

by:upanwar
ID: 34924387
You need to resize the filesystem also to occupy the the new extended space.

It is like you have created a partition but you need to format that to get in use. Same thing is here once you extend the LVM, it increase the physical size but to get that extended partion logically you need to resize the filesyatem.

Please provide more details about the layout, FStype, then we will paste the commands accordingly.

0
 
LVL 12

Expert Comment

by:upanwar
ID: 34924414
0
 

Author Comment

by:mce-man-it
ID: 34924580
Hi,

That would be great if you can tell me the commands.

The RAID is a united digital raid.
24TB
Format: lmz2
Attributes: wz—n-
Volume Group Size: 19.10TB
Available: 3.47TB

We have 2 Logical Volumes:
/Archive – File system Ext3
/RAID      – File system Ext3

There is around 3.47TB of  unused space.

I want to increase the size of the Archive volume. I.E by 3.4TB.

Do you know long the increase will take? and is it possible for users to carry on using the server, while the increasing is happening? i.e. connecting to the /RAID volume?

Thanks,
0
 
LVL 14

Expert Comment

by:Monis Monther
ID: 34924740
1- To be honest I have not grown a Logicl volume by Tera Bytes of space, Giga Bytes take a few seconds.

2- Yes people should be able to continue to work normally on the disk while increasing the size

3- An ext3 filesystem has a limit for the maximum Partition size to be 16TB in case of a 4K block size. How big is your /RAID now. Please post the output of the command

df  -h

Also post the output of the command

vgdisplay


0
 

Author Comment

by:mce-man-it
ID: 34925114
Here the df -h output

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/hyperstar00-xinet                  917G  508G  363G  59% /Applications
/dev/mapper/hyperstar01-Archive                      5.8T  5.2T  380G  94% /Archive
/dev/mapper/hyperstar01-RAID                   9.7T  5.7T  3.5T  62% /RAID

So I want to increase the size of the Archive volume. I.E by 3.4TB.

Thanks,
0
 
LVL 12

Expert Comment

by:upanwar
ID: 34925150
Please provide the output of
pvscan
vgdisplay
fdisk -l
0
 

Author Comment

by:mce-man-it
ID: 34925300
df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      131G   49G   75G  40% /
/dev/cciss/c0d0p1      99M   20M   75M  21% /boot
tmpfs                 5.9G  8.0K  5.9G   1% /dev/shm
/dev/mapper/dbvolume-dbvolume
                      550G  256G  267G  49% /volumes/dbvol
/dev/mapper/hyperstar00-xinet
                      917G  508G  363G  59% /Applications
/dev/mapper/hyperstar01-Archive
                      5.8T  5.2T  380G  94% /Archive
/dev/mapper/hyperstar01-RAID
                      9.7T  5.7T  3.5T  62% /RAID
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

pvscan

 PV /dev/cciss/c0d1     VG dbvolume      lvm2 [558.73 GB / 0    free]
  PV /dev/sdb            VG hyperstar01   lvm2 [2.00 TB / 0    free]
  PV /dev/sdc            VG hyperstar01   lvm2 [2.00 TB / 0    free]
  PV /dev/sdf            VG hyperstar01   lvm2 [2.00 TB / 0    free]
  PV /dev/sdd            VG hyperstar01   lvm2 [2.00 TB / 0    free]
  PV /dev/sde            VG hyperstar01   lvm2 [2.00 TB / 239.86 GB free]
  PV /dev/sdg            VG hyperstar01   lvm2 [2.00 TB / 0    free]
  PV /dev/sdh            VG hyperstar01   lvm2 [2.00 TB / 0    free]
  PV /dev/sdi            VG hyperstar01   lvm2 [2.00 TB / 143.92 GB free]
  PV /dev/sdj            VG hyperstar01   lvm2 [2.00 TB / 2.00 TB free]
  PV /dev/sdk            VG hyperstar01   lvm2 [1.10 TB / 1.10 TB free]
  PV /dev/cciss/c0d0p2   VG VolGroup00    lvm2 [136.56 GB / 0    free]
  PV /dev/sda            VG hyperstar00   lvm2 [931.32 GB / 0    free]
  Total: 13 [20.69 TB] / in use: 13 [20.69 TB] / in no VG: 0 [0   ]

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

vgdisplay

 --- Volume group ---
  VG Name               dbvolume
  System ID            
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  2
  VG Access             read/write
  VG Status             resizable
  MAX LV                256
  Cur LV                1
  Open LV               1
  Max PV                256
  Cur PV                1
  Act PV                1
  VG Size               558.73 GB
  PE Size               4.00 MB
  Total PE              143035
  Alloc PE / Size       143035 / 558.73 GB
  Free  PE / Size       0 / 0  
  VG UUID               i7au2T-95Jg-6dZE-zsIN-SFQF-eVjF-elitFp
   
  --- Volume group ---
  VG Name               hyperstar01
  System ID            
  Format                lvm2
  Metadata Areas        10
  Metadata Sequence No  28
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                10
  Act PV                10
  VG Size               19.10 TB
  PE Size               4.00 MB
  Total PE              5006766
  Alloc PE / Size       4096000 / 15.62 TB
  Free  PE / Size       910766 / 3.47 TB
  VG UUID               bHDo0K-NbHg-dgbm-7dGv-gerx-aQt8-ur8TT9
   
  --- 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               136.56 GB
  PE Size               32.00 MB
  Total PE              4370
  Alloc PE / Size       4370 / 136.56 GB
  Free  PE / Size       0 / 0  
  VG UUID               5zhmBu-Js40-R6Rn-xKzJ-NUjo-crZc-mSHOaQ
   
  --- Volume group ---
  VG Name               hyperstar00
  System ID            
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  2
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               931.32 GB
  PE Size               4.00 MB
  Total PE              238418
  Alloc PE / Size       238418 / 931.32 GB
  Free  PE / Size       0 / 0  
  VG UUID               7YTJZe-nfWb-iXLA-cGT3-Ekj2-j8Bi-CQFKIM


------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

fdisk -l

Disk /dev/cciss/c0d0: 146.7 GB, 146778685440 bytes
255 heads, 63 sectors/track, 17844 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

           Device Boot      Start         End      Blocks   Id  System
/dev/cciss/c0d0p1   *           1          13      104391   83  Linux
/dev/cciss/c0d0p2              14       17844   143227507+  8e  Linux LVM

Disk /dev/cciss/c0d1: 599.9 GB, 599932581888 bytes
255 heads, 32 sectors/track, 143595 cylinders
Units = cylinders of 8160 * 512 = 4177920 bytes

           Device Boot      Start         End      Blocks   Id  System

Disk /dev/sda: 999.9 GB, 999998095360 bytes
255 heads, 63 sectors/track, 121576 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

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

Disk /dev/sdb: 2198.9 GB, 2198998089728 bytes
255 heads, 63 sectors/track, 267346 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

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

Disk /dev/sdc: 2198.9 GB, 2198998089728 bytes
255 heads, 63 sectors/track, 267346 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

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

Disk /dev/sdd: 2198.9 GB, 2198998089728 bytes
255 heads, 63 sectors/track, 267346 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

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

Disk /dev/sde: 2198.9 GB, 2198998089728 bytes
255 heads, 63 sectors/track, 267346 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

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

Disk /dev/sdf: 2198.9 GB, 2198998089728 bytes
255 heads, 63 sectors/track, 267346 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

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

Disk /dev/sdg: 2198.9 GB, 2198998089728 bytes
255 heads, 63 sectors/track, 267346 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

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

Disk /dev/sdh: 2198.9 GB, 2198998089728 bytes
255 heads, 63 sectors/track, 267346 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

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

Disk /dev/sdi: 2198.9 GB, 2198998089728 bytes
255 heads, 63 sectors/track, 267346 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

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

Disk /dev/sdj: 2198.9 GB, 2198998089728 bytes
255 heads, 63 sectors/track, 267346 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

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

Disk /dev/sdk: 1208.9 GB, 1208954126336 bytes
255 heads, 63 sectors/track, 146980 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdk doesn't contain a valid partition table
0
 
LVL 14

Expert Comment

by:Monis Monther
ID: 34925397
OK From the output of df -h

/dev/mapper/hyperstar01-RAID
                      9.7T  5.7T  3.5T  62% /RAID

it seems that your /RAID belongs to the hyperstar01 VG and from the output of vgdisplay

 Free  PE / Size       910766 / 3.47 TB

It shows that you have arround 3.47TB of free space on this VG that you can expand your volume.

Ok now finally we need the LogicalVolume name that needs to be expanded. Please post the output of

lvdisplay /dev/hyperstar01/RAID

0
 
LVL 12

Accepted Solution

by:
upanwar earned 500 total points
ID: 34925423
lvextend -L +3481.6G /dev/hyperstar01/Archive   (It will extend the LV, since vg is already having free space)

resize2fs /dev/hyperstar01/Archive (It will resize the FS)

After this just type df-h

you will get the FS with new size.

0
 

Author Comment

by:mce-man-it
ID: 34925488
So in terminal I need to type:

# lvextend -L +3481.6G /dev/hyperstar01/Archive              ENTER

# resize2fs /dev/hyperstar01/Archive                                  ENTER

# df-h

Is this correct?
0
 
LVL 12

Expert Comment

by:upanwar
ID: 34925519
yes
0
 

Author Comment

by:mce-man-it
ID: 34926003
thanks upanwar
0
 

Author Comment

by:mce-man-it
ID: 34926011
I will take this and left you know how it goes.
0

Featured Post

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question