@@ -115,6 +115,39 @@ if [ -z "$version" ]; then
115
115
exit 2
116
116
fi
117
117
118
+ NON_WRITABLE=" "
119
+ # ensure all nodes are writable
120
+ if " $CLUSTER " ; then
121
+ if [ -z " $FILE_TO_TEST " ]; then
122
+ FILE_TO_TEST=" /data/user/tmp/test-ro-file.txt"
123
+ fi
124
+
125
+ # Iterate through each node in the cluster
126
+ nodes=$( ghe-ssh " $host " ghe-cluster-nodes)
127
+ first=true
128
+ # echo $nodes | while read -r node; do
129
+ for node in $nodes ; do
130
+ if ! $( echo " set -o pipefail; ssh " $node " -- 'touch " $FILE_TO_TEST " && rm " $FILE_TO_TEST " '" | ghe-ssh " $host " /bin/bash) ; then
131
+ # echo "File system is writable on $node"
132
+ # else
133
+ echo " File system is not writeable on $node " 1>&2
134
+ if [ " $first " = true ]; then
135
+ NON_WRITABLE=" $node "
136
+ first=false
137
+ else
138
+ NON_WRITABLE=" $NON_WRITABLE , $node "
139
+ fi
140
+ fi || true
141
+ done
142
+ # Display the comma-separated list of non-writable nodes
143
+ if [ ! -z " $NON_WRITABLE " ]; then
144
+ echo " Error: Non-writable nodes: $NON_WRITABLE . Please make sure the file systems for all Enterprise nodes are writable." 1>&2
145
+ exit 1
146
+ else
147
+ echo " All nodes are writable."
148
+ fi
149
+ fi
150
+
118
151
# Block restoring snapshots to older releases of GitHub Enterprise Server
119
152
if [ -n " $GHE_RESTORE_SNAPSHOT_PATH " ]; then
120
153
snapshot_version=$( cat $GHE_RESTORE_SNAPSHOT_PATH /version)
@@ -177,7 +210,7 @@ SKIP_MSG
177
210
178
211
# Display dir requirements for repositories and mysql
179
212
echo -e " \nChecking host for sufficient space for a backup..."
180
- available_space=$( df -B 1k $GHE_DATA_DIR | awk ' END{printf "%.0f", $4 * 1024}' )
213
+ available_space=$( df -B 1k $GHE_DATA_DIR | awk ' END{printf "%.0f", $4 * 1024}' )
181
214
echo " We recommend allocating at least 5x the amount of storage allocated to the primary GitHub appliance for historical snapshots and growth over time."
182
215
183
216
repos_disk_size=$( transfer_size repositories /tmp)
0 commit comments