Wednesday, November 16, 2016

How convert cds disk format to a sliced disk format


Converting from sliced to cds is possible using the vxcdsconvert command but there is no direct command to convert cds disk to sliced disk. 

One work around is to evacuate the existing data to a new device which is initialized as sliced disk. 
Here is an example on how to evacuate data from cds disk to sliced disk. 

Example: 
Initialized one device as cdsdisk and one device as sliced: 
--------------- 
c3t50060E80004372C0d6s2 auto:sliced - - online 
c3t50060E80004372C0d17s2 auto:cdsdisk - - online 
--------------- 
Create a disk group with cdsdisk: 
--------------- 
# vxdg init mixdg cds_disk01=c3t50060E80004372C0d17s2 

# vxdisk -g mixdg list 
DEVICE TYPE DISK GROUP STATUS 
c3t50060E80004372C0d17s2 auto:cdsdisk cds_disk01 mixdg online <====== 
--------------- 
Create volumes and files on mixdg disk group 
--------------- 
# vxassist -g mixdg maxsize 
Maximum volume size: 1918976 (937Mb) 
# vxassist -g mixdg make datavol 1918976 
# mkfs -F vxfs /dev/vx/rdsk/mixdg/datavol 
version 7 layout 
1929216 sectors, 964608 blocks of size 1024, log size 16384 blocks 
largefiles supported 
--------------- 
Mount the filesystem and populate with data 
--------------- 
# mount -F vxfs /dev/vx/dsk/mixdg/datavol /datavol 
# df -k 
Filesystem kbytes used avail capacity Mounted on 
/dev/vx/dsk/mixdg/datavol 
959488 174847 735831 20% /datavol 
--------------- 
After creation of the cds diskgroup, the data needs to be 'evacuated' to a new sliced disk. 
Important: Make sure there is equal or larger space on the new device compared to the current device. 

To verify they have equal size, verify the public length 
This is the original cdsdisk which has existing data and part of the diskgroup "mixdg" 
--------------- 
# vxdisk list c3t50060E80004372C0d17s2 
Device: c3t50060E80004372C0d17s2 
devicetag: c3t50060E80004372C0d17 


iosize: min=512 (bytes) max=2048 (blocks) 
public: slice=2 offset=65792 len=1920000 disk_offset=0 <==== length is "1920000" 
private: slice=2 offset=256 len=65536 disk_offset=0 
update: time=1273452460 seqno=0.7 
ssb: actual_seqno=0.0 
--------------- 
This is the new lun / it has same size as the existing cds disk 
--------------- 
# vxdisk list c3t50060E80004372C0d6s2 
Device: c3t50060E80004372C0d6s2 
devicetag: c3t50060E80004372C0d6 


version: 2.1 
iosize: min=512 (bytes) max=2048 (blocks) 
public: slice=4 offset=0 len=1920000 disk_offset=76800 <==== pub length is "1920000" 
private: slice=3 offset=1 len=76799 disk_offset=0 
update: time=1273451487 seqno=0.2 
--------------- 
Add a new device with equal or larger size than the existing cds disk in the diskgroup 
--------------- 
# vxdg -g mixdg adddisk sliced_disk01=c3t50060E80004372C0d6s2 
VxVM vxdg ERROR V-5-1-6478 Device c3t50060E80004372C0d6s2 cannot be added to a CDS disk group 
-- Error messages informs that the diskgroup cds attribute is "on". 
-- Cannot add non-cds type when the cds=on. 
Turn 'cds' off so a sliced format can be added to an existing cds disk group. 
# vxdg -g mixdg set cds=off 
Add the sliced disk to the diskgroup: 
# vxdg -g mixdg adddisk sliced_disk01=c3t50060E80004372C0d6s2 
# vxdisk -g mixdg list 
DEVICE TYPE DISK GROUP STATUS 
c3t50060E80004372C0d6s2 auto:sliced sliced_disk01 mixdg online 
c3t50060E80004372C0d17s2 auto:cdsdisk cds_disk01 mixdg online 
--------------- 
vxprint output showing device in used is "cds_disk01" 
--------------- 
# vxprint -rthg mixdg 


dg mixdg default default 27000 1273448675.146.license 
dm cds_disk01 c3t50060E80004372C0d17s2 auto 65536 1931008 - 
dm sliced_disk01 c3t50060E80004372C0d6s2 auto 76543 1881600 - 
v datavol - ENABLED ACTIVE 1929216 SELECT - fsgen 
pl datavol-01 datavol ENABLED ACTIVE 1929216 CONCAT - RW 
sd cds_disk01-01 datavol-01 cds_disk01 0 1929216 0 c3t50060E80004372C0d17 ENA 
--------------- 
Evacuate data from cdsdisk to sliced disk: 
--------------- 
# vxevac -g mixdg cds_disk01 sliced_disk01 
-- takes a bit of time to complete it depends on how big is your data 
--------------- 
Verify if the data is now in "sliced_disk01" disk: 
--------------- 
# vxprint -rthg mixdg 


dg mixdg default default 38000 1273452460.153.license 
dm cds_disk01 c3t50060E80004372C0d17s2 auto 65536 1920000 - 
dm sliced_disk01 c3t50060E80004372C0d6s2 auto 76799 1920000 - 
v datavol - ENABLED ACTIVE 1918976 SELECT - fsgen 
pl datavol-01 datavol ENABLED ACTIVE 1918976 CONCAT - RW 
sd sliced_disk01-01 datavol-01 sliced_disk01 0 1918976 0 c3t50060E80004372C0d6 ENA 
--------------- 
-- Verify access to the data/file system 

Remove the cds disk from the diskgroup: 
--------------- 
# vxdg -g mixdg rmdisk cds_disk01 

# vxdisk -g mixdg list 
DEVICE TYPE DISK GROUP STATUS 
c3t50060E80004372C0d6s2 auto:sliced sliced_disk01 mixdg online 
--------------- 
Uninitialize the original device 
--------------- 
# vxdiskunsetup -C c3t50060E80004372C0d17 
--------------- 
All data is now in evacuated to the new device formatted as sliced. 

If the volume data needs to be moved back, use the same procedure. 

Initialize the original device as sliced 
--------------- 
# vxdisksetup -i c3t50060E80004372C0d17 format=sliced 
--------------- 
NOTE: Make sure the publength is the same or the new disk where you will evacuate the data a has a higher publength size. 
Add the disk back to the disk group 
--------------- 
# vxdg -g mixdg adddisk orig_sliced_disk01=c3t50060E80004372C0d17s2 

# vxdisk -g mixdg list 
DEVICE TYPE DISK GROUP STATUS 
c3t50060E80004372C0d6s2 auto:sliced sliced_disk01 mixdg online 
c3t50060E80004372C0d17s2 auto:sliced orig_sliced_disk01 mixdg online 

# vxprint -rthg mixdg 


dg mixdg default default 38000 1273452460.153.license 
dm orig_sliced_disk01 c3t50060E80004372C0d17s2 auto 76543 1881600 - 
dm sliced_disk01 c3t50060E80004372C0d6s2 auto 76799 1920000 - 
v datavol - ENABLED ACTIVE 1918976 SELECT - fsgen 
pl datavol-01 datavol ENABLED ACTIVE 1918976 CONCAT - RW 
sd sliced_disk01-01 datavol-01 sliced_disk01 0 1918976 0 c3t50060E80004372C0d6 ENA 
--------------- 
Evacuate data from temp_sliced disk to the original physical device: 
--------------- 
# vxevac -g mixdg sliced_disk01 orig_sliced_disk01 
-- takes a bit of time to complete as it depends on how big is the data being evacuated. 
--------------- 
# vxprint -rthg mixdg 


dg mixdg default default 38000 1273452460.153.license 
dm orig_sliced_disk01 c3t50060E80004372C0d17s2 auto 65536 1920000 - 
dm sliced_disk01 c3t50060E80004372C0d6s2 auto 76799 1920000 - 
v datavol - ENABLED ACTIVE 1918976 SELECT - fsgen 
pl datavol-01 datavol ENABLED ACTIVE 1918976 CONCAT - RW 
sd orig_sliced_disk01-01 datavol-01 orig_sliced_disk01 0 1918976 0 c3t50060E80004372C0d17 ENA 
--------------- 
Remove the temporary disk from the diskgroup: 
--------------- 
# vxdg -g mixdg rmdisk sliced_disk01 

# vxdisk -g mixdg list 
DEVICE TYPE DISK GROUP STATUS 
c3t50060E80004372C0d17s2 auto:cdsdisk orig_sliced_disk01 mixdg online 
--------------- 
Uninitialize the sliced_disk01 device 
--------------- 
# vxdiskunsetup -C c3t50060E80004372C0d6 
---------------

No comments:

Post a Comment