1752535 Members
5082 Online
108788 Solutions
New Discussion юеВ

vgexport Device busy

 
SOLVED
Go to solution
Tuan Nguyen
Regular Advisor

vgexport Device busy

Hello,

I am running N4000 server 11.0. I try to vgexport a vg but keep having "device busy" error.

vgexport -m /tmp/vg01.map -s -v /dev/vg01

Beginning the export process on Volume Group "/dev/vg01".
vgexport: Volume group "/dev/vg01" is still active.
vgexport: Couldn't export volume group "/dev/vg01".

my /dev/vg01 has
/dev/vg01/lvol1 as secondary swap
/dev/vg01/lvol2 mounted as /data1
/dev/vg01/lvol2 mounted as /data2

I unmounted /data1 and /data2 and run vgchange -a n /dev/vg01

vgchange: Couldn't deactivate volume group "/dev/vg01":
Device busy

I must vgexport this vg01 and vgimport it after the upgrade to 11i to avoid retore data from tape. I believe that I am having this problem because I have a swap configured within this vg.

Please help. Any input is greatly appreciated.

Tuan

7 REPLIES 7
James R. Ferguson
Acclaimed Contributor
Solution

Re: vgexport Device busy

Hi Tuan:

On HP-UX the only way to deactivate a swap device is to remove it from the '/etc/fstab' and reboot. Once activated, swap cannot be deactivated.

Regards!

...JRF...
Tuan Nguyen
Regular Advisor

Re: vgexport Device busy

James,

Thank you for your supper quick response.

So, you are saying that I shoud remove the swap entry in /etc/fstab, then deactivate the vg01, then vgexport?

Tuan
James R. Ferguson
Acclaimed Contributor

Re: vgexport Device busy

Hi (again) Tuan:

> So, you are saying that I shoud remove the swap entry in /etc/fstab, then deactivate the vg01, then vgexport?

Not exactly. You need to remove the swap entry in '/etc/fstab', then REBOOT. Following the reboot the volume group will be activated as always, so then deactivate it with 'vgchange' and then, finally, 'vgexport' it.

You must reboot to "deactivate" the swap. Rather, you must reboot and NOT activate the swap.

Regards!

...JRF...
Tuan Nguyen
Regular Advisor

Re: vgexport Device busy

James,

Thank you for the clarification. I will try this tomorrow. Say I have the map file exported, then I will cold install the OS, patch, etc... then vgimport this map file, then edit /etc/fstab, then reboot. The secondary swap and /data1 and /data2 should remain intact, right?

Thank you James

Tuan
James R. Ferguson
Acclaimed Contributor

Re: vgexport Device busy

Hi (again) Tuan:

> Say I have the map file exported, then I will cold install the OS, patch, etc... then vgimport this map file, then edit /etc/fstab, then reboot. The secondary swap and /data1 and /data2 should remain intact, right?

Yes. Your mapfile will contain the VGID of the volume group because you specified the '-s' switch. Hence, when you 'vgimport' using the mapfile all physical devices with a matching VGID will be imported and recorded in your '/etc/lvmtab'. If you have multiple paths (alternate links) you will want to review the primary versus secondary link relationships and 'vgreduce'/'vgextend' some paths in order to best balance the paths for high-availablity. Other than that, your logical volumes and any data they contain will be intact.

When you copy your original '/etc/fstab' into your upgraded configuration, remember to uncomment your secondary swap device and reboot to activate that swap.

Regards!

...JRF...
Tuan Nguyen
Regular Advisor

Re: vgexport Device busy

James,

Perfect.

Again, I really appreciate your help. I can't thank you enough.

Thank you very much.

Tuan
James R. Ferguson
Acclaimed Contributor

Re: vgexport Device busy

Hi (again) Tuan:

I just realized that you are apparently cold-installing onto your existing hardware. If that is the case, you don't need to deactivate your non-vg00 volume groups as discussed. Simply do:

# vgexport -m /tmp/vg01.map -s -p -v /dev/vg01

The '-p' will generate the requisite mapfile without requiring you to deactivate the volume group, and the export will not be performed. That's fine if you are cold-installing. All you want is the mapfile with the VGID information within to use AFTER you overwrite your existing vg00 during the cold-install.

Regards!

...JRF...