Download as pdf
Download as pdf
You are on page 1of 1
QO Geo Atroy Blog successivos: Grea blog Entra REDHAT ENTERPRISE LINUX ADMIN L coycses poses se Esercizio Extend LVM logical volume and resize file (old and new way) per la Mente Starting with Redhat Bateprie nm 6.2 (and Gentos 6.2, we can row extenda Logical vchume in LYM andat thecame time resize te flesyster inthe same command, video pitt Questo é ill mportante che Previously, cncea Logical volume is extended, youxsed to ran es resizeais to then extend filesystem until which the system willnot, Vedra 0: beable tosee the extended space inthe logical volume. iuardalo ora ‘This cen mow be achieved in the same command as"Ivextend! vsing the 7" (~resizels) Letseee hon ye dothis theo wayand the new way >) LoMiwas Huy, Thavo ali luo clldrpotata wich ia ine [root@rhelmaster -]é Ivdisplay Logical volume LYPath ——dev/repe/repodata L¥Mame ——_repodata VGWame repo LY GUID dE DaTy-kwgsdVeortgelBntit-gfot-Vouen Lv Write Access read/orite LY Greation host, time rhelmaster, 2013-01-18 16:04:32 -0800 Lvstatus available form 3 LW Sis 9.0018 CurrentLE — agoa Segments ovine! Allovation inherit 2136 Read ahead sectors auto Y February ceurvantly sett 256 Block devise 2530 ‘This volume haste file apstens yuminape mounted a flewst [root@rholmaster ~1# df-h /yumrepo aac Filesystem Size Used Avail Use Mounted on » (Mov mapper /repo-repodata 8.90 7.66 985M Bo% /sumrepo Chscking the Volume group repo, Lees [can ancther aGB to this vyolume: lroot@rhelmaster ~]# epdisplay ~ Volume group — WGName repo System ID Format Irma Metadata Areas Metadate Sequence No = VGaccess —read/urite VGSistus resizable MAKLY 8 cul OpenbY MaxPy oo cuey a aotPY Gace 10.00GiB PESio «00M ToulPE 2559 AllooFE /Size 2904 /9.006i8 Free PE/Size 255 (2020.00 YGUUID —LQgu¥-2Aax-DePe-azo(l-Zqa0-ENel-2uSZUP cok, Lets extend the Lagical velume repo with that GR. Pye used allthe available Pis(2g5) to expend the volume, [root@rhelmaster -]# Ivestend-1 +255 /dev/repo fropodata -Extanding logical volume repodata to 10.00 GiB Logical volume repodata successfully rsizod As yousse the il systema hast picked up thenew size yats [root@rhelmaster ~]# df-h jyumrepo/ Filesystem Size Used Avail sss Miounted on (a mapper repo-repedata B.9G 7.86 985M 89% fyumrepo Now, woll resize and you should 0a the now sizo forthe fle systom [root@rhelmaster -]# resizoufs /Jov/ropo/repodata esineaiea.quiaa(a7-May-2010) [ileeystem at (elev /repocepodata is mounted om /ymrepa, ‘online resizing naquined old dase_Hoeks = 1,new dese blocks <1 Penforening an online veize of /deu /repefoepodata ta 2620435 (20 blocks, The filesystem on /dev /repo/vepodata isnow sé20q1s blocks Jong. [root@rhelmaster ~1# df-h /yumrepo/ Filesystem Size Used Avail Use%Mounted on (Mav mapper frepo-repodata 9.98 7.96 1.56 80% /yumrepo ‘Asthe Volume groupnow kas un ont of pace, Tve added a new 106 disktothe server. Wel format and useit ro extend the Volumegroup Format the disk [root@rhelmaster ~]# [disk-cu /lev/sde Device contains nether a valid DCS partition table, nor Sun, SOT or OSF disHabl Building a new DOS dishlabsl with dick identifier cxcessbega. [Changet will remain in memory ony, umnel you decide towrite them, After that, of course, the previens content wont be recoverable. ‘arning: invalid flag oxooos ofpartion table q willbe eorrooted by wore) Command (for belp)s 1 Commandaction = wetended p primary pattition (-4) P Partition mumber (1eql: 4 First sector C2oqthz0e7519, default 204) ‘Using defsult value 2043 Lastecctor, +scotors or sak M,C (2048-zos7agu9, default souyagaak: ‘Using delzult value 20973539 Command Gn forbelp)st Selected partition 2 Hex code [type Lta list code): Ba (Changed system type of partition «to Ba (Linx LYM) Command (m fr belpyep Disk ev odes 19.7 GE, 2279 74sBaqo bytes 107 heads, 17 beaters track, sa5c9 aylindars, total 20871520 sectors nite seston of * sie = gaa bytes Sactor sie logical/phivsice) az bytes / saz bytes 1/0 size (eninimum optimal) gr2bytes / 512 bytes Diskidentifer: oxcepsboge Device Boot Start End Bleeks 1d System (Mevisdes 20g 2og7igi9 toqBa7g6 Be Linux LYM Command (m forkelp):w ‘The partition table has been altered! Calling itl) to ne-wed partition table, Make ita LVM Physical volume [root @rhelmaster ~]# pvcreate /dew/sdex ‘Writing physical volume dats to disk! fdev ses" Physical volume (dev sds" successfully created Extend the LVM Volume group [root@rhelmaster ~]# vgestend repo /dev/sdex ‘Welume group "repo! successfully extended and voles got the added 1008 inthe LVM volume group repo lroot@rhelmaster ~]# epdisplay —Velume group — YGWame repo System 1D Format Tema Matadta Ares 2 Matadata Sequence No 6 WG aooase read mite GStatue resizable MARLY oo curl Openty MexPY oo carey actPY 2 VGSize 19. 99GiE PESco «00 MiB TowlPE 5128 AllooFE /Siz02559/ 10.00GiB Frov PE/Size 2969 /10.000i8 YGUUID ——LQguw¥-2Aax-DePe-az0ll-Zqa0-ENel-2uSZUP Extend the Logical Volume Lats filly allocate this to extend the LVM logical volume repovdate and resi he Fin the same comand: [root@rhelmaster -1# Ivestend 1 +2559- /dev/repo fropodata -Extanding logical volume repodata to 29.09 GB ed eee 5240892 (40d blocks, The filesystem on /dev/mapper/repo-repodats isnow 5240832 Dlocksleng. And there you go, the ilesystem axtendad and can see the full, ‘2008 allocated to the Logical volume [root@rhelmaster ~]# df-h /yumrepo Filesystem Size Used Avail Uso%Mounted on (daw mapper repo-repedata 208 7.9 12 go fpumrepo NO COMMENTS LINKS TO THIS POST. Subscribe to: Rost Comraents (tem) Start Download (>)

You might also like