Operating System - HP-UX
1753779 Members
7654 Online
108799 Solutions
New Discussion юеВ

How do i expand fileystem on a two node cluster on existing disk

 
Jolly Kalayil
Occasional Contributor

How do i expand fileystem on a two node cluster on existing disk

How do i expand a filesystem on two node disk
on existing disk.

Jolly
7 REPLIES 7
Pupil_1
Trusted Contributor

Re: How do i expand fileystem on a two node cluster on existing disk

Looks like you need to provide some more information on the requirement.
There is always something new to learn everyday !!
A. Clay Stephenson
Acclaimed Contributor

Re: How do i expand fileystem on a two node cluster on existing disk

Assuming that you have OnlineJFS and that you have enough free PE's in the VG then run lvextend on the LVOL and then run fsadm -F vxfs -b newsize on the corresponding filesystem. You can do it "on the fly" and because the LVM metadata is stored on the disks themselves, if the package moves to the other node, it will be aware of the larger LVOL/filesystem. More steps are involved if adding an LVOL, for example, but increasing the size of an existing LVOL can be done "on the fly". You must execute the commands manually because SAM will immediately tell you this is a VG under the control of MC/SG.
If it ain't broke, I can fix that.
nanan
Trusted Contributor

Re: How do i expand fileystem on a two node cluster on existing disk

Hi jolly

Do you mean you want to increace an existent filesystem or to create new file system and reflect the cluster?

it was already explained to increace filesystem the above by

I would like to explain about last case

Let's you have two system name A, B

1. create file system (on any node, A)
- vgcreate > lvcreate >newfs
2. export the and import to node B

3. Reflect the vg into cluster
vgchange -a n on A
vgchnage -c y on A

4. change the cluster cntl file
/etc/cmcluster//.cntl
add VGS to be opened exclusive mode
and add lvols new created to be mounted
at fail-over situation automatically


Regards
nanan
Geoff Wild
Honored Contributor

Re: How do i expand fileystem on a two node cluster on existing disk

The answer is: very carefully :)

Expanding file systems with onlinejfs on node with file system mounted:

lvextend -L /dev/vgXX/lvolXX

fsadm -b M /mount/point

Then you need to create a map file:

vgexport -s -v -p -m /tmp/vgXX.map /dev/vgXX

copy that file to the other node
on other node:

make note of the group files minor number
ll /dev/vgXX/group

vgexport /dev/vgXX

mkdir /dev/vgXX
mknod /dev/vgXX/group c 64 0xHH0000

vgimport -s -v -m /tmp/vgXX.map /dev/vgXX

Also see:

Managing MC/SG:

http://docs.hp.com/en/B3936-90079/index.html

Rgds...Geoff



Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
A. Clay Stephenson
Acclaimed Contributor

Re: How do i expand fileystem on a two node cluster on existing disk

There is no need to do a vgexport -s on the current node or a vgimport on the adoptive node. In this case, all of the changes are confined to the ondisk LVM metadata and to the LVOL/filesystem itself. As soon as the volume group is activated on the adoptive node, these changes are detected. I am assuming that the VG has been imported already. If, for example, the number of LVOL's in this VG changed rather than simply the size of an existing LVOL then more would have to be done. At the very least, device nodes would have to be created under /dev/vgxx for the new LVOL's (or removed for no-longer existing ones). The control scripts would also have to be copied so that the package would know what to do with the new LVOL's.

There is one "gotcha" to not activating the volume group on the adoptive node. If the package fails over to the adoptive node AND a disk within that VG fails and must be replaced, then vgcfgrestore would have stale data. It is therefore wise, to schedule some (brief) downtime to move the package to the adoptive node, let it activate the vg, and do a vgvfgbackup on the adoptive node. (The vgcfgbackup was done automatically on the orignal node so no explicit action there is needed.)
If it ain't broke, I can fix that.
Muthyala
Frequent Advisor

Re: How do i expand fileystem on a two node cluster on existing disk

Hi

Please Refer this document.

DATE: 5/10/00
DOCUMENT DESCRIPTION: RESIZING A LOGICAL VOLUME IN A SERVICEGUARD PACKAGE
DOCUMENT ID: UXSGKBAN00000342

You may provide feedback on this document

RESIZING A LOGICAL VOLUME IN A SERVICEGUARD PACKAGE
DOCID: UXSGKBAN00000342 UPDATED: 20031112
DOCUMENT
This article addresses the process of changing the size of a logical volume
governed by Serviceguard.

├в ┬в A logical volume's size may only be increased or reduced when it's parent
volume group is active.

├в ┬в VxFS = Journal File System. Online JFS = Advanced JFS = Advanced VxFS.

├в ┬в If Advanced Journal File System (AdvJFS) features are loaded, the
administrator can grow/reduce a file system within the logical volume while
the file system is in service. If only standard JFS is loaded, the file
system must be unmounted in order to change it's size, and loss of data may
occur if the file system is reduced.

├в ┬в The results of reducing the size of a VxFS filesystem prior to AdvJFS
version 3.3 (which is not available for 10.20) are uncertain. File system
backup is recommended prior to resizing a file system, but specifically
recommended for pre-3.3 file systems in case of unexpected truncation of a
file system.

├в ┬в Changing the size of a logical volume only affects the content of the VGDA
(LVM structures on the disks). Therefore, after resizing the logical volume
and the file system within it, no Serviceguard files or commands need be
performed. The size of the logical volume is loaded whenever the VG is
activated with the package startup.

For the purposes of clarity, the following procedure uses an example volume
group and logical volume and mount point: vg07, lvol4 and /mnt1.


Growing a logical volume
1) If the VG is not active on any node, activate it on a node currently
running (Serviceguard cmlvmd (Serviceguard) must be running in order to
activate a clustered VG).

# vgchange -a e vg07

2) On the node where the VG is active, use lvextend to increase the
size of the lvol.

lvextend syntax:
/usr/sbin/lvextend [-A autobackup] {-l le_number | -L lv_size | -m
mirror_copies} lv_path [pv_path ... | pvg_name ...]
- where lv_size is in megabytes.

Sample command to grow an LVOL to 8GB size:
# lvextend -L 8000 /dev/vg07/lvol4

3a) Growing a standard (non-AdvJFS) file system
# cmhaltpkg (umounts the file system)
# vgchange -a e vg07 (activates the VG)
# extendfs /dev/vg07/rlvol4 (grows the file sys)
# vgchange -a n vg07 (deactivate the VG)
# cmrunpkg (start the package)


3b) Growing AdvJFS file systems: (while the f/sys is active)
To grow the file system to the new boundary of the logical volume,
determine the number of disk blocks that match the new logical volume size.
The formula for determining the number of blocks is:

Megabytes x 1024 bytes per block = Disk Blocks.
NOTE: The fsadm_vxfs man page refers to disk blocks as "sectors".

Example: grow a logical volume to 8GB.

8000MB * 1024 bytes/block = 8192000 disk blocks

Syntax to adjust the size of an AdvJFS file system:
fsadm -F vxfs -b /

Sample command:
# fsadm -F vxfs -b 8192000 /mnt1
(see also the man page for fsadm_vxfs(1M))


Reducing the size of the logical volume

Standard LVM
1) Backup the data files in the logical volume.

2) If the logical volume has a file system on it, the file system must be
unmounted before proceeding:
# cmhaltpkg (umounts the file system)
# vgchange -a e vg07 (activates the VG)

3) Reduce the size of the logical volume.
Example - reduce an lvol to 2GB size:

# lvreduce -L 2000 /dev/vg07/lvol4

4) Because the file system is now truncated abnormally, recreate the file
system:
# newfs -F vxfs /dev/vg07/rlvol4
note raw logical volume

# mount /dev/vg07/rlvol4 /mnt1
# bdf /mnt1 # verify it's size is correct

5) Reload the data into the mounted file system.

6) Now complete the process:
# umount /mnt1
# vgchange -a n vg07
# cmrunpkg


Advanced JFS (while the logical volume is mounted):
1) Perform directory and extent re-org/de-fragmentation:

# fsadm -d -D -e -E /mnt1

NOTES:
├в ┬в This will fail if an inode is assigned past the end of the lvol.

├в ┬в HPUX 10.20 requires JFS version 3, 11.00 requires JFS version 3.3 and JFS
patches.

├в ┬в errno 16 may mean it cannot be reduced if the old lvol size is not a
multiple of 32MB

2) Reduce the size of the file system online. Example: reduce the file
system to 2GB:

# fsadm -F vxfs -b 2048000 /mnt1

(2048000 = 2000MB x 1024 bytes per block.)

3) Now reduce the logical volume size. Example:
# lvreduce -L 2000 /dev/vg07/lvol4


How to Extend Mounted Filesystem OnHP-UX Under Cluster Environment

#lvextend ├в L (Present Space + New Space) /dev/vg00/lvol4

If OnlineJFS is avaible please carry the next step. (It is available on all NBB HP Servers)

#fsadm ├в F vxfs ├в b (Present Space + New Space X 1024) /mount_point

If OnlineJFS is not there not there then

Umount the file System
Then Do
#umount /mount_point
#lvextend ├в L (Present Space + New Space) /dev/vg00/lvol4
#extendfs -F vxfs /dev/vg00/rlvol
Then Do Mount
#mount /dev/vg00/lvol /mount_point


### DOCUMENT END ###





Geoff Wild
Honored Contributor

Re: How do i expand fileystem on a two node cluster on existing disk

Sorry - I meant to add that the vgexport/vgimport is only required if you add disks to the vg.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.