Visit Counter

Tuesday, March 7, 2017

Creating, Destroying, and Renaming ZFS File Systems in Solaris 11 Sparc




Solaris 11 Sparc
--------------------

ZFS file systems can be created and destroyed by using the zfs create and zfs destroy commands. ZFS file systems can be renamed by using the zfs rename command.


Last time I added two new disks in M3000 Sparc Server which running on Solaris 11.3



Creating a ZFS file system

Destroying a ZFS file system
Renaming a ZFS file system



root@afi-ssaerp:/# zpool status

  pool: datapool
 state: ONLINE
  scan: none requested
config:

        NAME       STATE     READ WRITE CKSUM

        datapool   ONLINE       0     0     0
          c2t40d0  ONLINE       0     0     0

errors: No known data errors


  pool: lnpool

 state: ONLINE
  scan: none requested
config:

        NAME      STATE     READ WRITE CKSUM

        lnpool    ONLINE       0     0     0
          c1t2d0  ONLINE       0     0     0
          c1t3d0  ONLINE       0     0     0

errors: No known data errors


  pool: rpool

 state: ONLINE
  scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM

        rpool          ONLINE            0     0     0
        c1t0d0s0   ONLINE              0     0     0

errors: No known data errors


root@afi-ssaerp:/#


 #  zpool create c1t2d0 c1t3d0 lnpool  (Pool Name)

   
#  zpool create lnpool c1t2d0 c1t3d0    

root@afi-ssaerp:~# format

Searching for disks...done



AVAILABLE DISK SELECTIONS:

       0. c1t0d0 <FUJITSU-MBD2147RC-3701 cyl 14087 alt 2 hd 24 sec 848>
          /pci@0,600000/pci@0/pci@0/scsi@0/sd@0,0
       1. c1t1d0 <FUJITSU-MBB2147RC-3703 cyl 14087 alt 2 hd 24 sec 848>
          /pci@0,600000/pci@0/pci@0/scsi@0/sd@1,0
       2. c1t2d0 <HGST-H101860SFSUN600G-A990-558.91GB>
          /pci@0,600000/pci@0/pci@0/scsi@0/sd@2,0
       3. c1t3d0 <HGST-H101860SFSUN600G-A3T0-558.91GB>
          /pci@0,600000/pci@0/pci@0/scsi@0/sd@3,0
       4. c2t40d0 <SUN-StorEdge 3510-327R-681.16GB>
          /pci@0,600000/pci@0/pci@8/SUNW,qlc@0/fp@0,0/ssd@w216000c0ff87d4cf,0



Specify disk (enter its number):



root@afi-ssaerp:~#  zpool list


NAME       SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT

datapool   680G   204K   680G   0%  1.00x  ONLINE  -
lnpool    1.09T   186K  1.09T   0%  1.00x  ONLINE  -
rpool      136G   133G  3.13G  97%  1.00x  ONLINE  -


root@afi-ssaerp:~#



Creating a ZFS file system



# df -h


lnpool                 1.1T    31K       1.1T     1%    /lnpool

lnpool/test            1.1T    31K       1.1T     1%    /test
lnpool/inforln         1.1T    31K       1.1T     1%    /inforln


 # zfs create lnpool/test



# zfs set mountpoint=/inforln lnpool/inforln





root@afi-ssaerp:/# zfs get mountpoint lnpool/ora

NAME        PROPERTY    VALUE  SOURCE
lnpool/inforln  mountpoint  /inforln   local


Destroying a ZFS File System



To destroy a ZFS file system, use the zfs destroy command. The destroyed file system is automatically unmounted and unshared. For more information about automatically managed mounts or automatically managed shares, see Automatic Mount PointsIn the following example, the test file system is destroyed:





root@afi-ssaerp:/# zfs list
NAME                              USED  AVAIL  REFER  
lnpool                                234K  1.07T    31K  /lnpool
lnpool/inforln                     31K  1.07T    31K  /inforln
lnpool/ora                           31K  1.07T    31K  /ora
lnpool/test                           31K  1.07T    31K  /test




root@afi-ssaerp:/# zfs destroy lnpool/test




root@afi-ssaerp:/# zfs list

NAME                              USED  AVAIL  REFER 

lnpool/inforln                     31K  1.07T    31K  /inforln
lnpool/ora                           31K  1.07T    31K  /ora



remove test folder from / mount point
# rm -rf test






Renaming a ZFS file system


While renameing the zfs file system getting error: Cannot Un mount '/ora' device busy




root@afi-ssaerp:~# zfs rename rpool/ora rpool/ora1



cannot unmount '/ora': Device busy

We have to unmount the mountpoint /ora using below command.

root@afi-ssaerp:~# zfs umount -f /ora



root@afi-ssaerp:~# zfs rename rpool/ora rpool/ora1

root@afi-ssaerp:~# zfs mount rpool/ora1

root@afi-ssaerp:~# zfs mountpoint=ora1 rpool/ora1

root@afi-ssaerp:~# df -h
....


rpool/ora1              55G    12G       380M    97%    /ora1


Refer:


http://docs.oracle.com/cd/E19253-01/819-5461/gamnq/index.html