Solved

Extend Volume using LVM is a logical volume manager

Posted on 2011-02-17
17
1,237 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
  • 7
  • 6
  • 3
  • +1
17 Comments
 
LVL 14

Expert Comment

by:small_student
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:mce-man-it
Comment Utility
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
Comment Utility
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
Comment Utility
0
 

Author Comment

by:mce-man-it
Comment Utility
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:small_student
Comment Utility
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:mce-man-it
Comment Utility
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
Comment Utility
Please provide the output of
pvscan
vgdisplay
fdisk -l
0
 

Author Comment

by:mce-man-it
Comment Utility
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:small_student
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
yes
0
 

Author Comment

by:mce-man-it
Comment Utility
thanks upanwar
0
 

Author Comment

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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

771 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now