Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Can't create folders in my backups share

Featured Replies

  • Community Expert
2 hours ago, phunky1 said:

When mover runs, it remove the share folder which then causes the issues.

This issue happens when the mover tries to destroy the dataset and fails, leaving it unmounted. If you are seeing a different behavior, it's likely not the same issue

  • Replies 60
  • Views 2.3k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • LT believes they have found the problem, and it will be resolved for 7.2.1

  • Actually think I found the problem. I also run duplicacy, which backs up my backup share on Sundays at 2am but we just switched over to daylight savings time a few weeks ago in Australia. My suspicion

  • I continue to have this pop up on one of my servers. Have disabled all backup plugins/services and switched from SABnzbd to NZBget (on a hunch that didn't turn out to be true. Still think it may be

  • Community Expert

7.2.1-rc.1 is out, and it should resolve this issue, please retest.

Same problem I found because torrents could not be created downloaded. Temporary fix zfs mount -a. Is this fixed on 7.2.1?

  • Community Expert
35 minutes ago, etsi said:

Is this fixed on 7.2.1?

It is meant to be fixed in 7.2.1-rc1 which is now available if you want to confirm it is fixed for you.

8 hours ago, etsi said:

Temporary fix zfs mount -a

When and how often running this needed?

Its Save that running hourly, every x Minutes or every time that the syslog sad the dataset already exist?

A Script for the actually Situation:

#!/bin/bash
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # Temp Fix Script for shfs: cannot create 'cache/Share Name': dataset already exists # #
# # (needs Unraid 7.2, maybe fixed in 7.2.1) # # 
# # # # 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

# -----------------------------------------
# Temp‑Fix‑Script für Unraid 7.2
#
# • prüft das Syslog nach "cannot create '<DATASET>': dataset already exists"
# • berücksichtigt nur Einträge der letzten N Minuten (Standard 5)
# • prüft die definierte OS‑Version (Standard 7.2.0)
# • führt bei einem Treffer "zfs mount -a" aus
# • schreibt alles in ein Log‑File und rotiert bei Überschreitung der Größe (Standard >5 MiB)
# • anonymisiert Host‑ und Dataset‑Infos (Schalter ANONYMIZE)
# ------------------------------------------------

# ============= Konfiguration ==============
ANONYMIZE=false # true → anonymisieren, false → originale Werte
TARGET_VERSION="7.2.0" # gewünschte Unraid‑Version
LOGFILE="/mnt/user/Logs/unraid_zfs_mount.log" # z.B. /mnt/user/Logs/unraid_zfs_mount.log
MAX_LOG_SIZE=$((5 * 1024 * 1024)) # 5 MiB → Rotation
ZFS_CMD="zfs" # ggf. voller Pfad (/usr/sbin/zfs)
SYSLOG="/var/log/syslog" # z.B. /var/log/syslog oder /var/log/messages
TIME_WINDOW_MIN=5 # Minuten zurück schauen
# =================================================

# -------------------- Farben (Konsole) ----------------------
C_RESET="\e[0m"
C_BLUE="\e[34m" # INFO
C_GREEN="\e[32m" # SUCCESS
C_YELLOW="\e[33m" # WARN
C_RED="\e[31m" # ERROR

# ---------------- Anonymisierungs‑Funktion ----------------
# Ersetzt den Hostnamen (4. Feld) und den Dataset‑Pfad.
anonymize_line() {
local line="$1"

#  Hostnamen anonymisieren (4. Feld im klassischen Syslog‑Format)
line=$(echo "$line" | awk '{ $4="<HOSTNAME>"; print }')

#  Dataset‑Pfad anonymisieren (zwischen "cannot create '" und "':")
line=$(echo "$line" | sed -E "s/(cannot create ')[^']+(')/\1<PATH>\/<DATASET>\2/")
echo "$line"
}
# -----------------------------------------------------------------

# --------------------------- Logging‑Funktion --------------
log() {
local level="$1"
local msg_raw="$2" # kann eine komplette Syslog‑Zeile sein
local ts
ts=$(date '+%Y-%m-%d %H:%M:%S')

# ----- Anonymisierung entscheiden -----
if $ANONYMIZE && [[ "$msg_raw" =~ ^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[[:space:]] ]]; then
# Nachricht sieht aus wie eine Syslog‑Zeile → anonymisieren
msg=$(anonymize_line "$msg_raw")
else
msg="$msg_raw"
fi

#  Log‑Eintrag (ohne Farben)
echo "[$ts] [$level] $msg" >> "$LOGFILE"

#  Farbige Ausgabe auf der Konsole
local colour
case "$level" in
INFO) colour=$C_BLUE ;;
SUCCESS) colour=$C_GREEN ;;
WARN) colour=$C_YELLOW ;;
ERROR) colour=$C_RED ;;
*) colour=$C_RESET ;;
esac
echo -e "${colour}[$ts] [$level] $msg${C_RESET}"

#  Log‑Größen‑Check → logrotate
if [[ -f "$LOGFILE" ]]; then
local size
size=$(stat -c%s "$LOGFILE")
if (( size > MAX_LOG_SIZE )); then
echo "[$ts] [WARN] Log‑Datei > ${MAX_LOG_SIZE} Byte – starte logrotate." >> "$LOGFILE"
echo -e "${C_YELLOW}[$ts] [WARN] Log‑Datei > ${MAX_LOG_SIZE} Byte – starte logrotate.${C_RESET}"
if command -v logrotate >/dev/null 2>&1; then
logrotate -f /etc/logrotate.d/unraid_zfs_mount 2>/dev/null
if [[ $? -eq 0 ]]; then
echo "[$ts] [SUCCESS] logrotate erfolgreich ausgeführt." >> "$LOGFILE"
echo -e "${C_GREEN}[$ts] [SUCCESS] logrotate erfolgreich ausgeführt.${C_RESET}"
else
echo "[$ts] [ERROR] logrotate fehlgeschlagen!" >> "$LOGFILE"
echo -e "${C_RED}[$ts] [ERROR] logrotate fehlgeschlagen!${C_RESET}"
fi
else
echo "[$ts] [WARN] logrotate nicht gefunden – bitte manuell bereinigen." >> "$LOGFILE"
echo -e "${C_YELLOW}[$ts] [WARN] logrotate nicht gefunden – bitte manuell bereinigen.${C_RESET}"
fi
fi
fi
}
# --------------------------------------------------------------------

# ---------------------------  Unraid‑Version ermitteln ----------
if [[ -f /etc/unraid-version ]]; then
UNRAID_VER=$(grep -oE '[0-9]+\.[0-9]+(\.[0-9]+)?' /etc/unraid-version | head -n1)
log "INFO" "Version aus /etc/unraid-version: $UNRAID_VER"
elif grep -q '^VERSION_ID=' /etc/os-release; then
UNRAID_VER=$(grep '^VERSION_ID=' /etc/os-release | cut -d'"' -f2)
log "INFO" "Version aus /etc/os-release: $UNRAID_VER"
else
log "ERROR" "Konnte Unraid‑Version nicht ermitteln."
exit 1
fi

if [[ "$UNRAID_VER" != "$TARGET_VERSION" ]]; then
log "INFO" "Unraid‑Version ($UNRAID_VER) ≠ $TARGET_VERSION → Skript beendet."
exit 0
fi
log "INFO" "Unraid‑Version ($UNRAID_VER) entspricht Zielversion – starte Prüfungen."

# ---------------------  Syslog‑Scan --------------------
if [[ ! -f "$SYSLOG" ]]; then
log "ERROR" "Syslog-Datei $SYSLOG nicht gefunden."
exit 1
fi

# Hilfsfunktion: Monat‑Kurzname → Zahl (z.B. Nov → 11)
month_to_num() {
case "$1" in
Jan) echo 01 ;;
Feb) echo 02 ;;
Mar) echo 03 ;;
Apr) echo 04 ;;
May) echo 05 ;;
Jun) echo 06 ;;
Jul) echo 07 ;;
Aug) echo 08 ;;
Sep) echo 09 ;;
Oct) echo 10 ;;
Nov) echo 11 ;;
Dec) echo 12 ;;
*) echo 00 ;; # fallback
esac
}

# Zeitgrenze: jetzt – TIME_WINDOW_MIN Minuten
NOW_EPOCH=$(date +%s)
LIMIT_EPOCH=$(( NOW_EPOCH - TIME_WINDOW_MIN * 60 ))

log "INFO" "Suche nach Fehlermeldungen der letzten ${TIME_WINDOW_MIN} Minuten …"

# Regex‑Muster, das wir suchen
PATTERN="cannot create '([^']+)': dataset already exists"

FOUND=0

while IFS= read -r line; do
# Schnell prüfen, ob das Muster überhaupt vorkommt
if ! echo "$line" | grep -Ei "$PATTERN" >/dev/null 2>&1; then
continue
fi

# Beispiel‑Log‑Zeile:
# Nov 9 02:08:42 <HOSTNAME> shfs: cannot create 'cache/<DATASET>': dataset already exists
month=$(echo "$line" | awk '{print $1}')
day=$(echo "$line" | awk '{print $2}')
time=$(echo "$line" | awk '{print $3}')

# Monat → Zahl, Tag ggf. mit führender Null
mon_num=$(month_to_num "$month")
day_padded=$(printf "%02d" "$day")

# Vollständiges Datum (Jahr = aktuelles Jahr)
year=$(date +%Y)
datetime_str="${year}-${mon_num}-${day_padded} ${time}" # z.B. 2025-11-09 02:08:42

# In Epoch‑Zeit umwandeln (GNU date)
entry_epoch=$(date -d "$datetime_str" +%s 2>/dev/null || echo 0)

# Nur Einträge innerhalb des definierten Fensters berücksichtigen
if (( entry_epoch >= LIMIT_EPOCH )); then
ds=$(echo "$line" | perl -ne 'print "$1\n" if /cannot create '\''([^'\'']+)'\''/i')
# Log‑Eintrag – die `log`‑Funktion übernimmt ggf. Anonymisierung
log "WARN" "$line"
FOUND=1
fi
done < "$SYSLOG"

# ---------------------------  Ergebnis auswerten --------------------
if (( FOUND )); then
# ---- ZFS mount -a ausführen ----
if ! command -v "$ZFS_CMD" >/dev/null 2>&1; then
log "ERROR" "ZFS‑Tool nicht gefunden (Befehl $ZFS_CMD fehlt)."
exit 1
fi
log "INFO" "Führe '$ZFS_CMD mount -a' aus …"
if "$ZFS_CMD" mount -a >>"$LOGFILE" 2>&1; then
log "SUCCESS" "'$ZFS_CMD mount -a' erfolgreich abgeschlossen."
else
log "ERROR" "'$ZFS_CMD mount -a' fehlgeschlagen – siehe Log."
fi
else
log "SUCCESS" "Kein 'cannot create … dataset already exists'-Eintrag in den letzten ${TIME_WINDOW_MIN} Minuten gefunden – kein Mount nötig."
fi
  • Community Expert
7 hours ago, Revan335 said:

A Script for the actually Situation:

Instead of using a script, please upgrade to 7.2.1-rc.1 and retest to confirm if it's fixed there, since both I and LT cannot reproduce the issue.

I've been on 7.2.1-rc.1 for 37 hours and it appears to be fixed.

I have the same issue since 7.2.0

zfs mount -a works as a workaround

Installed 7.2.1 rc1 a few moments ago and will test it! Thanks!

On 11/12/2025 at 10:47 AM, Master-Rudi said:

Installed 7.2.1 rc1 a few moments ago and will test it! Thanks!

Works fine, tested a lot with mover running and files eg. Seems to be fixed with 7.2.1

With Running Mover Check and other Improvements!

We are very excited for 7.2.1 with a general Fix for all!

#!/bin/bash
# -------------------------
# USER_SCRIPT_NAME="ZFS – Temp Fix – Dataset Creation"
# USER_SCRIPT_DESCRIPTION="Durchsucht das Syslog nach \"cannot create … dataset already exists\" und führt bei Bedarf \"zfs mount -a\" aus."
# USER_SCRIPT_LOGFILE="/mnt/user/Logs/unraid_zfs_mount.log"
# USER_SCRIPT_CRON="0 */6 * * *" # optional: alle 6 Stunden automatisch ausführen
# -----------------------------

# --------------
# Konfiguration
# -------------------
ANONYMIZE=false # true → anonymisieren, false → Originalwerte
TARGET_VERSION="7.2.0" # gewünschte Unraid‑Version
LOGFILE="/mnt/user/Logs/unraid_zfs_mount.log"
MAX_LOG_SIZE=$((5 * 1024 * 1024)) # 5 MiB → Rotation
ZFS_CMD="zfs" # ggf. voller Pfad (/usr/sbin/zfs)
SYSLOG="/var/log/syslog" # oder /var/log/messages
TIME_WINDOW_MIN=5 # Minuten zurückblicken

# -------------------
# Farben (Konsole)
# ---------------
C_RESET="\e[0m"
C_BLUE="\e[34m"
C_GREEN="\e[32m"
C_YELLOW="\e[33m"
C_RED="\e[31m"

# -----------------------
# Hilfsfunktionen
# ------------------------

# Anonymisiert sensible Teile einer Log‑Zeile
anonymize_line() {
local line="$1"
# Hostnamen anonymisieren (4. Feld im klassischen Syslog‑Format)
line=$(awk '{ $4=""; print }' <<<"$line")
# Dataset‑Pfad anonymisieren (zwischen "cannot create '" und "':")
line=$(sed -E "s/(cannot create ')[^']+(')/\1<redacted>\2/" <<<"$line")
printf '%s\n' "$line"
}

# Einheitliches Logging (Datei + farbige Console‑Ausgabe)
log() {
local level="$1"
local msg_raw="$2"
local ts=$(date '+%Y-%m-%d %H:%M:%S')
local msg

if $ANONYMIZE && [[ "$msg_raw" =~ ^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[[:space:]] ]]; then
msg=$(anonymize_line "$msg_raw")
else
msg="$msg_raw"
fi

#  Log‑Eintrag (ohne Farben)
printf '[%s] [%s] %s\n' "$ts" "$level" "$msg" >>"$LOGFILE"

#  Farbige Ausgabe auf der Konsole
local colour
case "$level" in
INFO) colour=$C_BLUE ;;
SUCCESS) colour=$C_GREEN ;;
WARN) colour=$C_YELLOW ;;
ERROR) colour=$C_RED ;;
*) colour=$C_RESET ;;
esac
printf "${colour}[%s] [%s] %s${C_RESET}\n" "$ts" "$level" "$msg"

#  Log‑Größen‑Prüfung → logrotate
if [[ -f "$LOGFILE" ]]; then
local size
size=$(stat -c%s "$LOGFILE" 2>/dev/null || stat -f%z "$LOGFILE" 2>/dev/null || echo 0)

if (( size > MAX_LOG_SIZE )); then
printf '[%s] [WARN] Log‑Datei > %s Byte – starte logrotate.\n' "$ts" "$MAX_LOG_SIZE" >>"$LOGFILE"
printf "${C_YELLOW}[%s] [WARN] Log‑Datei > %s Byte – starte logrotate.${C_RESET}\n" "$ts" "$MAX_LOG_SIZE"

if command -v logrotate >/dev/null 2>&1; then
logrotate -f /etc/logrotate.d/unraid_zfs_mount 2>/dev/null
if [[ $? -eq 0 ]]; then
printf '[%s] [SUCCESS] logrotate erfolgreich ausgeführt.\n' "$ts" >>"$LOGFILE"
printf "${C_GREEN}[%s] [SUCCESS] logrotate erfolgreich ausgeführt.${C_RESET}\n" "$ts"
else
printf '[%s] [ERROR] logrotate fehlgeschlagen!\n' "$ts" >>"$LOGFILE"
printf "${C_RED}[%s] [ERROR] logrotate fehlgeschlagen!${C_RESET}\n" "$ts"
fi
else
printf '[%s] [WARN] logrotate nicht gefunden – bitte manuell bereinigen.\n' "$ts" >>"$LOGFILE"
printf "${C_YELLOW}[%s] [WARN] logrotate nicht gefunden – bitte manuell bereinigen.${C_RESET}\n" "$ts"
fi
fi
fi
}

# ----------------------------------------
# Mover‑Check – Skript nur fortsetzen, wenn kein Mover aktiv ist
# ------------------------------------------
check_mover_running() {
# 1. Prozess‑Check
if pgrep -x mover >/dev/null 2>&1; then
return 1 # Mover läuft
fi

# 2. Log‑Check (falls Prozess bereits beendet, aber kein "finished"-Eintrag)
local mover_start mover_end
mover_start=$(grep -Ei "Mover.*started" "$SYSLOG" | tail -1)
mover_end=$(grep -Ei "Mover.*finished" "$SYSLOG" | tail -1)

if [[ -n $mover_start ]] && { [[ -z $mover_end ]] || [[ $mover_end < $mover_start ]]; }; then
return 1 # Mover läuft (oder hat nicht sauber beendet)
fi
return 0 # Mover ist nicht aktiv
}

# ------------------------------
# Hauptablauf
# ------------------------------

if ! check_mover_running; then
log "INFO" "Mover läuft momentan – Skript wird beendet, um Konflikte zu vermeiden."
exit 0
fi
log "INFO" "Mover ist nicht aktiv – starte Prüfungen."

#  Unraid‑Version ermitteln
if [[ -f /etc/unraid-version ]]; then
UNRAID_VER=$(grep -oE '[0-9]+\.[0-9]+(\.[0-9]+)?' /etc/unraid-version | head -n1)
log "INFO" "Version aus /etc/unraid-version: $UNRAID_VER"
elif grep -q '^VERSION_ID=' /etc/os-release; then
UNRAID_VER=$(grep '^VERSION_ID=' /etc/os-release | cut -d'"' -f2)
log "INFO" "Version aus /etc/os-release: $UNRAID_VER"
else
log "ERROR" "Konnte Unraid‑Version nicht ermitteln."
exit 1
fi

if [[ "$UNRAID_VER" != "$TARGET_VERSION" ]]; then
log "INFO" "Unraid‑Version ($UNRAID_VER) ≠ $TARGET_VERSION → Skript beendet."
exit 0
fi
log "INFO" "Unraid‑Version ($UNRAID_VER) entspricht Zielversion – starte Prüfungen."

#  Syslog‑Scan
if [[ ! -f "$SYSLOG" ]]; then
log "ERROR" "Syslog‑Datei $SYSLOG nicht gefunden."
exit 1
fi

NOW_EPOCH=$(date +%s)
LIMIT_EPOCH=$(( NOW_EPOCH - TIME_WINDOW_MIN * 60 ))
log "INFO" "Suche nach Fehlermeldungen der letzten ${TIME_WINDOW_MIN} Minuten …"

PATTERN="cannot create '([^']+)': dataset already exists"
FOUND=0

# Hilfsfunktion: Monat → Zahl
month_to_num() {
case "$1" in
Jan) echo 01 ;;
Feb) echo 02 ;;
Mar) echo 03 ;;
Apr) echo 04 ;;
May) echo 05 ;;
Jun) echo 06 ;;
Jul) echo 07 ;;
Aug) echo 08 ;;
Sep) echo 09 ;;
Oct) echo 10 ;;
Nov) echo 11 ;;
Dec) echo 12 ;;
*) echo 00 ;;
esac
}

while IFS= read -r line; do
# Schnell prüfen, ob das Muster überhaupt vorkommt
if ! grep -Ei "$PATTERN" <<<"$line" >/dev/null 2>&1; then
continue
fi

# Datum/Zeit extrahieren (Syslog‑Format: Mon DD HH:MM:SS …)
month=$(awk '{print $1}' <<<"$line")
day=$(awk '{print $2}' <<<"$line")
time=$(awk '{print $3}' <<<"$line")

mon_num=$(month_to_num "$month")
day_padded=$(printf "%02d" "$day")
year=$(date +%Y)

datetime_str="${year}-${mon_num}-${day_padded} ${time}"
# GNU‑date‑Fallback + macOS‑Fallback (falls nicht verfügbar → 0)
entry_epoch=$(date -d "$datetime_str" +%s 2>/dev/null || \
date -j -f "%Y-%m-%d %H:%M:%S" "$datetime_str" "+%s" 2>/dev/null || echo 0)

if (( entry_epoch >= LIMIT_EPOCH )); then
log "WARN" "$line"
FOUND=1
fi
done <"$SYSLOG"

#  Ergebnis auswerten
if (( FOUND )); then
if ! command -v "$ZFS_CMD" >/dev/null 2>&1; then
log "ERROR" "ZFS‑Tool nicht gefunden (Befehl $ZFS_CMD fehlt)."
exit 1
fi
log "INFO" "Führe '$ZFS_CMD mount -a' aus …"
if "$ZFS_CMD" mount -a >>"$LOGFILE" 2>&1; then
log "SUCCESS" "'$ZFS_CMD mount -a' erfolgreich abgeschlossen."
else
log "ERROR" "'$ZFS_CMD mount -a' fehlgeschlagen – siehe Log."
fi
else
log "SUCCESS" "Kein 'cannot create … dataset already exists'-Eintrag in den letzten ${TIME_WINDOW_MIN} Minuten gefunden – kein Mount nötig."
fi

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.