Skip to content

Commit

Permalink
Skip readonly ZFS properties during zfs clone operation.
Browse files Browse the repository at this point in the history
  • Loading branch information
vermaden committed Jun 1, 2022
1 parent f3b6d85 commit e16839f
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions beadm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh -e

# Copyright (c) 2012-2020 Slawomir Wojciech Wojtczak (vermaden)
# Copyright (c) 2012-2022 Slawomir Wojciech Wojtczak (vermaden)
# Copyright (c) 2012-2013 Bryan Drewery (bdrewery)
# Copyright (c) 2012-2013 Mike Clarke (rawthey)
# Copyright (c) 2013 Dancho Penev (dpslavov)
Expand Down Expand Up @@ -50,7 +50,7 @@ then
echo " / / // ___// / // / // / / /\ \ / / // / "
echo " \____/ \____/ \_____\\\____//__/__/__/ \_\\\____//_/ "
echo
echo "beadm 1.3.5 2022/05/06"
echo "beadm 1.3.6 2022/06/01"
echo
exit 0
fi
Expand Down Expand Up @@ -244,13 +244,20 @@ __be_new() { # 1=SOURCE 2=TARGET
local OPTS=""
while read NAME PROPERTY VALUE
do
if [ "${VALUE}" != "" ]
then
local OPTS="-o ${PROPERTY}=\"${VALUE}\" ${OPTS}"
else
local OPTS=""
break
fi
case ${PROPERTY} in
(snapshot_count|filesystem_count)
# read only property - skip it
;;
(*)
if [ "${VALUE}" != "" ]
then
local OPTS="-o ${PROPERTY}=\"${VALUE}\" ${OPTS}"
else
local OPTS=""
break
fi
;;
esac
done << EOF
$( zfs get -o name,property,value -s local,received -H all ${FS} | awk '!/[\t ]canmount[\t ]/' )
EOF
Expand Down

0 comments on commit e16839f

Please sign in to comment.