Operating System - HP-UX
1820882 Members
3469 Online
109628 Solutions
New Discussion юеВ

Help with 'lvreduce' on core file system '/var'

 
SOLVED
Go to solution
mfqm87
Frequent Visitor

Help with 'lvreduce' on core file system '/var'

Hi,

We have a server (rx4640 - HPUX 11.31 with OnlineJFS) and I am working on mirriong of two internal hard drive. Problem is the second drive is part of '/var' (not mirrored) and I can't use 'pvmove' command since there is no free PE on main drive.

After a little bit of research I came up with the following steps and I need your feedback:

1- backup file system

2- fsadm -F vxfs -D -E -d -e /var (defrag)

3- fsadm -F vxfs -b m 23988 /var (reduce file system size)

4- lvreduce -L 23988 /dev/vg00/lvol8 (reduce logical volume size)

5- pvmove -n /dev/vg00/lvol8 /dev/dsk/c3t0d0 /dev/dsk/c2t1d0 (move PE from second drive to main one)

Edit: no need for 'pvmove' command lvreduce command took care of that !

Thanks

 

5 REPLIES 5
Sush_S
HPE Pro

Re: Help with 'lvreduce' on core file system '/var'

Hi mfqm87, 
If I understand correctly, your system consists of two disks. 
The main drive contains all the partitions, including a small portion of /var, while the second drive holds partial data of /var. 
Have I comprehended it correctly?

In order to free up space on the primary disk for the portion of /var currently residing on the second drive, you can consider defragmenting the filesystem and removing temporary and unnecessary files. By doing so, you may be able to recover space on the main disk, providing greater flexibility for the mirroring process.
However, it is crucial to be cautious and avoid accidentally deleting important data or system files. Remember to back up your data and proceed with care when performing these operations.

To guarantee the storage of a complete copy of the data, make sure that the mirror disk possesses either an equal or larger capacity than the primary disk.

Besides that, your proposed steps seem generally reasonable for optimizing the filesystem and moving the PE from second drive to main one.

Regards,
SUSH_S



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
mfqm87
Frequent Visitor

Re: Help with 'lvreduce' on core file system '/var'

Hi @Sush_S,

Thank you for your reply

If I understand correctly, your system consists of two disks.
The main drive contains all the partitions, including a small portion of /var, while the second drive holds partial data of /var.
Have I comprehended it correctly?

That's right the total size of '/var' is 28GB, 3.3GB on the second drive and the remaining on main drive (actual current size of data is 16.5GB).

In order to free up space on the primary disk for the portion of /var currently residing on the second drive, you can consider defragmenting the filesystem and removing temporary and unnecessary files. By doing so, you may be able to recover space on the main disk, providing greater flexibility for the mirroring process.
However, it is crucial to be cautious and avoid accidentally deleting important data or system files. Remember to back up your data and proceed with care when performing these operations.

So you think defragmentation is enough no need to reduce the logical voulme ?

I am planning to backup the file system and test the backup server before attempting the process.

To guarantee the storage of a complete copy of the data, make sure that the mirror disk possesses either an equal or larger capacity than the primary disk.

Yes the second disk have the same capacity of primary one.

 

 

Sush_S
HPE Pro
Solution

Re: Help with 'lvreduce' on core file system '/var'

Hi mfqm87,
Defragmentation focuses on optimizing the arrangement of files within the existing space but it won't reduce LV size. To actually reclaim disk space and accommodate the migrated data, you will need to resize the logical volume or partition using lvreduce.
After reducing the LV size if the entire volume fits on disk1, and disk2 is now empty, then you no longer need to perform a pvmove operation.


Regards,
SUSH_S



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
mfqm87
Frequent Visitor

Re: Help with 'lvreduce' on core file system '/var'

Thanks @Sush_S 

I have succssefully reduced '/var' and removed the second drive from 'vg00'.

After reducing the LV size if the entire volume fits on disk1, and disk2 is now empty, then you no longer need to perform a pvmove operation.

That's correct after defragment process and reducing the logical volume 'pvmove' command was not needed.

Sunitha_Mod
Moderator

Re: Help with 'lvreduce' on core file system '/var'

Hello @mfqm87,

Perfect! We are extremely glad to know the problem has been resolved. 



Thanks,
Sunitha G
I'm an HPE employee.
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo