Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1257
  • Last Modified:

Extend Volume using LVM is a logical volume manager


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
mce-man-it
Asked:
mce-man-it
  • 7
  • 6
  • 3
  • +1
1 Solution
 
Monis MontherSystem ArchitectCommented:
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
 
l4ncel0tCommented:
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
 
upanwarCommented:
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
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
mce-man-itAuthor Commented:
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
 
upanwarCommented:
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
 
mce-man-itAuthor Commented:
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
 
Monis MontherSystem ArchitectCommented:
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
 
mce-man-itAuthor Commented:
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
 
upanwarCommented:
Please provide the output of
pvscan
vgdisplay
fdisk -l
0
 
mce-man-itAuthor Commented:
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
 
Monis MontherSystem ArchitectCommented:
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
 
upanwarCommented:
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
 
mce-man-itAuthor Commented:
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
 
upanwarCommented:
yes
0
 
mce-man-itAuthor Commented:
thanks upanwar
0
 
mce-man-itAuthor Commented:
I will take this and left you know how it goes.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

  • 7
  • 6
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now