• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

vgchange Command Examples in Linux

by Deepika

vgchange is a command-line utility for modifying the attributes of a Logical Volume Manager (LVM) volume group. LVM is a system that allows users to manage logical volumes, which are virtual storage devices created by combining multiple physical storage devices. Volume groups are collections of physical volumes that have been combined into a single logical volume for easier management.

With vgchange, you can activate or deactivate a volume group, change its access mode, or modify its physical volume attributes. Some of the common use cases for vgchange include:

  • Activating a volume group: When a volume group is activated, its logical volumes become available to the system. This is useful when you want to access the data stored on the logical volumes.
  • Deactivating a volume group: When a volume group is deactivated, its logical volumes become unavailable to the system. This is useful when you want to perform maintenance on the volume group or its physical volumes.
  • Changing the access mode: The access mode determines how many systems can access a volume group at the same time. You can set the access mode to read-only, which allows multiple systems to read data from the volume group but prevents any system from modifying the data. Alternatively, you can set the access mode to read-write, which allows multiple systems to read and modify the data.
  • Modifying physical volume attributes: You can use vgchange to change the attributes of the physical volumes in a volume group, such as their size or location.

vgchange Command Examples

1. Change the activation status of logical volumes in all volume groups:

# sudo vgchange --activate y|n

2. Change the activation status of logical volumes in the specified volume group (determined with `vgscan`):

# sudo vgchange --activate y|n volume_group}

Summary

vgchange is a powerful tool that should be used with caution. Before using it, make sure you have a good understanding of LVM and its concepts. You can find more information on vgchange and other LVM commands in the lvm2 man pages or online documentation.

Filed Under: Linux

Some more articles you might also be interested in …

  1. chcon Command Examples in Linux
  2. sfil Command Examples in Linux
  3. Difference between absolute and relative paths in Linux
  4. How to use “xfs_admin” command to change parameters of an XFS filesystem
  5. ar – Create, modify, and extract from archives (.a, .so, .o)
  6. How to Password Protect GRUB2 in Oracle Enterprise Linux 7
  7. How To Configure sssd To Work With Multiple Active Directory Domains in Different Forests (CentOS/RHEL)
  8. whatis: command not found
  9. nft Command Examples in Linux
  10. Basic “ls” Command examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • aws ec2: CLI for AWS EC2 (Command Examples)
  • aws cur – Create, query, and delete AWS usage report definitions (Command Examples)
  • aws configure – Manage configuration for the AWS CLI (Command Examples)
  • aws cognito-idp: Manage Amazon Cognito user pool and its users and groups using the CLI

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright