Comandos Varios de ZFS

Page last edited hace 2059 días 13 horas
De Solaris-ES
Saltar a: navegación, buscar

Comandos Varios de ZFS[editar]

# zpool create -o canmount=noauto -m /oracle/pkg01 pnewtour-dg da1d0 da2d0 da3d0
# zpool create -m none pnewtour-dg da1d0 da2d0 da3d0
# zpool create tank raidz da0d0 da1d0 da2d0
# zpool create tank mirror da0d0 da1d0 mirror da2d0 da3d0
# zpool destroy pnewtour-dg
# zpool list
# zpool status
# zpool import -f pnewtour-dg
# zpool export pnewtour-dg
# zpool add pnewtour-dg c5tXd0
# zpool iostat pnewtour-dg 5 10
# zfs create pnewtour-dg/test
# zfs destroy pnewtour-dg/test
# zfs list
# zfs list -o type,used,available,referenced,mounted,quota,reservation,volsize,mountpoint,sharenfs,devices,canmount,name
# zfs rename pnewtour-dg/test pnewtour-dg/test2
# zfs set mountpoint=none pnewtour-dg
# zfs unmount pnewtour-dg
# zfs mount pnewtour-dg
  • Crear un mirror a partir de un zpool existente
root@zonepool01 # zpool status
  pool: zona1-zpool
 state: ONLINE
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        zona1-zpool  ONLINE       0     0     0
          c0t0d0s4  ONLINE       0     0     0

errors: No known data errors

  pool: zona2-zpool
 state: ONLINE
 scrub: none requested
config:
 
         NAME        STATE     READ WRITE CKSUM
         zona2-zpool  ONLINE       0     0     0
          c0t1d0s5  ONLINE       0     0     0

errors: No known data errors

 pool: zona3-zpool
state: ONLINE
scrub: none requested
config:

        NAME          STATE     READ WRITE CKSUM
        zona3-zpool   ONLINE       0     0     0
          mirror-0    ONLINE       0     0     0
            c0t0d0s6  ONLINE       0     0     0
            c0t1d0s6  ONLINE       0     0     0

errors: No known data errors

root@zonepool01 # zpool attach zona1-zpool c0t0d0s4 c0t1d0s4
root@zonepool01 # zpool status
  pool: zona1-zpool
 state: ONLINE
status: One or more devices is currently being resilvered.  The pool will
        continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scrub: resilver in progress for 0h0m, 1.16% done, 0h19m to go
config:

        NAME          STATE     READ WRITE CKSUM
        zona1-zpool   ONLINE       0     0     0
          mirror-0    ONLINE       0     0     0
            c0t0d0s4  ONLINE       0     0     0
            c0t1d0s4  ONLINE       0     0     0  751M resilvered

errors: No known data errors

  pool: zona2-zpool
 state: ONLINE
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        zona2-zpool  ONLINE       0     0     0
          c0t1d0s5  ONLINE       0     0     0

errors: No known data errors

  pool: zona3-zpool
 state: ONLINE
 scrub: none requested
config:

        NAME          STATE     READ WRITE CKSUM
        zona3-zpool   ONLINE       0     0     0
          mirror-0    ONLINE       0     0     0
            c0t0d0s6  ONLINE       0     0     0
            c0t1d0s6  ONLINE       0     0     0

errors: No known data errors


  • Crear un RAW de 4G
# zfs create -V 4g pnewtour-dg/test
# newfs /dev/zvol/rdsk/pnewtour-dg/test 
# mount /dev/zvol/dsk/pnewtour-dg/test /export/test
# zfs get all pnewtour-dg
# zfs set mountpoint=/export/test pnewtour-dg/test
# zfs set quota=50G pnewtour-dg/test
# zfs set sharenfs=on pnewtour-dg
# zfs set checksum=off pnewtour-dg
# zfs set atime=off pnewtour-dg
# zfs set compression=gzip pnewtour-dg
# zfs set compression=off pnewtour-dg
# zfs set canmount=noauto pnewtour-dg
# zfs unmount rpool/guests
# zfs set canmount=noauto rpool/guests
# zfs mountpoint=/guests guests	
format -e c6t1d0  
zpool  
zpool list  
zpool create -f -o failmode=continue -R /mnt -m legacy rbackup c6t1d0s0
zfs snapshot -r rpool@today
zfs send -R rpool@today | zfs receive -F -d rbackup
zfs destroy -r rbackup@today
zfs destroy -r rpool@today
mount -F zfs rbackup/ROOT/opensolaris /mnt
cd etc  
vi vfstab   
vi dumpadm.conf   
rm /mnt/etc/zfs/zpool.cache
df -k /  
zpool set bootfs=rbackup/ROOT/opensolaris rbackup
cd /boot/grub
installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c6t0d0s0
umount /mnt  
zpool export rbackup  
zfs set automount=noauto rpool/ROOT/opensolaris/opt
zfs set automount=noauto rpool/audit
zfs set automount=noauto rpool/export
zfs set automount=noauto rpool/export/home
zfs set automount=noauto rpool/guests
 init 6
zpool export rpool
REPARTICIONAR DISCO c6t0d0  
 zpool attach -f rbackup c6t1d0s0 c6t0d0s0
zpool create -f guests c6t1d0s3
 zpool add -f guests c6t0d0s3
 zfs set canmount=noauto rbackup/guests
 zfs set canmount=on guests
 init 6