Task: On RHEL 6 64-bit, perform online resize of filesystem /journal from 50GB to 100GB. That filesystem is part of multipath device brc001_journal_pv.
HOWTO:
In this post we are going to resize multipath device brc001_journal_pv with running IO operations. OS used is RHEL 6.2 64-bit. Remember, if you want to actually decrease size of volume, you cannot do that online, you have to unmount relevant filesystem, resize filesystem, resize lv/vg/pv and finally resize disk on array. But today we are going to increase size, so its easier.
What are relevant paths of device?
# multipath -ll
brc001_journal_pv
(36000d310003582000000000000000026) dm-1 COMPELNT,Compellent Vol
size=50G features='1
queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
|- 2:0:5:2 sdh 8:112 active ready running
`- 1:0:7:2 sdp 8:240 active ready running
.
.
Multipath
device brc001_journal_pv has paths sdh a sdp.
1. First we increase size of LUN on disk array. Every disk array has different guide, so please refer to documentation of your disk array.
2. Second we will rescan relevant paths and multipath device
echo 1 > /sys/block/sdh/device/rescan
echo 1 > /sys/block/sdp/device/rescan
multipathd -k"resize map
brc001_journal_pv"
# multipath -ll
brc001_journal_pv (36000d310003582000000000000000026) dm-1
COMPELNT,Compellent Vol
size=100G features='1 queue_if_no_path'
hwhandler='0' wp=rw
`-+-
policy='round-robin 0' prio=1 status=active
|- 2:0:5:2 sdh 8:112 active ready running
`- 1:0:7:2 sdp 8:240 active ready running
3. Resize physical volume
# pvresize /dev/mapper/brc001_journal_pv
Physical volume
"/dev/mapper/brc001_journal_pv" changed
1 physical volume(s) resized / 0 physical
volume(s) not resized
# pvs
/dev/mapper/brc001_journal_pv
PV VG Fmt Attr PSize
PFree
/dev/mapper/brc001_journal_pv
brc001_journal_vg lvm2 a-- 100.00g 0
4. Resize logical volume
# lvresize -l 100%VG /dev/mapper/brc001_journal_vg-journal_lv
Extending
logical volume journal_lv to 100.00 GiB
Logical volume journal_lv successfully
resized
# lvs
brc001_journal_vg
LV
VG Attr LSize
Origin Snap% Move Log Copy% Convert
journal_lv brc001_journal_vg -wi-ao 100.00g
5. Resize filesystem and we are done!
# resize2fs
/dev/mapper/brc001_journal_vg-journal_lv
resize2fs 1.41.12
(17-May-2010)
Filesystem at
/dev/mapper/brc001_journal_vg-journal_lv is mounted on /journal; on-line
resizing required
old desc_blocks = 4,
new_desc_blocks = 7
Performing an
on-line resize of /dev/mapper/brc001_journal_vg-journal_lv to 26213376 (4k)
blocks.
The filesystem on
/dev/mapper/brc001_journal_vg-journal_lv is now 26213376 blocks long.
# df
-h /journal/
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/brc001_journal_vg-journal_lv
99G 18G
82G 18% /journal
Excelente! Muchas Gracias.
ReplyDelete