Search This Blog

Saturday, July 30, 2016

HOW TO CONVERT CFS TO LOCAL VXFS



Let us see how we can convert a CFS to Local VXFS
Before Proceeding we need to perform the activities from Master Node.
Below are the commands to perform this on the master node


[root@lab1 /]# vxclustadm nidmap

Name                             CVM Nid    CM Nid     State              

lab1                             1          0          Joined: Master     

lab2                             2          1          Joined: Slave      

lab3                             0          2          Joined: Slave      

[root@lab1 /]# vxdctl -c mode

mode: enabled: cluster active - MASTER

master: lab1

Check the current cluster status:
[root@lab1 /]# cfscluster status



  Node             :  lab1

  Cluster Manager  :  running

  CVM state        :  running

  MOUNT POINT    SHARED VOLUME  DISK GROUP        STATUS

  /app/test      appvol01       appdg             MOUNTED      

  /app/test1     appvol02       appdg             MOUNTED      





  Node             :  lab2

  Cluster Manager  :  running

  CVM state        :  running

  MOUNT POINT    SHARED VOLUME  DISK GROUP        STATUS

  /app/test      appvol01       appdg             MOUNTED      

  /app/test1     appvol02       appdg             MOUNTED      





  Node             :  lab3

  Cluster Manager  :  running

  CVM state        :  running

  MOUNT POINT    SHARED VOLUME  DISK GROUP        STATUS

  /app/test      appvol01       appdg             MOUNTED      

  /app/test1     appvol02       appdg             MOUNTED   


Let us Create 10Mb files in two CFS  Mount Point
[root@lab1 /]# dd if=/dev/zero of=/app/test/test1_sample bs=10485760 count=1

1+0 records in

1+0 records out

10485760 bytes (10 MB) copied, 1.41686 s, 7.4 MB/s



[root@lab1 /]# dd if=/dev/zero of=/app/test1/test2_sample bs=10485760 count=1

1+0 records in

1+0 records out

10485760 bytes (10 MB) copied, 1.87966 s, 5.6 MB/



[root@lab1 /]# df -Ph /app/test

Filesystem                  Size  Used Avail Use% Mounted on

/dev/vx/dsk/appdg/appvol01  100M   18M   78M  19% /app/test



[root@lab1 /]# ls -l /app/test

total 10240

drwxr-xr-x. 2 root root       96 Jul 22 19:22 lost+found

-rw-r--r--. 1 root root 10485760 Jul 23 09:20 test1_sample



[root@lab1 /]# df -Ph /app/test1

Filesystem                  Size  Used Avail Use% Mounted on

/dev/vx/dsk/appdg/appvol02  100M   18M   78M  19% /app/test1



[root@lab1 /]# ls -l /app/test1

total 10240

drwxr-xr-x. 2 root root       96 Jul 23 08:52 lost+found

-rw-r--r--. 1 root root 10485760 Jul 23 09:20 test2_sample

Now we have Data in 2 mount points:

Unmounting Both the mount Points:
[root@lab1 /]# cfsumount /app/test

  Unmounting...

  /app/test got successfully unmounted from lab1

  /app/test got successfully unmounted from lab2

  /app/test got successfully unmounted from lab3


[root@lab1 /]# cfsumount /app/test1

  Unmounting...

  /app/test1 got successfully unmounted from lab2

  /app/test1 got successfully unmounted from lab3

  /app/test1 got successfully unmounted from lab1


Removing the mount Point from CVM Configuraiton:

[root@lab1 /]# cfsmntadm delete /app/test

  Mount Point is being removed...

  /app/test deleted successfully from cluster-configuration



[root@lab1 /]# cfsmntadm delete /app/test1

  Mount Point is being removed...

  /app/test1 deleted successfully from cluster-configuration


Checking Cluster Status:
[root@lab1 /]# cfscluster status



  Node             :  lab1

  Cluster Manager  :  running

  CVM state        :  running

  No mount point registered with cluster configuration





  Node             :  lab2

  Cluster Manager  :  running

  CVM state        :  running

  No mount point registered with cluster configuration





  Node             :  lab3

  Cluster Manager  :  running

  CVM state        :  running

  No mount point registered with cluster configuration



[root@lab1 /]# hastatus -summ



-- SYSTEM STATE

-- System               State                Frozen             



A  lab1                 RUNNING              0                   

A  lab2                 RUNNING              0                   

A  lab3                 RUNNING              0                   



-- GROUP STATE

-- Group           System               Probed     AutoDisabled    State         



B  cvm             lab1                 Y          N               ONLINE        

B  cvm             lab2                 Y          N               ONLINE        

B  cvm             lab3                 Y          N               ONLINE


Deport The DG:
[root@lab1 /]# vxdg deport appdg

Import the DG:
[root@lab1 /]# vxdg import appdg

Check the DG status:
[root@lab1 /]# vxdisk -oalldgs list|grep appdg

disk_3       auto:cdsdisk    appdg02      appdg        online

disk_7       auto:cdsdisk    appdg01      appdg        online

You could see the Shared Tag is not there for the DG now after being imported. We can use this as now Local FS.
Start all the volume:
[root@lab1 /]# vxvol -g appdg startall

Mount the Volume Again:
[root@lab1 /]# mount -t vxfs /dev/vx/dsk/appdg/appvol01 /app/test

[root@lab1 /]# mount -t vxfs /dev/vx/dsk/appdg/appvol02 /app/test1

Now check the data in each mount point:
[root@lab1 /]# mount -t vxfs /dev/vx/dsk/appdg/appvol02 /app/test1

[root@lab1 /]# ls -l /app/test/

total 10240

drwxr-xr-x. 2 root root       96 Jul 22 19:22 lost+found

-rw-r--r--. 1 root root 10485760 Jul 23 09:20 test1_sample



[root@lab1 /]# ls -l /app/test1

total 10240

drwxr-xr-x. 2 root root       96 Jul 23 08:52 lost+found

-rw-r--r--. 1 root root 10485760 Jul 23 09:20 test2_sample



[root@lab1 /]# cfscluster status



  Node             :  lab1

  Cluster Manager  :  running

  CVM state        :  running

  No mount point registered with cluster configuration





  Node             :  lab2

  Cluster Manager  :  running

  CVM state        :  running

  No mount point registered with cluster configuration





  Node             :  lab3

  Cluster Manager  :  running

  CVM state        :  running

  No mount point registered with cluster configuration

This is how we converted the CFS FS to local FS.


Thank you for reading.

For Reading other article, visit to “https://sites.google.com/site/unixwikis/

No comments:

Post a Comment