Moving volumes to disk partitions

You must move all volumes to disk partitions. You can do this using one of the following procedures:

Moving volumes onto disk partitions for HP-UX

Use the following procedure to move volumes to disk partitions.

To move volumes to disk partitions

  1. Evacuate disks using vxdiskadm, the GUI, or the vxevac script.

    Evacuation moves subdisks from the specified disks to target disks. The evacuated disks provide the initial free disk space for volumes to be moved to disk partitions.

  2. Remove the evacuated disks from VxVM control by entering the following:

    # vxdg rmdisk diskname

    # vxdisk rm devname

  3. Decide which volume to move first, and if the volume is mounted, unmount it.
  4. If the volume is being used as a raw partition for database applications, make sure that the application is not updating the volume and that you have applied the sync command to the data on the volume.
  5. Create a partition on free disk space of the same size as the volume using the format command. If there is not enough free space for the partition, add a new disk to the system for the first volume removed. Subsequent volumes can use the free space generated by the removal of this first volume.
  6. Copy the data on the volume onto the newly created disk partition using a command such as dd.

    # dd if=/dev/vx/dsk/diskgroup/lhome of=/dev/dsk/c2t2d2

    where c2t2d2 is the disk outside of Volume Manager and s7 is the newly

    created partition.

  7. Replace the entry for that volume (if present) in /etc/fstab with an entry for the newly created partition.
  8. Mount the disk partition if the corresponding volume was previously mounted.
  9. Remove the volume from VxVM using the following command:

    # vxedit -rf rm volume_name

  10. Remove any free disks (those having no subdisks defined on them) by removing the volumes from VxVM control.

    To check if there are still some subdisks remaining on a particular disk, use the vxprint command.

    # vxprint -F '%sdnum' diskname

    If the output is not 0, there are still some subdisks on this disk that you need to remove. If the output is 0, remove the disk from VxVM control.

    # vxdg rmdisk diskname

    # vxdisk rm devname

    Use the free space created for adding the data from the next volume you want to remove.

  11. After you successfully convert all volumes into disk partitions, reboot the system.
  12. After the reboot, make sure none of the volumes are open.

    # vxprint -Aht -e v_open

    If any volumes remain open, repeat the steps listed above.


Example of moving volumes to disk partitions on HP-UX

This example shows how to move the data on a volume to a disk partition. In the example, there are three disks: disk1 and disk2 are subdisks on volume vol01 and disk3 is a free disk. The data on vol01 is copied to disk3 using vxevac.

To move volumes to disk partitions on HP-UX

  1. Display voldg content before the data on vol01 is copied to disk3.

    # vxprint -g voldg -ht

    DG NAME NCONFIG NLOG MINORS GROUP-ID

    DM NAME DEVICE TYPE PRIVLEN PUBLEN STATE

    RV NAME RLINK_CNT KSTATE STATE PRIMARY DATAVOLS SRL

    RL NAME RVG KSTATE STATE REM_HOST REM_DG REM_RLNK

    V NAME RVG KSTATE STATE LENGTH READPOL PREFPLEX

    UTYPE

    PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID

    MODE

    SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE

    MODE

    SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM

    MODE

    DC NAME PARENTVOL LOGVOL

    SP NAME SNAPVOL DCO

    dg voldg default default 115000

    1017856044.1141.hostname.veritas.com

    dg voldg default default 115000

    1017856044.1141.hostname.veritas.com

    dm disk1 c1t12d0 auto:hpdisk 2591 17900352 -

    dm disk2 c1t14d0 auto:hpdisk 2591 17899056 -

    dm disk3 c1t3d0 auto:hpdisk 2591 17899056 -

    v vol1 - ENABLED ACTIVE 4196448 ROUND -

    fsgen

    pl pl1 vol1 ENABLED ACTIVE 4196448 CONCAT -

    RW

    sd sd1 pl1 disk1 0 2098224 0 c1t12d0

    ENA

    sd sd2 pl1 disk2 0 2098224 2098224 c1t14d0

    ENA

  2. Evacuate disk1 to disk3.

    # /etc/vx/bin/vxevac -g voldg disk1 disk3

    # vxprint -g voldg -ht

    DG NAME NCONFIG NLOG MINORS GROUP-ID

    DM NAME DEVICE TYPE PRIVLEN PUBLEN STATE

    RV NAME RLINK_CNT KSTATE STATE PRIMARY DATAVOLS SRL

    RL NAME RVG KSTATE STATE REM_HOST REM_DG REM_RLNK

    V NAME RVG KSTATE STATE LENGTH READPOL PREFPLEX

    UTYPE

    PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID

    MODE

    SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE

    MODE

    SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM

    MODE

    DC NAME PARENTVOL LOGVOL

    SP NAME SNAPVOL DCO

    dg voldg default default 115000

    1017856044.1141.hostname.veritas.com

    dm disk1 c1t12d0 auto:hpdisk 2591 17900352 -

    dm disk2 c1t14d0 auto:hpdisk 2591 17899056 -

    dm disk3 c1t3d0 auto:hpdisk 2591 17899056 -

    v vol1 - ENABLED ACTIVE 4196448 ROUND -

    fsgen

    pl pl1 vol1 ENABLED ACTIVE 4196448 CONCAT -

    RW

    sd disk3-01 pl1 disk3 0 2098224 0 c1t3d0

    ENA

    sd sd2 pl1 disk2 0 2098224 2098224 c1t14d0

    ENA

  3. Evacuate disk2 to disk3.

    # /etc/vx/bin/vxevac -g voldg disk2 disk3

    # vxprint -g voldg -ht

    DG NAME NCONFIG NLOG MINORS GROUP-ID

    DM NAME DEVICE TYPE PRIVLEN PUBLEN STATE

    RV NAME RLINK_CNT KSTATE STATE PRIMARY DATAVOLS SRL

    RL NAME RVG KSTATE STATE REM_HOST REM_DG REM_RLNK

    V NAME RVG KSTATE STATE LENGTH READPOL PREFPLEX

    UTYPE

    PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID

    MODE

    SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE

    MODE

    SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM

    MODE

    DC NAME PARENTVOL LOGVOL

    SP NAME SNAPVOL DCO

    dg voldg default default 115000

    1017856044.1141.hostname.veritas.com

    dm disk1 c1t12d0 auto:hpdisk 2591 17900352 -

    dm disk2 c1t14d0 auto:hpdisk 2591 17899056 -

    dm disk3 c1t3d0 auto:hpdisk 2591 17899056 -

    v vol1 - ENABLED ACTIVE 4196448 ROUND -

    fsgen

    pl pl1 vol1 ENABLED ACTIVE 4196448 CONCAT -

    RW

    sd disk3-01 pl1 disk3 0 2098224 0 c1t3d0

    ENA

    sd disk3-02 pl1 disk3 2098224 2098224 2098224 c1t3d0 ENA

  4. Remove the evacuated disks from VxVM control.

    # vxdisk -g voldg list

    DEVICE TYPE DISK GROUP STATUS

    c1t3d0 auto:hpdisk disk3 voldg

    online

    c1t12d0 auto:hpdisk disk1 voldg

    online

    c1t14d0 auto:hpdisk disk2 voldg

    # vxdg rmdisk disk1

    # vxdg rmdisk disk2

    # vxdisk rm c1t12d0

    # vxdisk rm c1t14d0

  5. Verify that the evacuated disks have been removed from VxVM control.

    # vxdisk -g voldg list

    DEVICE TYPE DISK GROUP STATUS

    c1t3d0 auto:hpdisk disk3 voldg online

  6. Check to see whether the volume you want to move first is mounted.

    # mount | grep vol1

    /vol1 on /dev/vx/dsk/voldg/vol1

    read/write/setuid/log/nolargefiles/dev=12dc138 on Wed Apr 3

    10:13:11 2002

  7. Copy the data on vol01 to the newly created disk partition.

    # dd if=/dev/vx/dsk/voldg/vol01 of=/dev/dsk/c1t12d0

  8. In the /etc/fstab file, remove the following entry.

    /dev/vx/dsk/voldg/vol1 /dev/vx/rdsk/voldg/vol1 /vol1 vxfs 4

    yes rw

  9. Replace it with an entry for the newly created partition.

    /dev/dsk/c1t12d0 /dev/rdsk/c1t12d0 /vol01 vxfs 4 yes rw

  10. Mount the disk partition.

    # mount -F vxfs /dev/dsk/c1t12d0 /vol01

  11. Remove vol01 from VxVM.

    # vxedit -rf rm /dev/vx/dsk/voldg/vol01

To complete the procedure, perform the remaining steps.