1

I've added a LVM disk to a Centos 6 server. After adding the disk, i used the command echo '- - -' > host0/scan to scan for the new disk, which has just added to the server.

After that, i could see the new disk by using the command fdisk -l. However, i could see the LVM device, which belong to the same disk, only after i've rebooted the server.

This what i got after adding the new disk:

fdisk -l

Disk /dev/sdb: 751.6 GB, 751619276800 bytes
255 heads, 63 sectors/track, 91379 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x119722fe

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       91379   734001786   83  Linux

And the following is what has been added after rebooting the server:

Disk /dev/mapper/data-lv: 751.6 GB, 751615082496 bytes
255 heads, 63 sectors/track, 91378 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Is there a way to make the LVM device to show up without rebooting the server?

1 Answer 1

2

vgchange -a y should activate all your LVM devices, or

vgchange -a y <vg_name> to active a single one,

both actions without the need for a reboot.

From man vchange:

DESCRIPTION vgchange allows you to change the attributes of one or more volume groups. Its main purpose is to activate and deactivate VolumeGroupName, or all volume groups if none is specified. Only active volume groups are subject to changes and allow access to their logical volumes.

-a, --activate [a|e|l]{y|n} Controls the availability of the logical volumes in the volume group for input/output. In other words, makes the logical volumes known/unknown to the kernel. If autoactivation option is used (-aay), each logical volume in the volume group is acti‐ vated only if it matches an item in the activation/auto_activation_volume_list set in lvm.conf. If this list is not set, then all volumes are considered for activation. The -aay option should be also used during system boot so it's possible to select which volumes to activate using the activation/auto_acti‐ vation_volume_list settting.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .