Operating System - HP-UX
1836984 Members
2054 Online
110111 Solutions
New Discussion

Re: how to move data to new disk

 
ShiWei_1
Occasional Contributor

how to move data to new disk

I have four disks in my k250;They're 18GB,9GB,2GB,2GB;I want to upgrade one 2GB to 18GB;how could I backup and reconfigure the /VGs,LOVLs and move data to the new disk(18GB)? I don't know the previous configuration of /VGs,LOVLs;and I don't know how many /VGs and /LOVLs there are?
9 REPLIES 9
Mei Jiao
Respected Contributor

Re: how to move data to new disk

Hi,

You may want to check your LVM configuration first.
# strings /etc/lvmtab
--> Note which VG the disk belongs to

# pvdisplay
for eg: # pvdisplay /dev/dsk/c1t0d2

# vgdisplay -v vgXX
for eg: # vgdisplay vg01
--> Note that you can see what are the LVOLs under this VG

If it's not VG00 that the disk belongs to, I think you can use 'fbackup' command to backup all the mountpoints of LVOLs that this disk belongs to.

Hope the above helps!
Sunil Sharma_1
Honored Contributor

Re: how to move data to new disk

Hi,

I believe your current VG config will not support more then 4 GB disk (Max PE limitation)

so it's batter if you follow these steps.
1.pvcreate new disk (18GB)
2. Create a new Volume group using this disk
(before that create /dev/vgnn directory and group file in hat)
3. Create new logical volumes of desire size
4. create File Systems
5. mount these file system on some dummy directory.
6. go to single user mode and transfer data from OLD File system to new temp mount point using cpio .
7. edit /etc/fstab
8.remove the dummy directory
and unmount new FS from temperory mount point and run mount -a.

Sunil
*** Dream as if you'll live forever. Live as if you'll die today ***
Elmar P. Kolkman
Honored Contributor

Re: how to move data to new disk

But that last example will not work for vg00. If you want to re-create the root volume group, use ignite to backup the whole vg00 and then boot from the ignite tape and select your 18Gb disk for vg00 instead of the 2 Gb.

As for finding your volumegroup information, use:
- 'bdf' to see which lvols are mounted
- 'swapinfo' which lvols are used as swapspace
- 'vgdisplay -v' on all your volumegroups to see the size and parameters on your volumegroups, how many lvols are defined, their size and which physical volumes are used in the volumegroup.

Looking at /etc/fstab can also give the basic information for swapspaces and mounts.
Every problem has at least one solution. Only some solutions are harder to find.
Jean-Louis Phelix
Honored Contributor

Re: how to move data to new disk

Hi,

We need more information to help you, especially the list of volume groups and the corresponding disks. Give us a "strings /etc/lvmtab" output.

- If the disk you want to change already contains a 18Gb disk, then it's really easy : you just have to pvcreate the new disk, vgextend the volume and pvmove the lvols

- If the 2Gb disk is you system disk, then igniteUX would be the easiest tool ...

- In all other cases, create a new volume and use cpio, tar or any other tool to transfer data.

Regards.
It works for me (© Bill McNAMARA ...)
Amruth
Regular Advisor

Re: how to move data to new disk

Hi,

It is better if you could paste the output of #strings /etc/lvmtab.

Regards,
AM
If i am doing the same way you are doing to me then what is the difference between us.
sparky_2
Frequent Advisor

Re: how to move data to new disk

Hi,
Allocate the new disk to the server as normal, create volume group and lvols accordingly, then use pvmove /dev/dsk/old_disk /dev/dsk/new_disk

A safer way to ensure no data is lost would be to use
dd if=/dev/vgNN/rlvolN of=/dev/vgNNTGT/rlvolN bs=32768
to transfer the data.

You really do need your previous vg, lvol details though to ensure the consistency of your data.

ShiWei_1
Occasional Contributor

Re: how to move data to new disk

Thank you! All of you!
These're the output of my K system:

#strings /etc/lvmtab
/dev/vg00
r9'8
/dev/dsk/c0t5d0
/dev/dsk/c0t4d0

/dev/vg01
r9'8
/dev/dsk/c0t0d0

/dev/vg02
r9':
/dev/dsk/c0t15d0
#

Would you give me the detail steps?

Thanks
Elmar P. Kolkman
Honored Contributor

Re: how to move data to new disk

Nice info, but I think we need more info: which disk do you want to replace and with what disk do you want to replace it?
And what is the lvol configuration on the volume groups? Are they all containing filesystems, or also swapspace on the disk you want to replace?

Since a volume group is created with a limited number of usable Physical Extents you can't add the new disk to the volume group if there isn't already a 18Gb disk in it or if you created the volume group with the maxPE parameter high enough to use the entire 18 Gb disk.

The easiest way, no matter which disk you want to replace, is to add the new disk, install the new disk and then remove the old disk.
Every problem has at least one solution. Only some solutions are harder to find.
Adisuria Wangsadinata_1
Honored Contributor

Re: how to move data to new disk

Hi there,

First you need to know whether the disk that you want to replace is boot disk (vg00) or non boot disk (vg01 or vg02). You can use the command below to check the size of the disk :

# diskinfo -v /dev/rdsk/cxtydz


If the boot disk :
- you need to create a bootable backup tape by using Ignite/UX features, make_tape_recovery command will help you to create the bootable backup tape for you.
- shutdown the system
- replace the boot disk with the new boot disk that have a bigger capacity (18GB)
- boot from the tape and restore into the new boot disk

If the boot disk used mirror/UX, you need to reduce the mirror first (lvreduce), shutdown the system, replace the mirror disk with the new boot disk, boot from the tape and restore to the new boot disk. This will help you to create a backup plan 8-).

If non boot disk :
- backup the file system on the disk that you need to update (for example vg01)
- shutdown the system and add new disk into the system if there's an available slot

a. startup the system
b. create a physical volume on the new disk, by using pvcreate command
c. extend the vg by adding physical volume (by using vgextend command)
d. move allocated PE from one physical volume to other physical volume (use pvmove command)

- if there's no available slot

a. deactivate the vg and export the vg, check /etc/lvmtab to make sure the vg is remove from this file and shutdown the sytem after that
b. replace the disk with the new one and startup the system
c. create a same vg and same lvol
d. mount it into the same mount point
e. restore from the backup

Hope this information can help you.

Best Regards,
AW
now working, next not working ... that's unix