0% found this document useful (0 votes)
103 views

Disk Format and LVM Extend

The document discusses extending storage on the lxrmststdb1 server. It provides commands to create a new partition on the /dev/emcpowerz disk using fdisk, add the partition to the existing vg01 volume group, extend the size of two logical volumes (/dev/lxrmststdb1_vg01/lv_1120 and /dev/lxrmststdb1_vg01/lv_grid) using lvextend, and resize the filesystems on both volumes using resize2fs. It then verifies the new sizes using df -h.

Uploaded by

Ram Guggul
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
103 views

Disk Format and LVM Extend

The document discusses extending storage on the lxrmststdb1 server. It provides commands to create a new partition on the /dev/emcpowerz disk using fdisk, add the partition to the existing vg01 volume group, extend the size of two logical volumes (/dev/lxrmststdb1_vg01/lv_1120 and /dev/lxrmststdb1_vg01/lv_grid) using lvextend, and resize the filesystems on both volumes using resize2fs. It then verifies the new sizes using df -h.

Uploaded by

Ram Guggul
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 9

fdisk reads from stdin so you just need to feed it the appropriate

commands. For example, the following clears the partition table,


if there is one, and makes a new one that has a single parititon
that is the; entire disk:

single or full partition


(echo o; echo n; echo p; echo 1; echo ; echo; echo w) | sudo fdisk

That creates a 200 MB partition on /dev/emcpower


(echo n; echo p; echo 1; echo 1; echo 200; echo w) | fdisk /dev/emcpower

(echo o; echo n; echo p; echo 1; echo ; echo; echo w) | fdisk /dev/emcpowerap

(echo o; echo n; echo p) | fdisk /dev/emcpowerap

p u n p 1 128 _ p q

--------------------------------------------------------------------------------
Please extend the below storage in lxrmststdb1 server and please confirm, once it
is completed.

Server Mount Point Current Size (GB) Total


Expected Size (GB)
lxrmststdb1 /app/oracle/product/11.2.0 10 20
lxrmststdb1 /app/grid 10 30

LVM format
----------
(echo p; echo u; echo p; echo n; echo p; echo 1; echo 128; echo; echo p; echo t;
echo 8e; echo p; echo w) | fdisk /dev/emcpowerz (working)

pvcreate /dev/emcpowerz1

[root@lxrmststdb1 ~]# vgs


VG #PV #LV #SN Attr VSize VFree
lxrmststdb1_vg01 1 6 0 wz--n- 59.98G 13.98G
vg00 1 7 0 wz--n- 136.50G 68.50G

vgextend lxrmststdb1_vg01 /dev/emcpowerz1

[root@lxrmststdb1 ~]# vgs


VG #PV #LV #SN Attr VSize VFree
lxrmststdb1_vg01 2 6 0 wz--n- 89.98G 43.98G
vg00 1 7 0 wz--n- 136.50G 68.50G

from /etc/fstab
---------------
/dev/lxrmststdb1_vg01/lv_grid /app/grid ext3
_netdev,defaults 1 2
/dev/lxrmststdb1_vg01/lv_1120 /app/oracle/product/11.2.0 ext3
_netdev,defaults 1 2
/dev/lxrmststdb1_vg01/lv_admin /app/oracle/admin ext3
_netdev,defaults 1 2

/dev/lxrmststdb1_vg01/lv_1120 /app/oracle/product/11.2.0

/dev/lxrmststdb1_vg01/lv_grid /app/grid

lvextend -L+10G /dev/lxrmststdb1_vg01/lv_1120

resize2fs /dev/lxrmststdb1_vg01/lv_1120

lvextend -L+20G /dev/lxrmststdb1_vg01/lv_grid

resize2fs /dev/lxrmststdb1_vg01/lv_grid

df -h
----

/dev/mapper/lxrmststdb1_vg01-lv_1120 20G 4.9G 14G 27%


/app/oracle/product/11.2.0

/dev/mapper/lxrmststdb1_vg01-lv_grid 30G 8.0G 21G 29% /app/grid

-----------------------------------------------------------------------------------
-------------------------------------
[root@lxrmststdb1 ~]# (echo p; echo u; echo p; echo n; echo p; echo 1; echo 128;
echo; echo p; echo t; echo 8e; echo p; echo w) | fdisk /dev/emcpowerz

The number of cylinders for this disk is set to 30720.


There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help):


Disk /dev/emcpowerz: 32.2 GB, 32212254720 bytes
64 heads, 32 sectors/track, 30720 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Device Boot Start End Blocks Id System

Command (m for help): Changing display/entry units to sectors

Command (m for help):


Disk /dev/emcpowerz: 32.2 GB, 32212254720 bytes
64 heads, 32 sectors/track, 30720 cylinders, total 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes

Device Boot Start End Blocks Id System

Command (m for help): Command action


e extended
p primary partition (1-4)
Partition number (1-4): First sector (32-62914559, default 32): Last sector or
+size or +sizeM or +sizeK (128-62914559, default 62914559): Using default value
62914559
Command (m for help):
Disk /dev/emcpowerz: 32.2 GB, 32212254720 bytes
64 heads, 32 sectors/track, 30720 cylinders, total 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes

Device Boot Start End Blocks Id System


/dev/emcpowerz1 128 62914559 31457216 83 Linux

Command (m for help): Selected partition 1


Hex code (type L to list codes): Changed system type of partition 1 to 8e (Linux
LVM)

Command (m for help):


Disk /dev/emcpowerz: 32.2 GB, 32212254720 bytes
64 heads, 32 sectors/track, 30720 cylinders, total 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes

Device Boot Start End Blocks Id System


/dev/emcpowerz1 128 62914559 31457216 8e Linux LVM

Command (m for help): The partition table has been altered!

Calling ioctl() to re-read partition table.


Syncing disks.
[root@lxrmststdb1 ~]# fdisk /dev/emcpowerz

The number of cylinders for this disk is set to 30720.


There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/emcpowerz: 32.2 GB, 32212254720 bytes


64 heads, 32 sectors/track, 30720 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Device Boot Start End Blocks Id System


/dev/emcpowerz1 1 30720 31457216 8e Linux LVM

Command (m for help): u


Changing display/entry units to sectors

Command (m for help): p

Disk /dev/emcpowerz: 32.2 GB, 32212254720 bytes


64 heads, 32 sectors/track, 30720 cylinders, total 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes

Device Boot Start End Blocks Id System


/dev/emcpowerz1 128 62914559 31457216 8e Linux LVM

Command (m for help): q

[root@lxrmststdb1 ~]# echo $?


0
[root@lxrmststdb1 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
lxrmststdb1_vg01 1 6 0 wz--n- 59.98G 13.98G
vg00 1 7 0 wz--n- 136.50G 68.50G
[root@lxrmststdb1 ~]# lvdisplay
--- Logical volume ---
LV Name /dev/lxrmststdb1_vg01/lv_1120
VG Name lxrmststdb1_vg01
LV UUID L7Hx0k-NJSc-8gwU-lNda-7NMh-3f9z-Xe9xGL
LV Write Access read/write
LV Status available
# open 1
LV Size 10.00 GB
Current LE 2560
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:7

--- Logical volume ---


LV Name /dev/lxrmststdb1_vg01/lv_admin
VG Name lxrmststdb1_vg01
LV UUID mPb8SD-fY7Z-HH2O-TG8S-MyEW-XTmv-sQ4ZFH
LV Write Access read/write
LV Status available
# open 1
LV Size 10.00 GB
Current LE 2560
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:8

--- Logical volume ---


LV Name /dev/lxrmststdb1_vg01/lv_appora
VG Name lxrmststdb1_vg01
LV UUID 7pNOLr-JoYx-k1MB-9cNh-RPeZ-ndP5-v0pvvn
LV Write Access read/write
LV Status available
# open 1
LV Size 5.00 GB
Current LE 1280
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:9

--- Logical volume ---


LV Name /dev/lxrmststdb1_vg01/lv_emagent
VG Name lxrmststdb1_vg01
LV UUID 6Sea5C-4qrc-aa0N-kneu-xKZ8-7Mp6-oMhlYX
LV Write Access read/write
LV Status available
# open 1
LV Size 10.00 GB
Current LE 2560
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:10

--- Logical volume ---


LV Name /dev/lxrmststdb1_vg01/lv_grid
VG Name lxrmststdb1_vg01
LV UUID NmlWNN-KSn7-fglr-Mz1T-xePb-CM26-vb3KKB
LV Write Access read/write
LV Status available
# open 1
LV Size 10.00 GB
Current LE 2560
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:11

--- Logical volume ---


LV Name /dev/lxrmststdb1_vg01/lv_orainv
VG Name lxrmststdb1_vg01
LV UUID Ar2ewS-XXdy-VA2v-DHRF-2taM-jwbW-E4aBmb
LV Write Access read/write
LV Status available
# open 1
LV Size 1.00 GB
Current LE 256
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:12

--- Logical volume ---


LV Name /dev/vg00/lvroot
VG Name vg00
LV UUID 12Ow75-w4Yb-zSHm-LCXV-hWcS-36n5-G2dz2w
LV Write Access read/write
LV Status available
# open 1
LV Size 4.00 GB
Current LE 1024
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0

--- Logical volume ---


LV Name /dev/vg00/lvusr
VG Name vg00
LV UUID aSdHAB-Vdsp-dhxr-3W39-KyRg-lOTJ-Wq5Uyd
LV Write Access read/write
LV Status available
# open 1
LV Size 10.00 GB
Current LE 2560
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1

--- Logical volume ---


LV Name /dev/vg00/lvopt
VG Name vg00
LV UUID duSQWl-vA4k-2sFp-pmPk-AZ3Y-a05r-fEv2qK
LV Write Access read/write
LV Status available
# open 1
LV Size 4.00 GB
Current LE 1024
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2

--- Logical volume ---


LV Name /dev/vg00/lvhome
VG Name vg00
LV UUID zdPnGv-CeuV-CUOe-vLXC-uB3j-GWPo-ItwRbL
LV Write Access read/write
LV Status available
# open 1
LV Size 4.00 GB
Current LE 1024
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:3

--- Logical volume ---


LV Name /dev/vg00/lvvar
VG Name vg00
LV UUID 6vPJ26-3b7F-FqUx-rqNY-K5Sj-FW3F-U0iB4f
LV Write Access read/write
LV Status available
# open 1
LV Size 10.00 GB
Current LE 2560
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:4

--- Logical volume ---


LV Name /dev/vg00/lvtmp
VG Name vg00
LV UUID YvtqhS-o1VY-ZCD9-LnH5-uIip-eoeg-RuSPxA
LV Write Access read/write
LV Status available
# open 1
LV Size 4.00 GB
Current LE 1024
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:5

--- Logical volume ---


LV Name /dev/vg00/lvswap
VG Name vg00
LV UUID yrzX79-aNig-7npt-FxtV-xkAb-qxDA-oMOIj8
LV Write Access read/write
LV Status available
# open 1
LV Size 32.00 GB
Current LE 8192
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:6

[root@lxrmststdb1 ~]# cat /etc/fstab


/dev/vg00/lvopt /opt ext3 defaults 1 2
/dev/vg00/lvhome /home ext3 defaults 1 2
/dev/vg00/lvvar /var ext3 defaults 1 2
/dev/vg00/lvtmp /tmp ext3 defaults 1 2
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/vg00/lvswap swap swap defaults 0 0

# SAN
/dev/lxrmststdb1_vg01/lv_appora /app/oracle ext3 _netdev,defaults 1 2
/dev/lxrmststdb1_vg01/lv_orainv /app/oracle/oraInventory ext3
_netdev,defaults 1 2
/dev/lxrmststdb1_vg01/lv_grid /app/grid ext3 _netdev,defaults 1 2
/dev/lxrmststdb1_vg01/lv_1120 /app/oracle/product/11.2.0 ext3
_netdev,defaults 1 2
/dev/lxrmststdb1_vg01/lv_admin /app/oracle/admin ext3 _netdev,defaults
1 2
/dev/lxrmststdb1_vg01/lv_emagent /app/oracle/product/emagent ext3
_netdev,defaults 1 2

# NAS
nsusphx01:/staging /staging nfs rsize=32768,wsize=32768,soft,intr 0 0
#nsusphx01:/rmsdata_loader_dev /RMS_DATA_LOADER_DEV nfs
rsize=32768,wsize=32768,soft,intr 0 0
nsusphx01:/rmsdata_loader_qa /RMS_DATA_LOADER_TST nfs
rsize=32768,wsize=32768,soft,intr 0 0
nsusphx03:/rms_exports /RMS_EXP nfs
wsize=32768,rsize=32768,rw,bg,intr,hard,timeo=600,vers=3,proto=tcp,noac 0 0

#tddusphx01:/backup/rman_repl/rmsprd_rman /RMSPRD_RMAN nfs


hard,bg,intr,rsize=32768,wsize=32768,nolock,proto=tcp,vers=3 0 0
tddusphx01:/backup/rman_repl/rmsprd_rman01 /RMSPRD_RMAN nfs
hard,bg,intr,rsize=32768,wsize=32768,nolock,proto=tcp,vers=3 0 0
#######nsusphx03:/rms_exports /RMSPRD_RMAN nfs
hard,bg,intr,rsize=32768,wsize=32768,nolock,proto=tcp,vers=3 0 0

nsusphx01:/rmsdata_loader_ld /rmsdata_loader_ld nfs


wsize=32768,rsize=32768,rw,bg,intr,hard,timeo=600,vers=3,proto=tcp,noac 0 0
nsusphx01:/rmsdata_upload_ld /rmsdata/upload_ld nfs
wsize=32768,rsize=32768,rw,bg,intr,hard,timeo=600,vers=3,proto=tcp,noac 0 0
usphxntap2:/vol/vol_bea/beaq /RMS_DATA_LOADER_DEV nfs
wsize=32768,rsize=32768,rw,bg,intr,hard,timeo=600,vers=3,proto=tcp,noac 0 0
[root@lxrmststdb1 ~]# cat /etc/fstab | grep -w /app/oracle/product/11.2.0
/dev/lxrmststdb1_vg01/lv_1120 /app/oracle/product/11.2.0 ext3
_netdev,defaults 1 2
[root@lxrmststdb1 ~]# pvcreate /dev/emcpowerz1
Physical volume "/dev/emcpowerz1" successfully created
[root@lxrmststdb1 ~]# vgextend lxrmststdb1_vg01 /dev/emcpowerz1
Volume group "lxrmststdb1_vg01" successfully extended
[root@lxrmststdb1 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
lxrmststdb1_vg01 2 6 0 wz--n- 89.98G 43.98G
vg00 1 7 0 wz--n- 136.50G 68.50G
[root@lxrmststdb1 ~]# lvextend -L+10G /dev/lxrmststdb1_vg01/lv_1120
Extending logical volume lv_1120 to 20.00 GB
Logical volume lv_1120 successfully resized
[root@lxrmststdb1 ~]# resize2fs /dev/lxrmststdb1_vg01/lv_1120
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/lxrmststdb1_vg01/lv_1120 is mounted on
/app/oracle/product/11.2.0; on-line resizing required
Performing an on-line resize of /dev/lxrmststdb1_vg01/lv_1120 to 5242880 (4k)
blocks.
The filesystem on /dev/lxrmststdb1_vg01/lv_1120 is now 5242880 blocks long.

[root@lxrmststdb1 ~]# vgs


VG #PV #LV #SN Attr VSize VFree
lxrmststdb1_vg01 2 6 0 wz--n- 89.98G 33.98G
vg00 1 7 0 wz--n- 136.50G 68.50G
[root@lxrmststdb1 ~]# lvextend -L+20G /dev/lxrmststdb1_vg01/lv_grid
Extending logical volume lv_grid to 30.00 GB
Logical volume lv_grid successfully resized
[root@lxrmststdb1 ~]# resize2fs /dev/lxrmststdb1_vg01/lv_grid
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/lxrmststdb1_vg01/lv_grid is mounted on /app/grid; on-line
resizing required
Performing an on-line resize of /dev/lxrmststdb1_vg01/lv_grid to 7864320 (4k)
blocks.
The filesystem on /dev/lxrmststdb1_vg01/lv_grid is now 7864320 blocks long.

[root@lxrmststdb1 ~]# vgs


VG #PV #LV #SN Attr VSize VFree
lxrmststdb1_vg01 2 6 0 wz--n- 89.98G 13.98G
vg00 1 7 0 wz--n- 136.50G 68.50G
[root@lxrmststdb1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg00-lvroot
3.9G 750M 3.0G 20% /
/dev/mapper/vg00-lvusr
9.7G 3.1G 6.2G 33% /usr
/dev/mapper/vg00-lvopt
3.9G 315M 3.4G 9% /opt
/dev/mapper/vg00-lvhome
3.9G 256M 3.5G 7% /home
/dev/mapper/vg00-lvvar
9.7G 3.9G 5.3G 43% /var
/dev/mapper/vg00-lvtmp
3.9G 174M 3.6G 5% /tmp
/dev/cciss/c0d0p1 190M 31M 150M 18% /boot
tmpfs 63G 40G 24G 63% /dev/shm
nsusphx01:/staging 745G 718G 27G 97% /staging
nsusphx01:/rmsdata_loader_qa
99G 85G 15G 86% /RMS_DATA_LOADER_TST
tddusphx01:/backup/rman_repl/rmsprd_rman01
32T 25T 6.8T 79% /RMSPRD_RMAN
nsusphx01:/rmsdata_loader_ld
197G 5.4G 192G 3% /rmsdata_loader_ld
nsusphx01:/rmsdata_upload_ld
197G 197G 32K 100% /rmsdata/upload_ld
/dev/mapper/lxrmststdb1_vg01-lv_appora
5.0G 4.5G 189M 97% /app/oracle
/dev/mapper/lxrmststdb1_vg01-lv_orainv
1008M 39M 919M 4% /app/oracle/oraInventory
/dev/mapper/lxrmststdb1_vg01-lv_grid
30G 8.0G 21G 29% /app/grid
/dev/mapper/lxrmststdb1_vg01-lv_1120
20G 4.9G 14G 27% /app/oracle/product/11.2.0
/dev/mapper/lxrmststdb1_vg01-lv_admin
9.9G 3.1G 6.3G 33% /app/oracle/admin
/dev/mapper/lxrmststdb1_vg01-lv_emagent
9.9G 1.9G 7.6G 20% /app/oracle/product/emagent
nsusphx03:/rms_exports
2.9T 1.4T 1.6T 47% /RMS_EXP
usphxntap2:/vol/vol_bea/beaq
300G 164G 137G 55% /RMS_DATA_LOADER_DEV
-----------------------------------------------------------------------------------
------------------------------------------

You might also like