#!/usr/bin/bash
# Path to ZFS executable:
ZFS=/usr/sbin/zfs
# Parse arguments:
TARGET=$1
SNAP=$2
COUNT=$3
mount=`$ZFS get -H -o value mountpoint $TARGET`
# Function to display usage:
usage() {
scriptname=`/usr/bin/basename $0`
echo "$scriptname: Take and rotate snapshots on a ZFS file system"
echo
echo " Usage:"
echo " $scriptname target snap_name count"
echo
echo " target: ZFS file system to act on"
echo " snap_name: Base name for snapshots, to be followed by a '.' and"
echo " an integer indicating relative age of the snapshot"
echo " count: Number of snapshots in the snap_name.number format to"
echo " keep at one time. Newest snapshot ends in '.0'."
echo
exit
}
# Basic argument checks:
if [ -z $COUNT ] ; then
usage
fi
if [ ! -z $4 ] ; then
usage
fi
# Snapshots are number starting at 0; $max_snap is the highest numbered
# snapshot that will be kept.
max_snap=$(($COUNT -1))
# Clean up oldest snapshot:
if [ -d /$mount/.zfs/snapshot/$SNAP.$max_snap ] ; then
$ZFS destroy -r $TARGET@$SNAP.$max_snap
fi
# Rename existing snapshots:
dest=$max_snap
while [ $dest -gt 0 ] ; do
src=$(($dest - 1))
if [ -d /$mount/.zfs/snapshot/$SNAP.$src ] ; then
$ZFS rename -r $TARGET@$SNAP.$src $TARGET@$SNAP.$dest
fi
dest=$(($dest - 1))
done
# Create new snapshot:
$ZFS snapshot -r $TARGET@$SNAP.0
Hi,
I need to increase a veritas filesystem I have currently mounted on a Solaris 10 server. We can resize the LUN on the NetApp filer no problem. What I need to know is what do I do next on the Solaris 10 server I have so that it will see the increase in size. Do I run 'devfsadm' to... (3 Replies)
I had a pool which was exported and due to some issues on my SAN i was never able to import it again. Can anyone tell me how can i destroy the exported pool to free up the LUN. I tried to create a new pool on the same pool but it gives me following error
# zpool create emcpool4 emcpower0c... (0 Replies)
Hi All,
I am trying to read zpool.cache file to find out pool information like pool name, devices it uses and all properties.
File seems to be in packed format.I am not sure how to unpack it.
But from opensolaris code base we can see that they have used libz for uncompromising this file, but... (0 Replies)
Hello,
It's been a while since I've done AIX..., but I'm planning
a new TSM on AIX disk-only backup solution.
I'm planning to make an AIX volume group out of 40 luns of 1 TB.
I'm planning to create one big file system on here.
The purpose for this is to use this as a device class FILE for... (5 Replies)
Hi,
I have aix 6.1 box. I want to configure iscsi luns from netapp storage. I tried in google but not getting proper solution for that. i m not getting the proper iqn name.
Please share me the steps to complete this requirements.
Thanks in advance. (1 Reply)
Hello,
Does anyone know how I can tell what disk are being not being used by a zpool?
For example in Veritas Volume manager, I can run a "vxdisk list" and disks that are marked as "online invalid" are disk that are not used.
I'm looking for a similar command in ZFS which will easily show... (5 Replies)
Hi,
I am trying to setup multipathing (using DM multipath) for a redhat cluster setup ...all setup is done but issue is :
node 1 shows the shared iscsi lun as sdc
node 2 shows the same as sdg (changes on reboots)
Due to this (i guess) i get i/o error & i can not read files created by... (0 Replies)
Hi
I need to identify a newly attached LUN from NetApp on a linuxserver running uname -o
GNU/Linux
I have first run the df -h and got the following:
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_outsystemdb-lv_root
50G 2.7G 45G ... (3 Replies)
Discussion started by: fretagi
3 Replies
LEARN ABOUT CENTOS
vgimport
VGIMPORT(8) System Manager's Manual VGIMPORT(8)NAME
vgimport - make exported volume groups known to the system
SYNOPSIS
vgimport [-a|--all] [-d|--debug] [-h|-?|--help] [-v|--verbose] VolumeGroupName [VolumeGroupName...]
DESCRIPTION
vgimport allows you to make a Volume Group that was previously exported using vgexport(8) known to the system again, perhaps after moving
its Physical Volumes from a different machine.
OPTIONS
See lvm(8) for common options.
-a, --all
Import all exported Volume Groups.
--force
Import exported Volume Groups even if there are missing Physical Volumes. This option should only be used if the missing devices
are known to have failed and they cannot be restored.
SEE ALSO lvm(8), pvscan(8), vgexport(8), vgscan(8)Sistina Software UK LVM TOOLS 2.02.105(2)-RHEL7 (2014-03-26) VGIMPORT(8)