mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-05 06:10:13 -05:00
Compare commits
83 commits
40ad88efac
...
dec765f8ac
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dec765f8ac | ||
|
|
588b670572 | ||
|
|
1c1bfd0dfa | ||
|
|
81cdcf9b22 | ||
|
|
ca4bcaa50a | ||
|
|
c73d86d6d7 | ||
|
|
bf2a8b63c5 | ||
|
|
50f9742560 | ||
|
|
3f515ab6e7 | ||
|
|
53194c4183 | ||
|
|
079aa52be5 | ||
|
|
ec46bafc3b | ||
|
|
1f496e61c6 | ||
|
|
3c3aedadef | ||
|
|
7ccb243a79 | ||
|
|
acacfc1fbc | ||
|
|
cfec991750 | ||
|
|
58a1bd5adb | ||
|
|
8d1aabdb6b | ||
|
|
ac5191dafe | ||
|
|
b644311e2a | ||
|
|
ddc35a473e | ||
|
|
1d988d5149 | ||
|
|
93677b3604 | ||
|
|
6bc4a5b469 | ||
|
|
d90f1bc73c | ||
|
|
db27f875f3 | ||
|
|
01b6cb8fea | ||
|
|
f9e797c0ea | ||
|
|
2c4ead0300 | ||
|
|
ddcae8cabb | ||
|
|
1ffc9d7400 | ||
|
|
084d3faa1e | ||
|
|
7b431d454c | ||
|
|
693bba243f | ||
|
|
f20fa3ebc8 | ||
|
|
7b1b75a12a | ||
|
|
e4efe9007b | ||
|
|
a12f5d8018 | ||
|
|
e0cc53a2e3 | ||
|
|
15be2a4017 | ||
|
|
c85265a809 | ||
|
|
39380487e9 | ||
|
|
db3f5af65a | ||
|
|
b297cbfa9b | ||
|
|
1ec42c1a73 | ||
|
|
dbf83a0e84 | ||
|
|
523f8c4a77 | ||
|
|
959128ed5d | ||
|
|
55973292e9 | ||
|
|
1a9f699dbf | ||
|
|
a45cf526c8 | ||
|
|
07ae36f036 | ||
|
|
3adc3f0881 | ||
|
|
926bc6884e | ||
|
|
b16a1aea3e | ||
|
|
1de9e4bbc9 | ||
|
|
f0e2f80017 | ||
|
|
645a587bdf | ||
|
|
f24fb67610 | ||
|
|
0a7366d670 | ||
|
|
1f45814b76 | ||
|
|
67d8b5c4cb | ||
|
|
ef8085646d | ||
|
|
1cad0e1b15 | ||
|
|
d6a7fa6bfb | ||
|
|
8d88e6f380 | ||
|
|
1b60d4234d | ||
|
|
19c726ac70 | ||
|
|
58824d7053 | ||
|
|
78c63df3a3 | ||
|
|
6e0e6972e7 | ||
|
|
a4ed90bb94 | ||
|
|
b1a9cd4394 | ||
|
|
51eed57482 | ||
|
|
84b8643b3c | ||
|
|
300f4bfabd | ||
|
|
1964b2f24a | ||
|
|
698afd2468 | ||
|
|
0849ab938e | ||
|
|
e77843b714 | ||
|
|
6dd57056bc | ||
|
|
c98b057125 |
129 changed files with 39572 additions and 24985 deletions
16
HISTORY
16
HISTORY
|
|
@ -1,8 +1,8 @@
|
|||
SnapRAID HISTORY
|
||||
================
|
||||
|
||||
15.0 WIP
|
||||
========
|
||||
15.0 (Work in Progress)
|
||||
=======================
|
||||
* Added support for automated filesystem snapshots to ensure data
|
||||
consistency and improve recovery reliability.
|
||||
When the 'snapshot' option is enabled, SnapRAID transparently manages
|
||||
|
|
@ -32,6 +32,8 @@ SnapRAID HISTORY
|
|||
will be slower, this change preserves hash data in the content file
|
||||
to ensure a better fix during disk failures and allows the --import
|
||||
option to remain functional even after an incomplete sync.
|
||||
* Skip spin-up and spin-down operations for non-rotational devices
|
||||
(like SSDs and NVMe drives) on Linux and Windows.
|
||||
* Added --with-smartctl, --with-zfs, --with-zpool, --with-bcachefs
|
||||
configure options to allow pinning the absolute path of each tool at
|
||||
build time. When not specified, the existing runtime discovery
|
||||
|
|
@ -39,6 +41,16 @@ SnapRAID HISTORY
|
|||
non-FHS systems.
|
||||
* Removed the 512 TiB limitation on hard disk size (when using the
|
||||
default 128 KiB blocks).
|
||||
* Added support for a custom info options tag `[info: ...]` in the
|
||||
`smartctl` configuration option. This allows replacing the default
|
||||
`-a` command line argument used to retrieve SMART attributes with a
|
||||
customized set of arguments, enabling better support for RAID
|
||||
controllers and USB enclosures.
|
||||
* Added support for specifying case-insensitive SMART attribute names
|
||||
(instead of only numeric IDs) in the `smartignore` configuration option.
|
||||
* Added support for filesystems where only specific files fail to report a
|
||||
64-bit inode number (such as ReFS when 128-bit file IDs cannot be mapped),
|
||||
allowing SnapRAID to continue processing those individual files without inodes.
|
||||
|
||||
14.10 2026/08
|
||||
=============
|
||||
|
|
|
|||
61
Makefile.am
61
Makefile.am
|
|
@ -2,6 +2,7 @@ bin_PROGRAMS = snapraid
|
|||
check_PROGRAMS = mktest mkstream checker
|
||||
|
||||
AM_CPPFLAGS = -DSYSCONFDIR="\"${sysconfdir}\""
|
||||
CLEANFILES =
|
||||
|
||||
if HAVE_DISK_ARBITRATION
|
||||
snapraid_LDFLAGS = -framework CoreFoundation -framework DiskArbitration
|
||||
|
|
@ -11,12 +12,14 @@ endif
|
|||
|
||||
# Windows
|
||||
if HOST_WINDOWS
|
||||
snapraid_LDADD = resource_res.o
|
||||
snapraid_LDADD = resource_res.o -ladvapi32 -luserenv
|
||||
mktest_LDADD = -ladvapi32 -luserenv
|
||||
mkstream_LDADD = -ladvapi32 -luserenv
|
||||
|
||||
resource_res.o: cmdline/resource.rc cmdline/resource.manifest
|
||||
$(WINDRES) --include-dir=. --include-dir=$(srcdir) $< -o $@
|
||||
|
||||
CLEANFILES = resource_res.o
|
||||
CLEANFILES += resource_res.o
|
||||
endif
|
||||
|
||||
snapraid_SOURCES = \
|
||||
|
|
@ -40,8 +43,10 @@ snapraid_SOURCES = \
|
|||
cmdline/io.c \
|
||||
cmdline/bw.c \
|
||||
cmdline/util.c \
|
||||
cmdline/str.c \
|
||||
cmdline/stream.c \
|
||||
cmdline/support.c \
|
||||
cmdline/memory.c \
|
||||
cmdline/elem.c \
|
||||
cmdline/state.c \
|
||||
cmdline/scan.c \
|
||||
|
|
@ -64,8 +69,10 @@ snapraid_SOURCES = \
|
|||
cmdline/import.c \
|
||||
cmdline/search.c \
|
||||
cmdline/thermal.c \
|
||||
cmdline/mingw.c \
|
||||
cmdline/unix.c
|
||||
os/mingw.c \
|
||||
cmdline/mingwapp.c \
|
||||
os/unix.c \
|
||||
cmdline/unixapp.c
|
||||
|
||||
noinst_HEADERS = \
|
||||
raid/raid.h \
|
||||
|
|
@ -90,13 +97,14 @@ noinst_HEADERS = \
|
|||
tommyds/tommyhashdyn.c \
|
||||
tommyds/tommylist.c \
|
||||
tommyds/tommytree.c \
|
||||
cmdline/portable.h \
|
||||
cmdline/snapraid.h \
|
||||
cmdline/io.h \
|
||||
cmdline/bw.h \
|
||||
cmdline/util.h \
|
||||
cmdline/str.h \
|
||||
cmdline/stream.h \
|
||||
cmdline/support.h \
|
||||
cmdline/memory.h \
|
||||
cmdline/elem.h \
|
||||
cmdline/state.h \
|
||||
cmdline/parity.h \
|
||||
|
|
@ -113,23 +121,37 @@ noinst_HEADERS = \
|
|||
cmdline/import.h \
|
||||
cmdline/search.h \
|
||||
cmdline/thermal.h \
|
||||
cmdline/mingw.h \
|
||||
cmdline/unix.h
|
||||
cmdline/app.h \
|
||||
os/os.h \
|
||||
os/mingw.h \
|
||||
os/unix.h \
|
||||
os/os.h \
|
||||
os/portable.h
|
||||
|
||||
mktest_SOURCES = \
|
||||
cmdline/mktest.c \
|
||||
cmdline/mingw.c \
|
||||
cmdline/unix.c \
|
||||
cmdline/support.c
|
||||
os/mingw.c \
|
||||
cmdline/mingwapp.c \
|
||||
os/unix.c \
|
||||
cmdline/unixapp.c \
|
||||
cmdline/support.c \
|
||||
cmdline/str.c \
|
||||
cmdline/memory.c \
|
||||
tommyds/tommy.c
|
||||
|
||||
mkstream_SOURCES = \
|
||||
cmdline/mkstream.c \
|
||||
cmdline/mingw.c \
|
||||
cmdline/unix.c \
|
||||
os/mingw.c \
|
||||
cmdline/mingwapp.c \
|
||||
os/unix.c \
|
||||
cmdline/unixapp.c \
|
||||
cmdline/support.c \
|
||||
cmdline/str.c \
|
||||
cmdline/memory.c \
|
||||
cmdline/util.c \
|
||||
cmdline/stream.c \
|
||||
raid/memory.c
|
||||
raid/memory.c \
|
||||
tommyds/tommy.c
|
||||
|
||||
# Checker binary share the snapraid variables, with the exception of the checker.c source
|
||||
checker_SOURCES = $(snapraid_SOURCES:cmdline/snapraid.c=cmdline/checker.c)
|
||||
|
|
@ -207,6 +229,7 @@ clean-local:
|
|||
rm -f lcov.info
|
||||
rm -f gmon.out
|
||||
rm -f makeslackware.sh makeslackdist.sh pkg/snapraid.SlackBuild pkg/snapraid.info makedeb.sh pkg/control makerpm.sh pkg/snapraid.spec
|
||||
rm -fr *.plist
|
||||
|
||||
maintainer-clean-local:
|
||||
rm -f $(LIST_MAN)
|
||||
|
|
@ -309,10 +332,18 @@ SNAP = $(srcdir)/test/test-snap.conf
|
|||
MSG = @echo =====
|
||||
SNAPRAID = ./checker$(EXEEXT)
|
||||
|
||||
CLEANFILES += rm.exe mv.exe touch.exe
|
||||
|
||||
setupcheck:
|
||||
rm -rf bench
|
||||
rm -f test.log
|
||||
rm -f rm.exe mv.exe touch.exe
|
||||
mkdir bench
|
||||
if !HAVE_POSIX
|
||||
ln -sf $$(which rm) rm.exe
|
||||
ln -sf $$(which mv) mv.exe
|
||||
ln -sf $$(which touch) touch.exe
|
||||
endif
|
||||
|
||||
# Not included in main check because it requires root permissions
|
||||
snapcheck: mktest checker setupcheck
|
||||
|
|
@ -1274,6 +1305,10 @@ endif
|
|||
|
||||
web: $(LIST_XML)
|
||||
|
||||
# All docs
|
||||
|
||||
doc: $(LIST_MAN) $(LIST_TXT)
|
||||
|
||||
# Windows distribution
|
||||
|
||||
DISTWIN = \
|
||||
|
|
|
|||
102
TODO
102
TODO
|
|
@ -3,15 +3,26 @@ SnapRAID TODO
|
|||
|
||||
This is the list of TODO items for SnapRAID.
|
||||
|
||||
- Next
|
||||
15.x Releases
|
||||
=============
|
||||
|
||||
* If UUID is unsupported, return a fake one ? This will allow to
|
||||
differentiate between the empty one with the case of access to a
|
||||
disk skipped.
|
||||
All done ?
|
||||
|
||||
* Integration with MergeFS ?
|
||||
16.x Releases
|
||||
=============
|
||||
|
||||
* Evaluate use of syscall getdents64() instead of readdir(): https://linux.die.net/man/2/getdents64
|
||||
* Use statx() instead of lstat() when scanning directories.
|
||||
|
||||
* Add a new 'restore' command, similar to 'fix', that recovers a whole disk
|
||||
using the same multithreaded approach as sync/scrub.
|
||||
|
||||
* Integration with MergerFS ?
|
||||
|
||||
* Restore ownership and permissions, at least in Unix.
|
||||
|
||||
* Restore directory timestamps.
|
||||
|
||||
* Enable MuseAir and disable random seed
|
||||
|
||||
* Check Reliability Test. We can derive Failure probability from MBTF
|
||||
https://github.com/linuxhw/SMART
|
||||
|
|
@ -29,8 +40,45 @@ The goal is a filelist that, for every file, includes full paths to the dependen
|
|||
on other data disks needed to repair that file (in addition to the parity data).
|
||||
See: https://sourceforge.net/p/snapraid/discussion/1677233/thread/6e872fdae0/
|
||||
|
||||
Future
|
||||
======
|
||||
|
||||
- Major
|
||||
|
||||
* Size-Based Checkpointing (autosave) using a write-ahead log (WAL).
|
||||
Instead of writing the full content file periodically (autosave), write incremental
|
||||
updates to companion `.wal` files. Use the existing bit-efficient `STREAM`
|
||||
abstraction (`cmdline/stream.h`) for the WAL. For each synced block entry,
|
||||
the stream writes: target disk index (`disk_idx`), block state (`state`),
|
||||
block position (`block_idx`), and the newly computed block hash (`hash`).
|
||||
This automatically provides:
|
||||
- Variable-length binary integer packing (`sputb32`/`sputb64`), reducing the average
|
||||
record size to ~20 bytes.
|
||||
- Built-in stream buffering for batched writes to prevent mechanical disk seeks,
|
||||
with periodic `ssync()` flushes (calling fdatasync internally).
|
||||
- Out-of-the-box support for atomic mirrored writes to multiple content directories
|
||||
via `sopen_multi_write()`.
|
||||
- Built-in block-level CRC integrity protection.
|
||||
Perform a full checkpoint (writing the content file and truncating the WAL)
|
||||
only when the WAL file size exceeds a threshold (e.g., 50 MB).
|
||||
|
||||
- Minor
|
||||
|
||||
* Emergency Memory Reserve for Graceful OOM Shutdown.
|
||||
Pre-allocate a small emergency memory reserve buffer (e.g., 10 MB) at program
|
||||
startup. Modify `malloc_nofail` (and related memory allocators in `memory.c`)
|
||||
so that if an allocation fails (returns NULL), the emergency buffer is freed
|
||||
to give the system breathing room. Then, trigger a graceful shutdown by
|
||||
stopping active I/O threads and calling `state_write()` to save the content
|
||||
file (preserving progress up to the last synced block) before calling `os_abort()`.
|
||||
|
||||
* Time-Based Content File Loading.
|
||||
On startup, read the modification time (mtime) of all configured content files,
|
||||
and sort the loading list to try loading the newest one first.
|
||||
This resolves the inconsistency window during sequential renames on crashes.
|
||||
If the newest file is corrupt, the existing load loop naturally falls back to the
|
||||
next newest.
|
||||
|
||||
* Add a new scrub option for checking recent blocks. Like -n, --newer-than.
|
||||
Working the opposite of -o-, --older-than
|
||||
|
||||
|
|
@ -68,14 +116,6 @@ https://sourceforge.net/p/snapraid/discussion/1677233/thread/648955ec/ (Leifi in
|
|||
https://sourceforge.net/p/snapraid/discussion/1677233/thread/5b6ef1b9/ (Miles in check + filter)
|
||||
Partially done. Now you can control it with --test-fmt
|
||||
|
||||
* Add ReFS support with 128 bit inode
|
||||
See: https://sourceforge.net/p/snapraid/discussion/1677233/thread/2be14f63/
|
||||
https://github.com/Microsoft/Windows-driver-samples/blob/master/filesys/miniFilter/avscan/filter/utility.h
|
||||
https://github.com/Microsoft/Windows-driver-samples/blob/master/filesys/miniFilter/avscan/filter/utility.c
|
||||
https://github.com/Microsoft/Windows-driver-samples/blob/master/filesys/miniFilter/delete/delete.c
|
||||
Partially done. Until the inodes are less than 64 bit, everything works.
|
||||
If a 128 bit inode is found, it aborts with "Invalid inode number! Is this ReFS?"
|
||||
|
||||
* When a disk is replaced, and SnapRAID detects this by a UUID change, we could clear the
|
||||
scrub information for that disk.
|
||||
https://sourceforge.net/p/snapraid/discussion/1677233/thread/ee87901b/
|
||||
|
|
@ -101,10 +141,6 @@ In fact, it makes sense as it's a good way to control the cache on the file,
|
|||
so, despite the name, that usage could be common for not temporary files.
|
||||
https://sourceforge.net/p/snapraid/discussion/1677233/thread/57d40108/
|
||||
|
||||
* Restore ownership and permissions, at least in Unix.
|
||||
|
||||
* Restore directory timestamps.
|
||||
|
||||
* Add an option for dup to list only duplicates with different names.
|
||||
This supposing that if a file has the same name, it's intentionally duplicated.
|
||||
|
||||
|
|
@ -128,10 +164,22 @@ This 'init' will work also without a content file, and parity files.
|
|||
Instead 'sync' will require all of them.
|
||||
This will also help when running with the parity filesystem unmounted.
|
||||
|
||||
* Rename sync->backup and fix->restore. It seems to me a naming expressing
|
||||
* Rename sync->backup and fix->restore/recover. It seems to me a naming expressing
|
||||
better the meaning of the commands. But not yet sure.
|
||||
|
||||
- Pooling
|
||||
|
||||
Rejected TODO
|
||||
=============
|
||||
|
||||
This is a list of rejected TODO items.
|
||||
|
||||
* Parallel hashes using vector instructions. See the 'parallel_hashes' branch.
|
||||
- Only Spooky2 can be effectively parallelized because vector instructions
|
||||
cannot efficiently perform 64x64->128 bit multiplications.
|
||||
best murmur3 spooky2 spk2sse spk2avx metro museair musesse museavx
|
||||
hash spooky2 6163 17570 24227 *34519* 20612 *27894* 10648 19827
|
||||
- This small speed increase occurs only in the best-case scenario when AVX is present
|
||||
and the number of disks is divisible by 4.
|
||||
|
||||
* Add a new "commit" command to move changes from the pool to the array.
|
||||
It should:
|
||||
|
|
@ -145,8 +193,7 @@ but kept in the same disk of the array.
|
|||
- Detect deletes, and move file in the array to a "/trash/" directory
|
||||
of the same disk. For safety no real deletion is done.
|
||||
File with the same name will get an extra extension like ".1", ".2".
|
||||
|
||||
- Major
|
||||
- MergerFS is anyway better
|
||||
|
||||
* Allocate parity minimizing concurrent use of it
|
||||
Each parity allocation should check for a parity
|
||||
|
|
@ -158,11 +205,12 @@ See: https://sourceforge.net/p/snapraid/discussion/1677233/thread/1797bf7d/
|
|||
enough parity, as the benefit of existing parity is maximized.
|
||||
- Possible increase of fragmentation of parity allocation
|
||||
- No real benefit when the array is filled
|
||||
|
||||
Rejected TODO
|
||||
=============
|
||||
|
||||
This is a list of rejected TODO items.
|
||||
- Slowing down operation that have to check the whole array.
|
||||
10 disk at 10% utilization, will use the full parity, requiring to
|
||||
read and write it completly. Essentially doubling the amount of data
|
||||
needed to be read or written.
|
||||
- Rotating disks are faster at low sector addresses, allocating high
|
||||
parity will slow down disks that could be instead faster.
|
||||
|
||||
* Use a memory mapped file to read the content file
|
||||
- Tried. No speed gain.
|
||||
|
|
|
|||
|
|
@ -1,413 +1,25 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2011 Andrea Mazzoleni
|
||||
// Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
#ifndef __PORTABLE_H
|
||||
#define __PORTABLE_H
|
||||
#ifndef __APP_H
|
||||
#define __APP_H
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include "config.h" /* Use " to include first in the same directory of this file */
|
||||
#endif
|
||||
|
||||
/***************************************************************************/
|
||||
/* Config */
|
||||
|
||||
#ifdef __MINGW32__
|
||||
/**
|
||||
* Enable the GNU printf functions instead of using the MSVCRT ones.
|
||||
*
|
||||
* Note that this is the default if _POSIX is also defined.
|
||||
* To disable it you have to set it to 0.
|
||||
*/
|
||||
#define __USE_MINGW_ANSI_STDIO 1
|
||||
|
||||
/**
|
||||
* Define the MSVCRT version targeting Windows 7.
|
||||
*/
|
||||
#define __MSVCRT_VERSION__ 0x0601
|
||||
|
||||
/**
|
||||
* Include Windows 7 headers.
|
||||
*
|
||||
* Like for InitializeCriticalSection().
|
||||
*/
|
||||
#define _WIN32_WINNT 0x601
|
||||
|
||||
/**
|
||||
* Undef as it clashes with windows.h declarations
|
||||
*/
|
||||
#undef DATADIR
|
||||
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Specify the format attribute for printf.
|
||||
*/
|
||||
#ifdef __MINGW32__
|
||||
#if defined(__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO == 1
|
||||
#define attribute_printf gnu_printf /* GNU format */
|
||||
#define printf __mingw_printf
|
||||
#else
|
||||
#define attribute_printf ms_printf /* MSVCRT format */
|
||||
#endif
|
||||
#else
|
||||
#define attribute_printf printf /* GNU format is the default one */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Compiler extension
|
||||
*/
|
||||
#ifndef __always_inline
|
||||
#define __always_inline inline __attribute__((always_inline))
|
||||
#endif
|
||||
|
||||
#ifndef __noreturn
|
||||
#define __noreturn __attribute__((noreturn))
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Architecture for inline assembly.
|
||||
*/
|
||||
#if HAVE_ASSEMBLY
|
||||
#if defined(__i386__)
|
||||
#define CONFIG_X86 1
|
||||
#define CONFIG_X86_32 1
|
||||
#endif
|
||||
|
||||
#if defined(__x86_64__)
|
||||
#define CONFIG_X86 1
|
||||
#define CONFIG_X86_64 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Includes some platform specific headers.
|
||||
*/
|
||||
#if HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_MOUNT_H
|
||||
#include <sys/mount.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_VFS_H
|
||||
#include <sys/vfs.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_STATFS_H
|
||||
#include <sys/statfs.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_FILE_H
|
||||
#include <sys/file.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_IOCTL_H
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_LINUX_FS_H
|
||||
#include <linux/fs.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_LINUX_BTRFS_H
|
||||
#include <linux/btrfs.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_LINUX_FIEMAP_H
|
||||
#include <linux/fiemap.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_BLKID_BLKID_H
|
||||
#include <blkid/blkid.h>
|
||||
#if HAVE_BLKID_DEVNO_TO_DEVNAME && HAVE_BLKID_GET_TAG_VALUE
|
||||
#define HAVE_BLKID 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Includes some standard headers.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h> /* On many systems (e.g., Darwin), `stdio.h' is a prerequisite. */
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <fcntl.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <limits.h>
|
||||
|
||||
#if HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_INTTYPES_H
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#else
|
||||
#if HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#else
|
||||
#include <time.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAVE_MACH_MACH_TIME_H
|
||||
#include <mach/mach_time.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_DIRENT_H
|
||||
#include <dirent.h>
|
||||
#define NAMLEN(dirent) strlen((dirent)->d_name)
|
||||
#else
|
||||
#define dirent direct
|
||||
#define NAMLEN(dirent) (dirent)->d_namlen
|
||||
#if HAVE_SYS_NDIR_H
|
||||
#include <sys/ndir.h>
|
||||
#endif
|
||||
#if HAVE_SYS_DIR_H
|
||||
#include <sys/dir.h>
|
||||
#endif
|
||||
#if HAVE_NDIR_H
|
||||
#include <ndir.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_MKDEV
|
||||
#include <sys/mkdev.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_SYSMACROS_H
|
||||
#include <sys/sysmacros.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_MATH_H
|
||||
#include <math.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_EXECINFO_H
|
||||
#include <execinfo.h>
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include <DiskArbitration/DiskArbitration.h>
|
||||
#include <mach-o/dyld.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_IO_H
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_GETOPT_LONG
|
||||
#define SWITCH_GETOPT_LONG(a, b) a
|
||||
#else
|
||||
#define SWITCH_GETOPT_LONG(a, b) b
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Enables lock file support.
|
||||
*/
|
||||
#if (HAVE_FLOCK && HAVE_FTRUNCATE) || defined(_WIN32)
|
||||
#define HAVE_LOCKFILE 1
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LINUX_CLOSE_RANGE_H
|
||||
#include <linux/close_range.h>
|
||||
#endif
|
||||
|
||||
/* implement close_range for glibc 2.33 or earlier */
|
||||
#if defined(__linux__) && !defined(HAVE_CLOSE_RANGE)
|
||||
#include <sys/syscall.h>
|
||||
#ifndef __NR_close_range
|
||||
#define __NR_close_range 436
|
||||
#endif
|
||||
#define close_range close_range_impl
|
||||
static inline int close_range_impl(unsigned int first, unsigned int last, unsigned int flags)
|
||||
{
|
||||
return (int)syscall(__NR_close_range, first, last, flags);
|
||||
}
|
||||
#define HAVE_CLOSE_RANGE 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Flags for open()
|
||||
*/
|
||||
#ifndef O_PATH
|
||||
#ifdef O_SEARCH
|
||||
#define O_PATH O_SEARCH /* macOS */
|
||||
#else
|
||||
#define O_PATH O_RDONLY /* POSIX */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Includes specific support for Windows or Linux.
|
||||
*/
|
||||
#ifdef __MINGW32__
|
||||
#include "mingw.h"
|
||||
#else
|
||||
#include "unix.h"
|
||||
#endif
|
||||
|
||||
/****************************************************************************/
|
||||
/* os */
|
||||
|
||||
/**
|
||||
* Default paths.
|
||||
*/
|
||||
void os_default_conf(char* dst, size_t dst_size, const char* argv0);
|
||||
|
||||
/**
|
||||
* Initialize signal handling.
|
||||
*/
|
||||
void os_signal_init();
|
||||
|
||||
/**
|
||||
* Restore signal handlers after fork in child process.
|
||||
* This resets signals to default handling.
|
||||
*/
|
||||
void os_signal_restore_after_fork(void);
|
||||
|
||||
/**
|
||||
* Global variable to identify if Ctrl+C is pressed.
|
||||
*/
|
||||
int os_global_interrupt(void);
|
||||
|
||||
/**
|
||||
* Get the os_tick counter value.
|
||||
*
|
||||
* Note that the frequency is unspecified, because the time measure
|
||||
* is meant to be used to compare the ratio between usage times.
|
||||
*/
|
||||
uint64_t os_tick(void);
|
||||
|
||||
/**
|
||||
* Get the os_tick counter value in millisecond.
|
||||
*/
|
||||
uint64_t os_tick_ms(void);
|
||||
|
||||
/**
|
||||
* Initializes the system.
|
||||
*/
|
||||
void os_init(int opt);
|
||||
|
||||
/**
|
||||
* Deinitialize the system.
|
||||
*/
|
||||
void os_done(void);
|
||||
|
||||
/**
|
||||
* Abort the process with a stacktrace.
|
||||
*/
|
||||
void os_abort(void) __noreturn;
|
||||
|
||||
/**
|
||||
* Clear the screen.
|
||||
*/
|
||||
void os_clear(void);
|
||||
|
||||
/**
|
||||
* Opaque handle tracking a process execution stream and its process ID.
|
||||
*
|
||||
* This structure encapsulates a standard buffered I/O stream tied to the
|
||||
* redirected standard output of a child process spawned via os_popen().
|
||||
*/
|
||||
#ifdef __MINGW32__
|
||||
#define OS_FILE FILE
|
||||
#else
|
||||
typedef struct OS_FILE {
|
||||
FILE* fp; /**< Standard I/O buffered stream wrapper. */
|
||||
pid_t pid; /**< Process ID of the child process. */
|
||||
} OS_FILE;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Spawns a child process and opens a buffered stream to read its stdout.
|
||||
*
|
||||
* This function acts as a safer alternative to standard popen(), accepting an
|
||||
* explicit argument vector rather than evaluating a shell command string.
|
||||
*
|
||||
* The child process is completely isolated in its own process group (via setpgid)
|
||||
* with its stdin and stderr redirected to /dev/null. The underlying pipe is
|
||||
* created with O_CLOEXEC set to prevent leakage across concurrent forks.
|
||||
*
|
||||
* @param argv A NULL-terminated array of strings representing the argument vector.
|
||||
* argv[0] must contain the absolute path to the verified executable.
|
||||
* @param extra_args A mutable string containing additional arguments separated by
|
||||
* spaces, or NULL if no extra arguments are needed.
|
||||
* @return A pointer to an initialized OS_FILE structure on success, or NULL on failure.
|
||||
* On failure, errno is set appropriately.
|
||||
*/
|
||||
OS_FILE* os_popen(const char** argv, char* extra_args);
|
||||
|
||||
/**
|
||||
* Reads a line from an OS execution stream.
|
||||
*
|
||||
* Reads characters from the specified stream into the buffer string until
|
||||
* (size - 1) characters are read, a newline character is read and transferred,
|
||||
* or an end-of-file (EOF) condition is encountered. A terminating null
|
||||
* character is appended.
|
||||
*
|
||||
* @param s Pointer to an array of chars where the string read is stored.
|
||||
* @param size Maximum number of characters to be read (including the null character).
|
||||
* @param stream Pointer to the OS_FILE tracking context.
|
||||
*
|
||||
* @return On success, returns the buffer pointer @p s. If EOF is reached or a read
|
||||
* error occurs before any characters are read, returns NULL.
|
||||
*/
|
||||
char* os_fgets(char* s, int size, OS_FILE* stream);
|
||||
|
||||
/**
|
||||
* Closes an execution stream and reaps the associated child process.
|
||||
*
|
||||
* Closes the underlying buffered standard I/O stream, releases the allocated
|
||||
* tracking context container, and blocks until the associated child process
|
||||
* terminates to prevent the creation of zombie processes.
|
||||
*
|
||||
* @param stream Pointer to the active OS_FILE context to close and free.
|
||||
*
|
||||
* @return The termination status of the child process on success, or -1 on failure.
|
||||
* On failure, errno is set appropriately.
|
||||
*/
|
||||
int os_pclose(OS_FILE* stream);
|
||||
|
||||
/****************************************************************************/
|
||||
/* app */
|
||||
#include "os/os.h"
|
||||
|
||||
/**
|
||||
* Include list support to have tommy_node.
|
||||
*/
|
||||
#include "tommyds/tommylist.h"
|
||||
|
||||
#define EINTERNAL EFAULT /**< Internal assertion failed. */
|
||||
#define EDATA EIO /**< Silent data corruption. */
|
||||
#define ESOFT EINVAL /**< Software error, like permission denied. */
|
||||
#define EUSER EINVAL /**< Invalid value specified by the user. */
|
||||
#define EEXTERNAL EINVAL /**< Invalid external interface behaviour. */
|
||||
#define ECONTENT EINVAL /**< Invalid content file. */
|
||||
#define EENVIRONMENT EINVAL /**< Invalid physical environment, like temperature too high. */
|
||||
#define ESYSLOG EINVAL /**< Syslog error. */
|
||||
|
||||
/**
|
||||
* Basic block position type.
|
||||
*/
|
||||
|
|
@ -433,34 +45,6 @@ static inline int hardlink(const char* a, const char* b)
|
|||
*/
|
||||
int devuuid(uint64_t device_id, const char* device_path, char* uuid, size_t size);
|
||||
|
||||
/**
|
||||
* Physical offset not yet read.
|
||||
*/
|
||||
#define FILEPHY_UNREAD_OFFSET 0
|
||||
|
||||
/**
|
||||
* Special value returned when the file-system doesn't report any offset for unknown reason.
|
||||
*/
|
||||
#define FILEPHY_UNREPORTED_OFFSET 1
|
||||
|
||||
/**
|
||||
* Special value returned when the file doesn't have a real offset.
|
||||
* For example, because it's stored in the NTFS MFT.
|
||||
*/
|
||||
#define FILEPHY_WITHOUT_OFFSET 2
|
||||
|
||||
/**
|
||||
* Value indicating real offsets. All offsets greater or equal at this one are real.
|
||||
*/
|
||||
#define FILEPHY_REAL_OFFSET 3
|
||||
|
||||
/**
|
||||
* Get the physical address of the specified file.
|
||||
* This is expected to be just a hint and not necessarily correct or unique.
|
||||
* Return 0 on success.
|
||||
*/
|
||||
int filephy(const char* path, uint64_t size, uint64_t* physical);
|
||||
|
||||
/**
|
||||
* Check if the underline file-system support persistent inodes.
|
||||
* Return -1 on error, 0 on success.
|
||||
|
|
@ -589,11 +173,6 @@ extern int exit_sync_needed;
|
|||
#define EXIT_FAILURE exit_failure
|
||||
#define EXIT_SYNC_NEEDED exit_sync_needed
|
||||
|
||||
/**
|
||||
* Fill memory with pseudo-random values.
|
||||
*/
|
||||
int randomize(void* ptr, size_t size);
|
||||
|
||||
/**
|
||||
* Standard SMART attributes.
|
||||
*/
|
||||
|
|
@ -691,9 +270,17 @@ int randomize(void* ptr, size_t size);
|
|||
#define SMARTCTL_FLAG_SELFERROR_LOGGED (1 << 7) /**< The device self-test log contains records of errors. */
|
||||
|
||||
/**
|
||||
* SMART max attribute length.
|
||||
* SMART max attribute name or value length.
|
||||
*/
|
||||
#define SMART_MAX 64
|
||||
#define SMART_MAX 128
|
||||
|
||||
/**
|
||||
* Smart ignore structure.
|
||||
*/
|
||||
struct smartignore_struct {
|
||||
int attr_index; /**< 0 if not set */
|
||||
char attr_name[SMART_MAX]; /**< Empty if not set */
|
||||
};
|
||||
|
||||
/**
|
||||
* Value for unassigned SMART attribute.
|
||||
|
|
@ -712,7 +299,7 @@ int randomize(void* ptr, size_t size);
|
|||
#define SMART_ATTR_WHEN_FAILED_NEVER 64
|
||||
|
||||
struct smart_attr {
|
||||
char name[128]; /**< SMART attribute name. */
|
||||
char name[SMART_MAX]; /**< SMART attribute name. */
|
||||
uint64_t raw; /**< SMART attributes raw. It can be SMART_UNASSIGNED. */
|
||||
uint64_t norm; /**< SMART attributes normalized. It can be SMART_UNASSIGNED even if raw is not. */
|
||||
uint64_t worst; /**< SMART attributes worst. It can be SMART_UNASSIGNED even if raw/norm is not. */
|
||||
|
|
@ -734,8 +321,9 @@ struct devinfo_struct {
|
|||
uint64_t device; /**< Device ID. */
|
||||
char name[PATH_MAX]; /**< Name of the disk combined with the split index if any */
|
||||
char mount[PATH_MAX]; /**< Mount point or other contained directory. */
|
||||
char smartctl[PATH_MAX]; /**< Options for smartctl. */
|
||||
int smartignore[SMART_IGNORE_MAX]; /**< Attribues to ignore */
|
||||
char smartctl[SMART_MAX]; /**< Custom option for smartctl. Empty means auto. */
|
||||
char smartctl_info[SMART_MAX]; /* Info options for smartctl. Empty means -a. */
|
||||
struct smartignore_struct smartignore[SMART_IGNORE_MAX]; /**< Attributes to ignore */
|
||||
char file[PATH_MAX]; /**< File device. */
|
||||
#ifdef _WIN32
|
||||
char wfile[PATH_MAX]; /**< File device in Windows format. Like \\.\PhysicalDriveX, or \\?\Volume{X}. */
|
||||
|
|
@ -796,16 +384,28 @@ int ambient_temperature(void);
|
|||
*/
|
||||
#define WINDOWS_SPACEHOLDER_SIZE (256 * 1024 * 1024)
|
||||
|
||||
/****************************************************************************/
|
||||
/* app */
|
||||
|
||||
/**
|
||||
* Generic errors
|
||||
* Initializes the application.
|
||||
*/
|
||||
#define EINTERNAL EFAULT /**< Internal assertion failed. */
|
||||
#define EDATA EIO /**< Silent data corruption. */
|
||||
#define ESOFT EINVAL /**< Software error, like permission denied. */
|
||||
#define EUSER EINVAL /**< Invalid value specified by the user. */
|
||||
#define EEXTERNAL EINVAL /**< Invalid external interface behaviour. */
|
||||
#define ECONTENT EINVAL /**< Invalid content file. */
|
||||
#define EENVIRONMENT EINVAL /**< Invalid physical environment, like temperature too high. */
|
||||
void app_init(void);
|
||||
|
||||
/**
|
||||
* Deinitializes the application.
|
||||
*/
|
||||
void app_done(void);
|
||||
|
||||
/**
|
||||
* Default paths.
|
||||
*/
|
||||
void app_default_conf(char* dst, size_t dst_size, const char* argv0);
|
||||
|
||||
/**
|
||||
* Signal handler.
|
||||
*/
|
||||
void app_signal_handler(int signum);
|
||||
|
||||
#endif
|
||||
|
||||
18
cmdline/bw.c
18
cmdline/bw.c
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2016 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "bw.h"
|
||||
|
||||
|
|
@ -17,7 +17,9 @@ void bw_limit(struct snapraid_bw* bw, uint64_t bytes)
|
|||
if (!bw || bw->limit == 0)
|
||||
return;
|
||||
|
||||
uint64_t elapsed = os_tick_ms() - bw->start;
|
||||
uint64_t start = bw->start;
|
||||
uint64_t now = os_tick_ms();
|
||||
uint64_t elapsed = now - start;
|
||||
uint64_t done;
|
||||
uint64_t eta;
|
||||
|
||||
|
|
@ -25,6 +27,18 @@ void bw_limit(struct snapraid_bw* bw, uint64_t bytes)
|
|||
|
||||
eta = done * 1000 / bw->limit;
|
||||
|
||||
/*
|
||||
* To prevent accumulating unlimited credit during long pauses
|
||||
* (such as CPU-bound hashing or metadata scanning), we cap the
|
||||
* maximum accumulated credit to 10 seconds.
|
||||
* If the elapsed time is more than 10 seconds ahead of the target ETA,
|
||||
* we advance the start time to align the credit to exactly 10 seconds.
|
||||
*/
|
||||
if (elapsed > eta + 10000) {
|
||||
bw->start = now - eta - 10000;
|
||||
elapsed = eta + 10000;
|
||||
}
|
||||
|
||||
if (eta > elapsed) {
|
||||
eta -= elapsed;
|
||||
if (eta > 1000)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2011 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "support.h"
|
||||
#include "util.h"
|
||||
|
|
@ -329,7 +329,9 @@ static int repair(struct snapraid_state* state, int rehash, block_off_t pos, uns
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
if (hash_is_invalid(block->hash)) {
|
||||
if (block == BLOCK_NULL) {
|
||||
hash = "none";
|
||||
} else if (hash_is_invalid(block->hash)) {
|
||||
hash = "lost";
|
||||
} else if (hash_is_zero(block->hash)) {
|
||||
hash = "zero";
|
||||
|
|
@ -658,7 +660,6 @@ static int file_post(struct snapraid_state* state, int fix, block_off_t i, struc
|
|||
struct snapraid_file* collide_file;
|
||||
struct snapraid_file* file;
|
||||
block_off_t file_pos;
|
||||
uint64_t inode;
|
||||
|
||||
disk = handle[j].disk;
|
||||
if (!disk) {
|
||||
|
|
@ -772,10 +773,12 @@ static int file_post(struct snapraid_state* state, int fix, block_off_t i, struc
|
|||
log_tag("status:recovered:%s:%s\n", disk->name, esc_tag(file->sub));
|
||||
msg_info("recovered %s\n", fmt_term(disk, file->sub));
|
||||
|
||||
inode = handle[j].st.st_ino;
|
||||
|
||||
/* search for the corresponding inode */
|
||||
collide_file = tommy_hashdyn_search(&disk->inodeset, file_inode_compare_to_arg, &inode, file_inode_hash(inode));
|
||||
uint64_t inode = handle[j].st.st_ino; /* don't know the exact type of st_ino and we cannot pass it by pointer in the search */
|
||||
if (inode != INODE_INVALID)
|
||||
collide_file = tommy_hashdyn_search(&disk->inodeset, file_inode_compare_to_arg, &inode, file_inode_hash(inode));
|
||||
else
|
||||
collide_file = 0;
|
||||
|
||||
/*
|
||||
* If the inode is already in the database and it refers to a different file name,
|
||||
|
|
@ -975,8 +978,8 @@ static int state_check_process(struct snapraid_state* state, int fix, struct sna
|
|||
memset(buffer[buffermax - 1], 0, state->block_size);
|
||||
raid_zero(buffer[buffermax - 1]);
|
||||
|
||||
failed = malloc_nofail(diskmax * sizeof(struct failed_struct));
|
||||
failed_map = malloc_nofail(diskmax * sizeof(unsigned));
|
||||
failed = nalloc_nofail(diskmax, sizeof(struct failed_struct));
|
||||
failed_map = nalloc_nofail(diskmax, sizeof(unsigned));
|
||||
|
||||
soft_error = 0;
|
||||
io_error = 0;
|
||||
|
|
@ -1806,7 +1809,7 @@ static int state_check_process(struct snapraid_state* state, int fix, struct sna
|
|||
log_error(ESOFT, "Error stating hardlink-to '%s' for not regular file.\n", path);
|
||||
log_tag("hardlink_error:%s:%s:%s: Hardlink-to error for not regular file\n", disk->name, esc_tag(slink->sub), esc_tag(slink->linkto));
|
||||
++soft_error;
|
||||
} else if (!unsuccessful && st.st_ino != stto.st_ino) {
|
||||
} else if (!unsuccessful && st.st_ino != INODE_INVALID && stto.st_ino != INODE_INVALID && st.st_ino != stto.st_ino) {
|
||||
unsuccessful = 1;
|
||||
|
||||
log_error(ESOFT, "Mismatch hardlink '%s' and '%s'. Different inode.\n", path, pathto);
|
||||
|
|
@ -2004,6 +2007,10 @@ bail:
|
|||
ret = handle_close(&handle[j]);
|
||||
if (ret == -1) {
|
||||
/* LCOV_EXCL_START */
|
||||
/*
|
||||
* If handle_close fails, the handle was open (f != -1), which
|
||||
* guarantees that both file and disk pointers are valid.
|
||||
*/
|
||||
log_tag("%s:%" PRIu64 ":%s:%s: Close error. %s.\n", es(errno), blockmax, disk->name, esc_tag(file->sub), strerror(errno));
|
||||
log_fatal_errno(errno, disk->name);
|
||||
|
||||
|
|
|
|||
|
|
@ -5,3 +5,4 @@
|
|||
#define HAVE_CHECKER 1
|
||||
|
||||
#include "snapraid.c"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2015 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "support.h"
|
||||
#include "state.h"
|
||||
|
|
@ -533,14 +533,37 @@ static void state_info_log(devinfo_t* devinfo)
|
|||
log_tag("attr:%s:%s:rotationrate:%" PRIu64 "\n", devinfo->file, devinfo->name, devinfo->info[INFO_ROTATION_RATE]);
|
||||
}
|
||||
|
||||
static void state_smart_ignore(struct snapraid_state* state, devinfo_t* devinfo)
|
||||
void state_smart_ignore(struct snapraid_state* state, devinfo_t* devinfo)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
/* clear attributes to ignore */
|
||||
for (int i = 0; i < SMART_IGNORE_MAX; ++i) {
|
||||
if (state->smartignore[i] < 256)
|
||||
devinfo->smart[state->smartignore[i]].raw = SMART_UNASSIGNED;
|
||||
if (devinfo->smartignore[i] < 256)
|
||||
devinfo->smart[devinfo->smartignore[i]].raw = SMART_UNASSIGNED;
|
||||
for (i = 0; i < SMART_IGNORE_MAX; ++i) {
|
||||
/* global ignore */
|
||||
if (state->smartignore[i].attr_index > 0 && state->smartignore[i].attr_index < 256) {
|
||||
devinfo->smart[state->smartignore[i].attr_index].raw = SMART_UNASSIGNED;
|
||||
}
|
||||
if (state->smartignore[i].attr_name[0] != 0) {
|
||||
for (j = 0; j < SMART_COUNT; ++j) {
|
||||
if (devinfo->smart[j].name[0] != 0
|
||||
&& strcasecmp(devinfo->smart[j].name, state->smartignore[i].attr_name) == 0) {
|
||||
devinfo->smart[j].raw = SMART_UNASSIGNED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* devinfo ignore */
|
||||
if (devinfo->smartignore[i].attr_index > 0 && devinfo->smartignore[i].attr_index < 256) {
|
||||
devinfo->smart[devinfo->smartignore[i].attr_index].raw = SMART_UNASSIGNED;
|
||||
}
|
||||
if (devinfo->smartignore[i].attr_name[0] != 0) {
|
||||
for (j = 0; j < SMART_COUNT; ++j) {
|
||||
if (devinfo->smart[j].name[0] != 0
|
||||
&& strcasecmp(devinfo->smart[j].name, devinfo->smartignore[i].attr_name) == 0) {
|
||||
devinfo->smart[j].raw = SMART_UNASSIGNED;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -583,9 +606,9 @@ static void state_smart_log(devinfo_t* devinfo, double afr)
|
|||
else if (attr->flags & SMART_ATTR_WHEN_FAILED_NEVER)
|
||||
when_failed = "never";
|
||||
|
||||
char norm[64] = { 0 };
|
||||
char worst[64] = { 0 };
|
||||
char thresh[64] = { 0 };
|
||||
char norm[SMART_MAX] = { 0 };
|
||||
char worst[SMART_MAX] = { 0 };
|
||||
char thresh[SMART_MAX] = { 0 };
|
||||
|
||||
if (attr->norm != SMART_UNASSIGNED)
|
||||
snprintf(norm, sizeof(norm), "%" PRIu64, attr->norm);
|
||||
|
|
@ -1051,6 +1074,7 @@ int state_device(struct snapraid_state* state, int operation, tommy_list* filter
|
|||
device_name_set(entry, disk->name, 0);
|
||||
pathcpy(entry->mount, sizeof(entry->mount), disk->dir);
|
||||
pathcpy(entry->smartctl, sizeof(entry->smartctl), disk->smartctl);
|
||||
pathcpy(entry->smartctl_info, sizeof(entry->smartctl_info), disk->smartctl_info);
|
||||
memcpy(entry->smartignore, disk->smartignore, sizeof(entry->smartignore));
|
||||
|
||||
tommy_list_insert_tail(&high, &entry->node, entry);
|
||||
|
|
@ -1078,6 +1102,7 @@ int state_device(struct snapraid_state* state, int operation, tommy_list* filter
|
|||
device_name_set(entry, lev_config_name(j), s);
|
||||
pathcpy(entry->mount, sizeof(entry->mount), state->parity[j].split_map[s].path);
|
||||
pathcpy(entry->smartctl, sizeof(entry->smartctl), state->parity[j].smartctl);
|
||||
pathcpy(entry->smartctl_info, sizeof(entry->smartctl_info), state->parity[j].smartctl_info);
|
||||
memcpy(entry->smartignore, state->parity[j].smartignore, sizeof(entry->smartignore));
|
||||
pathcut(entry->mount); /* remove the parity file */
|
||||
|
||||
|
|
@ -1109,7 +1134,8 @@ int state_device(struct snapraid_state* state, int operation, tommy_list* filter
|
|||
device_name_set(entry, extra->name, 0);
|
||||
pathcpy(entry->mount, sizeof(entry->mount), extra->dir);
|
||||
pathcpy(entry->smartctl, sizeof(entry->smartctl), extra->smartctl);
|
||||
memcpy(entry->smartignore, extra->smartignore, sizeof(extra->smartignore));
|
||||
pathcpy(entry->smartctl_info, sizeof(entry->smartctl_info), extra->smartctl_info);
|
||||
memcpy(entry->smartignore, extra->smartignore, sizeof(entry->smartignore));
|
||||
|
||||
tommy_list_insert_tail(&high, &entry->node, entry);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2011 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "util.h"
|
||||
#include "elem.h"
|
||||
|
|
@ -60,6 +60,7 @@ static void dry_data_reader(struct snapraid_worker* worker, struct snapraid_task
|
|||
ret = handle_close(handle);
|
||||
if (ret == -1) {
|
||||
/* LCOV_EXCL_START */
|
||||
|
||||
/*
|
||||
* This one is really an unexpected error, because we are only reading
|
||||
* and closing a descriptor should never fail
|
||||
|
|
@ -171,7 +172,7 @@ static int state_dry_process(struct snapraid_state* state, struct snapraid_parit
|
|||
|
||||
/* possibly waiting disks */
|
||||
waiting_mac = diskmax > RAID_PARITY_MAX ? diskmax : RAID_PARITY_MAX;
|
||||
waiting_map = malloc_nofail(waiting_mac * sizeof(unsigned));
|
||||
waiting_map = nalloc_nofail(waiting_mac, sizeof(unsigned));
|
||||
|
||||
soft_error = 0;
|
||||
io_error = 0;
|
||||
|
|
@ -187,8 +188,6 @@ static int state_dry_process(struct snapraid_state* state, struct snapraid_parit
|
|||
/* start all the worker threads */
|
||||
io_start(&io, blockstart, blockmax, 0);
|
||||
|
||||
blockcur = blockstart;
|
||||
|
||||
int alert = state_progress_begin(state, blockstart, blockmax, countmax);
|
||||
if (alert > 0)
|
||||
goto end;
|
||||
|
|
@ -368,6 +367,10 @@ bail:
|
|||
ret = handle_close(&handle[j]);
|
||||
if (ret == -1) {
|
||||
/* LCOV_EXCL_START */
|
||||
/*
|
||||
* If handle_close fails, the handle was open (f != -1), which
|
||||
* guarantees that both file and disk pointers are valid.
|
||||
*/
|
||||
log_tag("%s:%" PRIu64 ":%s:%s: Close error. %s.\n", es(errno), blockcur, disk->name, esc_tag(file->sub), strerror(errno));
|
||||
log_fatal_errno(errno, disk->name);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2011 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "support.h"
|
||||
#include "util.h"
|
||||
|
|
@ -33,7 +33,7 @@ struct snapraid_hash* hash_alloc(struct snapraid_state* state, struct snapraid_d
|
|||
hash->disk = disk;
|
||||
hash->file = file;
|
||||
|
||||
buf = malloc_nofail(file->blockmax * hash_size);
|
||||
buf = nalloc_nofail(file->blockmax, hash_size);
|
||||
|
||||
/* set the back pointer */
|
||||
for (i = 0; i < file->blockmax; ++i) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2011 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "elem.h"
|
||||
#include "support.h"
|
||||
|
|
@ -412,7 +412,7 @@ struct snapraid_file* file_alloc(unsigned block_size, const char* sub, data_off_
|
|||
file->physical = physical;
|
||||
file->flag = 0;
|
||||
file->shared_flag = 0;
|
||||
file->blockvec = malloc_nofail(file->blockmax * block_sizeof());
|
||||
file->blockvec = nalloc_nofail(file->blockmax, block_sizeof());
|
||||
|
||||
for (i = 0; i < file->blockmax; ++i) {
|
||||
struct snapraid_block* block = file_block(file, i);
|
||||
|
|
@ -437,7 +437,8 @@ struct snapraid_file* file_dup(struct snapraid_file* copy)
|
|||
file->inode = copy->inode;
|
||||
file->physical = copy->physical;
|
||||
file->flag = copy->flag;
|
||||
file->blockvec = malloc_nofail(file->blockmax * block_sizeof());
|
||||
file->shared_flag = 0;
|
||||
file->blockvec = nalloc_nofail(file->blockmax, block_sizeof());
|
||||
|
||||
for (i = 0; i < file->blockmax; ++i) {
|
||||
struct snapraid_block* block = file_block(file, i);
|
||||
|
|
@ -781,7 +782,7 @@ struct snapraid_dealloc* dealloc_alloc(unsigned block_size, const char* sub, dat
|
|||
dealloc->mtime_sec = mtime_sec;
|
||||
dealloc->mtime_nsec = mtime_nsec;
|
||||
dealloc->blockmax = (size + block_size - 1) / block_size;
|
||||
dealloc->blockhash = malloc_nofail(dealloc->blockmax * BLOCK_HASH_SIZE);
|
||||
dealloc->blockhash = nalloc_nofail(dealloc->blockmax, BLOCK_HASH_SIZE);
|
||||
|
||||
return dealloc;
|
||||
}
|
||||
|
|
@ -843,8 +844,11 @@ struct snapraid_disk* disk_alloc(const char* name, const char* dir, uint64_t dev
|
|||
#endif
|
||||
|
||||
disk->smartctl[0] = 0;
|
||||
for (i = 0; i < SMART_IGNORE_MAX; ++i)
|
||||
disk->smartignore[i] = 0;
|
||||
disk->smartctl_info[0] = 0;
|
||||
for (i = 0; i < SMART_IGNORE_MAX; ++i) {
|
||||
disk->smartignore[i].attr_index = 0;
|
||||
disk->smartignore[i].attr_name[0] = 0;
|
||||
}
|
||||
disk->fstype[0] = 0;
|
||||
disk->fslabel[0] = 0;
|
||||
disk->mount_device = dev;
|
||||
|
|
@ -915,8 +919,11 @@ struct snapraid_extra* extra_alloc(const char* name, const char* dir, uint64_t d
|
|||
pathslash(extra->dir, sizeof(extra->dir));
|
||||
|
||||
extra->smartctl[0] = 0;
|
||||
for (i = 0; i < SMART_IGNORE_MAX; ++i)
|
||||
extra->smartignore[i] = 0;
|
||||
extra->smartctl_info[0] = 0;
|
||||
for (i = 0; i < SMART_IGNORE_MAX; ++i) {
|
||||
extra->smartignore[i].attr_index = 0;
|
||||
extra->smartignore[i].attr_name[0] = 0;
|
||||
}
|
||||
extra->fstype[0] = 0;
|
||||
extra->fslabel[0] = 0;
|
||||
extra->device = dev;
|
||||
|
|
@ -1544,7 +1551,7 @@ struct snapraid_map* map_alloc(const char* name, unsigned position, block_off_t
|
|||
map->position = position;
|
||||
map->total_blocks = total_blocks;
|
||||
map->free_blocks = free_blocks;
|
||||
pathcpy(map->uuid, sizeof(map->uuid), uuid);
|
||||
pathcpy(map->content_uuid, sizeof(map->content_uuid), uuid);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -213,14 +213,6 @@ struct snapraid_block {
|
|||
*/
|
||||
#define FILE_IS_UNSYNCED 0x100
|
||||
|
||||
/**
|
||||
* If the file is without inode.
|
||||
* It could happen in file-systems where inodes are not persistent,
|
||||
* or when restoring a full disk with "fix".
|
||||
* In such cases we have to clear any stored duplicate inode.
|
||||
* After the scan process completes, no file should have this flag set.
|
||||
*/
|
||||
#define FILE_IS_WITHOUT_INODE 0x200
|
||||
|
||||
/**
|
||||
* The file is deleted.
|
||||
|
|
@ -245,11 +237,26 @@ struct snapraid_block {
|
|||
#define FILE_IS_JUNCTION 0x8000 /**< If it's a junction for Windows. Not yet supported. */
|
||||
#define FILE_IS_LINK_MASK 0xF000 /**< Mask for link type. */
|
||||
|
||||
/**
|
||||
* Flag to indicate the old version of a modified file during scanning.
|
||||
*/
|
||||
#define FILE_IS_MODIFIED_OLD 0x10000
|
||||
|
||||
/**
|
||||
* Flag to indicate the new version of a modified/reallocated file during scanning.
|
||||
*/
|
||||
#define FILE_IS_MODIFIED_NEW 0x20000
|
||||
|
||||
/**
|
||||
* Flag to indicate the old version of a kept file being reallocated during scanning.
|
||||
*/
|
||||
#define FILE_IS_REALLOC_OLD 0x40000
|
||||
|
||||
/**
|
||||
* Flags from this bit are shared between multiple threads
|
||||
* and goes in the shared_flags instead of flags
|
||||
*/
|
||||
#define FILE_FLAGS_SHARED_BIT 16
|
||||
#define FILE_FLAGS_SHARED_BIT 24
|
||||
|
||||
/**
|
||||
* During scan if the file is found missing and relocated to another place
|
||||
|
|
@ -259,7 +266,7 @@ struct snapraid_block {
|
|||
* This specific bit is written using protection from the stamp_mutex during
|
||||
* the multithread scan.
|
||||
*/
|
||||
#define FILE_IS_RELOCATED 0x10000
|
||||
#define FILE_IS_RELOCATED 0x1000000
|
||||
|
||||
/**
|
||||
* File.
|
||||
|
|
@ -273,8 +280,8 @@ struct snapraid_file {
|
|||
block_off_t blockmax; /**< Number of blocks. */
|
||||
char* sub; /**< Sub path of the file. Without the disk dir. The disk is implicit. */
|
||||
int mtime_nsec; /**< Modification time nanoseconds. In the range 0 <= x < 1,000,000,000, or STAT_NSEC_INVALID if not present. */
|
||||
uint16_t flag; /**< FILE_IS_* flags. */
|
||||
uint16_t shared_flag; /**< FILE_IS_RELOCATED flag. Keep it separated as it's accessed by multiple threads */
|
||||
uint32_t flag; /**< FILE_IS_* flags. */
|
||||
uint32_t shared_flag; /**< FILE_IS_RELOCATED flag. Keep it separated as it's accessed by multiple threads */
|
||||
|
||||
/* nodes for data structures */
|
||||
tommy_node nodelist;
|
||||
|
|
@ -343,8 +350,9 @@ struct snapraid_extent {
|
|||
struct snapraid_extra {
|
||||
char name[PATH_MAX]; /**< Name of the disk. */
|
||||
char dir[PATH_MAX]; /**< Mount point of the disk. It always terminates with /. */
|
||||
char smartctl[PATH_MAX]; /**< Custom command for smartctl. Empty means auto. */
|
||||
int smartignore[SMART_IGNORE_MAX]; /**< Smart attributes to ignore for this device. */
|
||||
char smartctl[SMART_MAX]; /**< Custom option for smartctl. Empty means auto. */
|
||||
char smartctl_info[SMART_MAX]; /* Info options for smartctl. Empty means -a. */
|
||||
struct smartignore_struct smartignore[SMART_IGNORE_MAX]; /**< Smart attributes to ignore for this device. */
|
||||
char uuid[UUID_MAX]; /**< UUID of the disk. They are probed during the config reading. */
|
||||
char fstype[FSINFO_MAX]; /**< Filesystem type */
|
||||
char fslabel[FSINFO_MAX]; /**< Filesystem label */
|
||||
|
|
@ -381,8 +389,9 @@ struct snapraid_disk {
|
|||
*/
|
||||
struct fssnapshot_struct fss;
|
||||
|
||||
char smartctl[PATH_MAX]; /**< Custom command for smartctl. Empty means auto. */
|
||||
int smartignore[SMART_IGNORE_MAX]; /**< Smart attributes to ignore for this device. */
|
||||
char smartctl[SMART_MAX]; /**< Custom option for smartctl. Empty means auto. */
|
||||
char smartctl_info[SMART_MAX]; /* Info options for smartctl. Empty means -a. */
|
||||
struct smartignore_struct smartignore[SMART_IGNORE_MAX]; /**< Smart attributes to ignore for this device. */
|
||||
char uuid[UUID_MAX]; /**< UUID of the disk. They are probed during the config reading. */
|
||||
char fstype[FSINFO_MAX]; /**< Filesystem type */
|
||||
char fslabel[FSINFO_MAX]; /**< Filesystem label */
|
||||
|
|
@ -483,7 +492,7 @@ struct snapraid_disk {
|
|||
*/
|
||||
struct snapraid_map {
|
||||
char name[PATH_MAX]; /**< Name of the disk. */
|
||||
char uuid[UUID_MAX]; /**< UUID of the disk. Empty if unknown. They are read from the content file. */
|
||||
char content_uuid[UUID_MAX]; /**< UUID of the disk. Empty if unknown. They are read from the content file. */
|
||||
block_off_t total_blocks; /**< Number of total blocks. */
|
||||
block_off_t free_blocks; /**< Number of free blocks at last 'sync'. */
|
||||
unsigned position; /**< Position of the disk in the parity. */
|
||||
|
|
@ -514,7 +523,8 @@ struct snapraid_map {
|
|||
*/
|
||||
struct snapraid_split {
|
||||
char path[PATH_MAX]; /**< Path of the parity file. */
|
||||
char uuid[UUID_MAX]; /**< UUID of the disk. Empty if unknown. They are probed during the config reading, and later read from the content file. */
|
||||
char uuid[UUID_MAX]; /**< UUID of the disk. Empty if unknown. They are probed during the config reading. */
|
||||
char content_uuid[UUID_MAX]; /**< UUID read from the content file. */
|
||||
char fstype[FSINFO_MAX]; /**< Filesystem type */
|
||||
char fslabel[FSINFO_MAX]; /**< Filesystem label */
|
||||
|
||||
|
|
@ -534,8 +544,9 @@ struct snapraid_split {
|
|||
struct snapraid_parity {
|
||||
struct snapraid_split split_map[SPLIT_MAX]; /**< Parity splits. */
|
||||
unsigned split_mac; /**< Number of parity splits. */
|
||||
char smartctl[PATH_MAX]; /**< Custom command for smartctl. Empty means auto. */
|
||||
int smartignore[SMART_IGNORE_MAX]; /**< Smart attributes to ignore for this device. */
|
||||
char smartctl[SMART_MAX]; /**< Custom option for smartctl. Empty means auto. */
|
||||
char smartctl_info[SMART_MAX]; /* Info options for smartctl. Empty means -a. */
|
||||
struct smartignore_struct smartignore[SMART_IGNORE_MAX]; /**< Smart attributes to ignore for this device. */
|
||||
block_off_t total_blocks; /**< Number of total blocks. */
|
||||
block_off_t free_blocks; /**< Number of free blocks at the last sync. */
|
||||
int is_excluded_by_filter; /**< If the parity is excluded by filters. */
|
||||
|
|
@ -796,8 +807,7 @@ static inline int block_has_file_and_valid_parity(const struct snapraid_block* b
|
|||
|
||||
static inline int file_flag_has(const struct snapraid_file* file, unsigned mask)
|
||||
{
|
||||
if (mask >= (1 << FILE_FLAGS_SHARED_BIT)) {
|
||||
mask >>= FILE_FLAGS_SHARED_BIT;
|
||||
if (mask >= (1U << FILE_FLAGS_SHARED_BIT)) {
|
||||
return (file->shared_flag & mask) == mask;
|
||||
} else {
|
||||
return (file->flag & mask) == mask;
|
||||
|
|
@ -806,8 +816,7 @@ static inline int file_flag_has(const struct snapraid_file* file, unsigned mask)
|
|||
|
||||
static inline void file_flag_set(struct snapraid_file* file, unsigned mask)
|
||||
{
|
||||
if (mask >= (1 << FILE_FLAGS_SHARED_BIT)) {
|
||||
mask >>= FILE_FLAGS_SHARED_BIT;
|
||||
if (mask >= (1U << FILE_FLAGS_SHARED_BIT)) {
|
||||
file->shared_flag |= mask;
|
||||
} else {
|
||||
file->flag |= mask;
|
||||
|
|
@ -816,8 +825,7 @@ static inline void file_flag_set(struct snapraid_file* file, unsigned mask)
|
|||
|
||||
static inline void file_flag_clear(struct snapraid_file* file, unsigned mask)
|
||||
{
|
||||
if (mask >= (1 << FILE_FLAGS_SHARED_BIT)) {
|
||||
mask >>= FILE_FLAGS_SHARED_BIT;
|
||||
if (mask >= (1U << FILE_FLAGS_SHARED_BIT)) {
|
||||
file->shared_flag &= ~mask;
|
||||
} else {
|
||||
file->flag &= ~mask;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2011 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "elem.h"
|
||||
#include "support.h"
|
||||
|
|
@ -136,7 +136,7 @@ int handle_open(struct snapraid_handle* handle, struct snapraid_file* file, int
|
|||
out_missing = log_error;
|
||||
|
||||
/* if already opened, nothing to do */
|
||||
if (handle->file == file && handle->file != 0 && handle->f != -1) {
|
||||
if (handle->file != 0 && handle->file == file && handle->f != -1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -382,7 +382,7 @@ struct snapraid_handle* handle_mapping(struct snapraid_state* state, unsigned* h
|
|||
}
|
||||
++size; /* size is one more than the max */
|
||||
|
||||
handle = malloc_nofail(size * sizeof(struct snapraid_handle));
|
||||
handle = nalloc_nofail(size, sizeof(struct snapraid_handle));
|
||||
|
||||
for (j = 0; j < size; ++j) {
|
||||
/* default for empty position */
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2013 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "support.h"
|
||||
#include "import.h"
|
||||
|
|
@ -54,7 +54,7 @@ static void import_file(struct snapraid_state* state, const char* path, uint64_t
|
|||
file->path = strdup_nofail(path);
|
||||
file->size = size;
|
||||
file->blockmax = (size + block_size - 1) / block_size;
|
||||
file->blockimp = malloc_nofail(file->blockmax * sizeof(struct snapraid_import_block));
|
||||
file->blockimp = nalloc_nofail(file->blockmax, sizeof(struct snapraid_import_block));
|
||||
file->is_runtime = 1;
|
||||
|
||||
buffer = malloc_nofail(block_size);
|
||||
|
|
@ -144,7 +144,7 @@ static void import_dealloc(struct snapraid_state* state, const char* dir, struct
|
|||
file->path = strdup_nofail(path);
|
||||
file->size = size;
|
||||
file->blockmax = (size + block_size - 1) / block_size;
|
||||
file->blockimp = malloc_nofail(file->blockmax * sizeof(struct snapraid_import_block));
|
||||
file->blockimp = nalloc_nofail(file->blockmax, sizeof(struct snapraid_import_block));
|
||||
file->is_runtime = 0;
|
||||
|
||||
offset = 0;
|
||||
|
|
|
|||
24
cmdline/io.c
24
cmdline/io.c
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2016 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "io.h"
|
||||
|
||||
|
|
@ -557,7 +557,15 @@ static void io_flush_thread(struct snapraid_io* io)
|
|||
if (all_done)
|
||||
break;
|
||||
|
||||
/* wait for something to complete */
|
||||
/*
|
||||
* Wait for something to complete.
|
||||
*
|
||||
* We cannot use thread_cond_wait(&io->write_done) here because
|
||||
* write_done is heavily optimized to only be signaled when the oldest
|
||||
* task in the queue completes (done_index == waiting_index).
|
||||
* Since io_flush waits for all tasks to complete, it would miss
|
||||
* wakeups for newer tasks and deadlock.
|
||||
*/
|
||||
thread_yield();
|
||||
}
|
||||
}
|
||||
|
|
@ -767,7 +775,7 @@ static void* io_reader_thread(void* arg)
|
|||
|
||||
if (task->state != TASK_STATE_READY) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Internal inconsistency: Unexpected state %d in reader for task at position %u in worker %u\n", task->state, task->position, worker->index);
|
||||
log_fatal(EINTERNAL, "Internal inconsistency: Unexpected state %d in reader for task at position %" PRIu64 " in worker %u\n", task->state, task->position, worker->index);
|
||||
os_abort();
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
|
@ -802,7 +810,7 @@ static void* io_writer_thread(void* arg)
|
|||
|
||||
if (task->state != TASK_STATE_READY) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Internal inconsistency: Unexpected state %d in writer for task at position %u in worker %u\n", task->state, task->position, worker->index);
|
||||
log_fatal(EINTERNAL, "Internal inconsistency: Unexpected state %d in writer for task at position %" PRIu64 " in worker %u\n", task->state, task->position, worker->index);
|
||||
os_abort();
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
|
@ -1013,10 +1021,10 @@ void io_init(struct snapraid_io* io, struct snapraid_state* state,
|
|||
io->reader_max = readers_count;
|
||||
io->writer_max = writers_count;
|
||||
|
||||
io->reader_map = malloc_nofail(sizeof(struct snapraid_worker) * io->reader_max);
|
||||
io->reader_list = malloc_nofail(sizeof(unsigned) * (io->reader_max + 1));
|
||||
io->writer_map = malloc_nofail(sizeof(struct snapraid_worker) * io->writer_max);
|
||||
io->writer_list = malloc_nofail(sizeof(unsigned) * (io->writer_max + 1));
|
||||
io->reader_map = nalloc_nofail(io->reader_max, sizeof(struct snapraid_worker));
|
||||
io->reader_list = nalloc_nofail(io->reader_max + 1, sizeof(unsigned));
|
||||
io->writer_map = nalloc_nofail(io->writer_max, sizeof(struct snapraid_worker));
|
||||
io->writer_list = nalloc_nofail(io->writer_max + 1, sizeof(unsigned));
|
||||
|
||||
io->data_base = 0;
|
||||
io->data_count = 0;
|
||||
|
|
|
|||
17
cmdline/io.h
17
cmdline/io.h
|
|
@ -76,7 +76,13 @@ struct snapraid_worker {
|
|||
thread_id_t thread; /**< Thread context for the worker. */
|
||||
#endif
|
||||
|
||||
struct snapraid_io* io; /**< Parent pointer. */
|
||||
/**
|
||||
* Parent pointer.
|
||||
*
|
||||
* Note that worker threads must NOT use this pointer to access
|
||||
* the global state (io->state).
|
||||
*/
|
||||
struct snapraid_io* io;
|
||||
|
||||
void (*func)(struct snapraid_worker*, struct snapraid_task*);
|
||||
|
||||
|
|
@ -182,6 +188,15 @@ struct snapraid_worker {
|
|||
* io_stop(&io);
|
||||
*/
|
||||
struct snapraid_io {
|
||||
/**
|
||||
* Pointer to the global state.
|
||||
*
|
||||
* Note that this pointer must NOT be accessed inside worker threads
|
||||
* (e.g. data_reader/writer, parity_reader/writer functions).
|
||||
* Workers must only operate on their pre-allocated buffers and local task variables,
|
||||
* while any state modifications must strictly happen on the main thread
|
||||
* after I/O completion.
|
||||
*/
|
||||
struct snapraid_state* state;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2013 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "util.h"
|
||||
#include "elem.h"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "elem.h"
|
||||
#include "parity.h"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2025 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "snapraid.h"
|
||||
|
||||
|
|
@ -96,20 +96,42 @@ static char* argutf8(const WCHAR* arg)
|
|||
return 0;
|
||||
|
||||
res = WideCharToMultiByte(CP_UTF8, 0, arg, len + 1 /* include final null */, utf8_arg, utf8_len, 0, 0);
|
||||
if (res != utf8_len)
|
||||
if (res != utf8_len) {
|
||||
free(utf8_arg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return utf8_arg;
|
||||
}
|
||||
|
||||
/* Global variable to store child process handle */
|
||||
static HANDLE child_process = NULL;
|
||||
static void* volatile child_process = NULL;
|
||||
|
||||
/*
|
||||
* Safe atomic access helpers for child_process.
|
||||
*
|
||||
* The console_handler runs concurrently on an OS-managed thread created by
|
||||
* the Windows kernel. Because plain writes and standard volatile access do not
|
||||
* guarantee CPU cache visibility (flushing from store buffers) or prevent CPU/compiler
|
||||
* out-of-order reordering (due to lack of hardware memory barriers/fences on MinGW),
|
||||
* we must use Win32 Interlocked APIs to ensure safe, atomic, fence-protected reads
|
||||
* and writes of the child process handle.
|
||||
*/
|
||||
static HANDLE child_process_read(void)
|
||||
{
|
||||
return InterlockedCompareExchangePointer(&child_process, NULL, NULL);
|
||||
}
|
||||
|
||||
static void child_process_write(HANDLE handle)
|
||||
{
|
||||
InterlockedExchangePointer(&child_process, handle);
|
||||
}
|
||||
|
||||
/* Console control handler - forwards Ctrl+C, Ctrl+Break to child */
|
||||
static BOOL WINAPI console_handler(DWORD ctrl_type)
|
||||
{
|
||||
/* if no child, default behavior */
|
||||
if (child_process == NULL)
|
||||
if (child_process_read() == NULL)
|
||||
return FALSE;
|
||||
|
||||
switch (ctrl_type) {
|
||||
|
|
@ -154,8 +176,8 @@ int main(int argc, char* argv[])
|
|||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
res = GetModuleFileNameW(NULL, app_buffer, sizeof(app_buffer));
|
||||
if (res == 0 || res >= sizeof(app_buffer)) {
|
||||
res = GetModuleFileNameW(NULL, app_buffer, COMMAND_LINE_MAX);
|
||||
if (res == 0 || res >= COMMAND_LINE_MAX) {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
|
@ -170,7 +192,7 @@ int main(int argc, char* argv[])
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
pos = argcat(cmd_buffer, sizeof(cmd_buffer), 0, app_buffer);
|
||||
pos = argcat(cmd_buffer, COMMAND_LINE_MAX, 0, app_buffer);
|
||||
if (pos < 0) {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
|
@ -186,7 +208,7 @@ int main(int argc, char* argv[])
|
|||
if (wcscmp(wide_argv[i], L"-s") == 0 || wcscmp(wide_argv[i], L"--spin-down-on-error") == 0) {
|
||||
mode = MODE_SPINDOWN;
|
||||
} else {
|
||||
pos = argcat(cmd_buffer, sizeof(cmd_buffer), pos, wide_argv[i]);
|
||||
pos = argcat(cmd_buffer, COMMAND_LINE_MAX, pos, wide_argv[i]);
|
||||
if (pos < 0) {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
|
@ -225,7 +247,7 @@ int main(int argc, char* argv[])
|
|||
}
|
||||
|
||||
/* store child process handle for signal handler */
|
||||
child_process = pi.hProcess;
|
||||
child_process_write(pi.hProcess);
|
||||
|
||||
wait = WaitForSingleObject(pi.hProcess, INFINITE);
|
||||
if (wait != WAIT_OBJECT_0) {
|
||||
|
|
@ -237,7 +259,7 @@ int main(int argc, char* argv[])
|
|||
}
|
||||
|
||||
/* clear child process handle */
|
||||
child_process = NULL;
|
||||
child_process_write(NULL);
|
||||
|
||||
if (!GetExitCodeProcess(pi.hProcess, &res)) {
|
||||
fprintf(stderr, "GetExitCodeProcess failed: %lu\n", (unsigned long)GetLastError());
|
||||
|
|
@ -293,7 +315,7 @@ const char* get_argv0(const char* argv0)
|
|||
}
|
||||
|
||||
/* global variable to store child PID for signal handler */
|
||||
static volatile pid_t child_pid = 0;
|
||||
static volatile sig_atomic_t child_pid = 0;
|
||||
|
||||
/* signal handler that forwards signals to child */
|
||||
/* LCOV_EXCL_START */
|
||||
|
|
@ -342,6 +364,18 @@ int main(int argc, char* argv[])
|
|||
sigaction(SIGUSR1, &sa, NULL); /* user-defined 1 */
|
||||
sigaction(SIGUSR2, &sa, NULL); /* user-defined 2 */
|
||||
|
||||
sigset_t set, oldset;
|
||||
sigemptyset(&set);
|
||||
sigaddset(&set, SIGINT);
|
||||
sigaddset(&set, SIGQUIT);
|
||||
sigaddset(&set, SIGTERM);
|
||||
sigaddset(&set, SIGHUP);
|
||||
sigaddset(&set, SIGUSR1);
|
||||
sigaddset(&set, SIGUSR2);
|
||||
|
||||
/* block signals to prevent signal race before child_pid is set */
|
||||
sigprocmask(SIG_BLOCK, &set, &oldset);
|
||||
|
||||
pid_t pid = fork();
|
||||
if (pid == -1) {
|
||||
/* LCOV_EXCL_START */
|
||||
|
|
@ -361,6 +395,9 @@ int main(int argc, char* argv[])
|
|||
signal(SIGUSR1, SIG_DFL);
|
||||
signal(SIGUSR2, SIG_DFL);
|
||||
|
||||
/* unblock signals in child */
|
||||
sigprocmask(SIG_SETMASK, &oldset, NULL);
|
||||
|
||||
execvp(get_argv0(argv[0]), argv);
|
||||
|
||||
/* here it's an error */
|
||||
|
|
@ -375,6 +412,9 @@ int main(int argc, char* argv[])
|
|||
/* store child PID so signal handler can forward signals */
|
||||
child_pid = pid;
|
||||
|
||||
/* unblock signals in parent */
|
||||
sigprocmask(SIG_SETMASK, &oldset, NULL);
|
||||
|
||||
do {
|
||||
ret = waitpid(pid, &status, 0);
|
||||
} while (ret == -1 && errno == EINTR); /* retry if interrupted by signal */
|
||||
|
|
|
|||
160
cmdline/memory.c
Normal file
160
cmdline/memory.c
Normal file
|
|
@ -0,0 +1,160 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2011 Andrea Mazzoleni
|
||||
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "support.h"
|
||||
#include "memory.h"
|
||||
|
||||
/****************************************************************************/
|
||||
/* memory */
|
||||
|
||||
/**
|
||||
* Cumulative amount of memory allocated.
|
||||
*/
|
||||
static size_t mcounter;
|
||||
|
||||
size_t malloc_counter_get(void)
|
||||
{
|
||||
size_t ret;
|
||||
|
||||
lock_memory();
|
||||
|
||||
ret = mcounter;
|
||||
|
||||
unlock_memory();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void malloc_counter_inc(size_t inc)
|
||||
{
|
||||
lock_memory();
|
||||
|
||||
mcounter += inc;
|
||||
|
||||
unlock_memory();
|
||||
}
|
||||
|
||||
/* LCOV_EXCL_START */
|
||||
static ssize_t malloc_print(int f, const char* str)
|
||||
{
|
||||
ssize_t len = 0;
|
||||
|
||||
while (str[len])
|
||||
++len;
|
||||
return write(f, str, len);
|
||||
}
|
||||
/* LCOV_EXCL_STOP */
|
||||
|
||||
/* LCOV_EXCL_START */
|
||||
static ssize_t malloc_printn(int f, size_t value)
|
||||
{
|
||||
char buf[32];
|
||||
int i;
|
||||
|
||||
if (!value)
|
||||
return write(f, "0", 1);
|
||||
|
||||
i = sizeof(buf);
|
||||
while (value) {
|
||||
buf[--i] = (value % 10) + '0';
|
||||
value /= 10;
|
||||
}
|
||||
|
||||
return write(f, buf + i, sizeof(buf) - i);
|
||||
}
|
||||
/* LCOV_EXCL_STOP */
|
||||
|
||||
/* LCOV_EXCL_START */
|
||||
void malloc_fail(size_t size)
|
||||
{
|
||||
/* don't use printf to avoid any possible extra allocation */
|
||||
int f = 2; /* stderr */
|
||||
|
||||
malloc_print(f, "Failed for Low Memory!\n");
|
||||
malloc_print(f, "Allocating ");
|
||||
malloc_printn(f, size);
|
||||
malloc_print(f, " bytes.\n");
|
||||
malloc_print(f, "Already allocated ");
|
||||
malloc_printn(f, malloc_counter_get());
|
||||
malloc_print(f, " bytes.\n");
|
||||
if (sizeof(void*) == 4) {
|
||||
malloc_print(f, "You are currently using a 32 bits executable.\n");
|
||||
malloc_print(f, "If you have more than 4GB of memory, please upgrade to a 64 bits one.\n");
|
||||
}
|
||||
}
|
||||
/* LCOV_EXCL_STOP */
|
||||
|
||||
void* malloc_nofail(size_t size)
|
||||
{
|
||||
void* ptr = malloc(size ? size : 1);
|
||||
|
||||
if (!ptr) {
|
||||
/* LCOV_EXCL_START */
|
||||
malloc_fail(size);
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
#ifndef CHECKER /* Don't preinitialize when running for valgrind */
|
||||
/*
|
||||
* Here we preinitialize the memory to ensure that the OS is really allocating it
|
||||
* and not only reserving the addressable space.
|
||||
* Otherwise we are risking that the OOM (Out Of Memory) killer in Linux will kill the process.
|
||||
* Filling the memory doesn't ensure to disable OOM, but it increase a lot the chances to
|
||||
* get a real error from malloc() instead than a process killed.
|
||||
* Note that calloc() doesn't have the same effect.
|
||||
*/
|
||||
memset(ptr, 0xA5, size);
|
||||
#endif
|
||||
|
||||
malloc_counter_inc(size);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* nalloc_nofail(size_t count, size_t size)
|
||||
{
|
||||
if (count > SIZE_MAX / size) {
|
||||
log_fatal(EINTERNAL, "Allocation size overflow\n");
|
||||
os_abort();
|
||||
}
|
||||
|
||||
size *= count;
|
||||
|
||||
/* see the note in malloc_nofail() of why we don't use calloc() */
|
||||
void* ptr = malloc(size ? size : 1);
|
||||
|
||||
if (!ptr) {
|
||||
/* LCOV_EXCL_START */
|
||||
malloc_fail(size);
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
malloc_counter_inc(size);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* calloc_nofail(size_t count, size_t size)
|
||||
{
|
||||
void* ptr = nalloc_nofail(count, size);
|
||||
|
||||
memset(ptr, 0, count * size);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
char* strdup_nofail(const char* str)
|
||||
{
|
||||
size_t size = strlen(str) + 1;
|
||||
|
||||
char* ptr = malloc_nofail(size);
|
||||
|
||||
memcpy(ptr, str, size);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
45
cmdline/memory.h
Normal file
45
cmdline/memory.h
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2011 Andrea Mazzoleni
|
||||
|
||||
#ifndef __MEMORY_H
|
||||
#define __MEMORY_H
|
||||
|
||||
/****************************************************************************/
|
||||
/* memory */
|
||||
|
||||
/**
|
||||
* Return the size of the cumulative allocated memory.
|
||||
*/
|
||||
size_t malloc_counter_get(void);
|
||||
|
||||
/**
|
||||
* Safe malloc.
|
||||
* If no memory is available, it aborts.
|
||||
*/
|
||||
void* malloc_nofail(size_t size);
|
||||
|
||||
/**
|
||||
* Safe malloc with calloc calling arguments.
|
||||
* If no memory is available, it aborts.
|
||||
*/
|
||||
void* nalloc_nofail(size_t count, size_t size);
|
||||
|
||||
/**
|
||||
* Safe calloc.
|
||||
* If no memory is available, it aborts.
|
||||
*/
|
||||
void* calloc_nofail(size_t count, size_t size);
|
||||
|
||||
/**
|
||||
* Safe strdup.
|
||||
* If no memory is available, it aborts.
|
||||
*/
|
||||
char* strdup_nofail(const char* str);
|
||||
|
||||
/**
|
||||
* Helper for printing an error about a failed allocation.
|
||||
*/
|
||||
void malloc_fail(size_t size);
|
||||
|
||||
#endif
|
||||
|
||||
1815
cmdline/mingwapp.c
Normal file
1815
cmdline/mingwapp.c
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2015 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "stream.h"
|
||||
#include "support.h"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2011 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "support.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2011 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "support.h"
|
||||
#include "elem.h"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2013 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "support.h"
|
||||
#include "elem.h"
|
||||
|
|
@ -80,7 +80,7 @@ static int clean_dir(const char* dir)
|
|||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
if (dd == 0 && errno == 0) {
|
||||
if (dd == 0) {
|
||||
break; /* finished */
|
||||
}
|
||||
|
||||
|
|
@ -196,7 +196,7 @@ static void read_dir(tommy_hashdyn* poolset, const char* base_dir, const char* s
|
|||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
if (dd == 0 && errno == 0) {
|
||||
if (dd == 0) {
|
||||
break; /* finished */
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2013 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "util.h"
|
||||
#include "elem.h"
|
||||
|
|
@ -44,7 +44,7 @@ void state_rehash(struct snapraid_state* state)
|
|||
|
||||
/* set the new hash and seed */
|
||||
state->hash = state->besthash;
|
||||
if (randomize(state->hashseed, HASH_MAX) != 0) {
|
||||
if (os_randomize(state->hashseed, HASH_MAX) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(errno, "Failed to get random values.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include <windows.h>
|
||||
|
||||
#include "../config.h"
|
||||
#include "config.h"
|
||||
|
||||
1 RT_MANIFEST "resource.manifest"
|
||||
|
||||
|
|
|
|||
164
cmdline/scan.c
164
cmdline/scan.c
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2011 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "support.h"
|
||||
#include "elem.h"
|
||||
|
|
@ -417,7 +417,7 @@ static void scan_file_delayed_allocate(struct snapraid_scan* scan, struct snapra
|
|||
}
|
||||
}
|
||||
|
||||
/* insert in the delayed list */
|
||||
/* insert in the delayed allocation list */
|
||||
tommy_list_insert_tail(&scan->file_insert_list, &file->nodelist, file);
|
||||
}
|
||||
|
||||
|
|
@ -604,7 +604,7 @@ static void scan_file_refresh(struct snapraid_scan* scan, const char* sub, struc
|
|||
st->st_nlink = synced_st.st_nlink;
|
||||
}
|
||||
|
||||
if (st->st_ino != synced_st.st_ino) {
|
||||
if (st->st_ino != INODE_INVALID && synced_st.st_ino != INODE_INVALID && st->st_ino != synced_st.st_ino) {
|
||||
log_tag("%s:%u:%s:%s: Uncached inode change error.\n", es(ESOFT), 0, disk->name, esc_tag(sub));
|
||||
log_fatal(ESOFT, "DANGER! Detected uncached inode change from %" PRIu64 " to %" PRIu64 " for file '%s'\n",
|
||||
(uint64_t)st->st_ino, (uint64_t)synced_st.st_ino, sub);
|
||||
|
|
@ -633,16 +633,13 @@ static void scan_file_insert(struct snapraid_scan* scan, struct snapraid_file* f
|
|||
struct snapraid_disk* disk = scan->disk;
|
||||
|
||||
/* insert the file in the containers */
|
||||
if (!file_flag_has(file, FILE_IS_WITHOUT_INODE))
|
||||
if (file->inode != INODE_INVALID)
|
||||
tommy_hashdyn_insert(&disk->inodeset, &file->nodeset, file, file_inode_hash(file->inode));
|
||||
|
||||
stamp_lock(disk);
|
||||
tommy_hashdyn_insert(&disk->pathset, &file->pathset, file, file_path_hash(file->sub));
|
||||
tommy_hashdyn_insert(&disk->stampset, &file->stampset, file, file_stamp_hash(file->size, file->mtime_sec, file->mtime_nsec));
|
||||
stamp_unlock(disk);
|
||||
|
||||
/* delayed allocation of the parity */
|
||||
scan_file_delayed_allocate(scan, file);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -655,9 +652,13 @@ static void scan_file_remove(struct snapraid_scan* scan, struct snapraid_file* f
|
|||
struct snapraid_disk* disk = scan->disk;
|
||||
|
||||
/* remove the file from the containers */
|
||||
if (!file_flag_has(file, FILE_IS_WITHOUT_INODE))
|
||||
if (file->inode != INODE_INVALID)
|
||||
tommy_hashdyn_remove_existing(&disk->inodeset, &file->nodeset);
|
||||
|
||||
stamp_lock(disk);
|
||||
tommy_hashdyn_remove_existing(&disk->pathset, &file->pathset);
|
||||
tommy_hashdyn_remove_existing(&disk->stampset, &file->stampset);
|
||||
stamp_unlock(disk);
|
||||
|
||||
/*
|
||||
* Keep track of the removed file (that won't be added later)
|
||||
|
|
@ -673,11 +674,15 @@ static void scan_file_remove(struct snapraid_scan* scan, struct snapraid_file* f
|
|||
tommy_list_insert_tail(&disk->dealloclist, &dealloc->nodelist, dealloc);
|
||||
}
|
||||
|
||||
stamp_lock(disk);
|
||||
tommy_hashdyn_remove_existing(&disk->stampset, &file->stampset);
|
||||
stamp_unlock(disk);
|
||||
|
||||
/* deallocate the file from the parity */
|
||||
/*
|
||||
* Deallocate the file from the parity.
|
||||
*
|
||||
* This is safe to run unlocked because:
|
||||
* 1. Modified files deallocations are deferred to Phase 2 (mono-threaded phase).
|
||||
* 2. Invalid parity files deallocated in Phase 1 are never selected by
|
||||
* file_is_full_hashed_and_stable() during copy-detection (since they lack
|
||||
* valid parity blocks).
|
||||
*/
|
||||
scan_file_deallocate(scan, file);
|
||||
}
|
||||
|
||||
|
|
@ -698,13 +703,15 @@ static void scan_file_keep(struct snapraid_scan* scan, struct snapraid_file* fil
|
|||
|
||||
/* if the file is full invalid, schedule a reinsert at later stage */
|
||||
if (file_is_full_invalid_parity_and_stable(scan->state, disk, file)) {
|
||||
|
||||
struct snapraid_file* copy = file_dup(file);
|
||||
file_flag_set(copy, FILE_IS_MODIFIED_NEW);
|
||||
|
||||
/* remove the file */
|
||||
scan_file_remove(scan, file, 0);
|
||||
/* insert in the delayed allocation list */
|
||||
scan_file_delayed_allocate(scan, copy);
|
||||
|
||||
/* reinsert the copy in the delayed list */
|
||||
scan_file_insert(scan, copy);
|
||||
/* mark the file to be removed on Phase 2 */
|
||||
file_flag_set(file, FILE_IS_REALLOC_OLD);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -723,6 +730,7 @@ static void scan_file(struct snapraid_scan* scan, int is_diff, const char* sub,
|
|||
int64_t file_already_present_mtime_sec;
|
||||
int file_already_present_mtime_nsec;
|
||||
int is_file_reported;
|
||||
int is_file_modified;
|
||||
/*
|
||||
* If the disk has persistent inodes and UUID, try a search on the past inodes,
|
||||
* to detect moved files.
|
||||
|
|
@ -755,9 +763,11 @@ static void scan_file(struct snapraid_scan* scan, int is_diff, const char* sub,
|
|||
* Always search with the new inode, in the all new inodes found until now,
|
||||
* with the eventual presence of also the past inodes
|
||||
*/
|
||||
uint64_t inode = st->st_ino;
|
||||
|
||||
file = tommy_hashdyn_search(&disk->inodeset, file_inode_compare_to_arg, &inode, file_inode_hash(inode));
|
||||
uint64_t inode = st->st_ino; /* don't know the exact type of st_ino and we cannot pass it by pointer in the search */
|
||||
if (inode != INODE_INVALID)
|
||||
file = tommy_hashdyn_search(&disk->inodeset, file_inode_compare_to_arg, &inode, file_inode_hash(inode));
|
||||
else
|
||||
file = 0;
|
||||
|
||||
/* identify moved files with past inodes and hardlinks with the new inodes */
|
||||
if (file) {
|
||||
|
|
@ -893,25 +903,26 @@ static void scan_file(struct snapraid_scan* scan, int is_diff, const char* sub,
|
|||
* otherwise, it will get removed
|
||||
*/
|
||||
|
||||
/* here the inode must be present */
|
||||
if (file->inode == INODE_INVALID) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Internal inconsistency in inode for file '%s%s' as unexpected missing\n", disk->dir, sub);
|
||||
os_abort();
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
/* remove from the inode set */
|
||||
tommy_hashdyn_remove_existing(&disk->inodeset, &file->nodeset);
|
||||
|
||||
/*
|
||||
* Clear the inode
|
||||
* this is not really needed for correct functionality
|
||||
* because we are going to set FILE_IS_WITHOUT_INODE
|
||||
* but it's easier for debugging to have invalid inodes set to 0
|
||||
*/
|
||||
file->inode = 0;
|
||||
|
||||
/* mark as missing inode */
|
||||
file_flag_set(file, FILE_IS_WITHOUT_INODE);
|
||||
/* clear the inode */
|
||||
file->inode = INODE_INVALID;
|
||||
|
||||
/* go further to find it by name */
|
||||
}
|
||||
|
||||
/* initialize for later overwrite */
|
||||
is_file_reported = 0;
|
||||
is_file_modified = 0;
|
||||
is_original_file_size_different_than_zero = 0;
|
||||
|
||||
/* then try finding it by name */
|
||||
|
|
@ -922,20 +933,18 @@ static void scan_file(struct snapraid_scan* scan, int is_diff, const char* sub,
|
|||
|
||||
if (is_file_already_present) {
|
||||
/* if the file is without an inode */
|
||||
if (file_flag_has(file, FILE_IS_WITHOUT_INODE)) {
|
||||
if (file->inode == INODE_INVALID) {
|
||||
/* set it now */
|
||||
file->inode = st->st_ino;
|
||||
|
||||
/* insert in the set */
|
||||
tommy_hashdyn_insert(&disk->inodeset, &file->nodeset, file, file_inode_hash(file->inode));
|
||||
|
||||
/* unmark as missing inode */
|
||||
file_flag_clear(file, FILE_IS_WITHOUT_INODE);
|
||||
/* insert in the set if valid */
|
||||
if (file->inode != INODE_INVALID)
|
||||
tommy_hashdyn_insert(&disk->inodeset, &file->nodeset, file, file_inode_hash(file->inode));
|
||||
} else {
|
||||
/* here the inode has to be different, otherwise we would have found it before */
|
||||
if (file->inode == st->st_ino) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Internal inconsistency in inode '%" PRIu64 "' for files '%s%s' as unexpected matching\n", file->inode, disk->dir, sub);
|
||||
log_fatal(EINTERNAL, "Internal inconsistency in inode '%" PRIu64 "' for file '%s%s' as unexpected matching\n", file->inode, disk->dir, sub);
|
||||
os_abort();
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
|
@ -978,7 +987,7 @@ static void scan_file(struct snapraid_scan* scan, int is_diff, const char* sub,
|
|||
}
|
||||
|
||||
/* if when processing the disk we used the past inodes values */
|
||||
if (has_past_inodes) {
|
||||
if (has_past_inodes && file->inode != INODE_INVALID && st->st_ino != INODE_INVALID) {
|
||||
/*
|
||||
* If persistent inodes are supported, we are sure that the inode number
|
||||
* is now different, because otherwise the file would have been found
|
||||
|
|
@ -1034,8 +1043,11 @@ static void scan_file(struct snapraid_scan* scan, int is_diff, const char* sub,
|
|||
/* keep track if the original file was not of zero size */
|
||||
is_original_file_size_different_than_zero = file->size != 0;
|
||||
|
||||
/* remove it, and continue to insert it again */
|
||||
scan_file_remove(scan, file, 1);
|
||||
/* mark it as to be removed in Phase 2 */
|
||||
file_flag_set(file, FILE_IS_MODIFIED_OLD);
|
||||
|
||||
/* flag that we are inserting the modified version so we skip Phase 1 insertion sets */
|
||||
is_file_modified = 1;
|
||||
|
||||
/* and continue to insert it again */
|
||||
} else {
|
||||
|
|
@ -1114,7 +1126,14 @@ static void scan_file(struct snapraid_scan* scan, int is_diff, const char* sub,
|
|||
}
|
||||
stamp_unlock(other_disk);
|
||||
|
||||
/* if found, and it's a fully hashed file */
|
||||
/*
|
||||
* If found, check stability and copy the hash.
|
||||
*
|
||||
* This is safe to execute unlocked because:
|
||||
* 1. Modified files deallocations are deferred to Phase 2 (mono-threaded phase).
|
||||
* 2. file_is_full_invalid_parity_and_stable() only accepts files with complete
|
||||
* invalid parity, preventing them from being selected by file_is_full_hashed_and_stable().
|
||||
*/
|
||||
if (other_file && file_is_full_hashed_and_stable(scan->state, other_disk, other_file)) {
|
||||
char path_other[PATH_MAX];
|
||||
struct stat other_st;
|
||||
|
|
@ -1179,8 +1198,14 @@ static void scan_file(struct snapraid_scan* scan, int is_diff, const char* sub,
|
|||
}
|
||||
}
|
||||
|
||||
/* insert the file in the delayed list */
|
||||
scan_file_insert(scan, file);
|
||||
if (!is_file_modified) { /* modified files are re-inserted in Phase 3 */
|
||||
scan_file_insert(scan, file);
|
||||
} else {
|
||||
file_flag_set(file, FILE_IS_MODIFIED_NEW);
|
||||
}
|
||||
|
||||
/* insert the file in the delayed allocation list */
|
||||
scan_file_delayed_allocate(scan, file);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1549,7 +1574,7 @@ static int scan_sub(struct snapraid_scan* scan, int level, int is_diff, char* pa
|
|||
* If the st_ino field is missing, takes care to fill it using the extended lstat()
|
||||
* this can happen only in Windows
|
||||
*/
|
||||
if (st->st_ino == 0 || st->st_nlink == 0) {
|
||||
if (st->st_ino == INODE_INVALID || st->st_nlink == 0) {
|
||||
if (lstat_sync(path_next, st, 0) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_tag("%s:%u:%s:%s: Stat error. %s.\n", es(errno), 0, disk->name, esc_tag(path_next), strerror(errno));
|
||||
|
|
@ -1711,13 +1736,11 @@ static void* scan_disk(void* arg)
|
|||
node = node->next;
|
||||
|
||||
/* remove from the inode set */
|
||||
tommy_hashdyn_remove_existing(&disk->inodeset, &file->nodeset);
|
||||
if (file->inode != INODE_INVALID)
|
||||
tommy_hashdyn_remove_existing(&disk->inodeset, &file->nodeset);
|
||||
|
||||
/* clear the inode */
|
||||
file->inode = 0;
|
||||
|
||||
/* mark as missing inode */
|
||||
file_flag_set(file, FILE_IS_WITHOUT_INODE);
|
||||
file->inode = INODE_INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1759,7 +1782,20 @@ static int state_diffscan(struct snapraid_state* state, int is_diff)
|
|||
tommy_list_insert_tail(&scanlist, &scan->node, scan);
|
||||
}
|
||||
|
||||
/* first scan all the directory and find new and deleted files */
|
||||
/*
|
||||
* We split the search in three phases:
|
||||
* Phase 1: Parallel scanning of directories, finding new and modified files (without deletions/deallocations).
|
||||
* Phase 2: Serialized removals (deleted files and old versions of modified files) to free up parity space.
|
||||
* Phase 3: Serialized insertions and allocations of new files.
|
||||
*
|
||||
* We must start Phase 2 (deletions) only when all disks have finished Phase 1 (scanning),
|
||||
* to ensure that copy/relocation detection on any disk can search the stampset of other disks
|
||||
* before their old files are deleted/deallocated.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Phase 1: Parallel scanning of directories
|
||||
*/
|
||||
for (i = scanlist; i != 0; i = i->next) {
|
||||
struct snapraid_scan* scan = i->data;
|
||||
#if HAVE_THREAD
|
||||
|
|
@ -1784,13 +1820,6 @@ static int state_diffscan(struct snapraid_state* state, int is_diff)
|
|||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We split the search in two phases because to detect files
|
||||
* moved from one disk to another we have to start deletion
|
||||
* only when all disks have all the new files found
|
||||
*/
|
||||
|
||||
/* now process all the new and deleted files */
|
||||
for (i = scanlist; i != 0; i = i->next) {
|
||||
struct snapraid_scan* scan = i->data;
|
||||
struct snapraid_disk* disk = scan->disk;
|
||||
|
|
@ -1799,6 +1828,10 @@ static int state_diffscan(struct snapraid_state* state, int is_diff)
|
|||
uint64_t phy_last;
|
||||
struct snapraid_file* phy_file_last;
|
||||
|
||||
/*
|
||||
* Phase 2: Removals (deleted files and old versions of modified files)
|
||||
*/
|
||||
|
||||
/* check for removed files */
|
||||
node = disk->filelist;
|
||||
while (node) {
|
||||
|
|
@ -1807,8 +1840,11 @@ static int state_diffscan(struct snapraid_state* state, int is_diff)
|
|||
/* next node */
|
||||
node = node->next;
|
||||
|
||||
/* remove if not present */
|
||||
if (!file_flag_has(file, FILE_IS_PRESENT)) {
|
||||
if (file_flag_has(file, FILE_IS_REALLOC_OLD)) {
|
||||
scan_file_remove(scan, file, 0);
|
||||
} else if (file_flag_has(file, FILE_IS_MODIFIED_OLD)) {
|
||||
scan_file_remove(scan, file, 1);
|
||||
} else if (!file_flag_has(file, FILE_IS_PRESENT)) {
|
||||
/* here we are in mono-thread context, no need to use the stamp_lock() to read FILE_IS_RELOCATED */
|
||||
if (!file_flag_has(file, FILE_IS_RELOCATED)) {
|
||||
++scan->count_remove;
|
||||
|
|
@ -1859,6 +1895,8 @@ static int state_diffscan(struct snapraid_state* state, int is_diff)
|
|||
}
|
||||
|
||||
/*
|
||||
* Phase 3: Insertions (new files and new versions of modified files)
|
||||
*
|
||||
* Sort the files before inserting them
|
||||
* we use a stable sort to ensure that if the reported physical offset/inode
|
||||
* are always 0, we keep at least the directory order
|
||||
|
|
@ -1912,6 +1950,11 @@ static int state_diffscan(struct snapraid_state* state, int is_diff)
|
|||
/* next node */
|
||||
node = node->next;
|
||||
|
||||
/* if this is a modified file new version, insert it into sets now */
|
||||
if (file_flag_has(file, FILE_IS_MODIFIED_NEW)) {
|
||||
scan_file_insert(scan, file);
|
||||
}
|
||||
|
||||
/* insert in the parity */
|
||||
scan_file_allocate(scan, file);
|
||||
}
|
||||
|
|
@ -1962,7 +2005,10 @@ static int state_diffscan(struct snapraid_state* state, int is_diff)
|
|||
int all_missing = 0;
|
||||
int all_rewritten = 0;
|
||||
done = 0;
|
||||
|
||||
for (i = state->disklist, j = scanlist; i != 0; i = i->next, j = j->next) {
|
||||
assert(j != 0); /* silence the clang static analyzer (both lists have the same number of elements) */
|
||||
|
||||
struct snapraid_disk* disk = i->data;
|
||||
struct snapraid_scan* scan = j->data;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2013 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "support.h"
|
||||
#include "elem.h"
|
||||
|
|
@ -275,7 +275,7 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par
|
|||
|
||||
/* possibly waiting disks */
|
||||
waiting_mac = diskmax > RAID_PARITY_MAX ? diskmax : RAID_PARITY_MAX;
|
||||
waiting_map = malloc_nofail(waiting_mac * sizeof(unsigned));
|
||||
waiting_map = nalloc_nofail(waiting_mac, sizeof(unsigned));
|
||||
|
||||
soft_error = 0;
|
||||
silent_error = 0;
|
||||
|
|
@ -720,6 +720,10 @@ bail:
|
|||
ret = handle_close(&handle[j]);
|
||||
if (ret == -1) {
|
||||
/* LCOV_EXCL_START */
|
||||
/*
|
||||
* If handle_close fails, the handle was open (f != -1), which
|
||||
* guarantees that both file and disk pointers are valid.
|
||||
*/
|
||||
log_tag("%s:%" PRIu64 ":%s:%s: Close error. %s.\n", es(errno), blockcur, disk->name, esc_tag(file->sub), strerror(errno));
|
||||
log_fatal_errno(errno, disk->name);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2014 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "support.h"
|
||||
#include "search.h"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2011 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "snapraid.h"
|
||||
#include "util.h"
|
||||
|
|
@ -13,6 +13,7 @@
|
|||
#include "elem.h"
|
||||
#include "state.h"
|
||||
#include "support.h"
|
||||
#include "stream.h"
|
||||
#include "tommyds/tommyhash.h"
|
||||
#include "tommyds/tommyarray.h"
|
||||
#include "tommyds/tommyarrayblkof.h"
|
||||
|
|
@ -841,6 +842,239 @@ static void test_wnmatch(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void test_parse_smartctl(void)
|
||||
{
|
||||
char smartctl[SMART_MAX];
|
||||
char smartctl_info[SMART_MAX];
|
||||
|
||||
/* empty default case */
|
||||
if (parse_smartctl("smartctl d1 %s", smartctl, sizeof(smartctl), smartctl_info, sizeof(smartctl_info)) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Failed parse_smartctl empty test 1\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
if (strcmp(smartctl, "smartctl d1 %s") != 0 || smartctl_info[0] != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Failed parse_smartctl empty test 2\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
if (parse_smartctl("smartctl d1 /dev/sda", smartctl, sizeof(smartctl), smartctl_info, sizeof(smartctl_info)) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Failed parse_smartctl empty test 3\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
if (strcmp(smartctl, "smartctl d1 /dev/sda") != 0 || smartctl_info[0] != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Failed parse_smartctl empty test 4\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
/* basic default case */
|
||||
if (parse_smartctl("smartctl d1 -d sat %s", smartctl, sizeof(smartctl), smartctl_info, sizeof(smartctl_info)) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Failed parse_smartctl basic test 1\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
if (strcmp(smartctl, "smartctl d1 -d sat %s") != 0 || smartctl_info[0] != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Failed parse_smartctl basic test 2\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
/* case with [info: xxx] tag */
|
||||
if (parse_smartctl("smartctl d1 [info: -H -i -A] -d sat %s", smartctl, sizeof(smartctl), smartctl_info, sizeof(smartctl_info)) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Failed parse_smartctl info test 1\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
if (strcmp(smartctl, "smartctl d1 -d sat %s") != 0 || strcmp(smartctl_info, "-H -i -A") != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Failed parse_smartctl info test 2\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
/* case with spaces in tag */
|
||||
if (parse_smartctl("smartctl d2 [info: -H -I ] -d sat", smartctl, sizeof(smartctl), smartctl_info, sizeof(smartctl_info)) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Failed parse_smartctl space test 1\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
if (strcmp(smartctl, "smartctl d2 -d sat") != 0 || strcmp(smartctl_info, "-H -I") != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Failed parse_smartctl space test 2\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
/* invalid case: multiple info tags */
|
||||
if (parse_smartctl("smartctl [info: -H] [info: -i] %s", smartctl, sizeof(smartctl), smartctl_info, sizeof(smartctl_info)) == 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Failed parse_smartctl multiple tags test\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
/* invalid case: missing closing bracket */
|
||||
if (parse_smartctl("smartctl [info: -H %s", smartctl, sizeof(smartctl), smartctl_info, sizeof(smartctl_info)) == 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Failed parse_smartctl missing bracket test\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
}
|
||||
|
||||
static void test_smart_ignore(void)
|
||||
{
|
||||
struct snapraid_state state;
|
||||
devinfo_t devinfo;
|
||||
int i;
|
||||
|
||||
memset(&state, 0, sizeof(state));
|
||||
memset(&devinfo, 0, sizeof(devinfo));
|
||||
|
||||
/* Initialize devinfo attributes with mock data */
|
||||
for (i = 0; i < SMART_COUNT; ++i) {
|
||||
devinfo.smart[i].raw = 100;
|
||||
devinfo.smart[i].norm = 100;
|
||||
snprintf(devinfo.smart[i].name, sizeof(devinfo.smart[i].name), "Attr_%d", i);
|
||||
}
|
||||
/* Special name for test */
|
||||
pathcpy(devinfo.smart[5].name, sizeof(devinfo.smart[5].name), "Reallocated_Sector_Ct");
|
||||
pathcpy(devinfo.smart[197].name, sizeof(devinfo.smart[197].name), "Current_Pending_Sector");
|
||||
|
||||
/* 1. Test numerical global ignore */
|
||||
state.smartignore[0].attr_index = 5;
|
||||
state.smartignore[0].attr_name[0] = 0;
|
||||
|
||||
/* 2. Test name global ignore (case-insensitive) */
|
||||
state.smartignore[1].attr_index = 0;
|
||||
pathcpy(state.smartignore[1].attr_name, sizeof(state.smartignore[1].attr_name), "current_pending_sector");
|
||||
|
||||
/* 3. Test numerical devinfo ignore */
|
||||
devinfo.smartignore[0].attr_index = 10;
|
||||
devinfo.smartignore[0].attr_name[0] = 0;
|
||||
|
||||
/* 4. Test name devinfo ignore (case-insensitive) */
|
||||
devinfo.smartignore[1].attr_index = 0;
|
||||
pathcpy(devinfo.smartignore[1].attr_name, sizeof(devinfo.smartignore[1].attr_name), "aTtR_20");
|
||||
|
||||
state_smart_ignore(&state, &devinfo);
|
||||
|
||||
/* Check that ignored attributes are set to SMART_UNASSIGNED */
|
||||
if (devinfo.smart[5].raw != SMART_UNASSIGNED) {
|
||||
log_fatal(EINTERNAL, "test_smart_ignore: numerical global ignore failed\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (devinfo.smart[197].raw != SMART_UNASSIGNED) {
|
||||
log_fatal(EINTERNAL, "test_smart_ignore: name global ignore failed\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (devinfo.smart[10].raw != SMART_UNASSIGNED) {
|
||||
log_fatal(EINTERNAL, "test_smart_ignore: numerical devinfo ignore failed\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (devinfo.smart[20].raw != SMART_UNASSIGNED) {
|
||||
log_fatal(EINTERNAL, "test_smart_ignore: name devinfo ignore failed\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* Check that non-ignored attributes are still present */
|
||||
if (devinfo.smart[6].raw != 100) {
|
||||
log_fatal(EINTERNAL, "test_smart_ignore: unmodified attribute was cleared\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
static void test_stream(void)
|
||||
{
|
||||
STREAM f;
|
||||
uint32_t v32;
|
||||
uint64_t v64;
|
||||
|
||||
/* 32-bit valid boundary */
|
||||
unsigned char buf_v32[] = { 0x7f, 0x7f, 0x7f, 0x7f, 0x8f };
|
||||
memset(&f, 0, sizeof(f));
|
||||
f.pos = buf_v32;
|
||||
f.end = buf_v32 + sizeof(buf_v32);
|
||||
if (sgetb32(&f, &v32) != 0 || v32 != 0xffffffffU) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "test_stream: valid uint32 max failed\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
/* 32-bit overflow payload in 5th terminal byte */
|
||||
unsigned char buf_o32[] = { 0x00, 0x00, 0x00, 0x00, 0xf1 };
|
||||
memset(&f, 0, sizeof(f));
|
||||
f.pos = buf_o32;
|
||||
f.end = buf_o32 + sizeof(buf_o32);
|
||||
if (sgetb32(&f, &v32) == 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "test_stream: uint32 overflow accepted\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
/* 32-bit 5th byte non-terminal */
|
||||
unsigned char buf_nt32[] = { 0x00, 0x00, 0x00, 0x00, 0x01, 0x80 };
|
||||
memset(&f, 0, sizeof(f));
|
||||
f.pos = buf_nt32;
|
||||
f.end = buf_nt32 + sizeof(buf_nt32);
|
||||
if (sgetb32(&f, &v32) == 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "test_stream: uint32 5th non-terminal accepted\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
/* 64-bit valid boundary */
|
||||
unsigned char buf_v64[] = { 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x81 };
|
||||
memset(&f, 0, sizeof(f));
|
||||
f.pos = buf_v64;
|
||||
f.end = buf_v64 + sizeof(buf_v64);
|
||||
if (sgetb64(&f, &v64) != 0 || v64 != 0xffffffffffffffffULL) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "test_stream: valid uint64 max failed\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
/* 64-bit overflow payload in 10th terminal byte */
|
||||
unsigned char buf_o64[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83 };
|
||||
memset(&f, 0, sizeof(f));
|
||||
f.pos = buf_o64;
|
||||
f.end = buf_o64 + sizeof(buf_o64);
|
||||
if (sgetb64(&f, &v64) == 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "test_stream: uint64 overflow accepted\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
/* 64-bit 10th byte non-terminal */
|
||||
unsigned char buf_nt64[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80 };
|
||||
memset(&f, 0, sizeof(f));
|
||||
f.pos = buf_nt64;
|
||||
f.end = buf_nt64 + sizeof(buf_nt64);
|
||||
if (sgetb64(&f, &v64) == 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "test_stream: uint64 10th non-terminal accepted\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void selftest(void)
|
||||
{
|
||||
log_tag("selftest:\n");
|
||||
|
|
@ -865,7 +1099,10 @@ void selftest(void)
|
|||
test_hash();
|
||||
test_crc32c();
|
||||
test_tommy();
|
||||
test_stream();
|
||||
test_wnmatch();
|
||||
test_parse_smartctl();
|
||||
test_smart_ignore();
|
||||
if (raid_selftest() != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Failed SELF test\n");
|
||||
|
|
@ -890,35 +1127,64 @@ void selftest(void)
|
|||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
if (raid_test_par(RAID_MODE_VANDERMONDE, 32, 256) != 0) {
|
||||
if (raid_test_par(RAID_MODE_VANDERMONDE_RAID, 32, 256) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Failed GEN Vandermonde test\n");
|
||||
log_fatal(EINTERNAL, "Failed GEN Vandermonde RAID test\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
if (raid_test_rec(RAID_MODE_VANDERMONDE, 12, 256) != 0) {
|
||||
if (raid_test_rec(RAID_MODE_VANDERMONDE_RAID, 12, 256) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Failed REC Vandermonde test\n");
|
||||
log_fatal(EINTERNAL, "Failed REC Vandermonde RAID test\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
if (raid_test_par(RAID_MODE_CAUCHY, 32, 256) != 0) {
|
||||
if (raid_test_par(RAID_MODE_CAUCHY_RAID, 32, 256) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Failed GEN Cauchy test\n");
|
||||
log_fatal(EINTERNAL, "Failed GEN Cauchy RAID test\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
if (raid_test_rec(RAID_MODE_CAUCHY, 12, 256) != 0) {
|
||||
if (raid_test_rec(RAID_MODE_CAUCHY_RAID, 12, 256) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Failed REC Cauchy test\n");
|
||||
log_fatal(EINTERNAL, "Failed REC Cauchy RAID test\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
if (raid_test_par(RAID_MODE_CAUCHY, 1, 256) != 0) {
|
||||
if (raid_test_par(RAID_MODE_CAUCHY_RAID, 1, 256) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Failed GEN Cauchy test single data disk\n");
|
||||
log_fatal(EINTERNAL, "Failed GEN Cauchy RAID test single data disk\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
if (raid_test_par(RAID_MODE_CAUCHY_AES, 32, 256) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Failed GEN Cauchy AES test\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
if (raid_test_rec(RAID_MODE_CAUCHY_AES, 12, 256) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Failed REC Cauchy AES test\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
/* Verify raid_mode get/set behavior */
|
||||
int cur = raid_mode(RAID_MODE_GET);
|
||||
int prev = raid_mode(RAID_MODE_CAUCHY_AES);
|
||||
if (prev != cur) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "raid_mode set did not return previous mode\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
if (raid_mode(RAID_MODE_GET) != RAID_MODE_CAUCHY_AES) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "raid_mode GET did not return active mode\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
raid_mode(prev);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2011 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "snapraid.h"
|
||||
#include "support.h"
|
||||
|
|
@ -951,7 +951,7 @@ int snapraid_main(int argc, char* argv[])
|
|||
lock_init();
|
||||
|
||||
/* defaults */
|
||||
os_default_conf(conf, sizeof(conf), argv[0]);
|
||||
app_default_conf(conf, sizeof(conf), argv[0]);
|
||||
memset(&opt, 0, sizeof(opt));
|
||||
opt.io_error_limit = 100;
|
||||
blockstart = 0;
|
||||
|
|
@ -1412,19 +1412,22 @@ int snapraid_main(int argc, char* argv[])
|
|||
}
|
||||
}
|
||||
|
||||
os_init(opt.force_scan_winfind);
|
||||
os_init(OS_INIT_OPT_AVOID_SLEEP | (opt.force_scan_winfind ? OS_INIT_OPT_WINFIND : 0));
|
||||
app_init();
|
||||
raid_init();
|
||||
crc32c_init();
|
||||
random_reseed();
|
||||
|
||||
if (speedtest != 0) {
|
||||
speed(speed_test_period, speed_test_disks_number, speed_test_blocks_size);
|
||||
app_done();
|
||||
os_done();
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
if (gen_conf != 0) {
|
||||
generate_configuration(gen_conf);
|
||||
app_done();
|
||||
os_done();
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
|
@ -1825,7 +1828,7 @@ int snapraid_main(int argc, char* argv[])
|
|||
memory();
|
||||
|
||||
/* intercept signals while operating */
|
||||
os_signal_init();
|
||||
os_signal_init(app_signal_handler, app_signal_handler);
|
||||
|
||||
#if HAVE_CHECKER
|
||||
/* run a test command if required */
|
||||
|
|
@ -1878,7 +1881,7 @@ int snapraid_main(int argc, char* argv[])
|
|||
memory();
|
||||
|
||||
/* intercept signals while operating */
|
||||
os_signal_init();
|
||||
os_signal_init(app_signal_handler, app_signal_handler);
|
||||
|
||||
ret = state_dry(&state, blockstart, blockcount);
|
||||
} else if (operation == OPERATION_REHASH) {
|
||||
|
|
@ -1894,7 +1897,7 @@ int snapraid_main(int argc, char* argv[])
|
|||
* The signal protection is meant only for saving the content file,
|
||||
* or an early stop of long operations.
|
||||
*/
|
||||
os_signal_init();
|
||||
os_signal_init(app_signal_handler, app_signal_handler);
|
||||
|
||||
/* save the new state if required */
|
||||
if (state.need_write)
|
||||
|
|
@ -1908,7 +1911,7 @@ int snapraid_main(int argc, char* argv[])
|
|||
memory();
|
||||
|
||||
/* intercept signals while operating */
|
||||
os_signal_init();
|
||||
os_signal_init(app_signal_handler, app_signal_handler);
|
||||
|
||||
state_snapshot_read(&state);
|
||||
|
||||
|
|
@ -1921,7 +1924,7 @@ int snapraid_main(int argc, char* argv[])
|
|||
state_read(&state);
|
||||
|
||||
/* intercept signals while operating */
|
||||
os_signal_init();
|
||||
os_signal_init(app_signal_handler, app_signal_handler);
|
||||
|
||||
state_write(&state);
|
||||
|
||||
|
|
@ -1947,7 +1950,7 @@ int snapraid_main(int argc, char* argv[])
|
|||
* The signal protection is meant only for saving the content file,
|
||||
* or an early stop of long operations.
|
||||
*/
|
||||
os_signal_init();
|
||||
os_signal_init(app_signal_handler, app_signal_handler);
|
||||
|
||||
if (state.need_write)
|
||||
state_write(&state);
|
||||
|
|
@ -2036,7 +2039,7 @@ int snapraid_main(int argc, char* argv[])
|
|||
memory();
|
||||
|
||||
/* intercept signals while operating */
|
||||
os_signal_init();
|
||||
os_signal_init(app_signal_handler, app_signal_handler);
|
||||
|
||||
state_snapshot_write(&state, &filterlist_disk);
|
||||
|
||||
|
|
@ -2078,6 +2081,7 @@ int snapraid_main(int argc, char* argv[])
|
|||
tommy_list_foreach(&filterlist_file, (tommy_foreach_func*)filter_free);
|
||||
tommy_list_foreach(&filterlist_disk, (tommy_foreach_func*)filter_free);
|
||||
|
||||
app_done();
|
||||
os_done();
|
||||
lock_done();
|
||||
|
||||
|
|
@ -2087,19 +2091,19 @@ int snapraid_main(int argc, char* argv[])
|
|||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
if (os_global_interrupt()) {
|
||||
if (os_signal_interrupt()) {
|
||||
/* LCOV_EXCL_START */
|
||||
#ifdef _WIN32
|
||||
exit(STATUS_CONTROL_C_EXIT);
|
||||
#else
|
||||
/* restore default handler */
|
||||
signal(os_global_interrupt(), SIG_DFL);
|
||||
signal(os_signal_interrupt(), SIG_DFL);
|
||||
|
||||
/* raise the signal again*/
|
||||
raise(os_global_interrupt());
|
||||
raise(os_signal_interrupt());
|
||||
|
||||
/* if raise() didn't terminate */
|
||||
_exit(128 + os_global_interrupt());
|
||||
_exit(128 + os_signal_interrupt());
|
||||
#endif
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
|
|
|||
191
cmdline/speed.c
191
cmdline/speed.c
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2011 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "snapraid.h"
|
||||
#include "util.h"
|
||||
|
|
@ -101,20 +101,34 @@ void speed_crc(int nd, void** v, int size, int delta, int period)
|
|||
printf("%8" PRIu64, ds / dt);
|
||||
printf("\n");
|
||||
|
||||
printf("%8s", "intel");
|
||||
fflush(stdout);
|
||||
|
||||
#if CONFIG_X86
|
||||
if (raid_cpu_has_crc32()) {
|
||||
printf("%8s", "intel");
|
||||
fflush(stdout);
|
||||
|
||||
SPEED_START {
|
||||
for (j = 0; j < nd; ++j)
|
||||
side_effect += crc32c_x86(0, v[j], size);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
printf("\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CONFIG_ARM_CRC
|
||||
printf("%8s", "arm");
|
||||
fflush(stdout);
|
||||
|
||||
SPEED_START {
|
||||
for (j = 0; j < nd; ++j)
|
||||
side_effect += crc32c_arm64(0, v[j], size);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
|
@ -1399,6 +1413,139 @@ void speed_rec(int nd, void** v, int size, int delta, int period)
|
|||
printf("\n");
|
||||
}
|
||||
|
||||
void speed_affinity(void)
|
||||
{
|
||||
#if HAVE_LINUX_DEVICE
|
||||
int num_cpus = sysconf(_SC_NPROCESSORS_CONF);
|
||||
if (num_cpus <= 0)
|
||||
return;
|
||||
|
||||
printf("Machine has %d cores\n", num_cpus);
|
||||
|
||||
int cpu = os_get_optimal_cpu();
|
||||
if (cpu <= 0)
|
||||
return;
|
||||
|
||||
cpu_set_t mask;
|
||||
CPU_ZERO(&mask);
|
||||
CPU_SET(cpu, &mask);
|
||||
|
||||
if (sched_setaffinity(0, sizeof(cpu_set_t), &mask) == 0) {
|
||||
printf("Running on core %d\n", cpu);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(__aarch64__) && defined(__APPLE__)
|
||||
static int check_cpu_feature(const char* name)
|
||||
{
|
||||
int value = 0;
|
||||
size_t len = sizeof(value);
|
||||
|
||||
if (sysctlbyname(name, &value, &len, NULL, 0) == 0) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const char* decode_cpufamily(uint32_t family)
|
||||
{
|
||||
switch (family) {
|
||||
case 0xe81e7ef6 : return "Monsoon/Mistral (A11)";
|
||||
case 0x07d34b9f : return "Vortex/Tempest (A12)";
|
||||
case 0x462504d2 : return "Lightning/Thunder (A13)";
|
||||
case 0x1b588bb3 : return "Firestorm/Icestorm (M1/A14)";
|
||||
case 0xda33d83d : return "Blizzard/Avalanche (M2/A15)";
|
||||
case 0x8765edea : return "Everest/Sawtooth (M3/A16)";
|
||||
case 0xfa33415e : return "Ibiza (M4/A17)";
|
||||
case 0 : return "Unavailable";
|
||||
default : return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
void print_apple(void)
|
||||
{
|
||||
char brand[128] = "Unknown Apple Silicon";
|
||||
size_t len = sizeof(brand);
|
||||
if (sysctlbyname("machdep.cpu.brand_string", &brand, &len, NULL, 0) != 0) {
|
||||
sysctlbyname("hw.model", &brand, &len, NULL, 0);
|
||||
}
|
||||
|
||||
uint32_t family = 0;
|
||||
len = sizeof(uint32_t);
|
||||
sysctlbyname("hw.cpufamily", &family, &len, NULL, 0);
|
||||
|
||||
int has_aes = check_cpu_feature("hw.optional.arm.FEAT_AES");
|
||||
int has_dotprod = check_cpu_feature("hw.optional.arm.FEAT_DotProd");
|
||||
int has_sha3 = check_cpu_feature("hw.optional.arm.FEAT_SHA3");
|
||||
int has_sve = check_cpu_feature("hw.optional.arm.FEAT_SVE");
|
||||
int has_sme = check_cpu_feature("hw.optional.arm.FEAT_SME");
|
||||
|
||||
printf("CPU %s, family %s (0x%08x), flags%s%s%s%s%s\n",
|
||||
brand, decode_cpufamily(family), family,
|
||||
has_aes ? " aes" : "",
|
||||
has_dotprod ? " dotprod" : "",
|
||||
has_sha3 ? " sha3" : "",
|
||||
has_sve ? " sve" : "",
|
||||
has_sme ? " sme" : ""
|
||||
);
|
||||
|
||||
unsigned long l1_d_bytes = 0;
|
||||
unsigned long l2_bytes = 0;
|
||||
unsigned long l3_bytes = 0;
|
||||
|
||||
len = sizeof(unsigned long);
|
||||
sysctlbyname("hw.l1dcachesize", &l1_d_bytes, &len, 0, 0);
|
||||
len = sizeof(unsigned long);
|
||||
sysctlbyname("hw.l2cachesize", &l2_bytes, &len, 0, 0);
|
||||
len = sizeof(unsigned long);
|
||||
sysctlbyname("hw.l3cachesize", &l3_bytes, &len, 0, 0);
|
||||
|
||||
printf("Cache L1 Data %lu KB, L2 %lu KB", l1_d_bytes / 1024, l2_bytes / 1024);
|
||||
if (l3_bytes > 0) {
|
||||
printf(", L3 %lu KB", l3_bytes / 1024);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
void print_intel(void)
|
||||
{
|
||||
char vendor[CPU_VENDOR_MAX];
|
||||
unsigned family;
|
||||
unsigned model;
|
||||
|
||||
raid_cpu_info(vendor, &family, &model);
|
||||
|
||||
printf("CPU %s, family %u, model %u (0x%x), flags%s%s%s%s%s%s%s%s%s%s\n", vendor, family, model, model,
|
||||
raid_cpu_has_sse2() ? " sse2" : "",
|
||||
raid_cpu_has_ssse3() ? " ssse3" : "",
|
||||
raid_cpu_has_crc32() ? " crc32" : "",
|
||||
raid_cpu_has_avx2() ? " avx2" : "",
|
||||
raid_cpu_has_avx2gfni() ? " avx2gfni" : "",
|
||||
raid_cpu_has_avx512bw() ? " avx512bw" : "",
|
||||
raid_cpu_has_avx512gfni() ? " avx512gfni" : "",
|
||||
raid_cpu_has_slowmult() ? " slowmult" : "",
|
||||
raid_cpu_has_slow_extendedreg() ? " slowext" : "",
|
||||
raid_cpu_has_avx512bw() && raid_cpu_has_slow_avx512() ? " slowavx512" : ""
|
||||
);
|
||||
|
||||
#ifdef __linux__
|
||||
long l1_d_bytes = sysconf(_SC_LEVEL1_DCACHE_SIZE);
|
||||
long l2_bytes = sysconf(_SC_LEVEL2_CACHE_SIZE);
|
||||
long l3_bytes = sysconf(_SC_LEVEL3_CACHE_SIZE);
|
||||
|
||||
printf("Cache L1 Data %lu KB, L2 %lu KB", l1_d_bytes / 1024, l2_bytes / 1024);
|
||||
if (l3_bytes > 0) {
|
||||
printf(", L3 %lu KB", l3_bytes / 1024);
|
||||
}
|
||||
printf("\n");
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void speed(int period, int nd, int size)
|
||||
{
|
||||
int i;
|
||||
|
|
@ -1445,30 +1592,21 @@ void speed(int period, int nd, int size)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
{
|
||||
char vendor[CPU_VENDOR_MAX];
|
||||
unsigned family;
|
||||
unsigned model;
|
||||
|
||||
raid_cpu_info(vendor, &family, &model);
|
||||
|
||||
printf("CPU %s, family %u, model %u (%xh), flags%s%s%s%s%s%s%s%s%s%s\n", vendor, family, model, model,
|
||||
raid_cpu_has_sse2() ? " sse2" : "",
|
||||
raid_cpu_has_ssse3() ? " ssse3" : "",
|
||||
raid_cpu_has_crc32() ? " crc32" : "",
|
||||
raid_cpu_has_avx2() ? " avx2" : "",
|
||||
raid_cpu_has_avx2gfni() ? " avx2gfni" : "",
|
||||
raid_cpu_has_avx512bw() ? " avx512bw" : "",
|
||||
raid_cpu_has_avx512gfni() ? " avx512gfni" : "",
|
||||
raid_cpu_has_slowmult() ? " slowmult" : "",
|
||||
raid_cpu_has_slow_extendedreg() ? " slowext" : "",
|
||||
raid_cpu_has_slow_avx512() ? " slowavx512" : ""
|
||||
);
|
||||
}
|
||||
#elif defined(__aarch64__) || defined(_M_ARM64)
|
||||
print_intel();
|
||||
#elif defined(__aarch64__) && defined(__APPLE__)
|
||||
print_apple();
|
||||
#elif defined(__aarch64__)
|
||||
#if defined(CONFIG_NEON)
|
||||
printf("CPU 64-bit ARM (AArch64), flags neon\n");
|
||||
#else
|
||||
printf("CPU 64-bit ARM (AArch64)\n");
|
||||
#elif defined(__arm__) || defined(_M_ARM)
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
#if defined(CONFIG_NEON)
|
||||
printf("CPU 32-bit ARM, flags neon\n");
|
||||
#else
|
||||
printf("CPU 32-bit ARM\n");
|
||||
#endif
|
||||
#elif defined(__powerpc64__)
|
||||
printf("CPU 64-bit PowerPC\n");
|
||||
#elif defined(__powerpc__)
|
||||
|
|
@ -1480,6 +1618,7 @@ void speed(int period, int nd, int size)
|
|||
#else
|
||||
printf("CPU of unknown architecture\n");
|
||||
#endif
|
||||
speed_affinity();
|
||||
#if WORDS_BIGENDIAN
|
||||
printf("Memory is big-endian %d-bit\n", (int)sizeof(void*) * 8);
|
||||
#else
|
||||
|
|
|
|||
262
cmdline/state.c
262
cmdline/state.c
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2011 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "elem.h"
|
||||
#include "import.h"
|
||||
|
|
@ -95,7 +95,7 @@ static int lev_config_scan(const char* s, unsigned* level, unsigned* mode)
|
|||
if (strcmp(s, "z-parity") == 0) {
|
||||
*level = 2;
|
||||
if (mode)
|
||||
*mode = RAID_MODE_VANDERMONDE;
|
||||
*mode = RAID_MODE_VANDERMONDE_RAID;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -107,7 +107,7 @@ const char* lev_raid_name(unsigned mode, unsigned n)
|
|||
switch (n) {
|
||||
case 1 : return "par1";
|
||||
case 2 : return "par2";
|
||||
case 3 : if (mode == RAID_MODE_CAUCHY)
|
||||
case 3 : if (mode == RAID_MODE_CAUCHY_RAID || mode == RAID_MODE_CAUCHY_AES)
|
||||
return "par3";
|
||||
else
|
||||
return "parz";
|
||||
|
|
@ -132,21 +132,25 @@ void state_init(struct snapraid_state* state)
|
|||
state->written = 0;
|
||||
state->checked_read = 0;
|
||||
state->block_size = 256 * KIBI; /* default 256 KiB */
|
||||
state->raid_mode = RAID_MODE_CAUCHY;
|
||||
state->raid_mode = RAID_MODE_CAUCHY_RAID;
|
||||
state->file_mode = ADVISE_DEFAULT;
|
||||
for (l = 0; l < LEV_MAX; ++l) {
|
||||
state->parity[l].split_mac = 0;
|
||||
for (s = 0; s < SPLIT_MAX; ++s) {
|
||||
state->parity[l].split_map[s].path[0] = 0;
|
||||
state->parity[l].split_map[s].uuid[0] = 0;
|
||||
state->parity[l].split_map[s].content_uuid[0] = 0;
|
||||
state->parity[l].split_map[s].fstype[0] = 0;
|
||||
state->parity[l].split_map[s].fslabel[0] = 0;
|
||||
state->parity[l].split_map[s].size = PARITY_SIZE_INVALID;
|
||||
state->parity[l].split_map[s].device = 0;
|
||||
}
|
||||
state->parity[l].smartctl[0] = 0;
|
||||
for (i = 0; i < SMART_IGNORE_MAX; ++i)
|
||||
state->parity[l].smartignore[i] = 0;
|
||||
state->parity[l].smartctl_info[0] = 0;
|
||||
for (i = 0; i < SMART_IGNORE_MAX; ++i) {
|
||||
state->parity[l].smartignore[i].attr_index = 0;
|
||||
state->parity[l].smartignore[i].attr_name[0] = 0;
|
||||
}
|
||||
state->parity[l].total_blocks = 0;
|
||||
state->parity[l].free_blocks = 0;
|
||||
state->parity[l].skip_access = 0;
|
||||
|
|
@ -166,8 +170,10 @@ void state_init(struct snapraid_state* state)
|
|||
state->lockfile[0] = 0;
|
||||
state->level = 1; /* default is the lowest protection */
|
||||
state->no_conf = 0;
|
||||
for (i = 0; i < SMART_IGNORE_MAX; ++i)
|
||||
state->smartignore[i] = 0;
|
||||
for (i = 0; i < SMART_IGNORE_MAX; ++i) {
|
||||
state->smartignore[i].attr_index = 0;
|
||||
state->smartignore[i].attr_name[0] = 0;
|
||||
}
|
||||
state->rehash_blocks = 0;
|
||||
state->bad_blocks = 0;
|
||||
state->unsynced_blocks = 0;
|
||||
|
|
@ -220,7 +226,7 @@ static void state_config_check(struct snapraid_state* state, const char* path, t
|
|||
unsigned l, s;
|
||||
|
||||
/* check for parity level */
|
||||
if (state->raid_mode == RAID_MODE_VANDERMONDE) {
|
||||
if (state->raid_mode == RAID_MODE_VANDERMONDE_RAID) {
|
||||
if (state->level > 3) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EUSER, "Using z-parity limits you to a maximum of 3 parities.\n");
|
||||
|
|
@ -475,7 +481,7 @@ static void state_config_check(struct snapraid_state* state, const char* path, t
|
|||
#ifdef CONFIG_X86
|
||||
if (!raid_cpu_has_ssse3())
|
||||
#endif
|
||||
if (state->raid_mode == RAID_MODE_CAUCHY && !state->opt.no_warnings) {
|
||||
if ((state->raid_mode == RAID_MODE_CAUCHY_RAID || state->raid_mode == RAID_MODE_CAUCHY_AES) && !state->opt.no_warnings) {
|
||||
if (state->level == 3) {
|
||||
log_info(EUSER, "WARNING! Your CPU doesn't have a fast implementation for triple parity.\n");
|
||||
log_info(EUSER, "WARNING! It's recommended to switch to 'z-parity' instead than '3-parity'.\n");
|
||||
|
|
@ -517,15 +523,75 @@ static void state_config_check(struct snapraid_state* state, const char* path, t
|
|||
}
|
||||
|
||||
/**
|
||||
* Validate the smartctl command.
|
||||
* Parse the smartctl command.
|
||||
*
|
||||
* It must contains only one %s string, and not other % chars.
|
||||
* It extracts the optional [info: xxx] tag, validates, and returns
|
||||
* the cleaned smartctl command and smartctl_info options.
|
||||
*/
|
||||
static int validate_smartctl(const char* custom)
|
||||
int parse_smartctl(const char* custom, char* smartctl, size_t smartctl_size, char* smartctl_info, size_t smartctl_info_size)
|
||||
{
|
||||
const char* s = custom;
|
||||
const char* s;
|
||||
const char* info_start = 0;
|
||||
size_t info_len = 0;
|
||||
size_t smartctl_len = 0;
|
||||
int arg = 0;
|
||||
|
||||
/* initialize output buffers */
|
||||
smartctl[0] = 0;
|
||||
smartctl_info[0] = 0;
|
||||
|
||||
/* look for "[info:" */
|
||||
s = custom;
|
||||
while (*s) {
|
||||
if (strncmp(s, "[info:", 6) == 0) {
|
||||
if (info_start) {
|
||||
/* multiple info tags not allowed */
|
||||
return -1;
|
||||
}
|
||||
|
||||
info_start = s;
|
||||
s += 6;
|
||||
|
||||
/* skip spaces inside bracket */
|
||||
while (isspace((unsigned char)*s))
|
||||
++s;
|
||||
|
||||
/* find matching ']' */
|
||||
const char* val_start = s;
|
||||
while (*s && *s != ']')
|
||||
++s;
|
||||
if (*s != ']') {
|
||||
/* missing closing bracket */
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* trim trailing spaces inside bracket */
|
||||
const char* val_end = s;
|
||||
while (val_end > val_start && isspace((unsigned char)val_end[-1]))
|
||||
--val_end;
|
||||
info_len = val_end - val_start;
|
||||
if (info_len >= smartctl_info_size) {
|
||||
/* info string too long */
|
||||
return -1;
|
||||
}
|
||||
|
||||
memcpy(smartctl_info, val_start, info_len);
|
||||
smartctl_info[info_len] = 0;
|
||||
++s; /* skip ']' */
|
||||
} else {
|
||||
if (smartctl_len + 1 >= smartctl_size) {
|
||||
return -1;
|
||||
}
|
||||
smartctl[smartctl_len++] = *s++;
|
||||
}
|
||||
}
|
||||
smartctl[smartctl_len] = 0;
|
||||
|
||||
/* trim extra spaces from the smartctl options */
|
||||
strtrim(smartctl);
|
||||
|
||||
/* validate the cleaned smartctl command */
|
||||
s = smartctl;
|
||||
while (*s) {
|
||||
if (s[0] == '%' && s[1] == 's') {
|
||||
if (arg) {
|
||||
|
|
@ -534,12 +600,23 @@ static int validate_smartctl(const char* custom)
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
arg = 1;
|
||||
++s;
|
||||
} else if (s[0] == '%') {
|
||||
/* LCOV_EXCL_START */
|
||||
return -1;
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
++s;
|
||||
}
|
||||
|
||||
/* validate the smartctl_info command */
|
||||
s = smartctl_info;
|
||||
while (*s) {
|
||||
if (s[0] == '%') {
|
||||
/* LCOV_EXCL_START */
|
||||
return -1;
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
++s;
|
||||
}
|
||||
|
||||
|
|
@ -1094,6 +1171,8 @@ void state_config(struct snapraid_state* state, const char* path, const char* co
|
|||
tommy_list_insert_tail(&state->extralist, &extra->node, extra);
|
||||
} else if (strcmp(tag, "smartctl") == 0) {
|
||||
char custom[PATH_MAX];
|
||||
char parsed_smartctl[SMART_MAX];
|
||||
char parsed_smartctl_info[SMART_MAX];
|
||||
|
||||
ret = sgettok(f, buffer, sizeof(buffer));
|
||||
if (ret < 0) {
|
||||
|
|
@ -1127,7 +1206,7 @@ void state_config(struct snapraid_state* state, const char* path, const char* co
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
if (validate_smartctl(custom) != 0) {
|
||||
if (parse_smartctl(custom, parsed_smartctl, sizeof(parsed_smartctl), parsed_smartctl_info, sizeof(parsed_smartctl_info)) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EUSER, "Invalid 'smartctl' option in '%s' at line %u\n", path, line);
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
@ -1143,7 +1222,8 @@ void state_config(struct snapraid_state* state, const char* path, const char* co
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
pathcpy(state->parity[level].smartctl, sizeof(state->parity[level].smartctl), custom);
|
||||
pathcpy(state->parity[level].smartctl, sizeof(state->parity[level].smartctl), parsed_smartctl);
|
||||
pathcpy(state->parity[level].smartctl_info, sizeof(state->parity[level].smartctl_info), parsed_smartctl_info);
|
||||
} else {
|
||||
/* search the disk */
|
||||
struct snapraid_disk* found_disk = 0;
|
||||
|
|
@ -1170,7 +1250,8 @@ void state_config(struct snapraid_state* state, const char* path, const char* co
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
pathcpy(found_disk->smartctl, sizeof(found_disk->smartctl), custom);
|
||||
pathcpy(found_disk->smartctl, sizeof(found_disk->smartctl), parsed_smartctl);
|
||||
pathcpy(found_disk->smartctl_info, sizeof(found_disk->smartctl_info), parsed_smartctl_info);
|
||||
} else if (found_extra) {
|
||||
if (found_extra->smartctl[0] != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
|
|
@ -1179,7 +1260,8 @@ void state_config(struct snapraid_state* state, const char* path, const char* co
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
pathcpy(found_extra->smartctl, sizeof(found_extra->smartctl), custom);
|
||||
pathcpy(found_extra->smartctl, sizeof(found_extra->smartctl), parsed_smartctl);
|
||||
pathcpy(found_extra->smartctl_info, sizeof(found_extra->smartctl_info), parsed_smartctl_info);
|
||||
} else {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EUSER, "Unknown 'smartctl' name '%s' at line %u\n", buffer, line);
|
||||
|
|
@ -1188,7 +1270,7 @@ void state_config(struct snapraid_state* state, const char* path, const char* co
|
|||
}
|
||||
}
|
||||
} else if (strcmp(tag, "smartignore") == 0) {
|
||||
int* smart;
|
||||
struct smartignore_struct* smart;
|
||||
|
||||
ret = sgettok(f, buffer, sizeof(buffer));
|
||||
if (ret < 0) {
|
||||
|
|
@ -1264,20 +1346,32 @@ void state_config(struct snapraid_state* state, const char* path, const char* co
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
smart[si] = strtou(buffer, &e, 0);
|
||||
int val = strtou(buffer, &e, 0);
|
||||
|
||||
if (!e || *e) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EUSER, "Invalid 'smartignore' specification in '%s' at line %u. It should be a number.\n", path, line);
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
if (smart[si] < 1 || smart[si] >= 256) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EUSER, "Invalid 'smartignore' specification in '%s' at line %u. It should be between 1 and 255.\n", path, line);
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
if (e && !*e) {
|
||||
/* numerical form */
|
||||
if (val < 1 || val >= 256) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EUSER,
|
||||
"Invalid 'smartignore' specification in '%s' at line %u. It should be between 1 and 255.\n",
|
||||
path, line);
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
smart[si].attr_index = val;
|
||||
smart[si].attr_name[0] = 0;
|
||||
} else {
|
||||
/* name form */
|
||||
if (strlen(buffer) >= SMART_MAX) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EUSER,
|
||||
"Invalid 'smartignore' specification in '%s' at line %u. Attribute name too long.\n",
|
||||
path, line);
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
smart[si].attr_index = 0;
|
||||
pathcpy(smart[si].attr_name, sizeof(smart[si].attr_name), buffer);
|
||||
}
|
||||
|
||||
++si;
|
||||
|
|
@ -1470,7 +1564,7 @@ void state_config(struct snapraid_state* state, const char* path, const char* co
|
|||
state->hash = state->besthash;
|
||||
|
||||
/* by default use a random hash seed */
|
||||
if (randomize(state->hashseed, HASH_MAX) != 0) {
|
||||
if (os_randomize(state->hashseed, HASH_MAX) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(errno, "Failed to retrieve random values.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
@ -1680,21 +1774,21 @@ static void state_map(struct snapraid_state* state)
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
if (disk->has_unsupported_uuid) {
|
||||
if (disk->uuid[0] == 0) {
|
||||
/* if uuid is not available, skip this one */
|
||||
continue;
|
||||
}
|
||||
|
||||
/* if the uuid is changed */
|
||||
if (strcmp(disk->uuid, map->uuid) != 0) {
|
||||
if (strcmp(disk->uuid, map->content_uuid) != 0) {
|
||||
/* mark the disk as with an UUID change */
|
||||
disk->has_different_uuid = 1;
|
||||
|
||||
/* if the previous uuid is available */
|
||||
if (map->uuid[0] != 0) {
|
||||
if (map->content_uuid[0] != 0) {
|
||||
/* count the number of uuid change */
|
||||
++uuid_mismatch;
|
||||
log_error(ESOFT, "UUID change for disk '%s' from '%s' to '%s'\n", disk->name, map->uuid, disk->uuid);
|
||||
log_error(ESOFT, "UUID change for disk '%s' from '%s' to '%s'\n", disk->name, map->content_uuid, disk->uuid);
|
||||
} else {
|
||||
/*
|
||||
* No message here, because having a disk without
|
||||
|
|
@ -1703,9 +1797,6 @@ static void state_map(struct snapraid_state* state)
|
|||
disk->had_empty_uuid = 1;
|
||||
}
|
||||
|
||||
/* update the uuid in the mapping, */
|
||||
pathcpy(map->uuid, sizeof(map->uuid), disk->uuid);
|
||||
|
||||
/* write the new state with the new uuid */
|
||||
state->need_write = 1;
|
||||
}
|
||||
|
|
@ -1716,28 +1807,20 @@ static void state_map(struct snapraid_state* state)
|
|||
if (!state->opt.skip_parity_access) {
|
||||
for (l = 0; l < state->level; ++l) {
|
||||
for (s = 0; s < state->parity[l].split_mac; ++s) {
|
||||
char uuid[UUID_MAX];
|
||||
int ret;
|
||||
|
||||
ret = devuuid(state->parity[l].split_map[s].device, state->parity[l].split_map[s].path, uuid, sizeof(uuid));
|
||||
|
||||
if (ret != 0) {
|
||||
/* uuid not available, just ignore */
|
||||
if (state->parity[l].split_map[s].uuid[0] == 0) {
|
||||
/* if uuid is not available, skip this one */
|
||||
continue;
|
||||
}
|
||||
|
||||
/* if the uuid is changed */
|
||||
if (strcmp(uuid, state->parity[l].split_map[s].uuid) != 0) {
|
||||
if (strcmp(state->parity[l].split_map[s].uuid, state->parity[l].split_map[s].content_uuid) != 0) {
|
||||
/* if the previous uuid is available */
|
||||
if (state->parity[l].split_map[s].uuid[0] != 0) {
|
||||
if (state->parity[l].split_map[s].content_uuid[0] != 0) {
|
||||
/* count the number of uuid change */
|
||||
++uuid_mismatch;
|
||||
log_error(ESOFT, "UUID change for parity '%s/%u' from '%s' to '%s'\n", lev_config_name(l), s, state->parity[l].split_map[s].uuid, uuid);
|
||||
log_error(ESOFT, "UUID change for parity '%s/%u' from '%s' to '%s'\n", lev_config_name(l), s, state->parity[l].split_map[s].content_uuid, state->parity[l].split_map[s].uuid);
|
||||
}
|
||||
|
||||
/* update the uuid */
|
||||
pathcpy(state->parity[l].split_map[s].uuid, sizeof(state->parity[l].split_map[s].uuid), uuid);
|
||||
|
||||
/* write the new state with the new uuid */
|
||||
state->need_write = 1;
|
||||
}
|
||||
|
|
@ -2281,7 +2364,8 @@ static void state_read_content(struct snapraid_state* state, const char* path, S
|
|||
file = file_alloc(state->block_size, sub, v_size, v_mtime_sec, v_mtime_nsec, v_inode, 0);
|
||||
|
||||
/* insert the file in the file containers */
|
||||
tommy_hashdyn_insert(&disk->inodeset, &file->nodeset, file, file_inode_hash(file->inode));
|
||||
if (file->inode != INODE_INVALID)
|
||||
tommy_hashdyn_insert(&disk->inodeset, &file->nodeset, file, file_inode_hash(file->inode));
|
||||
tommy_hashdyn_insert(&disk->pathset, &file->pathset, file, file_path_hash(file->sub));
|
||||
tommy_hashdyn_insert(&disk->stampset, &file->stampset, file, file_stamp_hash(file->size, file->mtime_sec, file->mtime_nsec));
|
||||
tommy_list_insert_tail(&disk->filelist, &file->nodelist, file);
|
||||
|
|
@ -3143,13 +3227,16 @@ static void state_read_content(struct snapraid_state* state, const char* path, S
|
|||
if (state->parity[v_level].split_mac < 1)
|
||||
state->parity[v_level].split_mac = 1;
|
||||
/* set the parity info */
|
||||
pathcpy(state->parity[v_level].split_map[0].uuid, sizeof(state->parity[v_level].split_map[0].uuid), v_uuid);
|
||||
if (state->no_conf) {
|
||||
pathcpy(state->parity[v_level].split_map[0].uuid, sizeof(state->parity[v_level].split_map[0].uuid), v_uuid);
|
||||
}
|
||||
pathcpy(state->parity[v_level].split_map[0].content_uuid, sizeof(state->parity[v_level].split_map[0].content_uuid), v_uuid);
|
||||
state->parity[v_level].total_blocks = v_total_blocks;
|
||||
state->parity[v_level].free_blocks = v_free_blocks;
|
||||
|
||||
log_tag("content_parity_split:%s:%s:%s:%" PRIi64 "\n",
|
||||
lev_config_name(v_level), /* P command always has a single split */
|
||||
state->parity[v_level].split_map[0].uuid,
|
||||
state->parity[v_level].split_map[0].content_uuid,
|
||||
esc_tag(state->parity[v_level].split_map[0].path),
|
||||
state->parity[v_level].split_map[0].size);
|
||||
}
|
||||
|
|
@ -3277,12 +3364,14 @@ static void state_read_content(struct snapraid_state* state, const char* path, S
|
|||
} else {
|
||||
char parity_name[64];
|
||||
|
||||
/* we copy the path only if without configuration file */
|
||||
if (state->no_conf)
|
||||
/* we copy the path and uuid only if without configuration file */
|
||||
if (state->no_conf) {
|
||||
pathcpy(state->parity[v_level].split_map[s].path, sizeof(state->parity[v_level].split_map[s].path), v_path);
|
||||
pathcpy(state->parity[v_level].split_map[s].uuid, sizeof(state->parity[v_level].split_map[s].uuid), v_uuid);
|
||||
}
|
||||
|
||||
/* set the split info */
|
||||
pathcpy(state->parity[v_level].split_map[s].uuid, sizeof(state->parity[v_level].split_map[s].uuid), v_uuid);
|
||||
pathcpy(state->parity[v_level].split_map[s].content_uuid, sizeof(state->parity[v_level].split_map[s].content_uuid), v_uuid);
|
||||
state->parity[v_level].split_map[s].size = v_size;
|
||||
|
||||
if (s == 0)
|
||||
|
|
@ -3291,7 +3380,7 @@ static void state_read_content(struct snapraid_state* state, const char* path, S
|
|||
pathprint(parity_name, sizeof(parity_name), "%s/%u", lev_config_name(v_level), s);
|
||||
log_tag("content_parity_split:%s:%s:%s:%" PRIi64 "\n",
|
||||
parity_name,
|
||||
state->parity[v_level].split_map[s].uuid,
|
||||
state->parity[v_level].split_map[s].content_uuid,
|
||||
esc_tag(state->parity[v_level].split_map[s].path),
|
||||
state->parity[v_level].split_map[s].size);
|
||||
}
|
||||
|
|
@ -3557,12 +3646,26 @@ static void* state_write_thread(void* arg)
|
|||
|
||||
/* save the mapping only if disk is mapped */
|
||||
if (disk->mapping_idx != -1) {
|
||||
const char* uuid;
|
||||
|
||||
sputc('M', f);
|
||||
sputbs(map->name, f);
|
||||
sputb32(map->position, f);
|
||||
sputb64(map->total_blocks, f);
|
||||
sputb64(map->free_blocks, f);
|
||||
sputbs(map->uuid, f);
|
||||
|
||||
/*
|
||||
* If the probed uuid is empty, but disk access was skipped (globally
|
||||
* or individually), write the last known uuid. Otherwise, write the
|
||||
* empty probed uuid.
|
||||
*/
|
||||
if (disk->uuid[0] == 0 && (state->opt.skip_disk_access || disk->skip_access)) {
|
||||
uuid = map->content_uuid;
|
||||
} else {
|
||||
uuid = disk->uuid;
|
||||
}
|
||||
sputbs(uuid, f);
|
||||
|
||||
if (context->first) {
|
||||
log_tag("content_data:%s:%" PRIi64 ":%" PRIi64 "\n",
|
||||
esc_tag(map->name),
|
||||
|
|
@ -3570,7 +3673,7 @@ static void* state_write_thread(void* arg)
|
|||
map->free_blocks * (uint64_t)state->block_size);
|
||||
log_tag("content_data_split:%s:%s\n",
|
||||
esc_tag(map->name),
|
||||
map->uuid);
|
||||
uuid);
|
||||
}
|
||||
if (serror(f)) {
|
||||
/* LCOV_EXCL_START */
|
||||
|
|
@ -3596,8 +3699,22 @@ static void* state_write_thread(void* arg)
|
|||
sputb32(state->parity[l].split_mac, f);
|
||||
for (s = 0; s < state->parity[l].split_mac; ++s) {
|
||||
char parity_name[64];
|
||||
const char* uuid;
|
||||
sputbs(state->parity[l].split_map[s].path, f);
|
||||
sputbs(state->parity[l].split_map[s].uuid, f);
|
||||
|
||||
/*
|
||||
* If the probed uuid is not empty, write it. Otherwise, if parity access was
|
||||
* skipped (globally or individually), write the last known uuid read from the
|
||||
* content file. Otherwise, write the empty probed uuid.
|
||||
*/
|
||||
if (state->parity[l].split_map[s].uuid[0] == 0
|
||||
&& (state->opt.skip_parity_access || state->parity[l].skip_access)) {
|
||||
uuid = state->parity[l].split_map[s].content_uuid;
|
||||
} else {
|
||||
uuid = state->parity[l].split_map[s].uuid;
|
||||
}
|
||||
sputbs(uuid, f);
|
||||
|
||||
sputb64(state->parity[l].split_map[s].size, f);
|
||||
if (s == 0)
|
||||
pathcpy(parity_name, sizeof(parity_name), lev_config_name(l));
|
||||
|
|
@ -3606,7 +3723,7 @@ static void* state_write_thread(void* arg)
|
|||
if (context->first) {
|
||||
log_tag("content_parity_split:%s:%s:%s:%" PRIi64 "\n",
|
||||
parity_name,
|
||||
state->parity[l].split_map[s].uuid,
|
||||
uuid,
|
||||
state->parity[l].split_map[s].path,
|
||||
state->parity[l].split_map[s].size);
|
||||
}
|
||||
|
|
@ -4001,10 +4118,17 @@ static void* state_write_thread(void* arg)
|
|||
if (context->first)
|
||||
bucket_to_list(&bucket_hash, &state->bucketlist, &state->bucketcount);
|
||||
|
||||
/*
|
||||
* Do not need to free the bucket entries in the success path because they
|
||||
* are added only if context->first is true, and they are already moved
|
||||
* to the list.
|
||||
*/
|
||||
|
||||
tommy_hashdyn_done(&bucket_hash);
|
||||
return 0;
|
||||
|
||||
bail:
|
||||
tommy_hashdyn_foreach(&bucket_hash, (tommy_foreach_func*)bucket_free);
|
||||
tommy_hashdyn_done(&bucket_hash);
|
||||
return context;
|
||||
}
|
||||
|
|
@ -4221,7 +4345,7 @@ static void state_write_content(struct snapraid_state* state, uint32_t* out_crc)
|
|||
count_hardlink = context->count_hardlink;
|
||||
count_symlink = context->count_symlink;
|
||||
count_dir = context->count_dir;
|
||||
cound_bad = context->count_bad;
|
||||
count_bad = context->count_bad;
|
||||
count_rehash = context->count_rehash;
|
||||
count_unsynced = context->count_unsynced;
|
||||
count_unscrubbed = context->count_unscrubbed;
|
||||
|
|
@ -4973,7 +5097,7 @@ int state_progress_begin(struct snapraid_state* state, block_off_t blockstart, b
|
|||
return -1;
|
||||
|
||||
/* stop if requested */
|
||||
if (os_global_interrupt()) {
|
||||
if (os_signal_interrupt()) {
|
||||
/* LCOV_EXCL_START */
|
||||
if (!state->opt.gui) {
|
||||
msg_status("Not starting due to interruption\n");
|
||||
|
|
@ -5494,7 +5618,7 @@ int state_progress(struct snapraid_state* state, struct snapraid_io* io, block_o
|
|||
}
|
||||
|
||||
/* stop if requested */
|
||||
if (os_global_interrupt()) {
|
||||
if (os_signal_interrupt()) {
|
||||
/* LCOV_EXCL_START */
|
||||
if (!state->opt.gui) {
|
||||
msg_bar("\n");
|
||||
|
|
@ -5696,8 +5820,8 @@ void generate_configuration(const char* path)
|
|||
struct snapraid_map* map = j->data;
|
||||
struct snapraid_disk* disk;
|
||||
printf("# Set the correct dir for disk '%s'\n", map->name);
|
||||
if (map->uuid[0])
|
||||
printf("# Disk '%s' is the one with id '%s'\n", map->name, map->uuid);
|
||||
if (map->content_uuid[0])
|
||||
printf("# Disk '%s' is the one with id '%s'\n", map->name, map->content_uuid);
|
||||
disk = find_disk_by_name(&state, map->name);
|
||||
if (disk && disk->filelist) {
|
||||
struct snapraid_file* file = disk->filelist->data;
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ struct snapraid_state {
|
|||
unsigned prevhash; /**< Previous hash kind used. In case of rehash. */
|
||||
unsigned besthash; /**< Best hash suggested. */
|
||||
const char* command; /**< Command running. */
|
||||
int smartignore[SMART_IGNORE_MAX]; /**< Smart attributes to ignore for all devices. */
|
||||
struct smartignore_struct smartignore[SMART_IGNORE_MAX]; /**< Smart attributes to ignore for all devices. */
|
||||
uint64_t rehash_blocks; /**< Blocks marked rehash */
|
||||
uint64_t bad_blocks; /**< Blocks marked bad */
|
||||
uint64_t unsynced_blocks; /**< If the parity is invalid, and a sync is needed. */
|
||||
|
|
@ -460,5 +460,15 @@ void state_snapshot_cleanup(struct snapraid_state* state);
|
|||
*/
|
||||
void generate_configuration(const char* content);
|
||||
|
||||
/**
|
||||
* Parse smartctl command.
|
||||
*/
|
||||
int parse_smartctl(const char* custom, char* smartctl, size_t smartctl_size, char* smartctl_info, size_t smartctl_info_size);
|
||||
|
||||
/**
|
||||
* Apply smart ignore logic to devinfo.
|
||||
*/
|
||||
void state_smart_ignore(struct snapraid_state* state, devinfo_t* devinfo);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2013 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "support.h"
|
||||
#include "elem.h"
|
||||
|
|
|
|||
456
cmdline/str.c
Normal file
456
cmdline/str.c
Normal file
|
|
@ -0,0 +1,456 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2025 Andrea Mazzoleni
|
||||
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "str.h"
|
||||
#include "support.h"
|
||||
|
||||
/****************************************************************************/
|
||||
/* string */
|
||||
|
||||
char* strpolish(char* s)
|
||||
{
|
||||
char* i = s;
|
||||
|
||||
while (*i) {
|
||||
if (isspace((unsigned char)*i) || !isprint((unsigned char)*i))
|
||||
*i = ' ';
|
||||
++i;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
unsigned strsplit(char** split_map, unsigned split_max, char* str, const char* delimiters)
|
||||
{
|
||||
unsigned mac = 0;
|
||||
|
||||
/* skip initial delimiters */
|
||||
str += strspn(str, delimiters);
|
||||
|
||||
while (*str != 0 && mac < split_max) {
|
||||
/* start of the token */
|
||||
split_map[mac] = str;
|
||||
++mac;
|
||||
|
||||
/* find the first delimiter or the end of the string */
|
||||
str += strcspn(str, delimiters);
|
||||
|
||||
/* put the final terminator if missing */
|
||||
if (*str != 0)
|
||||
*str++ = 0;
|
||||
|
||||
/* skip trailing delimiters */
|
||||
str += strspn(str, delimiters);
|
||||
}
|
||||
|
||||
return mac;
|
||||
}
|
||||
|
||||
unsigned argsplit(const char** split_map, unsigned split_max, char* str)
|
||||
{
|
||||
unsigned mac = 0;
|
||||
|
||||
/* skip leading whitespace */
|
||||
while (*str != 0 && isspace((unsigned char)*str))
|
||||
++str;
|
||||
|
||||
while (*str != 0 && mac < split_max) {
|
||||
char* dst = str;
|
||||
split_map[mac++] = dst;
|
||||
|
||||
#ifdef _WIN32
|
||||
/*
|
||||
* cmd.exe rules:
|
||||
* Unquoted: '^' escapes next char; '"' opens a quoted block.
|
||||
* Quoted: '"' closes the block; '^' is an ordinary character.
|
||||
*/
|
||||
int quoted = 0;
|
||||
|
||||
while (*str != 0 && (quoted || !isspace((unsigned char)*str))) {
|
||||
if (quoted) {
|
||||
if (*str == '"') {
|
||||
quoted = 0;
|
||||
++str;
|
||||
} else {
|
||||
*dst++ = *str++;
|
||||
}
|
||||
} else {
|
||||
if (*str == '^' && *(str + 1) != 0) {
|
||||
++str;
|
||||
*dst++ = *str++;
|
||||
} else if (*str == '"') {
|
||||
quoted = 1;
|
||||
++str;
|
||||
} else {
|
||||
*dst++ = *str++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
/*
|
||||
* bash rules:
|
||||
* Single-quoted block: everything literal, no exceptions.
|
||||
* Double-quoted block: '\' only escapes $, `, ", '\', newline;
|
||||
* other backslashes are copied verbatim.
|
||||
* Unquoted '\': always escapes the immediately following char.
|
||||
*/
|
||||
|
||||
/* set of characters that '\' can escape inside double quotes */
|
||||
static const char dq_escapable[] = "$`\"\\\n";
|
||||
|
||||
while (*str != 0 && !isspace((unsigned char)*str)) {
|
||||
|
||||
if (*str == '\'') {
|
||||
/* single-quoted block: truly everything is literal */
|
||||
++str;
|
||||
while (*str != 0 && *str != '\'')
|
||||
*dst++ = *str++;
|
||||
if (*str == '\'')
|
||||
++str;
|
||||
|
||||
} else if (*str == '"') {
|
||||
/* double-quoted block */
|
||||
++str;
|
||||
while (*str != 0 && *str != '"') {
|
||||
if (*str == '\\' && strchr(dq_escapable, *(str + 1))) {
|
||||
++str;
|
||||
}
|
||||
*dst++ = *str++;
|
||||
}
|
||||
if (*str == '"')
|
||||
++str;
|
||||
|
||||
} else if (*str == '\\') {
|
||||
/* unquoted backslash: next character always literal */
|
||||
++str;
|
||||
if (*str != 0)
|
||||
*dst++ = *str++;
|
||||
|
||||
} else {
|
||||
*dst++ = *str++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (*str != 0)
|
||||
++str; /* step past the delimiter */
|
||||
|
||||
/* skip whitespace before the next token */
|
||||
while (*str != 0 && isspace((unsigned char)*str))
|
||||
++str;
|
||||
|
||||
/* null-terminate after str has already moved on */
|
||||
*dst = 0;
|
||||
}
|
||||
|
||||
return mac;
|
||||
}
|
||||
|
||||
char* strtrim(char* str)
|
||||
{
|
||||
char* begin;
|
||||
char* end;
|
||||
|
||||
begin = str;
|
||||
while (begin[0] && isspace((unsigned char)begin[0]))
|
||||
++begin;
|
||||
|
||||
end = begin + strlen(begin);
|
||||
while (end > begin && isspace((unsigned char)end[-1]))
|
||||
--end;
|
||||
|
||||
end[0] = 0;
|
||||
|
||||
if (begin != str)
|
||||
memmove(str, begin, end - begin + 1);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
char* strlwr(char* str)
|
||||
{
|
||||
char* s = str;
|
||||
|
||||
while (*s) {
|
||||
*s = tolower((unsigned char)*s);
|
||||
++s;
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
char* worddigitstr(const char* haystack, const char* needle)
|
||||
{
|
||||
size_t len = strlen(needle);
|
||||
const char* s;
|
||||
|
||||
if (len == 0)
|
||||
return NULL;
|
||||
|
||||
for (s = haystack; (s = strstr(s, needle)) != NULL; ++s) {
|
||||
|
||||
/* left boundary */
|
||||
if (s == haystack || isspace((unsigned char)s[-1]) || isdigit((unsigned char)s[-1])) {
|
||||
/* right boundary */
|
||||
if (s[len] == 0 || isspace((unsigned char)s[len]) || isdigit((unsigned char)s[len])) {
|
||||
return (char*)s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int strtoi(const char* nptr, char** endptr, int base)
|
||||
{
|
||||
long val;
|
||||
int save_errno = errno;
|
||||
|
||||
errno = 0;
|
||||
val = strtol(nptr, endptr, base);
|
||||
|
||||
if (errno == ERANGE) {
|
||||
return val > 0 ? INT_MAX : INT_MIN;
|
||||
}
|
||||
|
||||
if (val > INT_MAX) {
|
||||
errno = ERANGE;
|
||||
return INT_MAX;
|
||||
}
|
||||
|
||||
if (val < INT_MIN) {
|
||||
errno = ERANGE;
|
||||
return INT_MIN;
|
||||
}
|
||||
|
||||
if (errno == 0) {
|
||||
errno = save_errno;
|
||||
}
|
||||
|
||||
return (int)val;
|
||||
}
|
||||
|
||||
unsigned strtou(const char* nptr, char** endptr, int base)
|
||||
{
|
||||
const char* p = nptr;
|
||||
char* end;
|
||||
unsigned long val;
|
||||
int neg = 0;
|
||||
int save_errno = errno;
|
||||
|
||||
while (isspace((unsigned char)*p)) {
|
||||
++p;
|
||||
}
|
||||
|
||||
if (*p == '-') {
|
||||
neg = 1;
|
||||
++p;
|
||||
} else if (*p == '+') {
|
||||
++p;
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
val = strtoul(p, &end, base);
|
||||
|
||||
if (end == p) {
|
||||
/* no conversion was performed */
|
||||
if (endptr) {
|
||||
*endptr = (char*)nptr;
|
||||
}
|
||||
errno = save_errno;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (endptr) {
|
||||
*endptr = end;
|
||||
}
|
||||
|
||||
if (errno == ERANGE || val > UINT_MAX) {
|
||||
errno = ERANGE;
|
||||
return UINT_MAX;
|
||||
}
|
||||
|
||||
if (errno == 0) {
|
||||
errno = save_errno;
|
||||
}
|
||||
|
||||
if (neg) {
|
||||
return (unsigned)-val;
|
||||
}
|
||||
|
||||
return (unsigned)val;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
/* wnmatch */
|
||||
|
||||
/**
|
||||
* Helper function for case-insensitive character comparison
|
||||
*/
|
||||
static inline int char_match(char p, char t)
|
||||
{
|
||||
#ifdef WIN32
|
||||
return tolower((unsigned char)p) == tolower((unsigned char)t);
|
||||
#else
|
||||
return p == t;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Match character class [...]
|
||||
* Return 0 if NOT matched
|
||||
*/
|
||||
static const char* match_class(const char* p, char t)
|
||||
{
|
||||
int negate = 0;
|
||||
int matched = 0;
|
||||
|
||||
if (*p == '!' || *p == '^') {
|
||||
negate = 1;
|
||||
++p;
|
||||
}
|
||||
|
||||
while (*p && *p != ']') {
|
||||
if (p[1] == '-' && p[2] != ']' && p[2] != 0) {
|
||||
/* range [a-z] */
|
||||
char start = *p;
|
||||
char end = p[2];
|
||||
#ifdef WIN32
|
||||
start = tolower((unsigned char)start);
|
||||
end = tolower((unsigned char)end);
|
||||
t = tolower((unsigned char)t);
|
||||
#endif
|
||||
if (t >= start && t <= end)
|
||||
matched = 1;
|
||||
p += 3;
|
||||
} else {
|
||||
/* single character */
|
||||
if (char_match(*p, t))
|
||||
matched = 1;
|
||||
++p;
|
||||
}
|
||||
}
|
||||
|
||||
if (*p == ']')
|
||||
++p;
|
||||
|
||||
if (negate)
|
||||
matched = !matched;
|
||||
if (!matched)
|
||||
return 0;
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
int wnmatch_sub(const char* p, const char* t, int match_sub)
|
||||
{
|
||||
char p1 = 0; /* previous char */
|
||||
while (*p) {
|
||||
char p0 = *p;
|
||||
switch (p0) {
|
||||
case '?' :
|
||||
/* ? matches any single character except / */
|
||||
if (*t == 0 || *t == '/')
|
||||
return 1;
|
||||
++p;
|
||||
++t;
|
||||
break;
|
||||
case '*' :
|
||||
/* check for ** */
|
||||
if (p[1] == '*') {
|
||||
/* skip the ** */
|
||||
p += 2;
|
||||
|
||||
/* munge all * */
|
||||
while (*p == '*')
|
||||
++p;
|
||||
|
||||
/* if its not near a slash, it's like a single * */
|
||||
if (p1 == '/' || *p == '/') {
|
||||
/* a ** at end matches everything */
|
||||
if (*p == 0)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* In between slashes matches to nothing
|
||||
*
|
||||
* Check for /##/ or ^##/ (^ start of string)
|
||||
*
|
||||
* This is required for:
|
||||
* "/##/file.txt" matching "/file.txt"
|
||||
* "##/file.txt" matching "file.txt"
|
||||
* "x##/file.txt" NOT matching "xfile.txt"
|
||||
*/
|
||||
if (*p == '/' && (p1 == 0 || p1 == '/')) {
|
||||
/* try reducing to nothing */
|
||||
if (wnmatch_sub(p + 1, t, match_sub) == 0)
|
||||
return 0;
|
||||
/* otherwise / should match in the text */
|
||||
}
|
||||
|
||||
/* try matching with 0 or more characters */
|
||||
while (*t) {
|
||||
if (wnmatch_sub(p, t, match_sub) == 0)
|
||||
return 0;
|
||||
++t;
|
||||
}
|
||||
|
||||
/* try matching at the end */
|
||||
return wnmatch_sub(p, t, match_sub);
|
||||
}
|
||||
} else {
|
||||
/* skip the * */
|
||||
++p;
|
||||
}
|
||||
|
||||
/* a * at end matches rest of segment */
|
||||
if (*p == 0) {
|
||||
while (*t && *t != '/')
|
||||
++t;
|
||||
return *t != 0;
|
||||
}
|
||||
|
||||
/* try matching with 0 or more characters */
|
||||
while (*t && *t != '/') {
|
||||
if (wnmatch_sub(p, t, match_sub) == 0)
|
||||
return 0;
|
||||
++t;
|
||||
}
|
||||
|
||||
/* try matching at the end */
|
||||
return wnmatch_sub(p, t, match_sub);
|
||||
case '[' :
|
||||
/* character class */
|
||||
if (*t == 0 || *t == '/')
|
||||
return 1;
|
||||
|
||||
p = match_class(p + 1, *t);
|
||||
if (!p)
|
||||
return 1;
|
||||
|
||||
++t;
|
||||
break;
|
||||
default :
|
||||
/* literal character */
|
||||
if (*t == 0 || !char_match(*p, *t))
|
||||
return 1;
|
||||
++p;
|
||||
++t;
|
||||
break;
|
||||
}
|
||||
p1 = p0;
|
||||
}
|
||||
|
||||
/* if we match sub directory */
|
||||
if (match_sub) {
|
||||
/* match successfully only if we are at a directory border */
|
||||
return *t != '/';
|
||||
} else {
|
||||
/* match successfully if we've consumed all text */
|
||||
return *t != 0;
|
||||
}
|
||||
}
|
||||
|
||||
141
cmdline/str.h
Normal file
141
cmdline/str.h
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2025 Andrea Mazzoleni
|
||||
|
||||
#ifndef __STR_H
|
||||
#define __STR_H
|
||||
|
||||
#include "app.h"
|
||||
#include "str.h"
|
||||
|
||||
/****************************************************************************/
|
||||
/* string */
|
||||
|
||||
/**
|
||||
* Polish a string.
|
||||
*
|
||||
* Not printable chars are replaced by spaces.
|
||||
*
|
||||
* Note that the passed string is modified.
|
||||
*/
|
||||
char* strpolish(char* s);
|
||||
|
||||
/**
|
||||
* Split a string into tokens in-place.
|
||||
*
|
||||
* Scans @str for tokens separated by any character in @delimiters,
|
||||
* null-terminates each token by overwriting its trailing delimiter,
|
||||
* and stores a pointer to each token's start in @split_map.
|
||||
*
|
||||
* Leading and consecutive delimiters are silently skipped, so the
|
||||
* output never contains empty tokens.
|
||||
*
|
||||
* The input string is modified in-place; @split_map entries point
|
||||
* directly into @str and are only valid for its lifetime.
|
||||
*
|
||||
* \param split_map Output array receiving pointers to each token.
|
||||
* \param split_max Capacity of @split_map; at most this many tokens are stored.
|
||||
* \param str Input string to tokenise (modified in-place).
|
||||
* \param delimiters Null-terminated set of delimiter characters.
|
||||
* \return Number of tokens stored in @split_map.
|
||||
*
|
||||
* Example:
|
||||
* char buf[] = " one,two,,three ";
|
||||
* char* map[8];
|
||||
* unsigned n = strsplit(map, 8, buf, " ,");
|
||||
* // n == 3, map[] == { "one", "two", "three" }
|
||||
*/
|
||||
unsigned strsplit(char** split_map, unsigned split_max, char* str, const char* delimiters);
|
||||
|
||||
/**
|
||||
* Split a command-line string into an argument vector,
|
||||
* applying the quoting rules of the platform's native shell.
|
||||
*
|
||||
* The input string is modified in-place: quotes and escape characters
|
||||
* are stripped and each token is null-terminated. Whitespace is the
|
||||
* implicit token delimiter on both platforms.
|
||||
*
|
||||
* bash quoting (Linux / macOS):
|
||||
* 'single quotes' - Everything literal; no escapes processed inside.
|
||||
* "double quotes" - '\' only escapes $, `, ", '\', and newline;
|
||||
* all other backslashes are kept as-is.
|
||||
* \x (unquoted) - Next character taken literally (even whitespace).
|
||||
*
|
||||
* cmd.exe quoting (Windows):
|
||||
* "double quotes" - Toggle quoted mode; inside, '^' is NOT special.
|
||||
* ^x (unquoted) - Next character taken literally.
|
||||
* Single quotes and '\' carry no special meaning in either mode.
|
||||
*
|
||||
* \param split_map Output array receiving pointers to each argument.
|
||||
* \param split_max Capacity of @split_map; at most this many tokens are stored.
|
||||
* \param str Input command-line string (modified in-place).
|
||||
* \return Number of arguments stored in @split_map.
|
||||
*
|
||||
* Example (bash):
|
||||
* char buf[] = "one 'two three' \"say \\\"hi\\\"\" back\\slash";
|
||||
* char* map[8];
|
||||
* unsigned n = argsplit(map, 8, buf);
|
||||
* // n==4, map[] == { "one", "two three", "say \"hi\"", "backslash" }
|
||||
*
|
||||
* Example (cmd.exe):
|
||||
* char buf[] = "one \"two three\" ^&safe ^\"quoted^\"";
|
||||
* char* map[8];
|
||||
* unsigned n = argsplit(map, 8, buf);
|
||||
* // n==4, map[] == { "one", "two three", "&safe", "\"quoted\"" }
|
||||
*/
|
||||
unsigned argsplit(const char** split_map, unsigned split_max, char* str);
|
||||
|
||||
/**
|
||||
* Trim spaces from the start and the end
|
||||
*/
|
||||
char* strtrim(char* s);
|
||||
|
||||
/**
|
||||
* Lower case
|
||||
*/
|
||||
char* strlwr(char* s);
|
||||
|
||||
/*
|
||||
* Find the first occurrence of 'needle' in 'haystack' only if it
|
||||
* appears as a separate word (space, number or string boundaries).
|
||||
*
|
||||
* Returns a pointer to the beginning of the match, or NULL if not found.
|
||||
*/
|
||||
char* worddigitstr(const char* haystack, const char* needle);
|
||||
|
||||
/**
|
||||
* Convert a string to an integer, with the same semantics as strtol.
|
||||
*/
|
||||
int strtoi(const char* nptr, char** endptr, int base);
|
||||
|
||||
/**
|
||||
* Convert a string to an unsigned integer, with the same semantics as strtoul.
|
||||
*/
|
||||
unsigned strtou(const char* nptr, char** endptr, int base);
|
||||
|
||||
/****************************************************************************/
|
||||
/* match */
|
||||
|
||||
/*
|
||||
* Wild match function.
|
||||
*
|
||||
* If match_sub is !=0, it matches sub directory. Specifically it matches if the
|
||||
* string "t" is not fully consumed and the next character to consume is a /.
|
||||
*
|
||||
* - ? matches any single character except /
|
||||
* - * matches any sequence of characters except /
|
||||
* - ** (nearby a /) matches everything including /
|
||||
* - ** (not near a /) like *
|
||||
* - ##/ reduces to nothing in addition to the normal matching of ** (using # instead of * to not mess the C comment)
|
||||
* - [...] matches character classes with support for ranges and negation lile [!...] or [^...], except /
|
||||
*
|
||||
* \return 0 if it matches
|
||||
*/
|
||||
int wnmatch_sub(const char* p, const char* t, int match_sub);
|
||||
|
||||
static inline int wnmatch(const char* p, const char* t)
|
||||
{
|
||||
return wnmatch_sub(p, t, 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2011 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "support.h"
|
||||
#include "util.h"
|
||||
|
|
@ -91,7 +91,7 @@ STREAM* sopen_multi_write(unsigned count, int flags)
|
|||
STREAM* s = malloc_nofail(sizeof(STREAM));
|
||||
|
||||
s->handle_size = count;
|
||||
s->handle = malloc_nofail(count * sizeof(struct stream_handle));
|
||||
s->handle = nalloc_nofail(count, sizeof(struct stream_handle));
|
||||
s->flags = flags;
|
||||
|
||||
for (i = 0; i < count; ++i)
|
||||
|
|
@ -586,7 +586,7 @@ int sgetb32(STREAM* f, uint32_t* value)
|
|||
{
|
||||
uint32_t v;
|
||||
unsigned char b;
|
||||
unsigned char s;
|
||||
unsigned s;
|
||||
int c;
|
||||
|
||||
v = 0;
|
||||
|
|
@ -603,7 +603,7 @@ loop:
|
|||
if ((b & 0x80) == 0) {
|
||||
v |= (uint32_t)b << s;
|
||||
s += 7;
|
||||
if (s >= 32) {
|
||||
if (tommy_unlikely(s >= 32)) {
|
||||
/* LCOV_EXCL_START */
|
||||
return -1;
|
||||
/* LCOV_EXCL_STOP */
|
||||
|
|
@ -611,6 +611,13 @@ loop:
|
|||
goto loop;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for overflow: at s == 28 only 4 bits (0x0f) fit in uint32_t
|
||||
*/
|
||||
if (tommy_unlikely(s == 28 && (b & 0x70) != 0)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
v |= (uint32_t)(b & 0x7f) << s;
|
||||
|
||||
*value = v;
|
||||
|
|
@ -622,7 +629,7 @@ int sgetb64(STREAM* f, uint64_t* value)
|
|||
{
|
||||
uint64_t v;
|
||||
unsigned char b;
|
||||
unsigned char s;
|
||||
unsigned s;
|
||||
int c;
|
||||
|
||||
v = 0;
|
||||
|
|
@ -639,7 +646,7 @@ loop:
|
|||
if ((b & 0x80) == 0) {
|
||||
v |= (uint64_t)b << s;
|
||||
s += 7;
|
||||
if (s >= 64) {
|
||||
if (tommy_unlikely(s >= 64)) {
|
||||
/* LCOV_EXCL_START */
|
||||
return -1;
|
||||
/* LCOV_EXCL_STOP */
|
||||
|
|
@ -647,6 +654,13 @@ loop:
|
|||
goto loop;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for overflow: at s == 63 only 1 bit (0x01) fits in uint64_t
|
||||
*/
|
||||
if (tommy_unlikely(s == 63 && (b & 0x7e) != 0)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
v |= (uint64_t)(b & 0x7f) << s;
|
||||
|
||||
*value = v;
|
||||
|
|
@ -679,7 +693,7 @@ int sgetbs(STREAM* f, char* str, size_t size)
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
if (len + 1 > size) {
|
||||
if (len >= size) {
|
||||
/* LCOV_EXCL_START */
|
||||
return -1;
|
||||
/* LCOV_EXCL_STOP */
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2011 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "support.h"
|
||||
|
||||
|
|
@ -362,10 +362,18 @@ static void vmsg(FILE* out, const char* format, va_list ap)
|
|||
free(dup);
|
||||
}
|
||||
|
||||
void log_fatal(int err, const char* format, ...)
|
||||
static void msg(FILE* out, const char* format, ...) __attribute__((format(attribute_printf, 2, 3)));
|
||||
static void msg(FILE* out, const char* format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, format);
|
||||
vmsg(out, format, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void vlog_fatal(int err, const char* format, va_list ap, const char* post)
|
||||
{
|
||||
lock_msg();
|
||||
|
||||
if (stdlog) {
|
||||
|
|
@ -374,26 +382,41 @@ void log_fatal(int err, const char* format, ...)
|
|||
else
|
||||
fprintf(stdlog, "msg:fatal: ");
|
||||
|
||||
va_start(ap, format);
|
||||
vfprintf(stdlog, format, ap);
|
||||
va_end(ap);
|
||||
va_list ap_copy;
|
||||
va_copy(ap_copy, ap);
|
||||
vfprintf(stdlog, format, ap_copy);
|
||||
va_end(ap_copy);
|
||||
|
||||
if (post)
|
||||
fprintf(stdlog, "%s", post);
|
||||
|
||||
fflush(stdlog);
|
||||
}
|
||||
|
||||
va_start(ap, format);
|
||||
vmsg(stderr, format, ap);
|
||||
va_end(ap);
|
||||
va_list ap_copy2;
|
||||
va_copy(ap_copy2, ap);
|
||||
vmsg(stderr, format, ap_copy2);
|
||||
va_end(ap_copy2);
|
||||
|
||||
if (post)
|
||||
msg(stderr, "%s", post);
|
||||
|
||||
fflush(stderr);
|
||||
|
||||
unlock_msg();
|
||||
}
|
||||
|
||||
void log_error(int err, const char* format, ...)
|
||||
void log_fatal(int err, const char* format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, format);
|
||||
vlog_fatal(err, format, ap, 0);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void vlog_error(int err, const char* format, va_list ap, const char* post)
|
||||
{
|
||||
lock_msg();
|
||||
|
||||
if (stdlog) {
|
||||
|
|
@ -402,15 +425,23 @@ void log_error(int err, const char* format, ...)
|
|||
else
|
||||
fprintf(stdlog, "msg:error: ");
|
||||
|
||||
va_start(ap, format);
|
||||
vfprintf(stdlog, format, ap);
|
||||
va_end(ap);
|
||||
va_list ap_copy;
|
||||
va_copy(ap_copy, ap);
|
||||
vfprintf(stdlog, format, ap_copy);
|
||||
va_end(ap_copy);
|
||||
|
||||
if (post)
|
||||
fprintf(stdlog, "%s", post);
|
||||
|
||||
fflush(stdlog);
|
||||
} else {
|
||||
va_start(ap, format);
|
||||
vmsg(stderr, format, ap);
|
||||
va_end(ap);
|
||||
va_list ap_copy;
|
||||
va_copy(ap_copy, ap);
|
||||
vmsg(stderr, format, ap_copy);
|
||||
va_end(ap_copy);
|
||||
|
||||
if (post)
|
||||
msg(stderr, "%s", post);
|
||||
|
||||
fflush(stderr);
|
||||
}
|
||||
|
|
@ -418,11 +449,17 @@ void log_error(int err, const char* format, ...)
|
|||
unlock_msg();
|
||||
}
|
||||
|
||||
|
||||
void log_info(int err, const char* format, ...)
|
||||
void log_error(int err, const char* format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, format);
|
||||
vlog_error(err, format, ap, 0);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void vlog_info(int err, const char* format, va_list ap, const char* post)
|
||||
{
|
||||
lock_msg();
|
||||
|
||||
if (stdlog) {
|
||||
|
|
@ -431,15 +468,23 @@ void log_info(int err, const char* format, ...)
|
|||
else
|
||||
fprintf(stdlog, "msg:info: ");
|
||||
|
||||
va_start(ap, format);
|
||||
vfprintf(stdlog, format, ap);
|
||||
va_end(ap);
|
||||
va_list ap_copy;
|
||||
va_copy(ap_copy, ap);
|
||||
vfprintf(stdlog, format, ap_copy);
|
||||
va_end(ap_copy);
|
||||
|
||||
if (post)
|
||||
fprintf(stdlog, "%s", post);
|
||||
|
||||
fflush(stdlog);
|
||||
} else {
|
||||
va_start(ap, format);
|
||||
vmsg(stderr, format, ap);
|
||||
va_end(ap);
|
||||
va_list ap_copy;
|
||||
va_copy(ap_copy, ap);
|
||||
vmsg(stderr, format, ap_copy);
|
||||
va_end(ap_copy);
|
||||
|
||||
if (post)
|
||||
msg(stderr, "%s", post);
|
||||
|
||||
fflush(stderr);
|
||||
}
|
||||
|
|
@ -447,6 +492,36 @@ void log_info(int err, const char* format, ...)
|
|||
unlock_msg();
|
||||
}
|
||||
|
||||
void log_info(int err, const char* format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, format);
|
||||
vlog_info(err, format, ap, 0);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void os_syslog(int level, const char* format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, format);
|
||||
switch (level) {
|
||||
case OS_LVL_CRITICAL :
|
||||
vlog_fatal(ESYSLOG, format, ap, "\n");
|
||||
break;
|
||||
case OS_LVL_ERROR :
|
||||
vlog_error(ESYSLOG, format, ap, "\n");
|
||||
break;
|
||||
case OS_LVL_WARNING :
|
||||
case OS_LVL_INFO :
|
||||
/* do not log */
|
||||
break;
|
||||
}
|
||||
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void log_expected(int err, const char* format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
|
@ -953,281 +1028,6 @@ bail:
|
|||
}
|
||||
#endif
|
||||
|
||||
char* strpolish(char* s)
|
||||
{
|
||||
char* i = s;
|
||||
|
||||
while (*i) {
|
||||
if (isspace((unsigned char)*i) || !isprint((unsigned char)*i))
|
||||
*i = ' ';
|
||||
++i;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
unsigned strsplit(char** split_map, unsigned split_max, char* str, const char* delimiters)
|
||||
{
|
||||
unsigned mac = 0;
|
||||
|
||||
/* skip initial delimiters */
|
||||
str += strspn(str, delimiters);
|
||||
|
||||
while (*str != 0 && mac < split_max) {
|
||||
/* start of the token */
|
||||
split_map[mac] = str;
|
||||
++mac;
|
||||
|
||||
/* find the first delimiter or the end of the string */
|
||||
str += strcspn(str, delimiters);
|
||||
|
||||
/* put the final terminator if missing */
|
||||
if (*str != 0)
|
||||
*str++ = 0;
|
||||
|
||||
/* skip trailing delimiters */
|
||||
str += strspn(str, delimiters);
|
||||
}
|
||||
|
||||
return mac;
|
||||
}
|
||||
|
||||
unsigned argsplit(const char** split_map, unsigned split_max, char* str)
|
||||
{
|
||||
unsigned mac = 0;
|
||||
|
||||
/* skip leading whitespace */
|
||||
while (*str != 0 && isspace((unsigned char)*str))
|
||||
++str;
|
||||
|
||||
while (*str != 0 && mac < split_max) {
|
||||
char* dst = str;
|
||||
split_map[mac++] = dst;
|
||||
|
||||
#ifdef _WIN32
|
||||
/*
|
||||
* cmd.exe rules:
|
||||
* Unquoted: '^' escapes next char; '"' opens a quoted block.
|
||||
* Quoted: '"' closes the block; '^' is an ordinary character.
|
||||
*/
|
||||
int quoted = 0;
|
||||
|
||||
while (*str != 0 && (quoted || !isspace((unsigned char)*str))) {
|
||||
if (quoted) {
|
||||
if (*str == '"') {
|
||||
quoted = 0;
|
||||
++str;
|
||||
} else {
|
||||
*dst++ = *str++;
|
||||
}
|
||||
} else {
|
||||
if (*str == '^' && *(str + 1) != 0) {
|
||||
++str;
|
||||
*dst++ = *str++;
|
||||
} else if (*str == '"') {
|
||||
quoted = 1;
|
||||
++str;
|
||||
} else {
|
||||
*dst++ = *str++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
/*
|
||||
* bash rules:
|
||||
* Single-quoted block: everything literal, no exceptions.
|
||||
* Double-quoted block: '\' only escapes $, `, ", '\', newline;
|
||||
* other backslashes are copied verbatim.
|
||||
* Unquoted '\': always escapes the immediately following char.
|
||||
*/
|
||||
|
||||
/* set of characters that '\' can escape inside double quotes */
|
||||
static const char dq_escapable[] = "$`\"\\\n";
|
||||
|
||||
while (*str != 0 && !isspace((unsigned char)*str)) {
|
||||
|
||||
if (*str == '\'') {
|
||||
/* single-quoted block: truly everything is literal */
|
||||
++str;
|
||||
while (*str != 0 && *str != '\'')
|
||||
*dst++ = *str++;
|
||||
if (*str == '\'')
|
||||
++str;
|
||||
|
||||
} else if (*str == '"') {
|
||||
/* double-quoted block */
|
||||
++str;
|
||||
while (*str != 0 && *str != '"') {
|
||||
if (*str == '\\' && strchr(dq_escapable, *(str + 1))) {
|
||||
++str;
|
||||
}
|
||||
*dst++ = *str++;
|
||||
}
|
||||
if (*str == '"')
|
||||
++str;
|
||||
|
||||
} else if (*str == '\\') {
|
||||
/* unquoted backslash: next character always literal */
|
||||
++str;
|
||||
if (*str != 0)
|
||||
*dst++ = *str++;
|
||||
|
||||
} else {
|
||||
*dst++ = *str++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (*str != 0)
|
||||
++str; /* step past the delimiter */
|
||||
|
||||
/* skip whitespace before the next token */
|
||||
while (*str != 0 && isspace((unsigned char)*str))
|
||||
++str;
|
||||
|
||||
/* null-terminate after str has already moved on */
|
||||
*dst = 0;
|
||||
}
|
||||
|
||||
return mac;
|
||||
}
|
||||
|
||||
char* strtrim(char* str)
|
||||
{
|
||||
char* begin;
|
||||
char* end;
|
||||
|
||||
begin = str;
|
||||
while (begin[0] && isspace((unsigned char)begin[0]))
|
||||
++begin;
|
||||
|
||||
end = begin + strlen(begin);
|
||||
while (end > begin && isspace((unsigned char)end[-1]))
|
||||
--end;
|
||||
|
||||
end[0] = 0;
|
||||
|
||||
if (begin != end)
|
||||
memmove(str, begin, end - begin + 1);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
char* strlwr(char* str)
|
||||
{
|
||||
char* s = str;
|
||||
|
||||
while (*s) {
|
||||
*s = tolower((unsigned char)*s);
|
||||
++s;
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
char* worddigitstr(const char* haystack, const char* needle)
|
||||
{
|
||||
size_t len = strlen(needle);
|
||||
const char* s;
|
||||
|
||||
if (len == 0)
|
||||
return NULL;
|
||||
|
||||
for (s = haystack; (s = strstr(s, needle)) != NULL; ++s) {
|
||||
|
||||
/* left boundary */
|
||||
if (s == haystack || isspace((unsigned char)s[-1]) || isdigit((unsigned char)s[-1])) {
|
||||
/* right boundary */
|
||||
if (s[len] == 0 || isspace((unsigned char)s[len]) || isdigit((unsigned char)s[len])) {
|
||||
return (char*)s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int strtoi(const char* nptr, char** endptr, int base)
|
||||
{
|
||||
long val;
|
||||
int save_errno = errno;
|
||||
|
||||
errno = 0;
|
||||
val = strtol(nptr, endptr, base);
|
||||
|
||||
if (errno == ERANGE) {
|
||||
return val > 0 ? INT_MAX : INT_MIN;
|
||||
}
|
||||
|
||||
if (val > INT_MAX) {
|
||||
errno = ERANGE;
|
||||
return INT_MAX;
|
||||
}
|
||||
|
||||
if (val < INT_MIN) {
|
||||
errno = ERANGE;
|
||||
return INT_MIN;
|
||||
}
|
||||
|
||||
if (errno == 0) {
|
||||
errno = save_errno;
|
||||
}
|
||||
|
||||
return (int)val;
|
||||
}
|
||||
|
||||
unsigned strtou(const char* nptr, char** endptr, int base)
|
||||
{
|
||||
const char* p = nptr;
|
||||
char* end;
|
||||
unsigned long val;
|
||||
int neg = 0;
|
||||
int save_errno = errno;
|
||||
|
||||
while (isspace((unsigned char)*p)) {
|
||||
++p;
|
||||
}
|
||||
|
||||
if (*p == '-') {
|
||||
neg = 1;
|
||||
++p;
|
||||
} else if (*p == '+') {
|
||||
++p;
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
val = strtoul(p, &end, base);
|
||||
|
||||
if (end == p) {
|
||||
/* no conversion was performed */
|
||||
if (endptr) {
|
||||
*endptr = (char*)nptr;
|
||||
}
|
||||
errno = save_errno;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (endptr) {
|
||||
*endptr = end;
|
||||
}
|
||||
|
||||
if (errno == ERANGE || val > UINT_MAX) {
|
||||
errno = ERANGE;
|
||||
return UINT_MAX;
|
||||
}
|
||||
|
||||
if (errno == 0) {
|
||||
errno = save_errno;
|
||||
}
|
||||
|
||||
if (neg) {
|
||||
return (unsigned)-val;
|
||||
}
|
||||
|
||||
return (unsigned)val;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
/* path */
|
||||
|
||||
|
|
@ -2028,160 +1828,6 @@ void advise_close(struct advise_struct* advise, int f)
|
|||
advise->dirty_end = 0;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
/* memory */
|
||||
|
||||
/**
|
||||
* Cumulative amount of memory allocated.
|
||||
*/
|
||||
static size_t mcounter;
|
||||
|
||||
size_t malloc_counter_get(void)
|
||||
{
|
||||
size_t ret;
|
||||
|
||||
lock_memory();
|
||||
|
||||
ret = mcounter;
|
||||
|
||||
unlock_memory();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void malloc_counter_inc(size_t inc)
|
||||
{
|
||||
lock_memory();
|
||||
|
||||
mcounter += inc;
|
||||
|
||||
unlock_memory();
|
||||
}
|
||||
|
||||
/* LCOV_EXCL_START */
|
||||
static ssize_t malloc_print(int f, const char* str)
|
||||
{
|
||||
ssize_t len = 0;
|
||||
|
||||
while (str[len])
|
||||
++len;
|
||||
return write(f, str, len);
|
||||
}
|
||||
/* LCOV_EXCL_STOP */
|
||||
|
||||
/* LCOV_EXCL_START */
|
||||
static ssize_t malloc_printn(int f, size_t value)
|
||||
{
|
||||
char buf[32];
|
||||
int i;
|
||||
|
||||
if (!value)
|
||||
return write(f, "0", 1);
|
||||
|
||||
i = sizeof(buf);
|
||||
while (value) {
|
||||
buf[--i] = (value % 10) + '0';
|
||||
value /= 10;
|
||||
}
|
||||
|
||||
return write(f, buf + i, sizeof(buf) - i);
|
||||
}
|
||||
/* LCOV_EXCL_STOP */
|
||||
|
||||
/* LCOV_EXCL_START */
|
||||
void malloc_fail(size_t size)
|
||||
{
|
||||
/* don't use printf to avoid any possible extra allocation */
|
||||
int f = 2; /* stderr */
|
||||
|
||||
malloc_print(f, "Failed for Low Memory!\n");
|
||||
malloc_print(f, "Allocating ");
|
||||
malloc_printn(f, size);
|
||||
malloc_print(f, " bytes.\n");
|
||||
malloc_print(f, "Already allocated ");
|
||||
malloc_printn(f, malloc_counter_get());
|
||||
malloc_print(f, " bytes.\n");
|
||||
if (sizeof(void*) == 4) {
|
||||
malloc_print(f, "You are currently using a 32 bits executable.\n");
|
||||
malloc_print(f, "If you have more than 4GB of memory, please upgrade to a 64 bits one.\n");
|
||||
}
|
||||
}
|
||||
/* LCOV_EXCL_STOP */
|
||||
|
||||
void* malloc_nofail(size_t size)
|
||||
{
|
||||
void* ptr = malloc(size);
|
||||
|
||||
if (!ptr) {
|
||||
/* LCOV_EXCL_START */
|
||||
malloc_fail(size);
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
#ifndef CHECKER /* Don't preinitialize when running for valgrind */
|
||||
/*
|
||||
* Here we preinitialize the memory to ensure that the OS is really allocating it
|
||||
* and not only reserving the addressable space.
|
||||
* Otherwise we are risking that the OOM (Out Of Memory) killer in Linux will kill the process.
|
||||
* Filling the memory doesn't ensure to disable OOM, but it increase a lot the chances to
|
||||
* get a real error from malloc() instead than a process killed.
|
||||
* Note that calloc() doesn't have the same effect.
|
||||
*/
|
||||
memset(ptr, 0xA5, size);
|
||||
#endif
|
||||
|
||||
malloc_counter_inc(size);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* calloc_nofail(size_t count, size_t size)
|
||||
{
|
||||
void* ptr;
|
||||
|
||||
size *= count;
|
||||
|
||||
/* see the note in malloc_nofail() of why we don't use calloc() */
|
||||
ptr = malloc(size);
|
||||
|
||||
if (!ptr) {
|
||||
/* LCOV_EXCL_START */
|
||||
malloc_fail(size);
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
memset(ptr, 0, size);
|
||||
|
||||
malloc_counter_inc(size);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
char* strdup_nofail(const char* str)
|
||||
{
|
||||
size_t size;
|
||||
char* ptr;
|
||||
|
||||
size = strlen(str) + 1;
|
||||
|
||||
ptr = malloc(size);
|
||||
|
||||
if (!ptr) {
|
||||
/* LCOV_EXCL_START */
|
||||
malloc_fail(size);
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
memcpy(ptr, str, size);
|
||||
|
||||
malloc_counter_inc(size);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
/* smartctl */
|
||||
|
||||
|
|
@ -2337,6 +1983,10 @@ int smartctl_attribute(OS_FILE* f, const char* file, const char* name, struct sm
|
|||
for (i = 0; i < INFO_COUNT; ++i)
|
||||
info[i] = SMART_UNASSIGNED;
|
||||
|
||||
pathcpy(smart[SMART_ERROR_PROTOCOL].name, sizeof(smart[SMART_ERROR_PROTOCOL].name), "error_protocol");
|
||||
pathcpy(smart[SMART_ERROR_MEDIUM].name, sizeof(smart[SMART_ERROR_MEDIUM].name), "error_medium");
|
||||
pathcpy(smart[SMART_WEAR_LEVEL].name, sizeof(smart[SMART_WEAR_LEVEL].name), "wear_level");
|
||||
|
||||
/* read the file */
|
||||
inside = 0;
|
||||
while (1) {
|
||||
|
|
@ -2514,6 +2164,7 @@ int smartctl_attribute(OS_FILE* f, const char* file, const char* name, struct sm
|
|||
*/
|
||||
} else if (smatch(s, "NVMe Version:") == 0) {
|
||||
strcpy(inter, "NVMe");
|
||||
info[INFO_ROTATION_RATE] = 0;
|
||||
/* special entries */
|
||||
} else if (snumber(s, "Media and Data Integrity Errors:", &raw) == 1) {
|
||||
smart[SMART_ERROR_MEDIUM].raw = raw;
|
||||
|
|
@ -2555,13 +2206,13 @@ int smartctl_attribute(OS_FILE* f, const char* file, const char* name, struct sm
|
|||
} else if (smatch(s, "ID#") == 0) {
|
||||
inside = 1;
|
||||
} else if (inside) {
|
||||
char id_name[128] = { 0 };
|
||||
char type[64] = { 0 };
|
||||
char updated[64] = { 0 };
|
||||
char when_failed[64] = { 0 };
|
||||
char norm[64] = { 0 };
|
||||
char worst[64] = { 0 };
|
||||
char thresh[64] = { 0 };
|
||||
char id_name[SMART_MAX] = { 0 };
|
||||
char type[SMART_MAX] = { 0 };
|
||||
char updated[SMART_MAX] = { 0 };
|
||||
char when_failed[SMART_MAX] = { 0 };
|
||||
char norm[SMART_MAX] = { 0 };
|
||||
char worst[SMART_MAX] = { 0 };
|
||||
char thresh[SMART_MAX] = { 0 };
|
||||
uint64_t min, max, avg;
|
||||
int format_minmax = 0;
|
||||
int format_avg = 0;
|
||||
|
|
@ -2892,9 +2543,10 @@ void thread_join(thread_id_t thread, void** retval)
|
|||
void thread_yield(void)
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
Sleep(0);
|
||||
Sleep(1); /* avoid 100% cpu utilization */
|
||||
#else
|
||||
sched_yield();
|
||||
usleep(1000); /* avoid 100% cpu utilization */
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
|
@ -2919,173 +2571,3 @@ int thread_setspecific(thread_key_t key, void* value)
|
|||
return pthread_setspecific(key, value);
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
/* wnmatch */
|
||||
|
||||
/**
|
||||
* Helper function for case-insensitive character comparison
|
||||
*/
|
||||
static inline int char_match(char p, char t)
|
||||
{
|
||||
#ifdef WIN32
|
||||
return tolower((unsigned char)p) == tolower((unsigned char)t);
|
||||
#else
|
||||
return p == t;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Match character class [...]
|
||||
* Return 0 if NOT matched
|
||||
*/
|
||||
static const char* match_class(const char* p, char t)
|
||||
{
|
||||
int negate = 0;
|
||||
int matched = 0;
|
||||
|
||||
if (*p == '!' || *p == '^') {
|
||||
negate = 1;
|
||||
++p;
|
||||
}
|
||||
|
||||
while (*p && *p != ']') {
|
||||
if (p[1] == '-' && p[2] != ']' && p[2] != 0) {
|
||||
/* range [a-z] */
|
||||
char start = *p;
|
||||
char end = p[2];
|
||||
#ifdef WIN32
|
||||
start = tolower((unsigned char)start);
|
||||
end = tolower((unsigned char)end);
|
||||
t = tolower((unsigned char)t);
|
||||
#endif
|
||||
if (t >= start && t <= end)
|
||||
matched = 1;
|
||||
p += 3;
|
||||
} else {
|
||||
/* single character */
|
||||
if (char_match(*p, t))
|
||||
matched = 1;
|
||||
++p;
|
||||
}
|
||||
}
|
||||
|
||||
if (*p == ']')
|
||||
++p;
|
||||
|
||||
if (negate)
|
||||
matched = !matched;
|
||||
if (!matched)
|
||||
return 0;
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
int wnmatch_sub(const char* p, const char* t, int match_sub)
|
||||
{
|
||||
char p1 = 0; /* previous char */
|
||||
while (*p) {
|
||||
char p0 = *p;
|
||||
switch (p0) {
|
||||
case '?' :
|
||||
/* ? matches any single character except / */
|
||||
if (*t == 0 || *t == '/')
|
||||
return 1;
|
||||
++p;
|
||||
++t;
|
||||
break;
|
||||
case '*' :
|
||||
/* check for ** */
|
||||
if (p[1] == '*') {
|
||||
/* skip the ** */
|
||||
p += 2;
|
||||
|
||||
/* munge all * */
|
||||
while (*p == '*')
|
||||
++p;
|
||||
|
||||
/* if its not near a slash, it's like a single * */
|
||||
if (p1 == '/' || *p == '/') {
|
||||
/* a ** at end matches everything */
|
||||
if (*p == 0)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* In between slashes matches to nothing
|
||||
*
|
||||
* Check for /##/ or ^##/ (^ start of string)
|
||||
*
|
||||
* This is required for:
|
||||
* "/##/file.txt" matching "/file.txt"
|
||||
* "##/file.txt" matching "file.txt"
|
||||
* "x##/file.txt" NOT matching "xfile.txt"
|
||||
*/
|
||||
if (*p == '/' && (p1 == 0 || p1 == '/')) {
|
||||
/* try reducing to nothing */
|
||||
if (wnmatch_sub(p + 1, t, match_sub) == 0)
|
||||
return 0;
|
||||
/* otherwise / should match in the text */
|
||||
}
|
||||
|
||||
/* try matching with 0 or more characters */
|
||||
while (*t) {
|
||||
if (wnmatch_sub(p, t, match_sub) == 0)
|
||||
return 0;
|
||||
++t;
|
||||
}
|
||||
|
||||
/* try matching at the end */
|
||||
return wnmatch_sub(p, t, match_sub);
|
||||
}
|
||||
} else {
|
||||
/* skip the * */
|
||||
++p;
|
||||
}
|
||||
|
||||
/* a * at end matches rest of segment */
|
||||
if (*p == 0) {
|
||||
while (*t && *t != '/')
|
||||
++t;
|
||||
return *t != 0;
|
||||
}
|
||||
|
||||
/* try matching with 0 or more characters */
|
||||
while (*t && *t != '/') {
|
||||
if (wnmatch_sub(p, t, match_sub) == 0)
|
||||
return 0;
|
||||
++t;
|
||||
}
|
||||
|
||||
/* try matching at the end */
|
||||
return wnmatch_sub(p, t, match_sub);
|
||||
case '[' :
|
||||
/* character class */
|
||||
if (*t == 0 || *t == '/')
|
||||
return 1;
|
||||
|
||||
p = match_class(p + 1, *t);
|
||||
if (!p)
|
||||
return 1;
|
||||
|
||||
++t;
|
||||
break;
|
||||
default :
|
||||
/* literal character */
|
||||
if (*t == 0 || !char_match(*p, *t))
|
||||
return 1;
|
||||
++p;
|
||||
++t;
|
||||
break;
|
||||
}
|
||||
p1 = p0;
|
||||
}
|
||||
|
||||
/* if we match sub directory */
|
||||
if (match_sub) {
|
||||
/* match successfully only if we are at a directory border */
|
||||
return *t != '/';
|
||||
} else {
|
||||
/* match successfully if we've consumed all text */
|
||||
return *t != 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,10 @@
|
|||
#ifndef __SUPPORT_H
|
||||
#define __SUPPORT_H
|
||||
|
||||
#include "app.h"
|
||||
#include "memory.h"
|
||||
#include "str.h"
|
||||
|
||||
/****************************************************************************/
|
||||
/* lock */
|
||||
|
||||
|
|
@ -90,6 +94,7 @@ typedef void log_ptr(int err, const char* format, ...) __attribute__((format(att
|
|||
*
|
||||
* These messages go in the log file and in stderr unconditionally.
|
||||
*/
|
||||
void vlog_fatal(int err, const char* format, va_list ap, const char* post);
|
||||
void log_fatal(int err, const char* format, ...) __attribute__((format(attribute_printf, 2, 3)));
|
||||
|
||||
/**
|
||||
|
|
@ -103,6 +108,7 @@ void log_fatal(int err, const char* format, ...) __attribute__((format(attribute
|
|||
*
|
||||
* These messages go in the log file if specified, otherwise they go in stderr.
|
||||
*/
|
||||
void vlog_error(int err, const char* format, va_list ap, const char* post);
|
||||
void log_error(int err, const char* format, ...) __attribute__((format(attribute_printf, 2, 3)));
|
||||
|
||||
/**
|
||||
|
|
@ -247,7 +253,7 @@ void printl(const char* str, size_t pad);
|
|||
void printp(double v, size_t pad);
|
||||
|
||||
/****************************************************************************/
|
||||
/* string */
|
||||
/* escape */
|
||||
|
||||
#define ESC_MAX (PATH_MAX * 2 + 1)
|
||||
#define ESC_POOL_MAX 8
|
||||
|
|
@ -275,108 +281,6 @@ static inline const char* esc_shell(const char* str, char* buffer)
|
|||
return esc_shell_multi(&str, 1, buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Polish a string.
|
||||
*
|
||||
* Not printable chars are replaced by spaces.
|
||||
*
|
||||
* Note that the passed string is modified.
|
||||
*/
|
||||
char* strpolish(char* s);
|
||||
|
||||
/**
|
||||
* Split a string into tokens in-place.
|
||||
*
|
||||
* Scans @str for tokens separated by any character in @delimiters,
|
||||
* null-terminates each token by overwriting its trailing delimiter,
|
||||
* and stores a pointer to each token's start in @split_map.
|
||||
*
|
||||
* Leading and consecutive delimiters are silently skipped, so the
|
||||
* output never contains empty tokens.
|
||||
*
|
||||
* The input string is modified in-place; @split_map entries point
|
||||
* directly into @str and are only valid for its lifetime.
|
||||
*
|
||||
* \param split_map Output array receiving pointers to each token.
|
||||
* \param split_max Capacity of @split_map; at most this many tokens are stored.
|
||||
* \param str Input string to tokenise (modified in-place).
|
||||
* \param delimiters Null-terminated set of delimiter characters.
|
||||
* \return Number of tokens stored in @split_map.
|
||||
*
|
||||
* Example:
|
||||
* char buf[] = " one,two,,three ";
|
||||
* char* map[8];
|
||||
* unsigned n = strsplit(map, 8, buf, " ,");
|
||||
* // n == 3, map[] == { "one", "two", "three" }
|
||||
*/
|
||||
unsigned strsplit(char** split_map, unsigned split_max, char* str, const char* delimiters);
|
||||
|
||||
/**
|
||||
* Split a command-line string into an argument vector,
|
||||
* applying the quoting rules of the platform's native shell.
|
||||
*
|
||||
* The input string is modified in-place: quotes and escape characters
|
||||
* are stripped and each token is null-terminated. Whitespace is the
|
||||
* implicit token delimiter on both platforms.
|
||||
*
|
||||
* bash quoting (Linux / macOS):
|
||||
* 'single quotes' - Everything literal; no escapes processed inside.
|
||||
* "double quotes" - '\' only escapes $, `, ", '\', and newline;
|
||||
* all other backslashes are kept as-is.
|
||||
* \x (unquoted) - Next character taken literally (even whitespace).
|
||||
*
|
||||
* cmd.exe quoting (Windows):
|
||||
* "double quotes" - Toggle quoted mode; inside, '^' is NOT special.
|
||||
* ^x (unquoted) - Next character taken literally.
|
||||
* Single quotes and '\' carry no special meaning in either mode.
|
||||
*
|
||||
* \param split_map Output array receiving pointers to each argument.
|
||||
* \param split_max Capacity of @split_map; at most this many tokens are stored.
|
||||
* \param str Input command-line string (modified in-place).
|
||||
* \return Number of arguments stored in @split_map.
|
||||
*
|
||||
* Example (bash):
|
||||
* char buf[] = "one 'two three' \"say \\\"hi\\\"\" back\\slash";
|
||||
* char* map[8];
|
||||
* unsigned n = argsplit(map, 8, buf);
|
||||
* // n==4, map[] == { "one", "two three", "say \"hi\"", "backslash" }
|
||||
*
|
||||
* Example (cmd.exe):
|
||||
* char buf[] = "one \"two three\" ^&safe ^\"quoted^\"";
|
||||
* char* map[8];
|
||||
* unsigned n = argsplit(map, 8, buf);
|
||||
* // n==4, map[] == { "one", "two three", "&safe", "\"quoted\"" }
|
||||
*/
|
||||
unsigned argsplit(const char** split_map, unsigned split_max, char* str);
|
||||
|
||||
/**
|
||||
* Trim spaces from the start and the end
|
||||
*/
|
||||
char* strtrim(char* s);
|
||||
|
||||
/**
|
||||
* Lower case
|
||||
*/
|
||||
char* strlwr(char* s);
|
||||
|
||||
/*
|
||||
* Find the first occurrence of 'needle' in 'haystack' only if it
|
||||
* appears as a separate word (space, number or string boundaries).
|
||||
*
|
||||
* Returns a pointer to the beginning of the match, or NULL if not found.
|
||||
*/
|
||||
char* worddigitstr(const char* haystack, const char* needle);
|
||||
|
||||
/**
|
||||
* Convert a string to an integer, with the same semantics as strtol.
|
||||
*/
|
||||
int strtoi(const char* nptr, char** endptr, int base);
|
||||
|
||||
/**
|
||||
* Convert a string to an unsigned integer, with the same semantics as strtoul.
|
||||
*/
|
||||
unsigned strtou(const char* nptr, char** endptr, int base);
|
||||
|
||||
/****************************************************************************/
|
||||
/* path */
|
||||
|
||||
|
|
@ -515,37 +419,6 @@ int advise_write(struct advise_struct* advise, int f, data_off_t offset, data_of
|
|||
int advise_read(struct advise_struct* advise, int f, data_off_t offset, data_off_t size);
|
||||
void advise_close(struct advise_struct* advise, int f);
|
||||
|
||||
/****************************************************************************/
|
||||
/* memory */
|
||||
|
||||
/**
|
||||
* Return the size of the cumulative allocated memory.
|
||||
*/
|
||||
size_t malloc_counter_get(void);
|
||||
|
||||
/**
|
||||
* Safe malloc.
|
||||
* If no memory is available, it aborts.
|
||||
*/
|
||||
void* malloc_nofail(size_t size);
|
||||
|
||||
/**
|
||||
* Safe cmalloc.
|
||||
* If no memory is available, it aborts.
|
||||
*/
|
||||
void* calloc_nofail(size_t count, size_t size);
|
||||
|
||||
/**
|
||||
* Safe strdup.
|
||||
* If no memory is available, it aborts.
|
||||
*/
|
||||
char* strdup_nofail(const char* str);
|
||||
|
||||
/**
|
||||
* Helper for printing an error about a failed allocation.
|
||||
*/
|
||||
void malloc_fail(size_t size);
|
||||
|
||||
/****************************************************************************/
|
||||
/* smartctl */
|
||||
|
||||
|
|
@ -602,30 +475,5 @@ void* thread_getspecific(thread_key_t key);
|
|||
int thread_setspecific(thread_key_t key, void* value);
|
||||
#endif
|
||||
|
||||
/****************************************************************************/
|
||||
/* match */
|
||||
|
||||
/*
|
||||
* Wild match function.
|
||||
*
|
||||
* If match_sub is !=0, it matches sub directory. Specifically it matches if the
|
||||
* string "t" is not fully consumed and the next character to consume is a /.
|
||||
*
|
||||
* - ? matches any single character except /
|
||||
* - * matches any sequence of characters except /
|
||||
* - ** (nearby a /) matches everything including /
|
||||
* - ** (not near a /) like *
|
||||
* - ##/ reduces to nothing in addition to the normal matching of ** (using # instead of * to not mess the C comment)
|
||||
* - [...] matches character classes with support for ranges and negation lile [!...] or [^...], except /
|
||||
*
|
||||
* \return 0 if it matches
|
||||
*/
|
||||
int wnmatch_sub(const char* p, const char* t, int match_sub);
|
||||
|
||||
static inline int wnmatch(const char* p, const char* t)
|
||||
{
|
||||
return wnmatch_sub(p, t, 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2011 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "support.h"
|
||||
#include "elem.h"
|
||||
|
|
@ -191,7 +191,7 @@ static int state_hash_process(struct snapraid_state* state, block_off_t blocksta
|
|||
if (handle[j].st.st_size != file->size
|
||||
|| handle[j].st.st_mtime != file->mtime_sec
|
||||
|| STAT_NSEC(&handle[j].st) != file->mtime_nsec
|
||||
|| handle[j].st.st_ino != file->inode
|
||||
|| (handle[j].st.st_ino != INODE_INVALID && file->inode != INODE_INVALID && handle[j].st.st_ino != file->inode)
|
||||
) {
|
||||
if (handle[j].st.st_size != file->size) {
|
||||
log_tag("error:%" PRIu64 ":%s:%s: Unexpected size change\n", blockcur, disk->name, esc_tag(file->sub));
|
||||
|
|
@ -354,6 +354,10 @@ bail:
|
|||
ret = handle_close(&handle[j]);
|
||||
if (ret == -1) {
|
||||
/* LCOV_EXCL_START */
|
||||
/*
|
||||
* If handle_close fails, the handle was open (f != -1), which
|
||||
* guarantees that both file and disk pointers are valid.
|
||||
*/
|
||||
log_tag("%s:%" PRIu64 ":%s:%s: Close error. %s.\n", es(errno), blockcur, disk->name, esc_tag(file->sub), strerror(errno));
|
||||
log_fatal_errno(errno, disk->name);
|
||||
|
||||
|
|
@ -560,7 +564,7 @@ static void sync_data_reader(struct snapraid_worker* worker, struct snapraid_tas
|
|||
if (handle->st.st_size != task->file->size
|
||||
|| handle->st.st_mtime != task->file->mtime_sec
|
||||
|| STAT_NSEC(&handle->st) != task->file->mtime_nsec
|
||||
|| handle->st.st_ino != task->file->inode
|
||||
|| (handle->st.st_ino != INODE_INVALID && task->file->inode != INODE_INVALID && handle->st.st_ino != task->file->inode)
|
||||
) {
|
||||
log_tag("error:%" PRIu64 ":%s:%s: Unexpected attribute change\n", blockcur, disk->name, esc_tag(task->file->sub));
|
||||
if (handle->st.st_size != task->file->size) {
|
||||
|
|
@ -693,12 +697,12 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
|
|||
memset(zero, 0, state->block_size);
|
||||
raid_zero(zero);
|
||||
|
||||
failed = malloc_nofail(diskmax * sizeof(struct failed_struct));
|
||||
failed_map = malloc_nofail(diskmax * sizeof(unsigned));
|
||||
failed = nalloc_nofail(diskmax, sizeof(struct failed_struct));
|
||||
failed_map = nalloc_nofail(diskmax, sizeof(unsigned));
|
||||
|
||||
/* possibly waiting disks */
|
||||
waiting_mac = diskmax > RAID_PARITY_MAX ? diskmax : RAID_PARITY_MAX;
|
||||
waiting_map = malloc_nofail(waiting_mac * sizeof(unsigned));
|
||||
waiting_map = nalloc_nofail(waiting_mac, sizeof(unsigned));
|
||||
|
||||
soft_error = 0;
|
||||
silent_error = 0;
|
||||
|
|
@ -1485,6 +1489,10 @@ bail:
|
|||
ret = handle_close(&handle[j]);
|
||||
if (ret == -1) {
|
||||
/* LCOV_EXCL_START */
|
||||
/*
|
||||
* If handle_close fails, the handle was open (f != -1), which
|
||||
* guarantees that both file and disk pointers are valid.
|
||||
*/
|
||||
log_tag("%s:%" PRIu64 ":%s:%s: Close error. %s.\n", es(errno), blockcur, disk->name, esc_tag(file->sub), strerror(errno));
|
||||
log_fatal_errno(errno, disk->name);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2025 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "thermal.h"
|
||||
#include "state.h"
|
||||
#include "io.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
|
||||
struct snapraid_thermal* thermal_alloc(uint64_t dev, const char* name)
|
||||
{
|
||||
|
|
@ -103,7 +104,13 @@ struct snapraid_thermal_params fit_thermal_model(const struct snapraid_thermal_p
|
|||
}
|
||||
|
||||
model.rmse = sqrt(sum_squared_residuals / n_points);
|
||||
model.r_squared = 1.0 - (sum_squared_residuals / sum_total);
|
||||
|
||||
/* avoid sum_total underflow and division by zero */
|
||||
if (sum_total > FLT_EPSILON) {
|
||||
model.r_squared = 1.0 - (sum_squared_residuals / sum_total);
|
||||
} else {
|
||||
model.r_squared = 1.0;
|
||||
}
|
||||
|
||||
return model;
|
||||
}
|
||||
|
|
@ -328,7 +335,7 @@ void state_thermal_cooldown(struct snapraid_state* state)
|
|||
sleep_time -= 30;
|
||||
}
|
||||
|
||||
if (!os_global_interrupt()) { /* don't wake-up if we are interrupting */
|
||||
if (!os_signal_interrupt()) { /* don't wake-up if we are interrupting */
|
||||
log_tag("thermal:spinup\n");
|
||||
|
||||
/* spinup */
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2014 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "support.h"
|
||||
#include "elem.h"
|
||||
|
|
@ -44,7 +44,7 @@ void state_touch(struct snapraid_state* state)
|
|||
uint32_t nano;
|
||||
|
||||
/* get a random nanosecond value */
|
||||
if (randomize(&nano, sizeof(nano)) != 0) {
|
||||
if (os_randomize(&nano, sizeof(nano)) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(errno, "Failed to retrieve random values.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
|
|||
|
|
@ -1,73 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2011 Andrea Mazzoleni
|
||||
|
||||
#ifndef __UNIX_H
|
||||
#define __UNIX_H
|
||||
|
||||
#ifdef __linux__
|
||||
#define HAVE_LINUX_DEVICE 1 /**< In Linux enables special device support. */
|
||||
#define HAVE_DIRECT_IO 1 /**< Support O_DIRECT in open(). */
|
||||
#endif
|
||||
|
||||
#define O_BINARY 0 /**< Not used in Unix. */
|
||||
#define O_SEQUENTIAL 0 /**< In Unix posix_fadvise() shall be used. */
|
||||
|
||||
|
||||
#if HAVE_POSIX_FADVISE
|
||||
int posix_fadvise_wrapper(int fd, off_t offset, off_t len, int advice);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* If nanoseconds are not supported, we report the special STAT_NSEC_INVALID value,
|
||||
* to mark that it's undefined.
|
||||
*/
|
||||
#define STAT_NSEC_INVALID -1
|
||||
|
||||
/* Check if we have nanoseconds support */
|
||||
#if HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
|
||||
#define STAT_NSEC(st) ((int)(st)->st_mtim.tv_nsec) /* Linux */
|
||||
#elif HAVE_STRUCT_STAT_ST_MTIMENSEC
|
||||
#define STAT_NSEC(st) ((int)(st)->st_mtimensec) /* NetBSD */
|
||||
#elif HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
|
||||
#define STAT_NSEC(st) ((int)(st)->st_mtimespec.tv_nsec) /* FreeBSD, Mac OS X */
|
||||
#else
|
||||
#define STAT_NSEC(st) STAT_NSEC_INVALID
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Open a file with the O_NOATIME flag to avoid to update the access time.
|
||||
*/
|
||||
int open_noatime(const char* file, int flags);
|
||||
|
||||
/**
|
||||
* Check if the specified file is hidden.
|
||||
*/
|
||||
int dirent_hidden(struct dirent* dd);
|
||||
|
||||
/**
|
||||
* Return a description of the file type.
|
||||
*/
|
||||
const char* stat_desc(struct stat* st);
|
||||
|
||||
/**
|
||||
* Return the alignment requirement for direct IO.
|
||||
*/
|
||||
size_t direct_size(void);
|
||||
|
||||
/****************************************************************************/
|
||||
/* thread */
|
||||
|
||||
#if HAVE_PTHREAD_H
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_PTHREAD
|
||||
#define HAVE_THREAD 1
|
||||
typedef pthread_t thread_id_t;
|
||||
typedef pthread_mutex_t thread_mutex_t;
|
||||
typedef pthread_cond_t thread_cond_t;
|
||||
typedef pthread_key_t thread_key_t;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2011 Andrea Mazzoleni
|
||||
|
||||
#include "portable.h"
|
||||
#include "os/portable.h"
|
||||
|
||||
#include "support.h"
|
||||
#include "util.h"
|
||||
|
|
@ -426,6 +426,19 @@ uint32_t crc32c_x86(uint32_t crc, const unsigned char* ptr, size_t size)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if CONFIG_ARM_CRC
|
||||
uint32_t crc32c_arm64(uint32_t crc, const unsigned char* ptr, size_t size)
|
||||
{
|
||||
crc ^= CRC_IV;
|
||||
|
||||
crc = crc32c_arm64_plain(crc, ptr, size);
|
||||
|
||||
crc ^= CRC_IV;
|
||||
|
||||
return crc;
|
||||
}
|
||||
#endif
|
||||
|
||||
uint32_t (*crc32c)(uint32_t crc, const unsigned char* ptr, size_t size);
|
||||
|
||||
void crc32c_init(void)
|
||||
|
|
@ -444,30 +457,30 @@ void crc32c_init(void)
|
|||
|
||||
/*
|
||||
* Rotate left.
|
||||
* In x86/x64 they are optimized with a single assembler instruction.
|
||||
* In x86/x64/ARM they are optimized with a single assembler instruction.
|
||||
*/
|
||||
static inline uint32_t util_rotl32(uint32_t x, int8_t r)
|
||||
static inline uint32_t util_rotl32(uint32_t x, unsigned r)
|
||||
{
|
||||
return (x << r) | (x >> (32 - r));
|
||||
return (x << (r & 31)) | (x >> ((-r) & 31));
|
||||
}
|
||||
|
||||
static inline uint64_t util_rotl64(uint64_t x, int8_t r)
|
||||
static inline uint64_t util_rotl64(uint64_t x, unsigned r)
|
||||
{
|
||||
return (x << r) | (x >> (64 - r));
|
||||
return (x << (r & 63)) | (x >> ((-r) & 63));
|
||||
}
|
||||
|
||||
/*
|
||||
* Rotate right.
|
||||
* In x86/x64 they are optimized with a single assembler instruction.
|
||||
* In x86/x64/ARM they are optimized with a single assembler instruction.
|
||||
*/
|
||||
static inline uint32_t util_rotr32(uint32_t x, int8_t r)
|
||||
static inline uint32_t util_rotr32(uint32_t x, unsigned r)
|
||||
{
|
||||
return (x >> r) | (x << (32 - r));
|
||||
return (x >> (r & 31)) | (x << ((-r) & 31));
|
||||
}
|
||||
|
||||
static inline uint64_t util_rotr64(uint64_t x, int8_t r)
|
||||
static inline uint64_t util_rotr64(uint64_t x, unsigned r)
|
||||
{
|
||||
return (x >> r) | (x << (64 - r));
|
||||
return (x >> (r & 63)) | (x << ((-r) & 63));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -664,24 +677,29 @@ int util_selftest(void)
|
|||
if (util_rotl32(0x00000001U, 31) != 0x80000000U) return -1;
|
||||
if (util_rotl32(0x12345678U, 4) != 0x23456781U) return -1;
|
||||
if (util_rotl32(0x12345678U, 0) != 0x12345678U) return -1;
|
||||
if (util_rotl32(0x12345678U, 32) != 0x12345678U) return -1; /* r % 32 == 0 */
|
||||
if (util_rotl32(0x12345678U, 32) != 0x12345678U) return -1;
|
||||
|
||||
/* rotate right 32-bit */
|
||||
if (util_rotr32(0x00000001U, 1) != 0x80000000U) return -1;
|
||||
if (util_rotr32(0x80000000U, 1) != 0x40000000U) return -1;
|
||||
if (util_rotr32(0x00000002U, 1) != 0x00000001U) return -1;
|
||||
if (util_rotr32(0x12345678U, 4) != 0x81234567U) return -1;
|
||||
if (util_rotr32(0x12345678U, 0) != 0x12345678U) return -1;
|
||||
if (util_rotr32(0x12345678U, 32) != 0x12345678U) return -1;
|
||||
|
||||
/* rotate left 64-bit */
|
||||
if (util_rotl64(1ULL, 1) != 2ULL) return -1;
|
||||
if (util_rotl64(1ULL << 63, 1) != 1ULL) return -1;
|
||||
if (util_rotl64(0x123456789ABCDEF0ULL, 8) != 0x3456789ABCDEF012ULL) return -1;
|
||||
if (util_rotl64(0x123456789ABCDEF0ULL, 0) != 0x123456789ABCDEF0ULL) return -1;
|
||||
if (util_rotl64(0x123456789ABCDEF0ULL, 64) != 0x123456789ABCDEF0ULL) return -1;
|
||||
|
||||
/* rotate right 64-bit */
|
||||
if (util_rotr64(1ULL, 1) != (1ULL << 63)) return -1;
|
||||
if (util_rotr64(2ULL, 1) != 1ULL) return -1;
|
||||
if (util_rotr64(0x123456789ABCDEF0ULL, 8) != 0xF0123456789ABCDEULL) return -1;
|
||||
if (util_rotr64(0x123456789ABCDEF0ULL, 0) != 0x123456789ABCDEF0ULL) return -1;
|
||||
if (util_rotr64(0x123456789ABCDEF0ULL, 64) != 0x123456789ABCDEF0ULL) return -1;
|
||||
|
||||
/* util_mum tests */
|
||||
uint64_t a, b;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#ifndef __UTIL_H
|
||||
#define __UTIL_H
|
||||
|
||||
#include "tommyds/tommytypes.h"
|
||||
|
||||
/****************************************************************************/
|
||||
/* memory */
|
||||
|
|
@ -77,7 +78,12 @@ static inline uint32_t crc32c_plain_char(uint32_t crc, unsigned char c)
|
|||
return crc;
|
||||
}
|
||||
#endif
|
||||
#if CONFIG_ARM_CRC
|
||||
asm ("crc32cb %w0, %w0, %w1\n" : "+r" (crc) : "r" (c));
|
||||
return crc;
|
||||
#else
|
||||
return CRC32C_0[(crc ^ c) & 0xff] ^ (crc >> 8);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -132,6 +138,33 @@ static inline uint32_t crc32c_x86_plain(uint32_t crc, const unsigned char* ptr,
|
|||
}
|
||||
#endif
|
||||
|
||||
#if CONFIG_ARM_CRC
|
||||
static inline uint32_t crc32c_arm64_plain(uint32_t crc, const unsigned char* ptr, size_t size)
|
||||
{
|
||||
while (size >= 8) {
|
||||
uint64_t val;
|
||||
__builtin_memcpy(&val, ptr, 8);
|
||||
asm ("crc32cx %w0, %w0, %x1\n" : "+r" (crc) : "r" (val));
|
||||
ptr += 8;
|
||||
size -= 8;
|
||||
}
|
||||
if (size >= 4) {
|
||||
uint32_t val;
|
||||
__builtin_memcpy(&val, ptr, 4);
|
||||
asm ("crc32cw %w0, %w0, %w1\n" : "+r" (crc) : "r" (val));
|
||||
ptr += 4;
|
||||
size -= 4;
|
||||
}
|
||||
while (size) {
|
||||
asm ("crc32cb %w0, %w0, %w1\n" : "+r" (crc) : "r" (*ptr));
|
||||
++ptr;
|
||||
--size;
|
||||
}
|
||||
|
||||
return crc;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Compute CRC-32 (Castagnoli) without the IV.
|
||||
*/
|
||||
|
|
@ -142,7 +175,11 @@ static inline uint32_t crc32c_plain(uint32_t crc, const unsigned char* ptr, size
|
|||
return crc32c_x86_plain(crc, ptr, size);
|
||||
}
|
||||
#endif
|
||||
#if CONFIG_ARM_CRC
|
||||
return crc32c_arm64_plain(crc, ptr, size);
|
||||
#else
|
||||
return crc32c_gen_plain(crc, ptr, size);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -155,6 +192,7 @@ extern uint32_t (*crc32c)(uint32_t crc, const unsigned char* ptr, size_t size);
|
|||
*/
|
||||
uint32_t crc32c_gen(uint32_t crc, const unsigned char* ptr, size_t size);
|
||||
uint32_t crc32c_x86(uint32_t crc, const unsigned char* ptr, size_t size);
|
||||
uint32_t crc32c_arm64(uint32_t crc, const unsigned char* ptr, size_t size);
|
||||
|
||||
/**
|
||||
* Initialize the CRC-32 (Castagnoli) support.
|
||||
|
|
|
|||
10
configure.ac
10
configure.ac
|
|
@ -7,7 +7,7 @@ AC_CANONICAL_HOST
|
|||
AC_CANONICAL_BUILD
|
||||
AC_CANONICAL_TARGET
|
||||
AM_INIT_AUTOMAKE([foreign no-dependencies subdir-objects])
|
||||
AC_CONFIG_SRCDIR([cmdline/snapraid.c])
|
||||
AC_CONFIG_SRCDIR([os/os.h])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
dnl Enables as many system-specific extensions as reasonably possible
|
||||
|
|
@ -70,11 +70,9 @@ dnl Checks for header files.
|
|||
AC_HEADER_ASSERT
|
||||
AC_HEADER_DIRENT
|
||||
AC_HEADER_SYS_WAIT
|
||||
AC_CHECK_HEADERS([fcntl.h stddef.h stdint.h stdlib.h string.h limits.h time.h sys/time.h])
|
||||
AC_CHECK_HEADERS([unistd.h getopt.h io.h inttypes.h byteswap.h])
|
||||
AC_CHECK_HEADERS([pthread.h math.h])
|
||||
AC_CHECK_HEADERS([sys/file.h sys/ioctl.h sys/sysmacros.h sys/mkdev.h sys/mount.h])
|
||||
AC_CHECK_HEADERS([linux/fiemap.h linux/fs.h linux/btrfs.h mach/mach_time.h execinfo.h])
|
||||
AC_CHECK_HEADERS([stdint.h inttypes.h unistd.h math.h execinfo.h strings.h getopt.h syslog.h grp.h pwd.h io.h])
|
||||
AC_CHECK_HEADERS([sys/file.h sys/sysctl.h sys/ioctl.h sys/time.h sys/types.h sys/mkdev.h sys/sysmacros.h sys/stat.h sys/prctl.h sys/sysinfo.h sys/utsname.h])
|
||||
AC_CHECK_HEADERS([linux/fs.h linux/btrfs.h linux/fiemap.h mach/mach_time.h])
|
||||
|
||||
# Check for the close_range(...,CLOSE_RANGE_CLOEXEC)
|
||||
AC_CHECK_HEADERS([linux/close_range.h])
|
||||
|
|
|
|||
1
configure.analyzer
Executable file
1
configure.analyzer
Executable file
|
|
@ -0,0 +1 @@
|
|||
./configure CC=/usr/libexec/ccc-analyzer
|
||||
|
|
@ -77,7 +77,7 @@ snapraid [\-c, \-\-conf CONFIG]
|
|||
snapraid [\-V, \-\-version] [\-H, \-\-help] [\-C, \-\-gen\-conf CONTENT]
|
||||
.PD 0
|
||||
.PD
|
||||
.SH DESCRIPTION
|
||||
.SH BESCHREIBUNG (DESCRIPTION)
|
||||
SnapRAID ist ein Sicherungsprogramm, das für Festplatten\-Arrays
|
||||
entwickelt wurde und Paritätsinformationen zur Datenwiederherstellung
|
||||
bei Ausfall von bis zu sechs Festplatten speichert.
|
||||
|
|
@ -107,7 +107,7 @@ SnapRAID sperrt Ihre Daten nicht ein; Sie können die Verwendung
|
|||
jederzeit beenden, ohne neu formatieren oder Daten verschieben zu müssen.
|
||||
.IP \(bu
|
||||
Um auf eine Datei zuzugreifen, muss nur eine einzige Festplatte
|
||||
drehen (spinnen), was Strom spart und Geräusche reduziert.
|
||||
anlaufen (drehen), was Strom spart und Geräusche reduziert.
|
||||
.PD
|
||||
.PP
|
||||
Für weitere Informationen besuchen Sie bitte die offizielle SnapRAID\-Website:
|
||||
|
|
@ -117,26 +117,34 @@ https://www.snapraid.it/
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH LIMITATIONS
|
||||
SnapRAID ist ein Hybrid aus einem RAID\- und einem Sicherungsprogramm,
|
||||
das darauf abzielt, die besten Vorteile beider zu kombinieren.
|
||||
Es hat jedoch einige Einschränkungen, die Sie vor der Verwendung
|
||||
berücksichtigen sollten.
|
||||
.SH EINSCHRäNKUNGEN (LIMITATIONS)
|
||||
SnapRAID ist ein Hybrid aus RAID und einem Backup\-Programm mit dem Ziel, die
|
||||
besten Vorteile von beiden zu kombinieren. Es hat jedoch einige Einschränkungen, die Sie
|
||||
vor der Verwendung berücksichtigen sollten.
|
||||
.PP
|
||||
Die Haupteinschränkung besteht darin, dass wenn eine Festplatte
|
||||
ausfällt und Sie in letzter Zeit keine Synchronisierung durchgeführt haben,
|
||||
Sie möglicherweise nicht vollständig wiederherstellen können.
|
||||
Genauer gesagt können Sie möglicherweise nicht bis zur Größe der
|
||||
geänderten oder gelöschten Dateien seit der letzten \`sync\`\-Operation
|
||||
wiederherstellen. Dies tritt auch dann auf, wenn die geänderten oder
|
||||
gelöschten Dateien sich nicht auf der ausgefallenen Festplatte befinden.
|
||||
Aus diesem Grund ist SnapRAID besser für Daten geeignet, die sich
|
||||
selten ändern.
|
||||
Die Haupteinschränkung besteht darin, dass Sie bei einem Festplattenausfall Daten nur bis zum
|
||||
Zustand des letzten \`sync\`\-Vorgangs wiederherstellen können. Alle Daten, die seit dem
|
||||
letzten Sync hinzugefügt oder geändert wurden und sich auf der ausgefallenen Festplatte befinden, gehen verloren.
|
||||
.PP
|
||||
Andererseits verhindern neu hinzugefügte Dateien die Wiederherstellung
|
||||
von bereits vorhandenen Dateien nicht. Sie verlieren nur die
|
||||
kürzlich hinzugefügten Dateien, wenn diese sich auf der ausgefallenen
|
||||
Festplatte befinden.
|
||||
Daher eignet sich SnapRAID in erster Linie für Daten, die sich selten ändern.
|
||||
.PP
|
||||
Für Daten, die beim letzten Sync bereits existierten, hängt die Wiederherstellungszuverlässigkeit
|
||||
davon ab, ob die Option \`snapshot\` verwendet wird:
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Mit Snapshot\-Unterstützung (verfügbar auf Btrfs, ZFS, Bcachefs und NTFS)
|
||||
kann SnapRAID automatisch eine eingefrorene Referenz Ihrer Datenträger beibehalten.
|
||||
Dies stellt sicher, dass der Wiederherstellungsprozess konsistent und zuverlässig bleibt,
|
||||
selbst wenn Sie während oder nach einem Sync Dateien auf Ihrem Live\-Dateisystem ändern oder löschen.
|
||||
.PD
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Ohne Snapshot\-Unterstützung kann das Löschen oder Ändern von Dateien nach einem \`sync\`
|
||||
die vollständige Wiederherstellung anderer ausgefallener Festplatten verhindern. Dies geschieht,
|
||||
weil die Parität nicht mehr mit den geänderten Dateien übereinstimmt, selbst wenn
|
||||
sich diese Dateien nicht auf der ausgefallenen Festplatte befinden. Neu hinzugefügte
|
||||
Dateien verhindern dagegen die Wiederherstellung bereits vorhandener Dateien nicht.
|
||||
.PD
|
||||
.PP
|
||||
Weitere Einschränkungen von SnapRAID sind:
|
||||
.PD 0
|
||||
|
|
@ -144,7 +152,7 @@ Weitere Einschränkungen von SnapRAID sind:
|
|||
Mit SnapRAID haben Sie immer noch separate Dateisysteme für jede
|
||||
Festplatte. Mit RAID erhalten Sie ein einziges großes Dateisystem.
|
||||
.IP \(bu
|
||||
SnapRAID streift (stripes) keine Daten.
|
||||
SnapRAID verwendet kein Data\-Striping (Verteilen von Datenblöcken).
|
||||
Mit RAID erhalten Sie einen Geschwindigkeitsvorteil durch Striping.
|
||||
.IP \(bu
|
||||
SnapRAID unterstützt keine Echtzeit\-Wiederherstellung.
|
||||
|
|
@ -152,20 +160,20 @@ Mit RAID müssen Sie die Arbeit nicht unterbrechen, wenn eine
|
|||
Festplatte ausfällt.
|
||||
.IP \(bu
|
||||
SnapRAID kann Daten nur von einer begrenzten Anzahl von Festplattenausfällen
|
||||
wiederherstellen. Mit einer Sicherung können Sie von einem
|
||||
wiederherstellen. Mit einer Sicherung können Sie Daten nach einem
|
||||
vollständigen Ausfall des gesamten Festplatten\-Arrays wiederherstellen.
|
||||
.IP \(bu
|
||||
Nur Dateinamen, Zeitstempel, symbolische Links (symlinks) und
|
||||
Hardlinks werden gespeichert. Berechtigungen, Eigentümerschaft
|
||||
und erweiterte Attribute werden nicht gespeichert.
|
||||
.PD
|
||||
.SH GETTING STARTED
|
||||
.SH ERSTE SCHRITTE (GETTING STARTED)
|
||||
Um SnapRAID zu verwenden, müssen Sie zuerst eine Festplatte in Ihrem
|
||||
Festplatten\-Array auswählen, die für \`parity\`\-Informationen
|
||||
reserviert wird. Mit einer Festplatte für Parität können Sie von
|
||||
einem einzelnen Festplattenausfall wiederherstellen, ähnlich wie bei RAID5.
|
||||
reserviert wird. Mit einer Festplatte für Parität können Sie Daten
|
||||
nach einem einzelnen Festplattenausfall wiederherstellen, ähnlich wie bei RAID5.
|
||||
.PP
|
||||
Wenn Sie von mehr Festplattenausfällen wiederherstellen möchten,
|
||||
Wenn Sie mehr Festplattenausfälle ausgleichen möchten,
|
||||
ähnlich wie bei RAID6, müssen Sie zusätzliche Festplatten für Parität
|
||||
reservieren. Jede zusätzliche Paritätsfestplatte ermöglicht die
|
||||
Wiederherstellung von einem weiteren Festplattenausfall.
|
||||
|
|
@ -309,7 +317,7 @@ Wenn dieser Befehl abgeschlossen ist, sind Ihre Daten SICHER.
|
|||
.PP
|
||||
Jetzt können Sie Ihr Array nach Belieben verwenden und die Paritätsinformationen
|
||||
regelmäßig durch Ausführen des \`sync\`\-Befehls aktualisieren.
|
||||
.SS Scrubbing
|
||||
.SS Scrubben (Scrubbing)
|
||||
Um die Daten und die Parität regelmäßig auf Fehler zu überprüfen,
|
||||
können Sie den Befehl \`scrub\` ausführen.
|
||||
.PP
|
||||
|
|
@ -373,10 +381,10 @@ kann Fehler melden, die durch entfernte oder geänderte Dateien
|
|||
verursacht wurden. Diese Fehler werden in der \`scrub\`\-Ausgabe
|
||||
gemeldet, aber die zugehörigen Blöcke werden nicht als fehlerhaft
|
||||
markiert.
|
||||
.SS Pooling
|
||||
.SS Zusammenführen (Pooling)
|
||||
Hinweis: Die unten beschriebene Pooling\-Funktion wurde durch das
|
||||
Tool mergerfs ersetzt, das jetzt die empfohlene Option für Linux\-Benutzer
|
||||
in der SnapRAID\-Community ist. Mergefs bietet eine flexiblere
|
||||
in der SnapRAID\-Community ist. Mergerfs bietet eine flexiblere
|
||||
und effizientere Möglichkeit, mehrere Laufwerke zu einem einzigen,
|
||||
vereinheitlichten Einhängepunkt (Mount Point) zusammenzufassen,
|
||||
was einen nahtlosen Zugriff auf Dateien über Ihr gesamtes Array
|
||||
|
|
@ -530,7 +538,7 @@ fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Undeleting
|
||||
.SS Wiederherstellen (Undeleting)
|
||||
SnapRAID funktioniert eher wie ein Sicherungsprogramm als ein RAID\-System
|
||||
und kann verwendet werden, um Dateien in ihren vorherigen Zustand
|
||||
wiederherzustellen oder das Löschen rückgängig zu machen, indem die
|
||||
|
|
@ -568,7 +576,7 @@ snapraid fix \-m
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Recovering
|
||||
.SS Wiederherstellung (Recovering)
|
||||
Das Schlimmste ist passiert, und Sie haben eine oder mehrere Festplatten
|
||||
verloren!
|
||||
.PP
|
||||
|
|
@ -683,19 +691,19 @@ snapraid sync
|
|||
.RE
|
||||
.PP
|
||||
Wenn alles wiederhergestellt ist, ist dieser Befehl sofort.
|
||||
.SH COMMANDS
|
||||
SnapRAID bietet einige einfache Befehle, mit denen Sie:
|
||||
.SH BEFEHLE (COMMANDS)
|
||||
SnapRAID bietet ein paar einfache Befehle, mit denen Sie folgende Aktionen ausführen können:
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Den Status des Arrays ausgeben \-> \`status\`
|
||||
.IP \(bu
|
||||
Die Festplatten steuern \-> \`smart\`, \`probe\`, \`up\`, \`down\`
|
||||
.IP \(bu
|
||||
Eine Sicherung/einen Snapshot erstellen \-> \`sync\`
|
||||
Einen Backup\-/Wiederherstellungspunkt erstellen \-> \`sync\`
|
||||
.IP \(bu
|
||||
Daten regelmäßig überprüfen \-> \`scrub\`
|
||||
.IP \(bu
|
||||
Die letzte Sicherung/den letzten Snapshot wiederherstellen \-> \`fix\`.
|
||||
Den letzten Backup\-/Wiederherstellungspunkt wiederherstellen \-> \`fix\`.
|
||||
.PD
|
||||
.PP
|
||||
Befehle müssen in Kleinbuchstaben geschrieben werden.
|
||||
|
|
@ -715,7 +723,7 @@ aufgelistet. Um sie zu beheben, können Sie den Befehl \`fix \-e\`
|
|||
verwenden.
|
||||
.PP
|
||||
Es zeigt auch ein Diagramm an, das den letzten Zeitpunkt darstellt,
|
||||
zu dem jeder Block gescrubbed oder synchronisiert wurde. Gescrubbed
|
||||
zu dem jeder Block gescrubbed oder synchronisiert wurde. Gescrubbte
|
||||
Blöcke werden mit \`*\`, Blöcke, die synchronisiert, aber noch nicht
|
||||
gescrubbed wurden, mit \`o\` angezeigt.
|
||||
.PP
|
||||
|
|
@ -724,7 +732,7 @@ Es wird nichts geändert.
|
|||
Gibt einen SMART\-Bericht aller Festplatten im System aus.
|
||||
.PP
|
||||
Es enthält eine Schätzung der Ausfallwahrscheinlichkeit im nächsten
|
||||
Jahr, sodass Sie die Wartungsersetzung von Festplatten planen können,
|
||||
Jahr, sodass Sie den vorsorglichen Austausch von Festplatten planen können,
|
||||
die verdächtige Attribute aufweisen.
|
||||
.PP
|
||||
Diese Wahrscheinlichkeitsschätzung wird durch Korrelation der SMART\-Attribute
|
||||
|
|
@ -959,14 +967,14 @@ Blöcke zu markieren.
|
|||
Die \`parity\`\-Dateien werden NICHT geändert.
|
||||
Die Dateien im Array werden NICHT geändert.
|
||||
.SS fix
|
||||
Behebt alle Dateien und die Paritätsdaten.
|
||||
Repariert alle Dateien und die Paritätsdaten.
|
||||
.PP
|
||||
Alle Dateien und Paritätsdaten werden mit dem Snapshot\-Zustand
|
||||
verglichen, der beim letzten \`sync\` gespeichert wurde.
|
||||
Wenn eine Abweichung gefunden wird, wird sie auf den gespeicherten
|
||||
Snapshot zurückgesetzt.
|
||||
Alle Dateien und Paritätsdaten werden mit dem im letzten \`sync\`
|
||||
gespeicherten Zustand verglichen. Wenn ein Unterschied gefunden
|
||||
wird, wird er auf den gespeicherten Zustand zurückgesetzt.
|
||||
.PP
|
||||
WARNUNG! Der Befehl \`fix\` unterscheidet nicht zwischen Fehlern und
|
||||
WARNUNG!
|
||||
Der Befehl \`fix\` unterscheidet nicht zwischen Fehlern und
|
||||
beabsichtigten Änderungen. Er setzt den Dateizustand bedingungslos
|
||||
auf den letzten \`sync\` zurück.
|
||||
.PP
|
||||
|
|
@ -1103,7 +1111,7 @@ Wenn Sie diese Dateien neu zuweisen möchten, können Sie die Option
|
|||
\-W, \-\-force\-realloc\-tail verwenden.
|
||||
Beachten Sie, dass solche Dateien während des Neuzuweisungsprozesses
|
||||
nicht durch die Parität geschützt sind.
|
||||
.SH OPTIONS
|
||||
.SH OPTIONEN (OPTIONS)
|
||||
SnapRAID bietet die folgenden Optionen:
|
||||
.TP
|
||||
.B \-c, \-\-conf CONFIG
|
||||
|
|
@ -1219,9 +1227,9 @@ Befehlsfehler sicher gestoppt werden.
|
|||
.B \-w, \-\-bw\-limit RATE
|
||||
Wendet eine globale Bandbreitenbegrenzung für alle Festplatten
|
||||
an. RATE ist die Anzahl der Bytes pro Sekunde. Sie können
|
||||
einen Multiplikator wie K, M oder G angeben (z.B. \-\-bw\-limit 1G).
|
||||
einen Multiplikator wie K, M, G oder T angeben (z.B. \-\-bw\-limit 1G).
|
||||
.TP
|
||||
.B \-t, \-\-tail GRÖSSE
|
||||
.B \-t, \-\-tail SIZE
|
||||
Beschränkt die Dateiliste auf diejenigen, die nicht mehr als die
|
||||
angegebene Tail\-Größe der Paritätsfestplatten belegen.
|
||||
Sie können Multiplikatoren wie K, M, G oder T verwenden (z. B. \-\-tail 1G).
|
||||
|
|
@ -1251,7 +1259,7 @@ Erzwingt den unsicheren Vorgang der Synchronisierung einer Datei
|
|||
mit Nullgröße, die zuvor nicht Null war. Wenn SnapRAID eine
|
||||
solche Bedingung erkennt, stoppt es den Vorgang, es sei denn,
|
||||
Sie geben diese Option an. Dies ermöglicht es Ihnen, leicht zu
|
||||
erkennen, wann nach einem Systemabsturz einige zugegriffene Dateien
|
||||
erkennen, wann nach einem Systemabsturz einige Dateien, auf die zugegriffen wurde,
|
||||
abgeschnitten (truncated) wurden. Dies ist eine mögliche Bedingung
|
||||
unter Linux mit den ext3/ext4\-Dateisystemen.
|
||||
Diese Option kann nur mit \`sync\` verwendet werden.
|
||||
|
|
@ -1286,7 +1294,7 @@ Festplatten oder mit Festplatten auf demselben physischen Gerät.
|
|||
Wenn Sie beispielsweise zwei Datenfestplatten verloren haben und
|
||||
eine Ersatzfestplatte haben, um nur die erste wiederherzustellen,
|
||||
können Sie die zweite unzugängliche Festplatte ignorieren.
|
||||
Oder wenn Sie eine Festplatte in dem auf einer bereits
|
||||
Oder wenn Sie eine Festplatte auf dem auf einer bereits
|
||||
verwendeten Festplatte verbleibenden freien Speicherplatz
|
||||
wiederherstellen möchten, wobei sie dasselbe physische Gerät
|
||||
gemeinsam nutzen.
|
||||
|
|
@ -1330,9 +1338,9 @@ WARNUNG! Diese Option ist nur für Experten gedacht, und es wird
|
|||
dringend empfohlen, sie nicht zu verwenden.
|
||||
Sie haben während der \`sync\`\-Operation KEINEN Datenschutz.
|
||||
.TP
|
||||
.B \-W, \-\-force\-realloc\-tail GRÖSSE
|
||||
.B \-W, \-\-force\-realloc\-tail SIZE
|
||||
Funktioniert wie \-R, \-\-force\-realloc, ist jedoch auf den angegebenen
|
||||
Endbereich (die letzten GRÖSSE Bytes) jeder Paritätsdatei beschränkt.
|
||||
Endbereich (die letzten SIZE Bytes) jeder Paritätsdatei beschränkt.
|
||||
Erzwingt die Neuzuweisung (Verschiebung) aller Dateifragmente/\-blöcke, die
|
||||
derzeit in diesem Endabschnitt gespeichert sind, sodass sie an beliebiger Stelle
|
||||
in den Paritätsdateien platziert werden können, wo freier Speicherplatz
|
||||
|
|
@ -1393,7 +1401,7 @@ Diese Option ist hauptsächlich für die erweiterte manuelle
|
|||
Wiederherstellung gedacht.
|
||||
.TP
|
||||
.B \-C, \-\-gen\-conf CONTENT
|
||||
Generiert eine Dummy\-Konfigurationsdatei aus einer vorhandenen
|
||||
Generiert eine Dummy\-Konfigurationsdatei aus einer bestehenden
|
||||
Content\-Datei. Die Konfigurationsdatei wird in die Standardausgabe
|
||||
geschrieben und überschreibt keine vorhandene.
|
||||
Diese Konfigurationsdatei enthält auch die Informationen,
|
||||
|
|
@ -1419,7 +1427,7 @@ Gibt eine kurze Hilfeanzeige aus.
|
|||
.TP
|
||||
.B \-V, \-\-version
|
||||
Gibt die Programmversion aus.
|
||||
.SH CONFIGURATION
|
||||
.SH KONFIGURATION (CONFIGURATION)
|
||||
SnapRAID benötigt eine Konfigurationsdatei, um zu wissen, wo sich
|
||||
Ihr Festplatten\-Array befindet und wo die Paritätsinformationen
|
||||
gespeichert werden sollen.
|
||||
|
|
@ -1432,9 +1440,8 @@ Verzeichnis wie \`snapraid.exe\` verwendet.
|
|||
Sie muss die folgenden Optionen (Groß\- und Kleinschreibung beachten)
|
||||
enthalten:
|
||||
.SS parity FILE [,FILE] ...
|
||||
Definiert die Dateien, die zum Speichern der Paritätsinformationen
|
||||
verwendet werden sollen. Die Parität ermöglicht den Schutz
|
||||
vor einem einzelnen Festplattenausfall, ähnlich wie bei RAID5.
|
||||
Definiert die Dateien, die zum Speichern der Paritätsinformationen verwendet werden.
|
||||
Die Parität ermöglicht den Schutz vor einem einzelnen Festplattenausfall, ähnlich wie bei RAID5.
|
||||
.PP
|
||||
Sie können mehrere Dateien angeben, die sich auf unterschiedlichen
|
||||
Festplatten befinden müssen. Wenn eine Datei nicht mehr wachsen
|
||||
|
|
@ -1453,8 +1460,7 @@ um die Warnung vor vollen Festplatten zu vermeiden.
|
|||
.PP
|
||||
Diese Option ist obligatorisch und kann nur einmal verwendet werden.
|
||||
.SS (2,3,4,5,6)\-parity FILE [,FILE] ...
|
||||
Definiert die Dateien, die zum Speichern zusätzlicher Paritätsinformationen
|
||||
verwendet werden sollen.
|
||||
Definiert die Dateien, die zum Speichern zusätzlicher Paritätsinformationen verwendet werden.
|
||||
.PP
|
||||
Für jede angegebene Paritätsstufe wird eine zusätzliche Schutzstufe
|
||||
aktiviert:
|
||||
|
|
@ -1496,8 +1502,8 @@ Es ist möglich, von einem Format in ein anderes zu konvertieren,
|
|||
indem die Konfigurationsdatei mit der gewünschten z\-parity\- oder
|
||||
3\-parity\-Datei angepasst und \`fix\` zur Neuerstellung verwendet wird.
|
||||
.SS content FILE
|
||||
Definiert die Datei, die zum Speichern der Liste und Prüfsummen
|
||||
aller im Festplatten\-Array vorhandenen Dateien verwendet werden soll.
|
||||
Definiert die Datei, die zum Speichern der Liste und der Prüfsummen aller
|
||||
im Festplatten\-Array vorhandenen Dateien verwendet wird.
|
||||
.PP
|
||||
Sie kann auf einer für Daten, Parität oder einer anderen
|
||||
verfügbaren Festplatte platziert werden.
|
||||
|
|
@ -1510,10 +1516,9 @@ um mehrere Kopien derselben Datei zu speichern.
|
|||
Sie müssen mindestens eine Kopie für jede verwendete Paritätsfestplatte
|
||||
plus eine speichern. Die Verwendung zusätzlicher Kopien schadet nicht.
|
||||
.SS data NAME DIR
|
||||
Definiert den Namen und den Einhängepunkt (Mount Point) der
|
||||
Datenfestplatten im Array. NAME wird zur Identifizierung der
|
||||
Festplatte verwendet und muss eindeutig sein. DIR ist der
|
||||
Einhängepunkt der Festplatte im Dateisystem.
|
||||
Definiert den Namen und Einhängepunkt der Datenfestplatten im Array. NAME
|
||||
wird zur Identifizierung der Festplatte verwendet und muss eindeutig sein.
|
||||
DIR ist der Einhängepunkt der Festplatte im Dateisystem.
|
||||
.PP
|
||||
Sie können den Einhängepunkt nach Bedarf ändern, solange Sie
|
||||
den NAME unverändert lassen.
|
||||
|
|
@ -1534,6 +1539,29 @@ z. B. die Boot\-Festplatte.
|
|||
.PP
|
||||
Beachten Sie, dass solche Festplatten nicht von den Befehlen \`up\` und \`down\`
|
||||
betroffen sind, da von ihnen erwartet wird, dass sie sich immer drehen.
|
||||
.SS snapshot
|
||||
Aktiviert die Verwendung von Dateisystem\-Snapshots für die Befehle \`sync\`, \`scrub\`,
|
||||
\`check\` und \`fix\`.
|
||||
.PP
|
||||
Wenn aktiviert, erstellt SnapRAID zu Beginn eines \'sync\' einen schreibgeschützten
|
||||
Snapshot Ihrer Daten. Dies gewährleistet eine konsistente Point\-in\-Time\-Ansicht
|
||||
Ihrer Dateien und verhindert Fehler, die durch gleichzeitige Dateiänderungen verursacht werden.
|
||||
.PP
|
||||
Dies verbessert die Wiederherstellung erheblich: Wenn eine Datei aus dem
|
||||
Live\-Dateisystem gelöscht wird, bleibt sie im Snapshot erhalten. Dies verhindert,
|
||||
dass die Parität für diesen Block \[dq]beschädigt\[dq] wird, sodass Sie Daten immer noch
|
||||
erfolgreich wiederherstellen können, wenn eine andere Festplatte ausfällt.
|
||||
.PP
|
||||
Diese Option gilt ausschließlich für Datenträger, die mit den Dateisystemen
|
||||
Btrfs, Bcachefs oder ZFS unter Linux und NTFS unter Windows formatiert sind.
|
||||
Paritätsfestplatten oder Datenträger mit anderen Dateisystemen verwenden immer
|
||||
die Live\-Version des Dateisystems.
|
||||
.PP
|
||||
Das Erstellen und Löschen von Snapshots erfordert Administratorrechte.
|
||||
Stellen Sie sicher, dass SnapRAID mit den erforderlichen Berechtigungen (z. B. sudo)
|
||||
ausgeführt wird, wenn diese Option aktiviert ist.
|
||||
.PP
|
||||
Eine detaillierte Erklärung des Snapshot\-Lebenszyklus finden Sie im Abschnitt SNAPSHOTS.
|
||||
.SS nohidden
|
||||
Schließt alle versteckten Dateien und Verzeichnisse aus.
|
||||
Unter Unix sind versteckte Dateien solche, die mit \`.\` beginnen.
|
||||
|
|
@ -1731,6 +1759,9 @@ In den angegebenen OPTIONS wird die Zeichenfolge \`%s\` durch den
|
|||
Gerätenamen ersetzt. Bei RAID\-Controllern ist das Gerät
|
||||
wahrscheinlich fest, und Sie müssen \`%s\` möglicherweise nicht verwenden.
|
||||
.PP
|
||||
Sie können auch eine benutzerdefinierte Info\-Optionszeichenfolge mit dem
|
||||
Tag \`[info: ...]\` angeben, um die Standardoption \`\-a\` zu ersetzen.
|
||||
.PP
|
||||
Weitere mögliche Optionen finden Sie in der smartmontools\-Dokumentation:
|
||||
.PP
|
||||
.RS 4
|
||||
|
|
@ -1746,6 +1777,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices
|
|||
Zum Beispiel:
|
||||
.PP
|
||||
.RS 4
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl parity \-d sat %s
|
||||
.PD 0
|
||||
.PD
|
||||
|
|
@ -1762,23 +1797,33 @@ ist. PARITY ist einer der Paritätsnamen: \`parity\`, \`2\-parity\`,
|
|||
Der Sonderwert * kann verwendet werden, um das Attribut auf allen
|
||||
Festplatten zu ignorieren.
|
||||
.PP
|
||||
Um beispielsweise das Attribut \`Current Pending Sector Count\` auf allen
|
||||
Festplatten zu ignorieren:
|
||||
Es können mehrere Attribute durch Leerzeichen getrennt angegeben werden.
|
||||
Jedes Attribut kann als Nummer von 1 bis 255 oder als Name ohne
|
||||
Berücksichtigung der Groß\-/Kleinschreibung (z. B. \`Current_Pending_Sector\`)
|
||||
angegeben werden.
|
||||
.PP
|
||||
Um beispielsweise das Attribut \`Current Pending Sector Count\` und
|
||||
\`Reallocated Sectors Count\` auf allen Festplatten über ihre Nummer
|
||||
oder ihren Namen zu ignorieren:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore * 197
|
||||
smartignore * 197 5
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.PP
|
||||
Um es nur auf der ersten Paritätsfestplatte zu ignorieren:
|
||||
Um sie nur auf der ersten Paritätsfestplatte zu ignorieren:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore parity 197
|
||||
smartignore parity 197 5
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Examples
|
||||
.SS Beispiele (Examples)
|
||||
Ein Beispiel für eine typische Konfiguration für Unix ist:
|
||||
.PP
|
||||
.RS 4
|
||||
|
|
@ -1814,7 +1859,7 @@ exclude /tmp/
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1886,7 +1931,123 @@ smartctl 2\-parity \-d areca,2/1 /dev/arcmsr0
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH PATTERN
|
||||
.SH SNAPSHOTS
|
||||
Wenn die Snapshot\-Option in der Konfiguration aktiviert ist, nutzt SnapRAID
|
||||
die Dateisystem\-Snapshot\-Funktionalität, um atomare und konsistente Operationen zu gewährleisten.
|
||||
.PP
|
||||
Die Verwaltung von Snapshots erfolgt vollständig automatisch und transparent.
|
||||
Sie können SnapRAID genau wie bisher verwenden, wobei der zusätzliche Schutz
|
||||
durch Snapshots vollständig im Hintergrund abgewickelt wird.
|
||||
.PP
|
||||
Dies bietet zwei wesentliche Vorteile:
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I Konsistenz
|
||||
Dateien, die während eines lang laufenden Syncs oder Scrubs auf dem Live\-Dateisystem
|
||||
geändert werden, verursachen keine Paritätskonflikte oder abgebrochenen Operationen,
|
||||
da SnapRAID ein eingefrorenes Point\-in\-Time\-Abbild sieht.
|
||||
.HP 4
|
||||
.I Wiederherstellung
|
||||
Wenn eine Datei im Live\-Dateisystem aktualisiert oder gelöscht wird,
|
||||
bleibt sie im Snapshot erhalten. Wenn ein Festplattenausfall auftritt,
|
||||
bevor der nächste Sync ausgeführt wird, verwendet SnapRAID die im Snapshot konservierten Daten,
|
||||
um die ausgefallene Festplatte zu rekonstruieren.
|
||||
.PD
|
||||
.PP
|
||||
.RS 4
|
||||
.PD 0
|
||||
Im Falle eines Festplattenausfalls während eines aktiven Sync\-Vorgangs
|
||||
ist SnapRAID auch in der Lage, automatisch sowohl aus dem Snapshot
|
||||
der vorherigen Paritätsberechnung als auch aus der aktuellen zu lesen.
|
||||
Dies maximiert die Wahrscheinlichkeit einer vollständigen Wiederherstellung, indem
|
||||
Zugriff auf die genauen Datenblöcke gewährt wird, die zur Lösung der Paritätsgleichungen
|
||||
erforderlich sind, selbst wenn diese Blöcke zwischen den Syncs geändert oder gelöscht wurden.
|
||||
.PD
|
||||
.PP
|
||||
.PD 0
|
||||
Ohne Snapshots führt eine aktualisierte oder gelöschte Datei auf einer gesunden
|
||||
Festplatte zu fehlenden Datenblöcken, die möglicherweise zur Reparatur
|
||||
anderer ausgefallener Festplatten benötigt werden.
|
||||
.PD
|
||||
.RE
|
||||
.RE
|
||||
.PP
|
||||
Snapshots werden nur für Datenträger erstellt und nur dann, wenn das zugrunde liegende
|
||||
Dateisystem diese Funktionalität unterstützt. Paritätsfestplatten verwenden immer
|
||||
das Live\-Dateisystem.
|
||||
.PP
|
||||
Derzeit wird dies auf Btrfs, Bcachefs und ZFS unter Linux
|
||||
und auf NTFS unter Windows unterstützt.
|
||||
.PP
|
||||
Sie können Datenträger mit unterschiedlichen Dateisystemen mischen. Nur diejenigen, die
|
||||
Snapshots unterstützen, werden diese nutzen, während andere Festplatten weiterhin
|
||||
direkt auf dem Live\-Dateisystem arbeiten.
|
||||
.PP
|
||||
Das Erstellen und Löschen von Snapshots erfordert Administratorrechte.
|
||||
Stellen Sie sicher, dass SnapRAID mit den erforderlichen Berechtigungen (z. B. sudo)
|
||||
ausgeführt wird, wenn Snapshots aktiviert sind.
|
||||
.SS Befehlsverhalten mit Snapshots (Command Behavior with Snapshots)
|
||||
Die Befehle \`sync\` und \`scrub\` arbeiten beide ausschließlich auf Snapshots,
|
||||
um sicherzustellen, dass alle Datenoperationen auf einem konsistenten,
|
||||
eingefrorenen Zustand ausgeführt werden. Durch die Nutzung dieser Snapshots verhindert SnapRAID Paritätskonflikte,
|
||||
die andernfalls durch gleichzeitige Dateiänderungen auf dem Live\-Dateisystem ausgelöst würden.
|
||||
Während eines \`sync\` verwendet der Befehl einen neuen Snapshot, der zu Beginn des Prozesses
|
||||
erstellt wurde, um den aktuellen Zustand für die Paritätsberechnung zu erfassen.
|
||||
Im Gegensatz dazu verwendet der Befehl \`scrub\` den letzten Snapshot, also den, der
|
||||
während des letzten erfolgreichen Syncs erstellt wurde, um einen zuverlässigen Referenzpunkt
|
||||
beizubehalten, der mit der vorhandenen Parität übereinstimmt.
|
||||
.PP
|
||||
Bei den Befehlen \`check\` und \`fix\` hängt die Verwendung des letzten Snapshots
|
||||
davon ab, ob bestimmte Festplatten mit der Option \-d, \-\-filter\-disk ausgewählt wurden.
|
||||
.PP
|
||||
Eine explizit über \-d ausgewählte Festplatte (das „Ziel“ der Operation)
|
||||
verwendet immer das Live\-Dateisystem. Für \`fix\` ermöglicht dies das Wiederherstellen
|
||||
von Daten auf dem aktiven Festplattenersatz. Für \`check\` ermöglicht es die Simulation
|
||||
des \`fix\`\-Vorgangs unter denselben Bedingungen.
|
||||
.PP
|
||||
Auf alle anderen Datenträger (die „Referenz“\-Festplatten) wird über ihre Snapshots zugegriffen.
|
||||
Dies stellt sicher, dass SnapRAID selbst dann, wenn Sie während einer laufenden Wiederherstellung
|
||||
Dateien auf Ihren gesunden Festplatten ändern, eine stabile, eingefrorene Referenz hat,
|
||||
um die Paritätsgleichungen zu lösen.
|
||||
.PP
|
||||
Wenn keine Option \-d angegeben ist, nimmt SnapRAID an, dass die Operation für das gesamte Array gilt.
|
||||
In diesem Fall verwenden \`check\` und \`fix\` ausschließlich die Live\-Dateisysteme.
|
||||
.PP
|
||||
Alle anderen Befehle arbeiten ausschließlich auf dem Live\-Dateisystem.
|
||||
.SH LEBENSZYKLUS VON SNAPSHOTS (SNAPSHOTS LIFECYCLE)
|
||||
SnapRAID verwaltet zwei spezifische Snapshots, \`stable\` und \`pending\`,
|
||||
in einem versteckten Verzeichnis im Stammverzeichnis jedes Daten\-Subvolumes.
|
||||
Unter Btrfs, Bcachefs und NTFS wird das Verzeichnis \`.snapraid/\` verwendet,
|
||||
unter ZFS das Standardverzeichnis \`.zfs/snapshot/\`.
|
||||
.PP
|
||||
Der \`stable\`\-Snapshot repräsentiert den Zustand des letzten
|
||||
erfolgreich abgeschlossenen \`sync\` und enthält die genauen Daten, die zur
|
||||
Berechnung der aktuellen Parität verwendet wurden. Er dient als primäre Datenquelle
|
||||
für die Befehle \`scrub\`, \`check\` und \`fix\`.
|
||||
.PP
|
||||
Der \`pending\`\-Snapshot ist ein temporäres Abbild, das zu Beginn eines \`sync\`
|
||||
erstellt wird, um einen eingefrorenen Zustand für die Paritätsberechnung bereitzustellen.
|
||||
Nach erfolgreichem Abschluss des Vorgangs wird der vorherige \`stable\`\-Snapshot gelöscht
|
||||
und der \`pending\`\-Snapshot wird heraufgestuft, um seinen Platz als neue stabile Referenz einzunehmen.
|
||||
.PP
|
||||
Wenn ein \`sync\` unterbrochen wird, bleibt der \`pending\`\-Snapshot erhalten.
|
||||
Nachfolgende \`scrub\`\-, \`check\`\- und \`fix\`\-Befehle verwenden diesen ausstehenden Snapshot,
|
||||
da er mit dem in der .content\-Datei aufgezeichneten Dateisystemzustand übereinstimmt,
|
||||
selbst wenn die Parität nur teilweise synchronisiert ist.
|
||||
.PP
|
||||
Im Falle einer \`sync\`\-Unterbrechung lesen die Befehle \`check\` und \`fix\`
|
||||
auch aus dem \`stable\`\-Snapshot, um Datenblöcke von Dateien abzurufen,
|
||||
die während des Syncs aktualisiert oder gelöscht wurden.
|
||||
Dies ist möglich, da die .content\-Datei Metadaten für alle geänderten oder
|
||||
gelöschten Dateien während des gesamten Sync\-Prozesses aufbewahrt.
|
||||
Diese historischen Informationen werden erst gelöscht, wenn ein Sync erfolgreich abgeschlossen
|
||||
und die endgültige Version der .content\-Datei gespeichert wurde.
|
||||
.PP
|
||||
Wenn ein \`sync\` nach einer Unterbrechung neu gestartet wird, wird der vorhandene
|
||||
ausstehende (pending) Snapshot gelöscht und ein neuer erstellt, um den
|
||||
aktuellen Zustand des Live\-Dateisystems zu erfassen.
|
||||
.SH MUSTER (PATTERN)
|
||||
Muster bieten eine flexible Möglichkeit, Dateien für die Einbeziehung oder
|
||||
den Ausschluss zu filtern. Durch die Verwendung von Globbing\-Zeichen können Sie Regeln definieren,
|
||||
die mit bestimmten Dateinamen oder ganzen Verzeichnisstrukturen übereinstimmen, ohne
|
||||
|
|
@ -2073,7 +2234,7 @@ snapraid \-f \[dq]*.mp3\[dq] check
|
|||
.PP
|
||||
Unter Unix müssen Sie Globbing\-Zeichen in der Befehlszeile in
|
||||
Anführungszeichen setzen, um zu verhindern, dass die Shell sie erweitert.
|
||||
.SH DATEIEN IGNORIEREN
|
||||
.SH DATEIEN IGNORIEREN (IGNORE FILE)
|
||||
Zusätzlich zu den globalen Regeln in der Konfigurationsdatei können Sie
|
||||
\`.snapraidignore\`\-Dateien in jedem Verzeichnis innerhalb des Arrays platzieren,
|
||||
um dezentrale Ausschlussregeln zu definieren.
|
||||
|
|
@ -2133,7 +2294,7 @@ build/
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH CONTENT
|
||||
.SH INHALT (CONTENT)
|
||||
SnapRAID speichert die Liste und Prüfsummen Ihrer Dateien in der
|
||||
Content\-Datei.
|
||||
.PP
|
||||
|
|
@ -2141,9 +2302,12 @@ Es ist eine Binärdatei, die alle im Festplatten\-Array vorhandenen
|
|||
Dateien auflistet, zusammen mit allen Prüfsummen zur Überprüfung
|
||||
ihrer Integrität.
|
||||
.PP
|
||||
Diese Datei wird von den Befehlen \`sync\` und \`scrub\` gelesen und
|
||||
geschrieben und von den Befehlen \`fix\`, \`check\` und \`status\` gelesen.
|
||||
.SH PARITY
|
||||
Die Content\-Datei wird von den Befehlen \`sync\`, \`scrub\`, \`touch\` und
|
||||
\`rehash\` gelesen und geschrieben. Sie wird von den Befehlen \`status\`,
|
||||
\`diff\`, \`check\`, \`fix\`, \`list\`, \`dup\`, \`locate\` und \`pool\` gelesen und
|
||||
von den Befehlen \`smart\`, \`probe\`, \`up\`, \`down\` und \`devices\` vollständig
|
||||
ignoriert.
|
||||
.SH PARITäT (PARITY)
|
||||
SnapRAID speichert die Paritätsinformationen Ihres Arrays in den
|
||||
Paritätsdateien.
|
||||
.PP
|
||||
|
|
@ -2152,7 +2316,7 @@ Dies sind Binärdateien, die die berechnete Parität aller in der
|
|||
.PP
|
||||
Diese Dateien werden von den Befehlen \`sync\` und \`fix\` gelesen
|
||||
und geschrieben und nur von den Befehlen \`scrub\` und \`check\` gelesen.
|
||||
.SH ENCODING
|
||||
.SH KODIERUNG (ENCODING)
|
||||
SnapRAID ignoriert unter Unix jede Kodierung. Es liest und speichert
|
||||
die Dateinamen mit derselben Kodierung, die vom Dateisystem
|
||||
verwendet wird.
|
||||
|
|
@ -2166,7 +2330,25 @@ eine TrueType\-Schriftart wie \`Lucida Console\` als Konsolenschriftart
|
|||
verwenden. Dies betrifft nur die gedruckten Dateinamen; wenn Sie
|
||||
die Konsolenausgabe in eine Datei umleiten, ist die resultierende
|
||||
Datei immer im UTF\-8\-Format.
|
||||
.SH EXIT\-CODE (EXIT CODE)
|
||||
SnapRAID endet mit den folgenden Fehlercodes:
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I 0
|
||||
Alles OK.
|
||||
.HP 4
|
||||
.I 1
|
||||
Der Befehl ist auf Fehler gestoßen.
|
||||
.HP 4
|
||||
.I 2
|
||||
Der Befehl \`diff\` hat festgestellt, dass alles OK ist, aber ein \`sync\` erforderlich ist.
|
||||
.PD
|
||||
.RE
|
||||
.SH ÜBERSETZUNG (TRANSLATION)
|
||||
Dieses Dokument ist eine automatische Übersetzung des englischen Handbuchs.
|
||||
Die maßgebliche Version finden Sie im englischen Handbuch.
|
||||
.SH COPYRIGHT
|
||||
Diese Datei ist Copyright (C) 2025 Andrea Mazzoleni
|
||||
.SH SEE ALSO
|
||||
snapraid_log(1), snapraidd(1)
|
||||
Diese Datei ist Copyright (C) 2026 Andrea Mazzoleni
|
||||
.SH SIEHE AUCH (SEE ALSO)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ Synopsis
|
|||
|
||||
:snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
Description
|
||||
Beschreibung (Description)
|
||||
SnapRAID ist ein Sicherungsprogramm, das für Festplatten-Arrays
|
||||
entwickelt wurde und Paritätsinformationen zur Datenwiederherstellung
|
||||
bei Ausfall von bis zu sechs Festplatten speichert.
|
||||
|
|
@ -45,56 +45,60 @@ Description
|
|||
* SnapRAID sperrt Ihre Daten nicht ein; Sie können die Verwendung
|
||||
jederzeit beenden, ohne neu formatieren oder Daten verschieben zu müssen.
|
||||
* Um auf eine Datei zuzugreifen, muss nur eine einzige Festplatte
|
||||
drehen (spinnen), was Strom spart und Geräusche reduziert.
|
||||
anlaufen (drehen), was Strom spart und Geräusche reduziert.
|
||||
|
||||
Für weitere Informationen besuchen Sie bitte die offizielle SnapRAID-Website:
|
||||
|
||||
:https://www.snapraid.it/
|
||||
|
||||
Limitations
|
||||
SnapRAID ist ein Hybrid aus einem RAID- und einem Sicherungsprogramm,
|
||||
das darauf abzielt, die besten Vorteile beider zu kombinieren.
|
||||
Es hat jedoch einige Einschränkungen, die Sie vor der Verwendung
|
||||
berücksichtigen sollten.
|
||||
Einschränkungen (Limitations)
|
||||
SnapRAID ist ein Hybrid aus RAID und einem Backup-Programm mit dem Ziel, die
|
||||
besten Vorteile von beiden zu kombinieren. Es hat jedoch einige Einschränkungen, die Sie
|
||||
vor der Verwendung berücksichtigen sollten.
|
||||
|
||||
Die Haupteinschränkung besteht darin, dass wenn eine Festplatte
|
||||
ausfällt und Sie in letzter Zeit keine Synchronisierung durchgeführt haben,
|
||||
Sie möglicherweise nicht vollständig wiederherstellen können.
|
||||
Genauer gesagt können Sie möglicherweise nicht bis zur Größe der
|
||||
geänderten oder gelöschten Dateien seit der letzten `sync`-Operation
|
||||
wiederherstellen. Dies tritt auch dann auf, wenn die geänderten oder
|
||||
gelöschten Dateien sich nicht auf der ausgefallenen Festplatte befinden.
|
||||
Aus diesem Grund ist SnapRAID besser für Daten geeignet, die sich
|
||||
selten ändern.
|
||||
Die Haupteinschränkung besteht darin, dass Sie bei einem Festplattenausfall Daten nur bis zum
|
||||
Zustand des letzten `sync`-Vorgangs wiederherstellen können. Alle Daten, die seit dem
|
||||
letzten Sync hinzugefügt oder geändert wurden und sich auf der ausgefallenen Festplatte befinden, gehen verloren.
|
||||
|
||||
Andererseits verhindern neu hinzugefügte Dateien die Wiederherstellung
|
||||
von bereits vorhandenen Dateien nicht. Sie verlieren nur die
|
||||
kürzlich hinzugefügten Dateien, wenn diese sich auf der ausgefallenen
|
||||
Festplatte befinden.
|
||||
Daher eignet sich SnapRAID in erster Linie für Daten, die sich selten ändern.
|
||||
|
||||
Für Daten, die beim letzten Sync bereits existierten, hängt die Wiederherstellungszuverlässigkeit
|
||||
davon ab, ob die Option `snapshot` verwendet wird:
|
||||
|
||||
* Mit Snapshot-Unterstützung (verfügbar auf Btrfs, ZFS, Bcachefs und NTFS)
|
||||
kann SnapRAID automatisch eine eingefrorene Referenz Ihrer Datenträger beibehalten.
|
||||
Dies stellt sicher, dass der Wiederherstellungsprozess konsistent und zuverlässig bleibt,
|
||||
selbst wenn Sie während oder nach einem Sync Dateien auf Ihrem Live-Dateisystem ändern oder löschen.
|
||||
|
||||
* Ohne Snapshot-Unterstützung kann das Löschen oder Ändern von Dateien nach einem `sync`
|
||||
die vollständige Wiederherstellung anderer ausgefallener Festplatten verhindern. Dies geschieht,
|
||||
weil die Parität nicht mehr mit den geänderten Dateien übereinstimmt, selbst wenn
|
||||
sich diese Dateien nicht auf der ausgefallenen Festplatte befinden. Neu hinzugefügte
|
||||
Dateien verhindern dagegen die Wiederherstellung bereits vorhandener Dateien nicht.
|
||||
|
||||
Weitere Einschränkungen von SnapRAID sind:
|
||||
|
||||
* Mit SnapRAID haben Sie immer noch separate Dateisysteme für jede
|
||||
Festplatte. Mit RAID erhalten Sie ein einziges großes Dateisystem.
|
||||
* SnapRAID streift (stripes) keine Daten.
|
||||
* SnapRAID verwendet kein Data-Striping (Verteilen von Datenblöcken).
|
||||
Mit RAID erhalten Sie einen Geschwindigkeitsvorteil durch Striping.
|
||||
* SnapRAID unterstützt keine Echtzeit-Wiederherstellung.
|
||||
Mit RAID müssen Sie die Arbeit nicht unterbrechen, wenn eine
|
||||
Festplatte ausfällt.
|
||||
* SnapRAID kann Daten nur von einer begrenzten Anzahl von Festplattenausfällen
|
||||
wiederherstellen. Mit einer Sicherung können Sie von einem
|
||||
wiederherstellen. Mit einer Sicherung können Sie Daten nach einem
|
||||
vollständigen Ausfall des gesamten Festplatten-Arrays wiederherstellen.
|
||||
* Nur Dateinamen, Zeitstempel, symbolische Links (symlinks) und
|
||||
Hardlinks werden gespeichert. Berechtigungen, Eigentümerschaft
|
||||
und erweiterte Attribute werden nicht gespeichert.
|
||||
|
||||
Getting Started
|
||||
Erste Schritte (Getting Started)
|
||||
Um SnapRAID zu verwenden, müssen Sie zuerst eine Festplatte in Ihrem
|
||||
Festplatten-Array auswählen, die für `parity`-Informationen
|
||||
reserviert wird. Mit einer Festplatte für Parität können Sie von
|
||||
einem einzelnen Festplattenausfall wiederherstellen, ähnlich wie bei RAID5.
|
||||
reserviert wird. Mit einer Festplatte für Parität können Sie Daten
|
||||
nach einem einzelnen Festplattenausfall wiederherstellen, ähnlich wie bei RAID5.
|
||||
|
||||
Wenn Sie von mehr Festplattenausfällen wiederherstellen möchten,
|
||||
Wenn Sie mehr Festplattenausfälle ausgleichen möchten,
|
||||
ähnlich wie bei RAID6, müssen Sie zusätzliche Festplatten für Parität
|
||||
reservieren. Jede zusätzliche Paritätsfestplatte ermöglicht die
|
||||
Wiederherstellung von einem weiteren Festplattenausfall.
|
||||
|
|
@ -174,7 +178,7 @@ Getting Started
|
|||
Jetzt können Sie Ihr Array nach Belieben verwenden und die Paritätsinformationen
|
||||
regelmäßig durch Ausführen des `sync`-Befehls aktualisieren.
|
||||
|
||||
Scrubbing
|
||||
Scrubben (Scrubbing)
|
||||
Um die Daten und die Parität regelmäßig auf Fehler zu überprüfen,
|
||||
können Sie den Befehl `scrub` ausführen.
|
||||
|
||||
|
|
@ -219,10 +223,10 @@ Getting Started
|
|||
gemeldet, aber die zugehörigen Blöcke werden nicht als fehlerhaft
|
||||
markiert.
|
||||
|
||||
Pooling
|
||||
Zusammenführen (Pooling)
|
||||
Hinweis: Die unten beschriebene Pooling-Funktion wurde durch das
|
||||
Tool mergerfs ersetzt, das jetzt die empfohlene Option für Linux-Benutzer
|
||||
in der SnapRAID-Community ist. Mergefs bietet eine flexiblere
|
||||
in der SnapRAID-Community ist. Mergerfs bietet eine flexiblere
|
||||
und effizientere Möglichkeit, mehrere Laufwerke zu einem einzigen,
|
||||
vereinheitlichten Einhängepunkt (Mount Point) zusammenzufassen,
|
||||
was einen nahtlosen Zugriff auf Dateien über Ihr gesamtes Array
|
||||
|
|
@ -300,7 +304,7 @@ Getting Started
|
|||
|
||||
:fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
||||
|
||||
Undeleting
|
||||
Wiederherstellen (Undeleting)
|
||||
SnapRAID funktioniert eher wie ein Sicherungsprogramm als ein RAID-System
|
||||
und kann verwendet werden, um Dateien in ihren vorherigen Zustand
|
||||
wiederherzustellen oder das Löschen rückgängig zu machen, indem die
|
||||
|
|
@ -323,7 +327,7 @@ Getting Started
|
|||
|
||||
:snapraid fix -m
|
||||
|
||||
Recovering
|
||||
Wiederherstellung (Recovering)
|
||||
Das Schlimmste ist passiert, und Sie haben eine oder mehrere Festplatten
|
||||
verloren!
|
||||
|
||||
|
|
@ -423,14 +427,14 @@ Getting Started
|
|||
|
||||
Wenn alles wiederhergestellt ist, ist dieser Befehl sofort.
|
||||
|
||||
Commands
|
||||
SnapRAID bietet einige einfache Befehle, mit denen Sie:
|
||||
Befehle (Commands)
|
||||
SnapRAID bietet ein paar einfache Befehle, mit denen Sie folgende Aktionen ausführen können:
|
||||
|
||||
* Den Status des Arrays ausgeben -> `status`
|
||||
* Die Festplatten steuern -> `smart`, `probe`, `up`, `down`
|
||||
* Eine Sicherung/einen Snapshot erstellen -> `sync`
|
||||
* Einen Backup-/Wiederherstellungspunkt erstellen -> `sync`
|
||||
* Daten regelmäßig überprüfen -> `scrub`
|
||||
* Die letzte Sicherung/den letzten Snapshot wiederherstellen -> `fix`.
|
||||
* Den letzten Backup-/Wiederherstellungspunkt wiederherstellen -> `fix`.
|
||||
|
||||
Befehle müssen in Kleinbuchstaben geschrieben werden.
|
||||
|
||||
|
|
@ -450,7 +454,7 @@ Commands
|
|||
verwenden.
|
||||
|
||||
Es zeigt auch ein Diagramm an, das den letzten Zeitpunkt darstellt,
|
||||
zu dem jeder Block gescrubbed oder synchronisiert wurde. Gescrubbed
|
||||
zu dem jeder Block gescrubbed oder synchronisiert wurde. Gescrubbte
|
||||
Blöcke werden mit `*`, Blöcke, die synchronisiert, aber noch nicht
|
||||
gescrubbed wurden, mit `o` angezeigt.
|
||||
|
||||
|
|
@ -460,7 +464,7 @@ Commands
|
|||
Gibt einen SMART-Bericht aller Festplatten im System aus.
|
||||
|
||||
Es enthält eine Schätzung der Ausfallwahrscheinlichkeit im nächsten
|
||||
Jahr, sodass Sie die Wartungsersetzung von Festplatten planen können,
|
||||
Jahr, sodass Sie den vorsorglichen Austausch von Festplatten planen können,
|
||||
die verdächtige Attribute aufweisen.
|
||||
|
||||
Diese Wahrscheinlichkeitsschätzung wird durch Korrelation der SMART-Attribute
|
||||
|
|
@ -657,14 +661,14 @@ Commands
|
|||
Die Dateien im Array werden NICHT geändert.
|
||||
|
||||
fix
|
||||
Behebt alle Dateien und die Paritätsdaten.
|
||||
Repariert alle Dateien und die Paritätsdaten.
|
||||
|
||||
Alle Dateien und Paritätsdaten werden mit dem Snapshot-Zustand
|
||||
verglichen, der beim letzten `sync` gespeichert wurde.
|
||||
Wenn eine Abweichung gefunden wird, wird sie auf den gespeicherten
|
||||
Snapshot zurückgesetzt.
|
||||
Alle Dateien und Paritätsdaten werden mit dem im letzten `sync`
|
||||
gespeicherten Zustand verglichen. Wenn ein Unterschied gefunden
|
||||
wird, wird er auf den gespeicherten Zustand zurückgesetzt.
|
||||
|
||||
WARNUNG! Der Befehl `fix` unterscheidet nicht zwischen Fehlern und
|
||||
WARNUNG!
|
||||
Der Befehl `fix` unterscheidet nicht zwischen Fehlern und
|
||||
beabsichtigten Änderungen. Er setzt den Dateizustand bedingungslos
|
||||
auf den letzten `sync` zurück.
|
||||
|
||||
|
|
@ -810,7 +814,7 @@ Commands
|
|||
Beachten Sie, dass solche Dateien während des Neuzuweisungsprozesses
|
||||
nicht durch die Parität geschützt sind.
|
||||
|
||||
Options
|
||||
Optionen (Options)
|
||||
SnapRAID bietet die folgenden Optionen:
|
||||
|
||||
-c, --conf CONFIG
|
||||
|
|
@ -926,9 +930,9 @@ Options
|
|||
-w, --bw-limit RATE
|
||||
Wendet eine globale Bandbreitenbegrenzung für alle Festplatten
|
||||
an. RATE ist die Anzahl der Bytes pro Sekunde. Sie können
|
||||
einen Multiplikator wie K, M oder G angeben (z.B. --bw-limit 1G).
|
||||
einen Multiplikator wie K, M, G oder T angeben (z.B. --bw-limit 1G).
|
||||
|
||||
-t, --tail GRÖSSE
|
||||
-t, --tail SIZE
|
||||
Beschränkt die Dateiliste auf diejenigen, die nicht mehr als die
|
||||
angegebene Tail-Größe der Paritätsfestplatten belegen.
|
||||
Sie können Multiplikatoren wie K, M, G oder T verwenden (z. B. --tail 1G).
|
||||
|
|
@ -958,7 +962,7 @@ Options
|
|||
mit Nullgröße, die zuvor nicht Null war. Wenn SnapRAID eine
|
||||
solche Bedingung erkennt, stoppt es den Vorgang, es sei denn,
|
||||
Sie geben diese Option an. Dies ermöglicht es Ihnen, leicht zu
|
||||
erkennen, wann nach einem Systemabsturz einige zugegriffene Dateien
|
||||
erkennen, wann nach einem Systemabsturz einige Dateien, auf die zugegriffen wurde,
|
||||
abgeschnitten (truncated) wurden. Dies ist eine mögliche Bedingung
|
||||
unter Linux mit den ext3/ext4-Dateisystemen.
|
||||
Diese Option kann nur mit `sync` verwendet werden.
|
||||
|
|
@ -993,7 +997,7 @@ Options
|
|||
Wenn Sie beispielsweise zwei Datenfestplatten verloren haben und
|
||||
eine Ersatzfestplatte haben, um nur die erste wiederherzustellen,
|
||||
können Sie die zweite unzugängliche Festplatte ignorieren.
|
||||
Oder wenn Sie eine Festplatte in dem auf einer bereits
|
||||
Oder wenn Sie eine Festplatte auf dem auf einer bereits
|
||||
verwendeten Festplatte verbleibenden freien Speicherplatz
|
||||
wiederherstellen möchten, wobei sie dasselbe physische Gerät
|
||||
gemeinsam nutzen.
|
||||
|
|
@ -1037,9 +1041,9 @@ Options
|
|||
dringend empfohlen, sie nicht zu verwenden.
|
||||
Sie haben während der `sync`-Operation KEINEN Datenschutz.
|
||||
|
||||
-W, --force-realloc-tail GRÖSSE
|
||||
-W, --force-realloc-tail SIZE
|
||||
Funktioniert wie -R, --force-realloc, ist jedoch auf den angegebenen
|
||||
Endbereich (die letzten GRÖSSE Bytes) jeder Paritätsdatei beschränkt.
|
||||
Endbereich (die letzten SIZE Bytes) jeder Paritätsdatei beschränkt.
|
||||
Erzwingt die Neuzuweisung (Verschiebung) aller Dateifragmente/-blöcke, die
|
||||
derzeit in diesem Endabschnitt gespeichert sind, sodass sie an beliebiger Stelle
|
||||
in den Paritätsdateien platziert werden können, wo freier Speicherplatz
|
||||
|
|
@ -1100,7 +1104,7 @@ Options
|
|||
Wiederherstellung gedacht.
|
||||
|
||||
-C, --gen-conf CONTENT
|
||||
Generiert eine Dummy-Konfigurationsdatei aus einer vorhandenen
|
||||
Generiert eine Dummy-Konfigurationsdatei aus einer bestehenden
|
||||
Content-Datei. Die Konfigurationsdatei wird in die Standardausgabe
|
||||
geschrieben und überschreibt keine vorhandene.
|
||||
Diese Konfigurationsdatei enthält auch die Informationen,
|
||||
|
|
@ -1127,7 +1131,7 @@ Options
|
|||
-V, --version
|
||||
Gibt die Programmversion aus.
|
||||
|
||||
Configuration
|
||||
Konfiguration (Configuration)
|
||||
SnapRAID benötigt eine Konfigurationsdatei, um zu wissen, wo sich
|
||||
Ihr Festplatten-Array befindet und wo die Paritätsinformationen
|
||||
gespeichert werden sollen.
|
||||
|
|
@ -1141,9 +1145,8 @@ Configuration
|
|||
enthalten:
|
||||
|
||||
parity FILE [,FILE] ...
|
||||
Definiert die Dateien, die zum Speichern der Paritätsinformationen
|
||||
verwendet werden sollen. Die Parität ermöglicht den Schutz
|
||||
vor einem einzelnen Festplattenausfall, ähnlich wie bei RAID5.
|
||||
Definiert die Dateien, die zum Speichern der Paritätsinformationen verwendet werden.
|
||||
Die Parität ermöglicht den Schutz vor einem einzelnen Festplattenausfall, ähnlich wie bei RAID5.
|
||||
|
||||
Sie können mehrere Dateien angeben, die sich auf unterschiedlichen
|
||||
Festplatten befinden müssen. Wenn eine Datei nicht mehr wachsen
|
||||
|
|
@ -1163,8 +1166,7 @@ Configuration
|
|||
Diese Option ist obligatorisch und kann nur einmal verwendet werden.
|
||||
|
||||
(2,3,4,5,6)-parity FILE [,FILE] ...
|
||||
Definiert die Dateien, die zum Speichern zusätzlicher Paritätsinformationen
|
||||
verwendet werden sollen.
|
||||
Definiert die Dateien, die zum Speichern zusätzlicher Paritätsinformationen verwendet werden.
|
||||
|
||||
Für jede angegebene Paritätsstufe wird eine zusätzliche Schutzstufe
|
||||
aktiviert:
|
||||
|
|
@ -1202,8 +1204,8 @@ Configuration
|
|||
3-parity-Datei angepasst und `fix` zur Neuerstellung verwendet wird.
|
||||
|
||||
content FILE
|
||||
Definiert die Datei, die zum Speichern der Liste und Prüfsummen
|
||||
aller im Festplatten-Array vorhandenen Dateien verwendet werden soll.
|
||||
Definiert die Datei, die zum Speichern der Liste und der Prüfsummen aller
|
||||
im Festplatten-Array vorhandenen Dateien verwendet wird.
|
||||
|
||||
Sie kann auf einer für Daten, Parität oder einer anderen
|
||||
verfügbaren Festplatte platziert werden.
|
||||
|
|
@ -1217,10 +1219,9 @@ Configuration
|
|||
plus eine speichern. Die Verwendung zusätzlicher Kopien schadet nicht.
|
||||
|
||||
data NAME DIR
|
||||
Definiert den Namen und den Einhängepunkt (Mount Point) der
|
||||
Datenfestplatten im Array. NAME wird zur Identifizierung der
|
||||
Festplatte verwendet und muss eindeutig sein. DIR ist der
|
||||
Einhängepunkt der Festplatte im Dateisystem.
|
||||
Definiert den Namen und Einhängepunkt der Datenfestplatten im Array. NAME
|
||||
wird zur Identifizierung der Festplatte verwendet und muss eindeutig sein.
|
||||
DIR ist der Einhängepunkt der Festplatte im Dateisystem.
|
||||
|
||||
Sie können den Einhängepunkt nach Bedarf ändern, solange Sie
|
||||
den NAME unverändert lassen.
|
||||
|
|
@ -1243,6 +1244,30 @@ Configuration
|
|||
Beachten Sie, dass solche Festplatten nicht von den Befehlen `up` und `down`
|
||||
betroffen sind, da von ihnen erwartet wird, dass sie sich immer drehen.
|
||||
|
||||
snapshot
|
||||
Aktiviert die Verwendung von Dateisystem-Snapshots für die Befehle `sync`, `scrub`,
|
||||
`check` und `fix`.
|
||||
|
||||
Wenn aktiviert, erstellt SnapRAID zu Beginn eines 'sync' einen schreibgeschützten
|
||||
Snapshot Ihrer Daten. Dies gewährleistet eine konsistente Point-in-Time-Ansicht
|
||||
Ihrer Dateien und verhindert Fehler, die durch gleichzeitige Dateiänderungen verursacht werden.
|
||||
|
||||
Dies verbessert die Wiederherstellung erheblich: Wenn eine Datei aus dem
|
||||
Live-Dateisystem gelöscht wird, bleibt sie im Snapshot erhalten. Dies verhindert,
|
||||
dass die Parität für diesen Block "beschädigt" wird, sodass Sie Daten immer noch
|
||||
erfolgreich wiederherstellen können, wenn eine andere Festplatte ausfällt.
|
||||
|
||||
Diese Option gilt ausschließlich für Datenträger, die mit den Dateisystemen
|
||||
Btrfs, Bcachefs oder ZFS unter Linux und NTFS unter Windows formatiert sind.
|
||||
Paritätsfestplatten oder Datenträger mit anderen Dateisystemen verwenden immer
|
||||
die Live-Version des Dateisystems.
|
||||
|
||||
Das Erstellen und Löschen von Snapshots erfordert Administratorrechte.
|
||||
Stellen Sie sicher, dass SnapRAID mit den erforderlichen Berechtigungen (z. B. sudo)
|
||||
ausgeführt wird, wenn diese Option aktiviert ist.
|
||||
|
||||
Eine detaillierte Erklärung des Snapshot-Lebenszyklus finden Sie im Abschnitt SNAPSHOTS.
|
||||
|
||||
nohidden
|
||||
Schließt alle versteckten Dateien und Verzeichnisse aus.
|
||||
Unter Unix sind versteckte Dateien solche, die mit `.` beginnen.
|
||||
|
|
@ -1437,6 +1462,9 @@ Configuration
|
|||
Gerätenamen ersetzt. Bei RAID-Controllern ist das Gerät
|
||||
wahrscheinlich fest, und Sie müssen `%s` möglicherweise nicht verwenden.
|
||||
|
||||
Sie können auch eine benutzerdefinierte Info-Optionszeichenfolge mit dem
|
||||
Tag `[info: ...]` angeben, um die Standardoption `-a` zu ersetzen.
|
||||
|
||||
Weitere mögliche Optionen finden Sie in der smartmontools-Dokumentation:
|
||||
|
||||
:https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
|
|
@ -1444,6 +1472,7 @@ Configuration
|
|||
|
||||
Zum Beispiel:
|
||||
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl parity -d sat %s
|
||||
|
||||
smartignore DISK/PARITY ATTR [ATTR...]
|
||||
|
|
@ -1458,16 +1487,23 @@ Configuration
|
|||
Der Sonderwert * kann verwendet werden, um das Attribut auf allen
|
||||
Festplatten zu ignorieren.
|
||||
|
||||
Um beispielsweise das Attribut `Current Pending Sector Count` auf allen
|
||||
Festplatten zu ignorieren:
|
||||
Es können mehrere Attribute durch Leerzeichen getrennt angegeben werden.
|
||||
Jedes Attribut kann als Nummer von 1 bis 255 oder als Name ohne
|
||||
Berücksichtigung der Groß-/Kleinschreibung (z. B. `Current_Pending_Sector`)
|
||||
angegeben werden.
|
||||
|
||||
:smartignore * 197
|
||||
Um beispielsweise das Attribut `Current Pending Sector Count` und
|
||||
`Reallocated Sectors Count` auf allen Festplatten über ihre Nummer
|
||||
oder ihren Namen zu ignorieren:
|
||||
|
||||
Um es nur auf der ersten Paritätsfestplatte zu ignorieren:
|
||||
:smartignore * 197 5
|
||||
:smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
:smartignore parity 197
|
||||
Um sie nur auf der ersten Paritätsfestplatte zu ignorieren:
|
||||
|
||||
Examples
|
||||
:smartignore parity 197 5
|
||||
|
||||
Beispiele (Examples)
|
||||
Ein Beispiel für eine typische Konfiguration für Unix ist:
|
||||
|
||||
:parity /mnt/diskp/snapraid.parity
|
||||
|
|
@ -1478,7 +1514,7 @@ Configuration
|
|||
:data d3 /mnt/disk3/
|
||||
:exclude /lost+found/
|
||||
:exclude /tmp/
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/sg0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1499,7 +1535,113 @@ Configuration
|
|||
:smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
Pattern
|
||||
Snapshots
|
||||
Wenn die Snapshot-Option in der Konfiguration aktiviert ist, nutzt SnapRAID
|
||||
die Dateisystem-Snapshot-Funktionalität, um atomare und konsistente Operationen zu gewährleisten.
|
||||
|
||||
Die Verwaltung von Snapshots erfolgt vollständig automatisch und transparent.
|
||||
Sie können SnapRAID genau wie bisher verwenden, wobei der zusätzliche Schutz
|
||||
durch Snapshots vollständig im Hintergrund abgewickelt wird.
|
||||
|
||||
Dies bietet zwei wesentliche Vorteile:
|
||||
|
||||
Konsistenz - Dateien, die während eines lang laufenden Syncs oder Scrubs auf dem Live-Dateisystem
|
||||
geändert werden, verursachen keine Paritätskonflikte oder abgebrochenen Operationen,
|
||||
da SnapRAID ein eingefrorenes Point-in-Time-Abbild sieht.
|
||||
Wiederherstellung - Wenn eine Datei im Live-Dateisystem aktualisiert oder gelöscht wird,
|
||||
bleibt sie im Snapshot erhalten. Wenn ein Festplattenausfall auftritt,
|
||||
bevor der nächste Sync ausgeführt wird, verwendet SnapRAID die im Snapshot konservierten Daten,
|
||||
um die ausgefallene Festplatte zu rekonstruieren.
|
||||
|
||||
Im Falle eines Festplattenausfalls während eines aktiven Sync-Vorgangs
|
||||
ist SnapRAID auch in der Lage, automatisch sowohl aus dem Snapshot
|
||||
der vorherigen Paritätsberechnung als auch aus der aktuellen zu lesen.
|
||||
Dies maximiert die Wahrscheinlichkeit einer vollständigen Wiederherstellung, indem
|
||||
Zugriff auf die genauen Datenblöcke gewährt wird, die zur Lösung der Paritätsgleichungen
|
||||
erforderlich sind, selbst wenn diese Blöcke zwischen den Syncs geändert oder gelöscht wurden.
|
||||
|
||||
Ohne Snapshots führt eine aktualisierte oder gelöschte Datei auf einer gesunden
|
||||
Festplatte zu fehlenden Datenblöcken, die möglicherweise zur Reparatur
|
||||
anderer ausgefallener Festplatten benötigt werden.
|
||||
|
||||
Snapshots werden nur für Datenträger erstellt und nur dann, wenn das zugrunde liegende
|
||||
Dateisystem diese Funktionalität unterstützt. Paritätsfestplatten verwenden immer
|
||||
das Live-Dateisystem.
|
||||
|
||||
Derzeit wird dies auf Btrfs, Bcachefs und ZFS unter Linux
|
||||
und auf NTFS unter Windows unterstützt.
|
||||
|
||||
Sie können Datenträger mit unterschiedlichen Dateisystemen mischen. Nur diejenigen, die
|
||||
Snapshots unterstützen, werden diese nutzen, während andere Festplatten weiterhin
|
||||
direkt auf dem Live-Dateisystem arbeiten.
|
||||
|
||||
Das Erstellen und Löschen von Snapshots erfordert Administratorrechte.
|
||||
Stellen Sie sicher, dass SnapRAID mit den erforderlichen Berechtigungen (z. B. sudo)
|
||||
ausgeführt wird, wenn Snapshots aktiviert sind.
|
||||
|
||||
Befehlsverhalten mit Snapshots (Command Behavior with Snapshots)
|
||||
Die Befehle `sync` und `scrub` arbeiten beide ausschließlich auf Snapshots,
|
||||
um sicherzustellen, dass alle Datenoperationen auf einem konsistenten,
|
||||
eingefrorenen Zustand ausgeführt werden. Durch die Nutzung dieser Snapshots verhindert SnapRAID Paritätskonflikte,
|
||||
die andernfalls durch gleichzeitige Dateiänderungen auf dem Live-Dateisystem ausgelöst würden.
|
||||
Während eines `sync` verwendet der Befehl einen neuen Snapshot, der zu Beginn des Prozesses
|
||||
erstellt wurde, um den aktuellen Zustand für die Paritätsberechnung zu erfassen.
|
||||
Im Gegensatz dazu verwendet der Befehl `scrub` den letzten Snapshot, also den, der
|
||||
während des letzten erfolgreichen Syncs erstellt wurde, um einen zuverlässigen Referenzpunkt
|
||||
beizubehalten, der mit der vorhandenen Parität übereinstimmt.
|
||||
|
||||
Bei den Befehlen `check` und `fix` hängt die Verwendung des letzten Snapshots
|
||||
davon ab, ob bestimmte Festplatten mit der Option -d, --filter-disk ausgewählt wurden.
|
||||
|
||||
Eine explizit über -d ausgewählte Festplatte (das „Ziel“ der Operation)
|
||||
verwendet immer das Live-Dateisystem. Für `fix` ermöglicht dies das Wiederherstellen
|
||||
von Daten auf dem aktiven Festplattenersatz. Für `check` ermöglicht es die Simulation
|
||||
des `fix`-Vorgangs unter denselben Bedingungen.
|
||||
|
||||
Auf alle anderen Datenträger (die „Referenz“-Festplatten) wird über ihre Snapshots zugegriffen.
|
||||
Dies stellt sicher, dass SnapRAID selbst dann, wenn Sie während einer laufenden Wiederherstellung
|
||||
Dateien auf Ihren gesunden Festplatten ändern, eine stabile, eingefrorene Referenz hat,
|
||||
um die Paritätsgleichungen zu lösen.
|
||||
|
||||
Wenn keine Option -d angegeben ist, nimmt SnapRAID an, dass die Operation für das gesamte Array gilt.
|
||||
In diesem Fall verwenden `check` und `fix` ausschließlich die Live-Dateisysteme.
|
||||
|
||||
Alle anderen Befehle arbeiten ausschließlich auf dem Live-Dateisystem.
|
||||
|
||||
Lebenszyklus von Snapshots (Snapshots Lifecycle)
|
||||
SnapRAID verwaltet zwei spezifische Snapshots, `stable` und `pending`,
|
||||
in einem versteckten Verzeichnis im Stammverzeichnis jedes Daten-Subvolumes.
|
||||
Unter Btrfs, Bcachefs und NTFS wird das Verzeichnis `.snapraid/` verwendet,
|
||||
unter ZFS das Standardverzeichnis `.zfs/snapshot/`.
|
||||
|
||||
Der `stable`-Snapshot repräsentiert den Zustand des letzten
|
||||
erfolgreich abgeschlossenen `sync` und enthält die genauen Daten, die zur
|
||||
Berechnung der aktuellen Parität verwendet wurden. Er dient als primäre Datenquelle
|
||||
für die Befehle `scrub`, `check` und `fix`.
|
||||
|
||||
Der `pending`-Snapshot ist ein temporäres Abbild, das zu Beginn eines `sync`
|
||||
erstellt wird, um einen eingefrorenen Zustand für die Paritätsberechnung bereitzustellen.
|
||||
Nach erfolgreichem Abschluss des Vorgangs wird der vorherige `stable`-Snapshot gelöscht
|
||||
und der `pending`-Snapshot wird heraufgestuft, um seinen Platz als neue stabile Referenz einzunehmen.
|
||||
|
||||
Wenn ein `sync` unterbrochen wird, bleibt der `pending`-Snapshot erhalten.
|
||||
Nachfolgende `scrub`-, `check`- und `fix`-Befehle verwenden diesen ausstehenden Snapshot,
|
||||
da er mit dem in der .content-Datei aufgezeichneten Dateisystemzustand übereinstimmt,
|
||||
selbst wenn die Parität nur teilweise synchronisiert ist.
|
||||
|
||||
Im Falle einer `sync`-Unterbrechung lesen die Befehle `check` und `fix`
|
||||
auch aus dem `stable`-Snapshot, um Datenblöcke von Dateien abzurufen,
|
||||
die während des Syncs aktualisiert oder gelöscht wurden.
|
||||
Dies ist möglich, da die .content-Datei Metadaten für alle geänderten oder
|
||||
gelöschten Dateien während des gesamten Sync-Prozesses aufbewahrt.
|
||||
Diese historischen Informationen werden erst gelöscht, wenn ein Sync erfolgreich abgeschlossen
|
||||
und die endgültige Version der .content-Datei gespeichert wurde.
|
||||
|
||||
Wenn ein `sync` nach einer Unterbrechung neu gestartet wird, wird der vorhandene
|
||||
ausstehende (pending) Snapshot gelöscht und ein neuer erstellt, um den
|
||||
aktuellen Zustand des Live-Dateisystems zu erfassen.
|
||||
|
||||
Muster (Pattern)
|
||||
Muster bieten eine flexible Möglichkeit, Dateien für die Einbeziehung oder
|
||||
den Ausschluss zu filtern. Durch die Verwendung von Globbing-Zeichen können Sie Regeln definieren,
|
||||
die mit bestimmten Dateinamen oder ganzen Verzeichnisstrukturen übereinstimmen, ohne
|
||||
|
|
@ -1620,7 +1762,7 @@ Pattern
|
|||
Unter Unix müssen Sie Globbing-Zeichen in der Befehlszeile in
|
||||
Anführungszeichen setzen, um zu verhindern, dass die Shell sie erweitert.
|
||||
|
||||
Dateien Ignorieren
|
||||
Dateien Ignorieren (Ignore File)
|
||||
Zusätzlich zu den globalen Regeln in der Konfigurationsdatei können Sie
|
||||
`.snapraidignore`-Dateien in jedem Verzeichnis innerhalb des Arrays platzieren,
|
||||
um dezentrale Ausschlussregeln zu definieren.
|
||||
|
|
@ -1662,7 +1804,7 @@ Dateien Ignorieren
|
|||
:# Schließt jede .tmp-Datei innerhalb von projects/ oder deren Unterordnern aus
|
||||
:*.tmp
|
||||
|
||||
Content
|
||||
Inhalt (Content)
|
||||
SnapRAID speichert die Liste und Prüfsummen Ihrer Dateien in der
|
||||
Content-Datei.
|
||||
|
||||
|
|
@ -1670,10 +1812,13 @@ Content
|
|||
Dateien auflistet, zusammen mit allen Prüfsummen zur Überprüfung
|
||||
ihrer Integrität.
|
||||
|
||||
Diese Datei wird von den Befehlen `sync` und `scrub` gelesen und
|
||||
geschrieben und von den Befehlen `fix`, `check` und `status` gelesen.
|
||||
Die Content-Datei wird von den Befehlen `sync`, `scrub`, `touch` und
|
||||
`rehash` gelesen und geschrieben. Sie wird von den Befehlen `status`,
|
||||
`diff`, `check`, `fix`, `list`, `dup`, `locate` und `pool` gelesen und
|
||||
von den Befehlen `smart`, `probe`, `up`, `down` und `devices` vollständig
|
||||
ignoriert.
|
||||
|
||||
Parity
|
||||
Parität (Parity)
|
||||
SnapRAID speichert die Paritätsinformationen Ihres Arrays in den
|
||||
Paritätsdateien.
|
||||
|
||||
|
|
@ -1683,7 +1828,7 @@ Parity
|
|||
Diese Dateien werden von den Befehlen `sync` und `fix` gelesen
|
||||
und geschrieben und nur von den Befehlen `scrub` und `check` gelesen.
|
||||
|
||||
Encoding
|
||||
Kodierung (Encoding)
|
||||
SnapRAID ignoriert unter Unix jede Kodierung. Es liest und speichert
|
||||
die Dateinamen mit derselben Kodierung, die vom Dateisystem
|
||||
verwendet wird.
|
||||
|
|
@ -1698,8 +1843,19 @@ Encoding
|
|||
die Konsolenausgabe in eine Datei umleiten, ist die resultierende
|
||||
Datei immer im UTF-8-Format.
|
||||
|
||||
Copyright
|
||||
Diese Datei ist Copyright (C) 2025 Andrea Mazzoleni
|
||||
Exit-Code (Exit Code)
|
||||
SnapRAID endet mit den folgenden Fehlercodes:
|
||||
|
||||
See Also
|
||||
snapraid_log(1), snapraidd(1)
|
||||
0 - Alles OK.
|
||||
1 - Der Befehl ist auf Fehler gestoßen.
|
||||
2 - Der Befehl `diff` hat festgestellt, dass alles OK ist, aber ein `sync` erforderlich ist.
|
||||
|
||||
Übersetzung (Translation)
|
||||
Dieses Dokument ist eine automatische Übersetzung des englischen Handbuchs.
|
||||
Die maßgebliche Version finden Sie im englischen Handbuch.
|
||||
|
||||
Copyright
|
||||
Diese Datei ist Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
Siehe auch (See Also)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ snapraid [-c, --conf CONFIG]
|
|||
snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
|
||||
2 DESCRIPTION
|
||||
=============
|
||||
2 BESCHREIBUNG (DESCRIPTION)
|
||||
============================
|
||||
|
||||
SnapRAID ist ein Sicherungsprogramm, das für Festplatten-Arrays
|
||||
entwickelt wurde und Paritätsinformationen zur Datenwiederherstellung
|
||||
|
|
@ -52,62 +52,66 @@ selten geänderten Dateien konzipiert und bietet folgende Funktionen:
|
|||
* SnapRAID sperrt Ihre Daten nicht ein; Sie können die Verwendung
|
||||
jederzeit beenden, ohne neu formatieren oder Daten verschieben zu müssen.
|
||||
* Um auf eine Datei zuzugreifen, muss nur eine einzige Festplatte
|
||||
drehen (spinnen), was Strom spart und Geräusche reduziert.
|
||||
anlaufen (drehen), was Strom spart und Geräusche reduziert.
|
||||
|
||||
Für weitere Informationen besuchen Sie bitte die offizielle SnapRAID-Website:
|
||||
|
||||
https://www.snapraid.it/
|
||||
|
||||
|
||||
3 LIMITATIONS
|
||||
=============
|
||||
3 EINSCHRäNKUNGEN (LIMITATIONS)
|
||||
===============================
|
||||
|
||||
SnapRAID ist ein Hybrid aus einem RAID- und einem Sicherungsprogramm,
|
||||
das darauf abzielt, die besten Vorteile beider zu kombinieren.
|
||||
Es hat jedoch einige Einschränkungen, die Sie vor der Verwendung
|
||||
berücksichtigen sollten.
|
||||
SnapRAID ist ein Hybrid aus RAID und einem Backup-Programm mit dem Ziel, die
|
||||
besten Vorteile von beiden zu kombinieren. Es hat jedoch einige Einschränkungen, die Sie
|
||||
vor der Verwendung berücksichtigen sollten.
|
||||
|
||||
Die Haupteinschränkung besteht darin, dass wenn eine Festplatte
|
||||
ausfällt und Sie in letzter Zeit keine Synchronisierung durchgeführt haben,
|
||||
Sie möglicherweise nicht vollständig wiederherstellen können.
|
||||
Genauer gesagt können Sie möglicherweise nicht bis zur Größe der
|
||||
geänderten oder gelöschten Dateien seit der letzten `sync`-Operation
|
||||
wiederherstellen. Dies tritt auch dann auf, wenn die geänderten oder
|
||||
gelöschten Dateien sich nicht auf der ausgefallenen Festplatte befinden.
|
||||
Aus diesem Grund ist SnapRAID besser für Daten geeignet, die sich
|
||||
selten ändern.
|
||||
Die Haupteinschränkung besteht darin, dass Sie bei einem Festplattenausfall Daten nur bis zum
|
||||
Zustand des letzten `sync`-Vorgangs wiederherstellen können. Alle Daten, die seit dem
|
||||
letzten Sync hinzugefügt oder geändert wurden und sich auf der ausgefallenen Festplatte befinden, gehen verloren.
|
||||
|
||||
Andererseits verhindern neu hinzugefügte Dateien die Wiederherstellung
|
||||
von bereits vorhandenen Dateien nicht. Sie verlieren nur die
|
||||
kürzlich hinzugefügten Dateien, wenn diese sich auf der ausgefallenen
|
||||
Festplatte befinden.
|
||||
Daher eignet sich SnapRAID in erster Linie für Daten, die sich selten ändern.
|
||||
|
||||
Für Daten, die beim letzten Sync bereits existierten, hängt die Wiederherstellungszuverlässigkeit
|
||||
davon ab, ob die Option `snapshot` verwendet wird:
|
||||
|
||||
* Mit Snapshot-Unterstützung (verfügbar auf Btrfs, ZFS, Bcachefs und NTFS)
|
||||
kann SnapRAID automatisch eine eingefrorene Referenz Ihrer Datenträger beibehalten.
|
||||
Dies stellt sicher, dass der Wiederherstellungsprozess konsistent und zuverlässig bleibt,
|
||||
selbst wenn Sie während oder nach einem Sync Dateien auf Ihrem Live-Dateisystem ändern oder löschen.
|
||||
|
||||
* Ohne Snapshot-Unterstützung kann das Löschen oder Ändern von Dateien nach einem `sync`
|
||||
die vollständige Wiederherstellung anderer ausgefallener Festplatten verhindern. Dies geschieht,
|
||||
weil die Parität nicht mehr mit den geänderten Dateien übereinstimmt, selbst wenn
|
||||
sich diese Dateien nicht auf der ausgefallenen Festplatte befinden. Neu hinzugefügte
|
||||
Dateien verhindern dagegen die Wiederherstellung bereits vorhandener Dateien nicht.
|
||||
|
||||
Weitere Einschränkungen von SnapRAID sind:
|
||||
|
||||
* Mit SnapRAID haben Sie immer noch separate Dateisysteme für jede
|
||||
Festplatte. Mit RAID erhalten Sie ein einziges großes Dateisystem.
|
||||
* SnapRAID streift (stripes) keine Daten.
|
||||
* SnapRAID verwendet kein Data-Striping (Verteilen von Datenblöcken).
|
||||
Mit RAID erhalten Sie einen Geschwindigkeitsvorteil durch Striping.
|
||||
* SnapRAID unterstützt keine Echtzeit-Wiederherstellung.
|
||||
Mit RAID müssen Sie die Arbeit nicht unterbrechen, wenn eine
|
||||
Festplatte ausfällt.
|
||||
* SnapRAID kann Daten nur von einer begrenzten Anzahl von Festplattenausfällen
|
||||
wiederherstellen. Mit einer Sicherung können Sie von einem
|
||||
wiederherstellen. Mit einer Sicherung können Sie Daten nach einem
|
||||
vollständigen Ausfall des gesamten Festplatten-Arrays wiederherstellen.
|
||||
* Nur Dateinamen, Zeitstempel, symbolische Links (symlinks) und
|
||||
Hardlinks werden gespeichert. Berechtigungen, Eigentümerschaft
|
||||
und erweiterte Attribute werden nicht gespeichert.
|
||||
|
||||
|
||||
4 GETTING STARTED
|
||||
=================
|
||||
4 ERSTE SCHRITTE (GETTING STARTED)
|
||||
==================================
|
||||
|
||||
Um SnapRAID zu verwenden, müssen Sie zuerst eine Festplatte in Ihrem
|
||||
Festplatten-Array auswählen, die für `parity`-Informationen
|
||||
reserviert wird. Mit einer Festplatte für Parität können Sie von
|
||||
einem einzelnen Festplattenausfall wiederherstellen, ähnlich wie bei RAID5.
|
||||
reserviert wird. Mit einer Festplatte für Parität können Sie Daten
|
||||
nach einem einzelnen Festplattenausfall wiederherstellen, ähnlich wie bei RAID5.
|
||||
|
||||
Wenn Sie von mehr Festplattenausfällen wiederherstellen möchten,
|
||||
Wenn Sie mehr Festplattenausfälle ausgleichen möchten,
|
||||
ähnlich wie bei RAID6, müssen Sie zusätzliche Festplatten für Parität
|
||||
reservieren. Jede zusätzliche Paritätsfestplatte ermöglicht die
|
||||
Wiederherstellung von einem weiteren Festplattenausfall.
|
||||
|
|
@ -187,8 +191,8 @@ Wenn dieser Befehl abgeschlossen ist, sind Ihre Daten SICHER.
|
|||
Jetzt können Sie Ihr Array nach Belieben verwenden und die Paritätsinformationen
|
||||
regelmäßig durch Ausführen des `sync`-Befehls aktualisieren.
|
||||
|
||||
4.1 Scrubbing
|
||||
-------------
|
||||
4.1 Scrubben (Scrubbing)
|
||||
------------------------
|
||||
|
||||
Um die Daten und die Parität regelmäßig auf Fehler zu überprüfen,
|
||||
können Sie den Befehl `scrub` ausführen.
|
||||
|
|
@ -234,12 +238,12 @@ verursacht wurden. Diese Fehler werden in der `scrub`-Ausgabe
|
|||
gemeldet, aber die zugehörigen Blöcke werden nicht als fehlerhaft
|
||||
markiert.
|
||||
|
||||
4.2 Pooling
|
||||
-----------
|
||||
4.2 Zusammenführen (Pooling)
|
||||
----------------------------
|
||||
|
||||
Hinweis: Die unten beschriebene Pooling-Funktion wurde durch das
|
||||
Tool mergerfs ersetzt, das jetzt die empfohlene Option für Linux-Benutzer
|
||||
in der SnapRAID-Community ist. Mergefs bietet eine flexiblere
|
||||
in der SnapRAID-Community ist. Mergerfs bietet eine flexiblere
|
||||
und effizientere Möglichkeit, mehrere Laufwerke zu einem einzigen,
|
||||
vereinheitlichten Einhängepunkt (Mount Point) zusammenzufassen,
|
||||
was einen nahtlosen Zugriff auf Dateien über Ihr gesamtes Array
|
||||
|
|
@ -317,8 +321,8 @@ den Zugriff auf Remote-Symlinks mit dem Befehl zu aktivieren:
|
|||
|
||||
fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
||||
|
||||
4.3 Undeleting
|
||||
--------------
|
||||
4.3 Wiederherstellen (Undeleting)
|
||||
---------------------------------
|
||||
|
||||
SnapRAID funktioniert eher wie ein Sicherungsprogramm als ein RAID-System
|
||||
und kann verwendet werden, um Dateien in ihren vorherigen Zustand
|
||||
|
|
@ -342,8 +346,8 @@ Oder um alle gelöschten Dateien auf allen Laufwerken wiederherzustellen mit:
|
|||
|
||||
snapraid fix -m
|
||||
|
||||
4.4 Recovering
|
||||
--------------
|
||||
4.4 Wiederherstellung (Recovering)
|
||||
----------------------------------
|
||||
|
||||
Das Schlimmste ist passiert, und Sie haben eine oder mehrere Festplatten
|
||||
verloren!
|
||||
|
|
@ -445,16 +449,16 @@ Festplatte zu resynchronisieren.
|
|||
Wenn alles wiederhergestellt ist, ist dieser Befehl sofort.
|
||||
|
||||
|
||||
5 COMMANDS
|
||||
==========
|
||||
5 BEFEHLE (COMMANDS)
|
||||
====================
|
||||
|
||||
SnapRAID bietet einige einfache Befehle, mit denen Sie:
|
||||
SnapRAID bietet ein paar einfache Befehle, mit denen Sie folgende Aktionen ausführen können:
|
||||
|
||||
* Den Status des Arrays ausgeben -> `status`
|
||||
* Die Festplatten steuern -> `smart`, `probe`, `up`, `down`
|
||||
* Eine Sicherung/einen Snapshot erstellen -> `sync`
|
||||
* Einen Backup-/Wiederherstellungspunkt erstellen -> `sync`
|
||||
* Daten regelmäßig überprüfen -> `scrub`
|
||||
* Die letzte Sicherung/den letzten Snapshot wiederherstellen -> `fix`.
|
||||
* Den letzten Backup-/Wiederherstellungspunkt wiederherstellen -> `fix`.
|
||||
|
||||
Befehle müssen in Kleinbuchstaben geschrieben werden.
|
||||
|
||||
|
|
@ -476,7 +480,7 @@ aufgelistet. Um sie zu beheben, können Sie den Befehl `fix -e`
|
|||
verwenden.
|
||||
|
||||
Es zeigt auch ein Diagramm an, das den letzten Zeitpunkt darstellt,
|
||||
zu dem jeder Block gescrubbed oder synchronisiert wurde. Gescrubbed
|
||||
zu dem jeder Block gescrubbed oder synchronisiert wurde. Gescrubbte
|
||||
Blöcke werden mit `*`, Blöcke, die synchronisiert, aber noch nicht
|
||||
gescrubbed wurden, mit `o` angezeigt.
|
||||
|
||||
|
|
@ -488,7 +492,7 @@ Es wird nichts geändert.
|
|||
Gibt einen SMART-Bericht aller Festplatten im System aus.
|
||||
|
||||
Es enthält eine Schätzung der Ausfallwahrscheinlichkeit im nächsten
|
||||
Jahr, sodass Sie die Wartungsersetzung von Festplatten planen können,
|
||||
Jahr, sodass Sie den vorsorglichen Austausch von Festplatten planen können,
|
||||
die verdächtige Attribute aufweisen.
|
||||
|
||||
Diese Wahrscheinlichkeitsschätzung wird durch Korrelation der SMART-Attribute
|
||||
|
|
@ -699,14 +703,14 @@ Die Dateien im Array werden NICHT geändert.
|
|||
5.9 fix
|
||||
-------
|
||||
|
||||
Behebt alle Dateien und die Paritätsdaten.
|
||||
Repariert alle Dateien und die Paritätsdaten.
|
||||
|
||||
Alle Dateien und Paritätsdaten werden mit dem Snapshot-Zustand
|
||||
verglichen, der beim letzten `sync` gespeichert wurde.
|
||||
Wenn eine Abweichung gefunden wird, wird sie auf den gespeicherten
|
||||
Snapshot zurückgesetzt.
|
||||
Alle Dateien und Paritätsdaten werden mit dem im letzten `sync`
|
||||
gespeicherten Zustand verglichen. Wenn ein Unterschied gefunden
|
||||
wird, wird er auf den gespeicherten Zustand zurückgesetzt.
|
||||
|
||||
WARNUNG! Der Befehl `fix` unterscheidet nicht zwischen Fehlern und
|
||||
WARNUNG!
|
||||
Der Befehl `fix` unterscheidet nicht zwischen Fehlern und
|
||||
beabsichtigten Änderungen. Er setzt den Dateizustand bedingungslos
|
||||
auf den letzten `sync` zurück.
|
||||
|
||||
|
|
@ -869,8 +873,8 @@ Beachten Sie, dass solche Dateien während des Neuzuweisungsprozesses
|
|||
nicht durch die Parität geschützt sind.
|
||||
|
||||
|
||||
6 OPTIONS
|
||||
=========
|
||||
6 OPTIONEN (OPTIONS)
|
||||
====================
|
||||
|
||||
SnapRAID bietet die folgenden Optionen:
|
||||
|
||||
|
|
@ -987,9 +991,9 @@ SnapRAID bietet die folgenden Optionen:
|
|||
-w, --bw-limit RATE
|
||||
Wendet eine globale Bandbreitenbegrenzung für alle Festplatten
|
||||
an. RATE ist die Anzahl der Bytes pro Sekunde. Sie können
|
||||
einen Multiplikator wie K, M oder G angeben (z.B. --bw-limit 1G).
|
||||
einen Multiplikator wie K, M, G oder T angeben (z.B. --bw-limit 1G).
|
||||
|
||||
-t, --tail GRÖSSE
|
||||
-t, --tail SIZE
|
||||
Beschränkt die Dateiliste auf diejenigen, die nicht mehr als die
|
||||
angegebene Tail-Größe der Paritätsfestplatten belegen.
|
||||
Sie können Multiplikatoren wie K, M, G oder T verwenden (z. B. --tail 1G).
|
||||
|
|
@ -1019,7 +1023,7 @@ SnapRAID bietet die folgenden Optionen:
|
|||
mit Nullgröße, die zuvor nicht Null war. Wenn SnapRAID eine
|
||||
solche Bedingung erkennt, stoppt es den Vorgang, es sei denn,
|
||||
Sie geben diese Option an. Dies ermöglicht es Ihnen, leicht zu
|
||||
erkennen, wann nach einem Systemabsturz einige zugegriffene Dateien
|
||||
erkennen, wann nach einem Systemabsturz einige Dateien, auf die zugegriffen wurde,
|
||||
abgeschnitten (truncated) wurden. Dies ist eine mögliche Bedingung
|
||||
unter Linux mit den ext3/ext4-Dateisystemen.
|
||||
Diese Option kann nur mit `sync` verwendet werden.
|
||||
|
|
@ -1054,7 +1058,7 @@ SnapRAID bietet die folgenden Optionen:
|
|||
Wenn Sie beispielsweise zwei Datenfestplatten verloren haben und
|
||||
eine Ersatzfestplatte haben, um nur die erste wiederherzustellen,
|
||||
können Sie die zweite unzugängliche Festplatte ignorieren.
|
||||
Oder wenn Sie eine Festplatte in dem auf einer bereits
|
||||
Oder wenn Sie eine Festplatte auf dem auf einer bereits
|
||||
verwendeten Festplatte verbleibenden freien Speicherplatz
|
||||
wiederherstellen möchten, wobei sie dasselbe physische Gerät
|
||||
gemeinsam nutzen.
|
||||
|
|
@ -1098,9 +1102,9 @@ SnapRAID bietet die folgenden Optionen:
|
|||
dringend empfohlen, sie nicht zu verwenden.
|
||||
Sie haben während der `sync`-Operation KEINEN Datenschutz.
|
||||
|
||||
-W, --force-realloc-tail GRÖSSE
|
||||
-W, --force-realloc-tail SIZE
|
||||
Funktioniert wie -R, --force-realloc, ist jedoch auf den angegebenen
|
||||
Endbereich (die letzten GRÖSSE Bytes) jeder Paritätsdatei beschränkt.
|
||||
Endbereich (die letzten SIZE Bytes) jeder Paritätsdatei beschränkt.
|
||||
Erzwingt die Neuzuweisung (Verschiebung) aller Dateifragmente/-blöcke, die
|
||||
derzeit in diesem Endabschnitt gespeichert sind, sodass sie an beliebiger Stelle
|
||||
in den Paritätsdateien platziert werden können, wo freier Speicherplatz
|
||||
|
|
@ -1161,7 +1165,7 @@ SnapRAID bietet die folgenden Optionen:
|
|||
Wiederherstellung gedacht.
|
||||
|
||||
-C, --gen-conf CONTENT
|
||||
Generiert eine Dummy-Konfigurationsdatei aus einer vorhandenen
|
||||
Generiert eine Dummy-Konfigurationsdatei aus einer bestehenden
|
||||
Content-Datei. Die Konfigurationsdatei wird in die Standardausgabe
|
||||
geschrieben und überschreibt keine vorhandene.
|
||||
Diese Konfigurationsdatei enthält auch die Informationen,
|
||||
|
|
@ -1189,8 +1193,8 @@ SnapRAID bietet die folgenden Optionen:
|
|||
Gibt die Programmversion aus.
|
||||
|
||||
|
||||
7 CONFIGURATION
|
||||
===============
|
||||
7 KONFIGURATION (CONFIGURATION)
|
||||
===============================
|
||||
|
||||
SnapRAID benötigt eine Konfigurationsdatei, um zu wissen, wo sich
|
||||
Ihr Festplatten-Array befindet und wo die Paritätsinformationen
|
||||
|
|
@ -1207,9 +1211,8 @@ enthalten:
|
|||
7.1 parity FILE [,FILE] ...
|
||||
---------------------------
|
||||
|
||||
Definiert die Dateien, die zum Speichern der Paritätsinformationen
|
||||
verwendet werden sollen. Die Parität ermöglicht den Schutz
|
||||
vor einem einzelnen Festplattenausfall, ähnlich wie bei RAID5.
|
||||
Definiert die Dateien, die zum Speichern der Paritätsinformationen verwendet werden.
|
||||
Die Parität ermöglicht den Schutz vor einem einzelnen Festplattenausfall, ähnlich wie bei RAID5.
|
||||
|
||||
Sie können mehrere Dateien angeben, die sich auf unterschiedlichen
|
||||
Festplatten befinden müssen. Wenn eine Datei nicht mehr wachsen
|
||||
|
|
@ -1231,8 +1234,7 @@ Diese Option ist obligatorisch und kann nur einmal verwendet werden.
|
|||
7.2 (2,3,4,5,6)-parity FILE [,FILE] ...
|
||||
---------------------------------------
|
||||
|
||||
Definiert die Dateien, die zum Speichern zusätzlicher Paritätsinformationen
|
||||
verwendet werden sollen.
|
||||
Definiert die Dateien, die zum Speichern zusätzlicher Paritätsinformationen verwendet werden.
|
||||
|
||||
Für jede angegebene Paritätsstufe wird eine zusätzliche Schutzstufe
|
||||
aktiviert:
|
||||
|
|
@ -1274,8 +1276,8 @@ indem die Konfigurationsdatei mit der gewünschten z-parity- oder
|
|||
7.4 content FILE
|
||||
----------------
|
||||
|
||||
Definiert die Datei, die zum Speichern der Liste und Prüfsummen
|
||||
aller im Festplatten-Array vorhandenen Dateien verwendet werden soll.
|
||||
Definiert die Datei, die zum Speichern der Liste und der Prüfsummen aller
|
||||
im Festplatten-Array vorhandenen Dateien verwendet wird.
|
||||
|
||||
Sie kann auf einer für Daten, Parität oder einer anderen
|
||||
verfügbaren Festplatte platziert werden.
|
||||
|
|
@ -1291,10 +1293,9 @@ plus eine speichern. Die Verwendung zusätzlicher Kopien schadet nicht.
|
|||
7.5 data NAME DIR
|
||||
-----------------
|
||||
|
||||
Definiert den Namen und den Einhängepunkt (Mount Point) der
|
||||
Datenfestplatten im Array. NAME wird zur Identifizierung der
|
||||
Festplatte verwendet und muss eindeutig sein. DIR ist der
|
||||
Einhängepunkt der Festplatte im Dateisystem.
|
||||
Definiert den Namen und Einhängepunkt der Datenfestplatten im Array. NAME
|
||||
wird zur Identifizierung der Festplatte verwendet und muss eindeutig sein.
|
||||
DIR ist der Einhängepunkt der Festplatte im Dateisystem.
|
||||
|
||||
Sie können den Einhängepunkt nach Bedarf ändern, solange Sie
|
||||
den NAME unverändert lassen.
|
||||
|
|
@ -1319,14 +1320,40 @@ z. B. die Boot-Festplatte.
|
|||
Beachten Sie, dass solche Festplatten nicht von den Befehlen `up` und `down`
|
||||
betroffen sind, da von ihnen erwartet wird, dass sie sich immer drehen.
|
||||
|
||||
7.7 nohidden
|
||||
7.7 snapshot
|
||||
------------
|
||||
|
||||
Aktiviert die Verwendung von Dateisystem-Snapshots für die Befehle `sync`, `scrub`,
|
||||
`check` und `fix`.
|
||||
|
||||
Wenn aktiviert, erstellt SnapRAID zu Beginn eines 'sync' einen schreibgeschützten
|
||||
Snapshot Ihrer Daten. Dies gewährleistet eine konsistente Point-in-Time-Ansicht
|
||||
Ihrer Dateien und verhindert Fehler, die durch gleichzeitige Dateiänderungen verursacht werden.
|
||||
|
||||
Dies verbessert die Wiederherstellung erheblich: Wenn eine Datei aus dem
|
||||
Live-Dateisystem gelöscht wird, bleibt sie im Snapshot erhalten. Dies verhindert,
|
||||
dass die Parität für diesen Block "beschädigt" wird, sodass Sie Daten immer noch
|
||||
erfolgreich wiederherstellen können, wenn eine andere Festplatte ausfällt.
|
||||
|
||||
Diese Option gilt ausschließlich für Datenträger, die mit den Dateisystemen
|
||||
Btrfs, Bcachefs oder ZFS unter Linux und NTFS unter Windows formatiert sind.
|
||||
Paritätsfestplatten oder Datenträger mit anderen Dateisystemen verwenden immer
|
||||
die Live-Version des Dateisystems.
|
||||
|
||||
Das Erstellen und Löschen von Snapshots erfordert Administratorrechte.
|
||||
Stellen Sie sicher, dass SnapRAID mit den erforderlichen Berechtigungen (z. B. sudo)
|
||||
ausgeführt wird, wenn diese Option aktiviert ist.
|
||||
|
||||
Eine detaillierte Erklärung des Snapshot-Lebenszyklus finden Sie im Abschnitt SNAPSHOTS.
|
||||
|
||||
7.8 nohidden
|
||||
------------
|
||||
|
||||
Schließt alle versteckten Dateien und Verzeichnisse aus.
|
||||
Unter Unix sind versteckte Dateien solche, die mit `.` beginnen.
|
||||
Unter Windows sind es solche mit dem versteckten Attribut.
|
||||
|
||||
7.8 exclude/include PATTERN
|
||||
7.9 exclude/include PATTERN
|
||||
---------------------------
|
||||
|
||||
Definiert die Datei- oder Verzeichnismuster, die im `sync`-Vorgang
|
||||
|
|
@ -1345,8 +1372,8 @@ PATTERN.
|
|||
|
||||
Diese Option kann mehrmals verwendet werden.
|
||||
|
||||
7.9 blocksize SIZE_IN_KIBIBYTES
|
||||
-------------------------------
|
||||
7.10 blocksize SIZE_IN_KIBIBYTES
|
||||
--------------------------------
|
||||
|
||||
Definiert die grundlegende Blockgröße in Kibibytes für die Parität.
|
||||
Ein Kibibyte entspricht 1024 Bytes.
|
||||
|
|
@ -1399,7 +1426,7 @@ Dies führt zu etwa 1,5% zusätzlichem Speicherplatz, ungefähr 60 GB
|
|||
für eine 4 TB Festplatte, was etwa 460.000 Dateien auf jeder
|
||||
Datenfestplatte ohne verschwendeten Platz ermöglicht.
|
||||
|
||||
7.10 hashsize SIZE_IN_BYTES
|
||||
7.11 hashsize SIZE_IN_BYTES
|
||||
---------------------------
|
||||
|
||||
Definiert die Hash-Größe in Bytes für die gespeicherten Blöcke.
|
||||
|
|
@ -1438,7 +1465,7 @@ von 512 erhalten Sie:
|
|||
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0.51 GiB
|
||||
|
||||
7.11 autosave SIZE_IN_GIGABYTES
|
||||
7.12 autosave SIZE_IN_GIGABYTES
|
||||
-------------------------------
|
||||
|
||||
Speichert den Zustand beim Synchronisieren oder Scrubben automatisch
|
||||
|
|
@ -1447,7 +1474,7 @@ Diese Option ist nützlich, um zu vermeiden, dass lange `sync`-Befehle
|
|||
von vorne gestartet werden müssen, wenn sie durch einen Maschinenabsturz
|
||||
oder ein anderes Ereignis unterbrochen werden.
|
||||
|
||||
7.12 temp_limit TEMPERATURE_CELSIUS
|
||||
7.13 temp_limit TEMPERATURE_CELSIUS
|
||||
-----------------------------------
|
||||
|
||||
Legt die maximal zulässige Festplattentemperatur in Celsius fest.
|
||||
|
|
@ -1483,14 +1510,14 @@ Normalerweise zeigt SnapRAID nur die Temperatur der heißesten
|
|||
Festplatte an. Um die Temperatur aller Festplatten anzuzeigen,
|
||||
verwenden Sie die Option -A oder --stats.
|
||||
|
||||
7.13 temp_sleep TIME_IN_MINUTES
|
||||
7.14 temp_sleep TIME_IN_MINUTES
|
||||
-------------------------------
|
||||
|
||||
Legt die Standby-Zeit in Minuten fest, wenn der Temperaturgrenzwert
|
||||
erreicht wird. Während dieser Zeit bleiben die Festplatten heruntergefahren.
|
||||
Der Standardwert ist 5 Minuten.
|
||||
|
||||
7.14 pool DIR
|
||||
7.15 pool DIR
|
||||
-------------
|
||||
|
||||
Definiert das Pooling-Verzeichnis, in dem die virtuelle Ansicht des
|
||||
|
|
@ -1498,7 +1525,7 @@ Festplatten-Arrays mithilfe des Befehls `pool` erstellt wird.
|
|||
|
||||
Das Verzeichnis muss bereits existieren.
|
||||
|
||||
7.15 share UNC_DIR
|
||||
7.16 share UNC_DIR
|
||||
------------------
|
||||
|
||||
Definiert den Windows UNC-Pfad, der für den Remote-Zugriff auf die
|
||||
|
|
@ -1516,7 +1543,7 @@ und schließlich das Dateiverzeichnis und der Name hinzugefügt werden.
|
|||
|
||||
Diese Option ist nur für Windows erforderlich.
|
||||
|
||||
7.16 smartctl DISK/PARITY OPTIONS...
|
||||
7.17 smartctl DISK/PARITY OPTIONS...
|
||||
------------------------------------
|
||||
|
||||
Definiert benutzerdefinierte smartctl-Optionen, um die SMART-Attribute
|
||||
|
|
@ -1533,6 +1560,9 @@ In den angegebenen OPTIONS wird die Zeichenfolge `%s` durch den
|
|||
Gerätenamen ersetzt. Bei RAID-Controllern ist das Gerät
|
||||
wahrscheinlich fest, und Sie müssen `%s` möglicherweise nicht verwenden.
|
||||
|
||||
Sie können auch eine benutzerdefinierte Info-Optionszeichenfolge mit dem
|
||||
Tag `[info: ...]` angeben, um die Standardoption `-a` zu ersetzen.
|
||||
|
||||
Weitere mögliche Optionen finden Sie in der smartmontools-Dokumentation:
|
||||
|
||||
https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
|
|
@ -1540,9 +1570,10 @@ Weitere mögliche Optionen finden Sie in der smartmontools-Dokumentation:
|
|||
|
||||
Zum Beispiel:
|
||||
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl parity -d sat %s
|
||||
|
||||
7.17 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
7.18 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
-------------------------------------------
|
||||
|
||||
Ignoriert das angegebene SMART-Attribut bei der Berechnung der
|
||||
|
|
@ -1556,17 +1587,24 @@ ist. PARITY ist einer der Paritätsnamen: `parity`, `2-parity`,
|
|||
Der Sonderwert * kann verwendet werden, um das Attribut auf allen
|
||||
Festplatten zu ignorieren.
|
||||
|
||||
Um beispielsweise das Attribut `Current Pending Sector Count` auf allen
|
||||
Festplatten zu ignorieren:
|
||||
Es können mehrere Attribute durch Leerzeichen getrennt angegeben werden.
|
||||
Jedes Attribut kann als Nummer von 1 bis 255 oder als Name ohne
|
||||
Berücksichtigung der Groß-/Kleinschreibung (z. B. `Current_Pending_Sector`)
|
||||
angegeben werden.
|
||||
|
||||
smartignore * 197
|
||||
Um beispielsweise das Attribut `Current Pending Sector Count` und
|
||||
`Reallocated Sectors Count` auf allen Festplatten über ihre Nummer
|
||||
oder ihren Namen zu ignorieren:
|
||||
|
||||
Um es nur auf der ersten Paritätsfestplatte zu ignorieren:
|
||||
smartignore * 197 5
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
smartignore parity 197
|
||||
Um sie nur auf der ersten Paritätsfestplatte zu ignorieren:
|
||||
|
||||
7.18 Examples
|
||||
-------------
|
||||
smartignore parity 197 5
|
||||
|
||||
7.19 Beispiele (Examples)
|
||||
-------------------------
|
||||
|
||||
Ein Beispiel für eine typische Konfiguration für Unix ist:
|
||||
|
||||
|
|
@ -1578,7 +1616,7 @@ Ein Beispiel für eine typische Konfiguration für Unix ist:
|
|||
data d3 /mnt/disk3/
|
||||
exclude /lost+found/
|
||||
exclude /tmp/
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/sg0
|
||||
smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1600,8 +1638,122 @@ Ein Beispiel für eine typische Konfiguration für Windows ist:
|
|||
smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
|
||||
8 PATTERN
|
||||
=========
|
||||
8 SNAPSHOTS
|
||||
===========
|
||||
|
||||
Wenn die Snapshot-Option in der Konfiguration aktiviert ist, nutzt SnapRAID
|
||||
die Dateisystem-Snapshot-Funktionalität, um atomare und konsistente Operationen zu gewährleisten.
|
||||
|
||||
Die Verwaltung von Snapshots erfolgt vollständig automatisch und transparent.
|
||||
Sie können SnapRAID genau wie bisher verwenden, wobei der zusätzliche Schutz
|
||||
durch Snapshots vollständig im Hintergrund abgewickelt wird.
|
||||
|
||||
Dies bietet zwei wesentliche Vorteile:
|
||||
|
||||
Konsistenz - Dateien, die während eines lang laufenden Syncs oder Scrubs auf dem Live-Dateisystem
|
||||
geändert werden, verursachen keine Paritätskonflikte oder abgebrochenen Operationen,
|
||||
da SnapRAID ein eingefrorenes Point-in-Time-Abbild sieht.
|
||||
Wiederherstellung - Wenn eine Datei im Live-Dateisystem aktualisiert oder gelöscht wird,
|
||||
bleibt sie im Snapshot erhalten. Wenn ein Festplattenausfall auftritt,
|
||||
bevor der nächste Sync ausgeführt wird, verwendet SnapRAID die im Snapshot konservierten Daten,
|
||||
um die ausgefallene Festplatte zu rekonstruieren.
|
||||
|
||||
Im Falle eines Festplattenausfalls während eines aktiven Sync-Vorgangs
|
||||
ist SnapRAID auch in der Lage, automatisch sowohl aus dem Snapshot
|
||||
der vorherigen Paritätsberechnung als auch aus der aktuellen zu lesen.
|
||||
Dies maximiert die Wahrscheinlichkeit einer vollständigen Wiederherstellung, indem
|
||||
Zugriff auf die genauen Datenblöcke gewährt wird, die zur Lösung der Paritätsgleichungen
|
||||
erforderlich sind, selbst wenn diese Blöcke zwischen den Syncs geändert oder gelöscht wurden.
|
||||
|
||||
Ohne Snapshots führt eine aktualisierte oder gelöschte Datei auf einer gesunden
|
||||
Festplatte zu fehlenden Datenblöcken, die möglicherweise zur Reparatur
|
||||
anderer ausgefallener Festplatten benötigt werden.
|
||||
|
||||
Snapshots werden nur für Datenträger erstellt und nur dann, wenn das zugrunde liegende
|
||||
Dateisystem diese Funktionalität unterstützt. Paritätsfestplatten verwenden immer
|
||||
das Live-Dateisystem.
|
||||
|
||||
Derzeit wird dies auf Btrfs, Bcachefs und ZFS unter Linux
|
||||
und auf NTFS unter Windows unterstützt.
|
||||
|
||||
Sie können Datenträger mit unterschiedlichen Dateisystemen mischen. Nur diejenigen, die
|
||||
Snapshots unterstützen, werden diese nutzen, während andere Festplatten weiterhin
|
||||
direkt auf dem Live-Dateisystem arbeiten.
|
||||
|
||||
Das Erstellen und Löschen von Snapshots erfordert Administratorrechte.
|
||||
Stellen Sie sicher, dass SnapRAID mit den erforderlichen Berechtigungen (z. B. sudo)
|
||||
ausgeführt wird, wenn Snapshots aktiviert sind.
|
||||
|
||||
8.1 Befehlsverhalten mit Snapshots (Command Behavior with Snapshots)
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Die Befehle `sync` und `scrub` arbeiten beide ausschließlich auf Snapshots,
|
||||
um sicherzustellen, dass alle Datenoperationen auf einem konsistenten,
|
||||
eingefrorenen Zustand ausgeführt werden. Durch die Nutzung dieser Snapshots verhindert SnapRAID Paritätskonflikte,
|
||||
die andernfalls durch gleichzeitige Dateiänderungen auf dem Live-Dateisystem ausgelöst würden.
|
||||
Während eines `sync` verwendet der Befehl einen neuen Snapshot, der zu Beginn des Prozesses
|
||||
erstellt wurde, um den aktuellen Zustand für die Paritätsberechnung zu erfassen.
|
||||
Im Gegensatz dazu verwendet der Befehl `scrub` den letzten Snapshot, also den, der
|
||||
während des letzten erfolgreichen Syncs erstellt wurde, um einen zuverlässigen Referenzpunkt
|
||||
beizubehalten, der mit der vorhandenen Parität übereinstimmt.
|
||||
|
||||
Bei den Befehlen `check` und `fix` hängt die Verwendung des letzten Snapshots
|
||||
davon ab, ob bestimmte Festplatten mit der Option -d, --filter-disk ausgewählt wurden.
|
||||
|
||||
Eine explizit über -d ausgewählte Festplatte (das „Ziel“ der Operation)
|
||||
verwendet immer das Live-Dateisystem. Für `fix` ermöglicht dies das Wiederherstellen
|
||||
von Daten auf dem aktiven Festplattenersatz. Für `check` ermöglicht es die Simulation
|
||||
des `fix`-Vorgangs unter denselben Bedingungen.
|
||||
|
||||
Auf alle anderen Datenträger (die „Referenz“-Festplatten) wird über ihre Snapshots zugegriffen.
|
||||
Dies stellt sicher, dass SnapRAID selbst dann, wenn Sie während einer laufenden Wiederherstellung
|
||||
Dateien auf Ihren gesunden Festplatten ändern, eine stabile, eingefrorene Referenz hat,
|
||||
um die Paritätsgleichungen zu lösen.
|
||||
|
||||
Wenn keine Option -d angegeben ist, nimmt SnapRAID an, dass die Operation für das gesamte Array gilt.
|
||||
In diesem Fall verwenden `check` und `fix` ausschließlich die Live-Dateisysteme.
|
||||
|
||||
Alle anderen Befehle arbeiten ausschließlich auf dem Live-Dateisystem.
|
||||
|
||||
|
||||
9 LEBENSZYKLUS VON SNAPSHOTS (SNAPSHOTS LIFECYCLE)
|
||||
==================================================
|
||||
|
||||
SnapRAID verwaltet zwei spezifische Snapshots, `stable` und `pending`,
|
||||
in einem versteckten Verzeichnis im Stammverzeichnis jedes Daten-Subvolumes.
|
||||
Unter Btrfs, Bcachefs und NTFS wird das Verzeichnis `.snapraid/` verwendet,
|
||||
unter ZFS das Standardverzeichnis `.zfs/snapshot/`.
|
||||
|
||||
Der `stable`-Snapshot repräsentiert den Zustand des letzten
|
||||
erfolgreich abgeschlossenen `sync` und enthält die genauen Daten, die zur
|
||||
Berechnung der aktuellen Parität verwendet wurden. Er dient als primäre Datenquelle
|
||||
für die Befehle `scrub`, `check` und `fix`.
|
||||
|
||||
Der `pending`-Snapshot ist ein temporäres Abbild, das zu Beginn eines `sync`
|
||||
erstellt wird, um einen eingefrorenen Zustand für die Paritätsberechnung bereitzustellen.
|
||||
Nach erfolgreichem Abschluss des Vorgangs wird der vorherige `stable`-Snapshot gelöscht
|
||||
und der `pending`-Snapshot wird heraufgestuft, um seinen Platz als neue stabile Referenz einzunehmen.
|
||||
|
||||
Wenn ein `sync` unterbrochen wird, bleibt der `pending`-Snapshot erhalten.
|
||||
Nachfolgende `scrub`-, `check`- und `fix`-Befehle verwenden diesen ausstehenden Snapshot,
|
||||
da er mit dem in der .content-Datei aufgezeichneten Dateisystemzustand übereinstimmt,
|
||||
selbst wenn die Parität nur teilweise synchronisiert ist.
|
||||
|
||||
Im Falle einer `sync`-Unterbrechung lesen die Befehle `check` und `fix`
|
||||
auch aus dem `stable`-Snapshot, um Datenblöcke von Dateien abzurufen,
|
||||
die während des Syncs aktualisiert oder gelöscht wurden.
|
||||
Dies ist möglich, da die .content-Datei Metadaten für alle geänderten oder
|
||||
gelöschten Dateien während des gesamten Sync-Prozesses aufbewahrt.
|
||||
Diese historischen Informationen werden erst gelöscht, wenn ein Sync erfolgreich abgeschlossen
|
||||
und die endgültige Version der .content-Datei gespeichert wurde.
|
||||
|
||||
Wenn ein `sync` nach einer Unterbrechung neu gestartet wird, wird der vorhandene
|
||||
ausstehende (pending) Snapshot gelöscht und ein neuer erstellt, um den
|
||||
aktuellen Zustand des Live-Dateisystems zu erfassen.
|
||||
|
||||
|
||||
10 MUSTER (PATTERN)
|
||||
===================
|
||||
|
||||
Muster bieten eine flexible Möglichkeit, Dateien für die Einbeziehung oder
|
||||
den Ausschluss zu filtern. Durch die Verwendung von Globbing-Zeichen können Sie Regeln definieren,
|
||||
|
|
@ -1724,8 +1876,8 @@ Unter Unix müssen Sie Globbing-Zeichen in der Befehlszeile in
|
|||
Anführungszeichen setzen, um zu verhindern, dass die Shell sie erweitert.
|
||||
|
||||
|
||||
9 DATEIEN IGNORIEREN
|
||||
====================
|
||||
11 DATEIEN IGNORIEREN (IGNORE FILE)
|
||||
===================================
|
||||
|
||||
Zusätzlich zu den globalen Regeln in der Konfigurationsdatei können Sie
|
||||
`.snapraidignore`-Dateien in jedem Verzeichnis innerhalb des Arrays platzieren,
|
||||
|
|
@ -1769,8 +1921,8 @@ Wenn Sie beispielsweise eine `.snapraidignore` in `/mnt/disk1/projects/` haben:
|
|||
*.tmp
|
||||
|
||||
|
||||
10 CONTENT
|
||||
==========
|
||||
12 INHALT (CONTENT)
|
||||
===================
|
||||
|
||||
SnapRAID speichert die Liste und Prüfsummen Ihrer Dateien in der
|
||||
Content-Datei.
|
||||
|
|
@ -1779,12 +1931,15 @@ Es ist eine Binärdatei, die alle im Festplatten-Array vorhandenen
|
|||
Dateien auflistet, zusammen mit allen Prüfsummen zur Überprüfung
|
||||
ihrer Integrität.
|
||||
|
||||
Diese Datei wird von den Befehlen `sync` und `scrub` gelesen und
|
||||
geschrieben und von den Befehlen `fix`, `check` und `status` gelesen.
|
||||
Die Content-Datei wird von den Befehlen `sync`, `scrub`, `touch` und
|
||||
`rehash` gelesen und geschrieben. Sie wird von den Befehlen `status`,
|
||||
`diff`, `check`, `fix`, `list`, `dup`, `locate` und `pool` gelesen und
|
||||
von den Befehlen `smart`, `probe`, `up`, `down` und `devices` vollständig
|
||||
ignoriert.
|
||||
|
||||
|
||||
11 PARITY
|
||||
=========
|
||||
13 PARITäT (PARITY)
|
||||
===================
|
||||
|
||||
SnapRAID speichert die Paritätsinformationen Ihres Arrays in den
|
||||
Paritätsdateien.
|
||||
|
|
@ -1796,8 +1951,8 @@ Diese Dateien werden von den Befehlen `sync` und `fix` gelesen
|
|||
und geschrieben und nur von den Befehlen `scrub` und `check` gelesen.
|
||||
|
||||
|
||||
12 ENCODING
|
||||
===========
|
||||
14 KODIERUNG (ENCODING)
|
||||
=======================
|
||||
|
||||
SnapRAID ignoriert unter Unix jede Kodierung. Es liest und speichert
|
||||
die Dateinamen mit derselben Kodierung, die vom Dateisystem
|
||||
|
|
@ -1814,13 +1969,30 @@ die Konsolenausgabe in eine Datei umleiten, ist die resultierende
|
|||
Datei immer im UTF-8-Format.
|
||||
|
||||
|
||||
13 COPYRIGHT
|
||||
15 EXIT-CODE (EXIT CODE)
|
||||
========================
|
||||
|
||||
SnapRAID endet mit den folgenden Fehlercodes:
|
||||
|
||||
0 - Alles OK.
|
||||
1 - Der Befehl ist auf Fehler gestoßen.
|
||||
2 - Der Befehl `diff` hat festgestellt, dass alles OK ist, aber ein `sync` erforderlich ist.
|
||||
|
||||
|
||||
16 ÜBERSETZUNG (TRANSLATION)
|
||||
============================
|
||||
|
||||
Dieses Dokument ist eine automatische Übersetzung des englischen Handbuchs.
|
||||
Die maßgebliche Version finden Sie im englischen Handbuch.
|
||||
|
||||
|
||||
17 COPYRIGHT
|
||||
============
|
||||
|
||||
Diese Datei ist Copyright (C) 2025 Andrea Mazzoleni
|
||||
Diese Datei ist Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
|
||||
14 SEE ALSO
|
||||
===========
|
||||
18 SIEHE AUCH (SEE ALSO)
|
||||
========================
|
||||
|
||||
snapraid_log(1), snapraidd(1)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
.TH "SnapRAID Backup para Arrays de Discos" 1
|
||||
.SH NAME
|
||||
snapraid \- SnapRAID Backup para Arrays de Discos
|
||||
.SH SYNOPSIS
|
||||
.SH SINOPSIS (SYNOPSIS)
|
||||
snapraid [\-c, \-\-conf CONFIG]
|
||||
.PD 0
|
||||
.PP
|
||||
|
|
@ -77,7 +77,7 @@ snapraid [\-c, \-\-conf CONFIG]
|
|||
snapraid [\-V, \-\-version] [\-H, \-\-help] [\-C, \-\-gen\-conf CONTENT]
|
||||
.PD 0
|
||||
.PD
|
||||
.SH DESCRIPTION
|
||||
.SH DESCRIPCIóN (DESCRIPTION)
|
||||
SnapRAID es un programa de copia de seguridad diseñado para arrays
|
||||
de discos, que almacena información de paridad para la recuperación
|
||||
de datos en caso de hasta seis fallos de disco.
|
||||
|
|
@ -90,7 +90,7 @@ características:
|
|||
Puede utilizar discos ya llenos de archivos sin la necesidad de
|
||||
reformatearlos, accediendo a ellos como de costumbre.
|
||||
.IP \(bu
|
||||
Todos sus datos son hasheados para asegurar la integridad de los datos
|
||||
Todos sus datos son procesados con hash para asegurar la integridad de los datos
|
||||
y prevenir la corrupción silenciosa.
|
||||
.IP \(bu
|
||||
Cuando el número de discos fallidos excede el recuento de paridad,
|
||||
|
|
@ -118,23 +118,34 @@ https://www.snapraid.it/
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH LIMITATIONS
|
||||
SnapRAID es un híbrido entre un programa RAID y un programa de copia
|
||||
de seguridad, con el objetivo de combinar los mejores beneficios de
|
||||
ambos. Sin embargo, tiene algunas limitaciones que debe considerar
|
||||
antes de usarlo.
|
||||
.SH LIMITACIONES (LIMITATIONS)
|
||||
SnapRAID es un híbrido entre un RAID y un programa de copia de seguridad, con el objetivo de combinar
|
||||
los mejores beneficios de ambos. Sin embargo, tiene algunas limitaciones que debería
|
||||
considerar antes de usarlo.
|
||||
.PP
|
||||
La principal limitación es que si un disco falla y no ha sincronizado
|
||||
recientemente, es posible que no pueda recuperarse por completo.
|
||||
Más específicamente, es posible que no pueda recuperar hasta el tamaño
|
||||
de los archivos cambiados o eliminados desde la última operación de
|
||||
sincronización. Esto ocurre incluso si los archivos cambiados o
|
||||
eliminados no están en el disco fallido. Esta es la razón por la que
|
||||
SnapRAID es más adecuado para datos que rara vez cambian.
|
||||
La principal limitación es que si un disco falla, solo puede recuperar datos hasta el
|
||||
estado de la última operación de sincronización (\`sync\`). Cualquier dato añadido o modificación realizada
|
||||
desde la última sincronización que se encuentre en el disco dañado se perderá.
|
||||
.PP
|
||||
Por otro lado, los archivos recién agregados no impiden la recuperación
|
||||
de los archivos ya existentes. Solo perderá los archivos recién
|
||||
agregados si están en el disco fallido.
|
||||
Por lo tanto, SnapRAID es adecuado principalmente para datos que cambian raramente.
|
||||
.PP
|
||||
Para los datos que ya existían en la última sincronización, la fiabilidad de la recuperación depende
|
||||
de si se utiliza la opción de instantánea (\`snapshot\`):
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Con soporte para instantáneas (disponible en Btrfs, ZFS, Bcachefs y NTFS),
|
||||
SnapRAID puede mantener automáticamente una referencia congelada de sus discos de datos.
|
||||
Esto garantiza que incluso si modifica o elimina archivos en su sistema de archivos activo
|
||||
durante o después de un sync, el proceso de recuperación se mantenga consistente y confiable.
|
||||
.PD
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Sin soporte para instantáneas, eliminar o cambiar archivos después de un \`sync\`
|
||||
puede impedir la recuperación completa de otros discos fallidos. Esto ocurre
|
||||
porque la paridad ya no coincide con los archivos modificados, incluso si
|
||||
esos archivos no están en el disco fallido. Por otro lado, los archivos recién añadidos
|
||||
no impiden la recuperación de los archivos ya existentes.
|
||||
.PD
|
||||
.PP
|
||||
Otras limitaciones de SnapRAID son:
|
||||
.PD 0
|
||||
|
|
@ -153,10 +164,10 @@ Con una copia de seguridad, puede recuperarse de un fallo completo
|
|||
de todo el array de discos.
|
||||
.IP \(bu
|
||||
Solo se guardan nombres de archivo, marcas de tiempo, enlaces simbólicos
|
||||
y enlaces duros. Los permisos, la propiedad y los atributos
|
||||
y enlaces físicos. Los permisos, la propiedad y los atributos
|
||||
extendidos no se guardan.
|
||||
.PD
|
||||
.SH GETTING STARTED
|
||||
.SH PRIMEROS PASOS (GETTING STARTED)
|
||||
Para usar SnapRAID, primero debe seleccionar un disco en su array de
|
||||
discos para dedicarlo a la información de \`parity\` (paridad). Con un
|
||||
disco para paridad, podrá recuperarse de un solo fallo de disco,
|
||||
|
|
@ -303,9 +314,9 @@ Cuando este comando se complete, sus datos estarán SEGUROS.
|
|||
.PP
|
||||
Ahora puede comenzar a usar su array como desee y periódicamente
|
||||
actualizar la información de paridad ejecutando el comando \`sync\`.
|
||||
.SS Scrubbing
|
||||
.SS Limpieza (Scrubbing)
|
||||
Para verificar periódicamente los datos y la paridad en busca de
|
||||
errores, puede ejecutar el comando \`scrub\` (fregar/limpiar).
|
||||
errores, puede ejecutar el comando \`scrub\` (depurar/limpiar).
|
||||
.PP
|
||||
.RS 4
|
||||
snapraid scrub
|
||||
|
|
@ -317,7 +328,7 @@ Este comando compara los datos de su array con el hash calculado
|
|||
durante el comando \`sync\` para verificar la integridad.
|
||||
.PP
|
||||
Cada ejecución del comando verifica aproximadamente el 8% del array,
|
||||
excluyendo los datos ya fregados en los 10 días anteriores.
|
||||
excluyendo los datos ya depurados en los 10 días anteriores.
|
||||
Puede usar la opción \-p, \-\-plan para especificar una cantidad
|
||||
diferente y la opción \-o, \-\-older\-than para especificar una edad
|
||||
diferente en días. Por ejemplo, para verificar el 5% del array en
|
||||
|
|
@ -348,9 +359,9 @@ snapraid \-e fix
|
|||
.PD
|
||||
.RE
|
||||
.PP
|
||||
En el siguiente \`scrub\`, los errores desaparecerán del informe de
|
||||
En la siguiente depuración (\`scrub\`), los errores desaparecerán del informe de
|
||||
\`status\` si realmente se han corregido. Para hacerlo más rápido,
|
||||
puede usar \-p bad para fregar solo los bloques marcados como defectuosos.
|
||||
puede usar \-p bad para depurar solo los bloques marcados como defectuosos.
|
||||
.PP
|
||||
.RS 4
|
||||
snapraid \-p bad scrub
|
||||
|
|
@ -362,11 +373,11 @@ Ejecutar \`scrub\` en un array no sincronizado puede reportar errores
|
|||
causados por archivos eliminados o modificados. Estos errores se
|
||||
informan en la salida de \`scrub\`, pero los bloques relacionados no
|
||||
se marcan como defectuosos.
|
||||
.SS Pooling
|
||||
.SS Agrupación (Pooling)
|
||||
Nota: La función de pooling descrita a continuación ha sido
|
||||
sustituida por la herramienta mergerfs, que ahora es la opción
|
||||
recomendada para los usuarios de Linux en la comunidad SnapRAID.
|
||||
Mergefs proporciona una forma más flexible y eficiente de agrupar
|
||||
Mergerfs proporciona una forma más flexible y eficiente de agrupar
|
||||
múltiples unidades en un único punto de montaje unificado,
|
||||
permitiendo un acceso sin problemas a los archivos en todo su array
|
||||
sin depender de enlaces simbólicos. Se integra bien con SnapRAID
|
||||
|
|
@ -516,7 +527,7 @@ fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Undeleting
|
||||
.SS Restauración (Undeleting)
|
||||
SnapRAID funciona más como un programa de copia de seguridad que como
|
||||
un sistema RAID, y se puede usar para restaurar o recuperar archivos
|
||||
a su estado anterior usando la opción \-f, \-\-filter:
|
||||
|
|
@ -553,15 +564,15 @@ snapraid fix \-m
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Recovering
|
||||
.SS Recuperación (Recovering)
|
||||
Ha sucedido lo peor, ¡y ha perdido uno o más discos!
|
||||
.PP
|
||||
¡NO ENTRE EN PÁNICO! ¡Podrá recuperarlos!
|
||||
.PP
|
||||
Lo primero que debe hacer es evitar más cambios en su array de discos.
|
||||
Deshabilite cualquier conexión remota a él y cualquier proceso
|
||||
programado, incluida cualquier sincronización o fregado nocturno
|
||||
programado de SnapRAID.
|
||||
programado, incluida cualquier sincronización o depuración nocturna
|
||||
programada de SnapRAID.
|
||||
.PP
|
||||
Luego, proceda con los siguientes pasos.
|
||||
.SS STEP 1 \-> Reconfigure
|
||||
|
|
@ -660,19 +671,19 @@ snapraid sync
|
|||
.RE
|
||||
.PP
|
||||
Si todo se recupera, este comando es inmediato.
|
||||
.SH COMMANDS
|
||||
SnapRAID proporciona algunos comandos simples que le permiten:
|
||||
.SH COMANDOS (COMMANDS)
|
||||
SnapRAID proporciona unos pocos comandos simples que le permiten:
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Imprimir el estado del array \-> \`status\`
|
||||
Mostrar el estado del array \-> \`status\`
|
||||
.IP \(bu
|
||||
Controlar los discos \-> \`smart\`, \`probe\`, \`up\`, \`down\`
|
||||
.IP \(bu
|
||||
Hacer una copia de seguridad/instantánea \-> \`sync\`
|
||||
Crear un punto de copia de seguridad/recuperación \-> \`sync\`
|
||||
.IP \(bu
|
||||
Comprobar periódicamente los datos \-> \`scrub\`
|
||||
.IP \(bu
|
||||
Restaurar la última copia de seguridad/instantánea \-> \`fix\`.
|
||||
Restaurar el último punto de copia de seguridad/recuperación \-> \`fix\`.
|
||||
.PD
|
||||
.PP
|
||||
Los comandos deben escribirse en minúsculas.
|
||||
|
|
@ -681,7 +692,7 @@ Imprime un resumen del estado del array de discos.
|
|||
.PP
|
||||
Incluye información sobre la fragmentación de la paridad, la antigüedad
|
||||
de los bloques sin verificar y todos los errores silenciosos
|
||||
registrados encontrados durante el fregado.
|
||||
registrados encontrados durante la depuración.
|
||||
.PP
|
||||
La información presentada se refiere a la última vez que ejecutó
|
||||
\`sync\`. Las modificaciones posteriores no se tienen en cuenta.
|
||||
|
|
@ -690,8 +701,8 @@ Si se detectaron bloques defectuosos, se enumeran sus números de bloque.
|
|||
Para corregirlos, puede usar el comando \`fix \-e\`.
|
||||
.PP
|
||||
También muestra un gráfico que representa la última vez que cada
|
||||
bloque fue fregado o sincronizado. Los bloques fregados se muestran
|
||||
con \`*\`, los bloques sincronizados pero aún no fregados con \`o\`.
|
||||
bloque fue depurado o sincronizado. Los bloques depurados se muestran
|
||||
con \`*\`, los bloques sincronizados pero aún no depurados con \`o\`.
|
||||
.PP
|
||||
Nada se modifica.
|
||||
.SS smart
|
||||
|
|
@ -867,38 +878,38 @@ pero la información de hash calculada previamente se mantiene.
|
|||
Los archivos \`content\` y \`parity\` se modifican si es necesario.
|
||||
Los archivos en el array NO se modifican.
|
||||
.SS scrub
|
||||
Frota (scrubs) el array, buscando errores silenciosos o de
|
||||
Depura (scrubs) el array, buscando errores silenciosos o de
|
||||
entrada/salida en los discos de datos y paridad.
|
||||
.PP
|
||||
Cada invocación verifica aproximadamente el 8% del array, excluyendo
|
||||
los datos ya fregados en los últimos 10 días.
|
||||
Esto significa que fregar una vez a la semana asegura que cada bit de
|
||||
los datos ya depurados en los últimos 10 días.
|
||||
Esto significa que depurar una vez a la semana asegura que cada bit de
|
||||
datos se verifique al menos una vez cada tres meses.
|
||||
.PP
|
||||
Puede definir un plan de fregado o una cantidad diferente utilizando
|
||||
Puede definir un plan de depuración o una cantidad diferente utilizando
|
||||
la opción \-p, \-\-plan, que acepta:
|
||||
bad \- Fregar bloques marcados como defectuosos.
|
||||
new \- Fregar bloques recién sincronizados que aún no han sido fregados.
|
||||
full \- Fregar todo.
|
||||
0\-100 \- Fregar el porcentaje especificado de bloques.
|
||||
bad \- Depurar bloques marcados como defectuosos.
|
||||
new \- Depurar bloques recién sincronizados que aún no han sido depurados.
|
||||
full \- Depurar todo.
|
||||
0\-100 \- Depurar el porcentaje especificado de bloques.
|
||||
.PP
|
||||
Si especifica un valor de porcentaje, también puede usar la opción \-o,
|
||||
\-\-older\-than para definir la antigüedad del bloque.
|
||||
Los bloques más antiguos se friegan primero, asegurando una verificación
|
||||
Los bloques más antiguos se depuran primero, asegurando una verificación
|
||||
óptima.
|
||||
Si desea fregar solo los bloques recién sincronizados que aún no han
|
||||
sido fregados, use la opción \`\-p new\`.
|
||||
Si desea depurar solo los bloques recién sincronizados que aún no han
|
||||
sido depurados, use la opción \`\-p new\`.
|
||||
.PP
|
||||
Para obtener detalles del estado del fregado, use el comando \`status\`.
|
||||
Para obtener detalles del estado de la depuración, use el comando \`status\`.
|
||||
.PP
|
||||
Para cualquier error silencioso o de entrada/salida encontrado, los
|
||||
bloques correspondientes se marcan como defectuosos en el archivo
|
||||
\`content\`.
|
||||
Estos bloques defectuosos se enumeran en \`status\` y se pueden
|
||||
corregir con \`fix \-e\`.
|
||||
Después de la corrección, en el siguiente fregado, se volverán a
|
||||
Después de la corrección, en la siguiente depuración, se volverán a
|
||||
verificar y, si se encuentran corregidos, se eliminará la marca de defectuoso.
|
||||
Para fregar solo los bloques defectuosos, puede usar el comando
|
||||
Para depurar solo los bloques defectuosos, puede usar el comando
|
||||
\`scrub \-p bad\`.
|
||||
.PP
|
||||
Se recomienda ejecutar \`scrub\` solo en un array sincronizado para evitar
|
||||
|
|
@ -912,15 +923,14 @@ verificación de cada bloque y para marcar bloques defectuosos.
|
|||
Los archivos \`parity\` NO se modifican.
|
||||
Los archivos en el array NO se modifican.
|
||||
.SS fix
|
||||
Corrige todos los archivos y la información de paridad.
|
||||
Repara todos los archivos y los datos de paridad.
|
||||
.PP
|
||||
Todos los archivos y la información de paridad se comparan con el
|
||||
estado de instantánea guardado en el último \`sync\`.
|
||||
Si se encuentra una diferencia, se revierte a la instantánea almacenada.
|
||||
Todos los archivos y datos de paridad si comparan con el estado guardado en
|
||||
el último \`sync\`. Si se encuentra una diferencia, se revierte al estado almacenado.
|
||||
.PP
|
||||
¡ADVERTENCIA! El comando \`fix\` no diferencia entre errores y
|
||||
modificaciones intencionales. Revierte incondicionalmente el estado
|
||||
del archivo al último \`sync\`.
|
||||
¡ADVERTENCIA!
|
||||
El comando \`fix\` no diferencia entre errores y modificaciones intencionadas.
|
||||
Revierte incondicionalmente el estado del archivo al del último \`sync\`.
|
||||
.PP
|
||||
Si no se especifica otra opción, se procesa todo el array.
|
||||
Utilice las opciones de filtro para seleccionar un subconjunto de
|
||||
|
|
@ -1051,7 +1061,7 @@ Si desea reasignar estos archivos, puede usar la opción
|
|||
\-W, \-\-force\-realloc\-tail.
|
||||
Tenga en cuenta que dichos archivos no estarán protegidos por la paridad durante
|
||||
el proceso de reasignación.
|
||||
.SH OPTIONS
|
||||
.SH OPCIONES (OPTIONS)
|
||||
SnapRAID proporciona las siguientes opciones:
|
||||
.TP
|
||||
.B \-c, \-\-conf CONFIG
|
||||
|
|
@ -1108,19 +1118,19 @@ según se enumeran en \`status\`.
|
|||
Esta opción solo se puede usar con \`check\` y \`fix\`.
|
||||
.TP
|
||||
.B \-p, \-\-plan PERC|bad|new|full
|
||||
Selecciona el plan de fregado (scrub). Si PERC es un valor
|
||||
Selecciona el plan de depuración (scrub). Si PERC es un valor
|
||||
numérico de 0 a 100, se interpreta como el porcentaje de
|
||||
bloques a fregar.
|
||||
bloques a depurar.
|
||||
En lugar de un porcentaje, puede especificar un plan:
|
||||
\`bad\` friega bloques defectuosos, \`new\` friega bloques aún
|
||||
no fregados, y \`full\` friega todo.
|
||||
\`bad\` depura bloques defectuosos, \`new\` depura bloques aún
|
||||
no depurados, y \`full\` depura todo.
|
||||
Esta opción solo se puede usar con \`scrub\`.
|
||||
.TP
|
||||
.B \-o, \-\-older\-than DAYS
|
||||
Selecciona la parte más antigua del array para procesar en \`scrub\`.
|
||||
DAYS es la edad mínima en días para que un bloque sea fregado;
|
||||
DAYS es la edad mínima en días para que un bloque sea depurado;
|
||||
el valor predeterminado es 10.
|
||||
Los bloques marcados como defectuosos siempre se friegan
|
||||
Los bloques marcados como defectuosos siempre se depuran
|
||||
independientemente de esta opción.
|
||||
Esta opción solo se puede usar con \`scrub\`.
|
||||
.TP
|
||||
|
|
@ -1176,7 +1186,7 @@ Aplica un límite de ancho de banda global para todos los discos.
|
|||
RATE es el número de bytes por segundo. Puede especificar un
|
||||
multiplicador como K, M o G (por ejemplo, \-\-bw\-limit 1G).
|
||||
.TP
|
||||
.B \-t, \-\-tail TAMAÑO
|
||||
.B \-t, \-\-tail SIZE
|
||||
Limita la lista de archivos a aquellos que no usan más del
|
||||
tamaño de cola especificado de los discos de paridad.
|
||||
Puede usar multiplicadores como K, M, G o T (por ejemplo, \-\-tail 1G).
|
||||
|
|
@ -1284,9 +1294,9 @@ Esta opción solo se puede usar con \`sync\`.
|
|||
recomienda encarecidamente no usarla.
|
||||
NO tiene protección de datos durante la operación \`sync\`.
|
||||
.TP
|
||||
.B \-W, \-\-force\-realloc\-tail TAMAÑO
|
||||
.B \-W, \-\-force\-realloc\-tail SIZE
|
||||
Funciona como \-R, \-\-force\-realloc, pero limitado a la porción final
|
||||
especificada (últimos TAMAÑO bytes) de cada archivo de paridad.
|
||||
especificada (últimos SIZE bytes) de cada archivo de paridad.
|
||||
Fuerza la reasignación (movimiento) de cualquier fragmento/bloque de archivo
|
||||
actualmente almacenado en esa sección final, permitiendo que se coloquen
|
||||
en cualquier lugar de los archivos de paridad donde haya espacio libre
|
||||
|
|
@ -1372,7 +1382,7 @@ Imprime una pantalla de ayuda corta.
|
|||
.TP
|
||||
.B \-V, \-\-version
|
||||
Imprime la versión del programa.
|
||||
.SH CONFIGURATION
|
||||
.SH CONFIGURACIóN (CONFIGURATION)
|
||||
SnapRAID requiere un archivo de configuración para saber dónde se
|
||||
encuentra su array de discos y dónde almacenar la información de paridad.
|
||||
.PP
|
||||
|
|
@ -1477,12 +1487,36 @@ realiza utilizando el UUID almacenado de los discos.
|
|||
Define el nombre y el punto de montaje de discos adicionales para monitorear
|
||||
con los comandos \`smart\` y \`probe\`.
|
||||
.PP
|
||||
Esto es útil para monitorear discos que no forman parte de la
|
||||
matriz pero que son necesarios para que el sistema funcione, como
|
||||
Esto es útil para monitorear discos que no forman parte del
|
||||
array pero que son necesarios para que el sistema funcione, como
|
||||
el disco de arranque.
|
||||
.PP
|
||||
Tenga en cuenta que dichos discos no se ven afectados por los comandos \`up\` y \`down\`
|
||||
porque se espera que estén siempre girando.
|
||||
.SS snapshot
|
||||
Habilita el uso de instantáneas del sistema de archivos para los comandos \`sync\`, \`scrub\`,
|
||||
\`check\` y \`fix\`.
|
||||
.PP
|
||||
Cuando está habilitado, SnapRAID crea una instantánea de solo lectura de sus datos al
|
||||
comienzo de un \'sync\'. Esto asegura una vista consistente y en un punto en el tiempo de sus
|
||||
archivos, evitando errores causados por modificaciones concurrentes de archivos.
|
||||
.PP
|
||||
Esto mejora significativamente la recuperación: si un archivo se elimina del sistema de archivos activo,
|
||||
permanece preservado en la instantánea. Esto evita que la paridad se \[dq]rompa\[dq]
|
||||
para ese bloque, asegurando que aún pueda recuperar los datos con éxito
|
||||
si falla otro disco.
|
||||
.PP
|
||||
Esta opción se aplica exclusivamente a discos de datos formateados con los sistemas de
|
||||
archivos Btrfs, Bcachefs o ZFS en Linux y NTFS en Windows.
|
||||
Los discos de paridad, o los discos de datos que usen otros sistemas de archivos, siempre usarán
|
||||
la versión activa del sistema de archivos.
|
||||
.PP
|
||||
La creación y eliminación de instantáneas requieren privilegios administrativos.
|
||||
Asegúrese de que SnapRAID se ejecute con los permisos necesarios (por ejemplo, sudo) cuando
|
||||
esta opción esté habilitada.
|
||||
.PP
|
||||
Consulte la sección SNAPSHOTS para obtener una explicación detallada del ciclo de vida
|
||||
de las instantáneas.
|
||||
.SS nohidden
|
||||
Excluye todos los archivos y directorios ocultos.
|
||||
En Unix, los archivos ocultos son los que comienzan con \`.\`.
|
||||
|
|
@ -1602,7 +1636,7 @@ RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0.51 GiB
|
|||
.PD 0
|
||||
.PD
|
||||
.SS autosave SIZE_IN_GIGABYTES
|
||||
Guarda automáticamente el estado al sincronizar o fregar después de
|
||||
Guarda automáticamente el estado al sincronizar o depurar después de
|
||||
la cantidad especificada de GB procesados.
|
||||
Esta opción es útil para evitar reiniciar comandos \`sync\` largos
|
||||
desde cero si son interrumpidos por un fallo de la máquina o
|
||||
|
|
@ -1680,6 +1714,10 @@ En las OPCIONES especificadas, la cadena \`%s\` se reemplaza por
|
|||
el nombre del dispositivo. Para los controladores RAID, el dispositivo
|
||||
es probable que sea fijo y es posible que no necesite usar \`%s\`.
|
||||
.PP
|
||||
También puede especificar una cadena de opciones de información
|
||||
personalizada mediante la etiqueta \`[info: ...]\` para sustituir
|
||||
la opción \`\-a\` predeterminada.
|
||||
.PP
|
||||
Consulte la documentación de smartmontools para conocer las posibles
|
||||
opciones:
|
||||
.PP
|
||||
|
|
@ -1696,6 +1734,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices
|
|||
Por ejemplo:
|
||||
.PP
|
||||
.RS 4
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl parity \-d sat %s
|
||||
.PD 0
|
||||
.PD
|
||||
|
|
@ -1711,19 +1753,27 @@ PARITY es uno de los nombres de paridad: \`parity\`, \`2\-parity\`,
|
|||
El valor especial * se puede usar para ignorar el atributo en todos
|
||||
los discos.
|
||||
.PP
|
||||
Por ejemplo, para ignorar el atributo \`Current Pending Sector Count\`
|
||||
en todos los discos:
|
||||
Se pueden especificar múltiples atributos separados por espacios.
|
||||
Cada atributo se puede especificar como un número del 1 al 255, o como un
|
||||
nombre que no distingue entre mayúsculas y minúsculas (p. ej., \`Current_Pending_Sector\`).
|
||||
.PP
|
||||
Por ejemplo, para ignorar los atributos \`Current Pending Sector Count\` y
|
||||
\`Reallocated Sectors Count\` en todos los discos por su número o nombre:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore * 197
|
||||
smartignore * 197 5
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.PP
|
||||
Para ignorarlo solo en el primer disco de paridad:
|
||||
Para ignorarlos solo en el primer disco de paridad:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore parity 197
|
||||
smartignore parity 197 5
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
|
|
@ -1763,7 +1813,7 @@ exclude /tmp/
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1819,7 +1869,7 @@ exclude \\System Volume Information
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1835,7 +1885,129 @@ smartctl 2\-parity \-d areca,2/1 /dev/arcmsr0
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH PATTERN
|
||||
.SH INSTANTáNEAS (SNAPSHOTS)
|
||||
Si la opción de instantánea está habilitada en la configuración, SnapRAID
|
||||
utiliza la funcionalidad de instantáneas del sistema de archivos para garantizar operaciones atómicas
|
||||
y consistentes.
|
||||
.PP
|
||||
La gestión de las instantáneas es completamente automática y transparente.
|
||||
Puede continuar usando SnapRAID exactamente como antes, con la
|
||||
protección adicional proporcionada por las instantáneas gestionadas completamente en
|
||||
segundo plano.
|
||||
.PP
|
||||
Esto proporciona dos beneficios primordiales:
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I Consistencia
|
||||
Los archivos modificados en el sistema de archivos activo durante un sync o scrub de
|
||||
larga duración no causarán desajustes de paridad ni operaciones abortadas,
|
||||
ya que SnapRAID ve una imagen congelada en el tiempo.
|
||||
.HP 4
|
||||
.I Recuperación
|
||||
Si un archivo se actualiza o elimina del sistema de archivos activo,
|
||||
permanece preservado en la instantánea. Si ocurre un fallo de disco
|
||||
antes de que se ejecute el siguiente sync, SnapRAID utiliza los datos preservados
|
||||
en la instantánea para reconstruir el disco fallido.
|
||||
.PD
|
||||
.PP
|
||||
.RS 4
|
||||
.PD 0
|
||||
En caso de fallo de un disco durante un proceso de sync activo,
|
||||
SnapRAID también es capaz de leer automáticamente tanto de la instantánea
|
||||
del cómputo de paridad anterior como del actual.
|
||||
Esto maximiza la probabilidad de una recuperación completa al
|
||||
proporcionar acceso a los bloques de datos exactos requeridos para resolver
|
||||
las ecuaciones de paridad, incluso si esos bloques fueron modificados
|
||||
o eliminados entre syncs.
|
||||
.PD
|
||||
.PP
|
||||
.PD 0
|
||||
Sin instantáneas, un archivo actualizado o eliminado en un disco sano
|
||||
da como resultado la pérdida de bloques de datos que pueden ser necesarios para
|
||||
reparar otros discos fallidos.
|
||||
.PD
|
||||
.RE
|
||||
.RE
|
||||
.PP
|
||||
Las instantáneas se crean solo para discos de datos y solo si el sistema de archivos
|
||||
subyacente admite esta funcionalidad. Los discos de paridad siempre usan
|
||||
el sistema de archivos activo.
|
||||
.PP
|
||||
Actualmente, esto es compatible con Btrfs, Bcachefs y ZFS en Linux
|
||||
y con NTFS en Windows.
|
||||
.PP
|
||||
Puede mezclar discos de datos con diferentes sistemas de archivos. Solo aquellos que
|
||||
admitan instantáneas las utilizarán, mientras que los demás discos continuarán
|
||||
operando directamente en el sistema de archivos activo.
|
||||
.PP
|
||||
La creación y eliminación de instantáneas requieren privilegios administrativos.
|
||||
Asegúrese de que SnapRAID se ejecute con los permisos necesarios (por ejemplo, sudo)
|
||||
cuando las instantáneas estén habilitadas.
|
||||
.SS Comportamiento de comandos con instantáneas
|
||||
Los comandos \`sync\` y \`scrub\` operan exclusivamente en instantáneas
|
||||
para garantizar que todas las operaciones de datos se realicen contra un estado consistente
|
||||
y congelado. Al utilizar estas instantáneas, SnapRAID evita desajustes de paridad
|
||||
que de otro modo serian provocados por modificaciones de archivos concurrentes en el sistema de archivos activo.
|
||||
Durante un \`sync\`, el comando utiliza una nueva instantánea creada al
|
||||
inicio del proceso para capturar el estado actual para el cómputo de paridad.
|
||||
Por el contrario, el comando \`scrub\` utiliza la última instantánea, la
|
||||
creada durante el sync más reciente, para mantener un punto de referencia confiable
|
||||
que coincida con la paridad existente.
|
||||
.PP
|
||||
Para los comandos \`check\` y \`fix\`, el uso de la última instantánea
|
||||
depende de si se seleccionan discos específicos mediante la opción
|
||||
\-d, \-\-filter\-disk.
|
||||
.PP
|
||||
Un disco seleccionado explícitamente mediante \-d (el \[dq]objetivo\[dq] de la operación)
|
||||
siempre utiliza el sistema de archivos activo. Para \`fix\`, esto permite restaurar
|
||||
datos en el reemplazo de disco activo. Para \`check\`, permite simular
|
||||
la operación \`fix\` bajo las mismas condiciones.
|
||||
.PP
|
||||
Todos los demás discos de datos (los discos de \[dq]referencia\[dq]) se accederán a través de
|
||||
sus instantáneas. Esto garantiza que incluso si está modificando archivos
|
||||
en sus discos sanos mientras se realiza una recuperación, SnapRAID
|
||||
tenga una referencia estable y congelada para resolver las ecuaciones de paridad.
|
||||
.PP
|
||||
Si no se proporciona la opción \-d, SnapRAID asume que la operación se aplica
|
||||
a todo el array, en cuyo caso, \`check\` y \`fix\` usarán los sistemas
|
||||
de archivos activos exclusivamente.
|
||||
.PP
|
||||
Todos los demás comandos funcionan exclusivamente en el sistema de archivos activo.
|
||||
.SH CICLO DE VIDA DE LAS INSTANTáNEAS (SNAPSHOTS LIFECYCLE)
|
||||
SnapRAID gestiona dos instantáneas específicas, \`stable\` y \`pending\`,
|
||||
dentro de un directorio oculto en la raíz de cada subvolumen de datos.
|
||||
En Btrfs, Bcachefs y NTFS se utiliza el directorio \`.snapraid/\`,
|
||||
en ZFS el estándar \`.zfs/snapshot/\`.
|
||||
.PP
|
||||
La instantánea \`stable\` representa el estado del último
|
||||
\`sync\` completado con éxito, que contiene los datos exactos utilizados para
|
||||
calcular la paridad actual. Sirve como fuente de datos principal
|
||||
para los comandos \`scrub\`, \`check\` y \`fix\`.
|
||||
.PP
|
||||
La instantánea \`pending\` es una imagen temporal creada al inicio
|
||||
de un \`sync\` para proporcionar un estado congelado para el cómputo de paridad.
|
||||
Una vez completada con éxito la operación, la instantánea \`stable\` anterior
|
||||
se elimina y la instantánea \`pending\` se promueve para
|
||||
tomar su lugar como la nueva referencia estable.
|
||||
.PP
|
||||
Si un \`sync\` se interrumpe, la instantánea \`pending\` se conserva.
|
||||
Los comandos posteriores \`scrub\`, \`check\` y \`fix\` utilizarán esta
|
||||
instantánea pendiente, ya que coincide con el estado del sistema de archivos registrado en
|
||||
el archivo .content, incluso si la paridad solo está parcialmente sincronizada.
|
||||
.PP
|
||||
En caso de interrupción de un \`sync\`, los comandos \`check\` y \`fix\`
|
||||
también leen de la instantánea \`stable\` para recuperar bloques de datos
|
||||
de archivos que se actualizaron o eliminaron durante el sync.
|
||||
Esto es posible porque el archivo .content conserva los metadatos de
|
||||
todos los archivos modificados o eliminados durante todo el proceso de sync.
|
||||
Esta información histórica solo se borra una vez que el sync finaliza
|
||||
con éxito y se guarda la versión final del archivo .content.
|
||||
.PP
|
||||
Si un \`sync\` se reinicia después de una interrupción, la instantánea pending existente
|
||||
se elimina y se crea una nueva para
|
||||
capturar el estado actual del sistema de archivos activo.
|
||||
.SH PATRONES (PATTERN)
|
||||
Los patrones proporcionan una forma flexible de filtrar archivos para su inclusión o
|
||||
exclusión. Al usar caracteres de globbing, puede definir reglas que coincidan con
|
||||
nombres de archivos específicos o estructuras de directorios completas sin
|
||||
|
|
@ -2021,7 +2193,7 @@ snapraid \-f \[dq]*.mp3\[dq] check
|
|||
.PP
|
||||
En Unix, al usar caracteres globbing en la línea de comandos, debe
|
||||
ponerlos entre comillas para evitar que el shell los expanda.
|
||||
.SH IGNORAR ARCHIVOS
|
||||
.SH IGNORAR ARCHIVOS (IGNORE FILE)
|
||||
Además de las reglas globales en el archivo de configuración, puedes
|
||||
colocar archivos \`.snapraidignore\` en cualquier directorio dentro del array
|
||||
para definir reglas de exclusión descentralizadas.
|
||||
|
|
@ -2081,7 +2253,7 @@ build/
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH CONTENT
|
||||
.SH CONTENIDO (CONTENT)
|
||||
SnapRAID almacena la lista y las sumas de comprobación de sus
|
||||
archivos en el archivo de contenido.
|
||||
.PP
|
||||
|
|
@ -2089,9 +2261,11 @@ Es un archivo binario que enumera todos los archivos presentes en
|
|||
su array de discos, junto con todas las sumas de comprobación para
|
||||
verificar su integridad.
|
||||
.PP
|
||||
Este archivo es leído y escrito por los comandos \`sync\` y \`scrub\`
|
||||
y leído por los comandos \`fix\`, \`check\` y \`status\`.
|
||||
.SH PARITY
|
||||
El archivo de contenido es leído y escrito por los comandos \`sync\`,
|
||||
\`scrub\`, \`touch\` y \`rehash\`. Es leído por los comandos \`status\`, \`diff\`,
|
||||
\`check\`, \`fix\`, \`list\`, \`dup\`, \`locate\` y \`pool\`, y es completamente
|
||||
ignorado por los comandos \`smart\`, \`probe\`, \`up\`, \`down\` y \`devices\`.
|
||||
.SH PARIDAD (PARITY)
|
||||
SnapRAID almacena la información de paridad de su array en los
|
||||
archivos de paridad.
|
||||
.PP
|
||||
|
|
@ -2100,7 +2274,7 @@ de todos los bloques definidos en el archivo \`content\`.
|
|||
.PP
|
||||
Estos archivos son leídos y escritos por los comandos \`sync\` y \`fix\`
|
||||
y solo leídos por los comandos \`scrub\` y \`check\`.
|
||||
.SH ENCODING
|
||||
.SH CODIFICACIóN (ENCODING)
|
||||
SnapRAID en Unix ignora cualquier codificación. Lee y almacena los
|
||||
nombres de archivo con la misma codificación utilizada por el sistema
|
||||
de archivos.
|
||||
|
|
@ -2114,7 +2288,25 @@ configurar la consola de Windows en modo UTF\-8 con el comando
|
|||
como fuente de la consola. Esto afecta solo a los nombres de
|
||||
archivo impresos; si redirige la salida de la consola a un archivo,
|
||||
el archivo resultante siempre está en formato UTF\-8.
|
||||
.SH CóDIGO DE SALIDA (EXIT CODE)
|
||||
SnapRAID termina con los siguientes códigos de error:
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I 0
|
||||
Todo bien.
|
||||
.HP 4
|
||||
.I 1
|
||||
El comando encontró algunos errores.
|
||||
.HP 4
|
||||
.I 2
|
||||
El comando \`diff\` determinó que todo está bien, pero se necesita un \`sync\`.
|
||||
.PD
|
||||
.RE
|
||||
.SH TRADUCCIóN (TRANSLATION)
|
||||
Este documento es una traducción automática del manual en inglés.
|
||||
Consulte el manual en inglés para obtener la versión oficial.
|
||||
.SH COPYRIGHT
|
||||
Este archivo es Copyright (C) 2025 Andrea Mazzoleni
|
||||
.SH SEE ALSO
|
||||
snapraid_log(1), snapraidd(1)
|
||||
Este archivo es Copyright (C) 2026 Andrea Mazzoleni
|
||||
.SH VéASE TAMBIéN (SEE ALSO)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
Name{number}
|
||||
snapraid - SnapRAID Backup para Arrays de Discos
|
||||
|
||||
Synopsis
|
||||
Sinopsis (Synopsis)
|
||||
:snapraid [-c, --conf CONFIG]
|
||||
: [-f, --filter PATTERN] [-d, --filter-disk NAME]
|
||||
: [-m, --filter-missing] [-e, --filter-error]
|
||||
|
|
@ -23,7 +23,7 @@ Synopsis
|
|||
|
||||
:snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
Description
|
||||
Descripción (Description)
|
||||
SnapRAID es un programa de copia de seguridad diseñado para arrays
|
||||
de discos, que almacena información de paridad para la recuperación
|
||||
de datos en caso de hasta seis fallos de disco.
|
||||
|
|
@ -34,7 +34,7 @@ Description
|
|||
|
||||
* Puede utilizar discos ya llenos de archivos sin la necesidad de
|
||||
reformatearlos, accediendo a ellos como de costumbre.
|
||||
* Todos sus datos son hasheados para asegurar la integridad de los datos
|
||||
* Todos sus datos son procesados con hash para asegurar la integridad de los datos
|
||||
y prevenir la corrupción silenciosa.
|
||||
* Cuando el número de discos fallidos excede el recuento de paridad,
|
||||
la pérdida de datos se limita a los discos afectados; los datos en
|
||||
|
|
@ -52,23 +52,30 @@ Description
|
|||
|
||||
:https://www.snapraid.it/
|
||||
|
||||
Limitations
|
||||
SnapRAID es un híbrido entre un programa RAID y un programa de copia
|
||||
de seguridad, con el objetivo de combinar los mejores beneficios de
|
||||
ambos. Sin embargo, tiene algunas limitaciones que debe considerar
|
||||
antes de usarlo.
|
||||
Limitaciones (Limitations)
|
||||
SnapRAID es un híbrido entre un RAID y un programa de copia de seguridad, con el objetivo de combinar
|
||||
los mejores beneficios de ambos. Sin embargo, tiene algunas limitaciones que debería
|
||||
considerar antes de usarlo.
|
||||
|
||||
La principal limitación es que si un disco falla y no ha sincronizado
|
||||
recientemente, es posible que no pueda recuperarse por completo.
|
||||
Más específicamente, es posible que no pueda recuperar hasta el tamaño
|
||||
de los archivos cambiados o eliminados desde la última operación de
|
||||
sincronización. Esto ocurre incluso si los archivos cambiados o
|
||||
eliminados no están en el disco fallido. Esta es la razón por la que
|
||||
SnapRAID es más adecuado para datos que rara vez cambian.
|
||||
La principal limitación es que si un disco falla, solo puede recuperar datos hasta el
|
||||
estado de la última operación de sincronización (`sync`). Cualquier dato añadido o modificación realizada
|
||||
desde la última sincronización que se encuentre en el disco dañado se perderá.
|
||||
|
||||
Por otro lado, los archivos recién agregados no impiden la recuperación
|
||||
de los archivos ya existentes. Solo perderá los archivos recién
|
||||
agregados si están en el disco fallido.
|
||||
Por lo tanto, SnapRAID es adecuado principalmente para datos que cambian raramente.
|
||||
|
||||
Para los datos que ya existían en la última sincronización, la fiabilidad de la recuperación depende
|
||||
de si se utiliza la opción de instantánea (`snapshot`):
|
||||
|
||||
* Con soporte para instantáneas (disponible en Btrfs, ZFS, Bcachefs y NTFS),
|
||||
SnapRAID puede mantener automáticamente una referencia congelada de sus discos de datos.
|
||||
Esto garantiza que incluso si modifica o elimina archivos en su sistema de archivos activo
|
||||
durante o después de un sync, el proceso de recuperación se mantenga consistente y confiable.
|
||||
|
||||
* Sin soporte para instantáneas, eliminar o cambiar archivos después de un `sync`
|
||||
puede impedir la recuperación completa de otros discos fallidos. Esto ocurre
|
||||
porque la paridad ya no coincide con los archivos modificados, incluso si
|
||||
esos archivos no están en el disco fallido. Por otro lado, los archivos recién añadidos
|
||||
no impiden la recuperación de los archivos ya existentes.
|
||||
|
||||
Otras limitaciones de SnapRAID son:
|
||||
|
||||
|
|
@ -82,10 +89,10 @@ Limitations
|
|||
Con una copia de seguridad, puede recuperarse de un fallo completo
|
||||
de todo el array de discos.
|
||||
* Solo se guardan nombres de archivo, marcas de tiempo, enlaces simbólicos
|
||||
y enlaces duros. Los permisos, la propiedad y los atributos
|
||||
y enlaces físicos. Los permisos, la propiedad y los atributos
|
||||
extendidos no se guardan.
|
||||
|
||||
Getting Started
|
||||
Primeros pasos (Getting Started)
|
||||
Para usar SnapRAID, primero debe seleccionar un disco en su array de
|
||||
discos para dedicarlo a la información de `parity` (paridad). Con un
|
||||
disco para paridad, podrá recuperarse de un solo fallo de disco,
|
||||
|
|
@ -168,9 +175,9 @@ Getting Started
|
|||
Ahora puede comenzar a usar su array como desee y periódicamente
|
||||
actualizar la información de paridad ejecutando el comando `sync`.
|
||||
|
||||
Scrubbing
|
||||
Limpieza (Scrubbing)
|
||||
Para verificar periódicamente los datos y la paridad en busca de
|
||||
errores, puede ejecutar el comando `scrub` (fregar/limpiar).
|
||||
errores, puede ejecutar el comando `scrub` (depurar/limpiar).
|
||||
|
||||
:snapraid scrub
|
||||
|
||||
|
|
@ -178,7 +185,7 @@ Getting Started
|
|||
durante el comando `sync` para verificar la integridad.
|
||||
|
||||
Cada ejecución del comando verifica aproximadamente el 8% del array,
|
||||
excluyendo los datos ya fregados en los 10 días anteriores.
|
||||
excluyendo los datos ya depurados en los 10 días anteriores.
|
||||
Puede usar la opción -p, --plan para especificar una cantidad
|
||||
diferente y la opción -o, --older-than para especificar una edad
|
||||
diferente en días. Por ejemplo, para verificar el 5% del array en
|
||||
|
|
@ -197,9 +204,9 @@ Getting Started
|
|||
|
||||
:snapraid -e fix
|
||||
|
||||
En el siguiente `scrub`, los errores desaparecerán del informe de
|
||||
En la siguiente depuración (`scrub`), los errores desaparecerán del informe de
|
||||
`status` si realmente se han corregido. Para hacerlo más rápido,
|
||||
puede usar -p bad para fregar solo los bloques marcados como defectuosos.
|
||||
puede usar -p bad para depurar solo los bloques marcados como defectuosos.
|
||||
|
||||
:snapraid -p bad scrub
|
||||
|
||||
|
|
@ -208,11 +215,11 @@ Getting Started
|
|||
informan en la salida de `scrub`, pero los bloques relacionados no
|
||||
se marcan como defectuosos.
|
||||
|
||||
Pooling
|
||||
Agrupación (Pooling)
|
||||
Nota: La función de pooling descrita a continuación ha sido
|
||||
sustituida por la herramienta mergerfs, que ahora es la opción
|
||||
recomendada para los usuarios de Linux en la comunidad SnapRAID.
|
||||
Mergefs proporciona una forma más flexible y eficiente de agrupar
|
||||
Mergerfs proporciona una forma más flexible y eficiente de agrupar
|
||||
múltiples unidades en un único punto de montaje unificado,
|
||||
permitiendo un acceso sin problemas a los archivos en todo su array
|
||||
sin depender de enlaces simbólicos. Se integra bien con SnapRAID
|
||||
|
|
@ -286,7 +293,7 @@ Getting Started
|
|||
|
||||
:fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
||||
|
||||
Undeleting
|
||||
Restauración (Undeleting)
|
||||
SnapRAID funciona más como un programa de copia de seguridad que como
|
||||
un sistema RAID, y se puede usar para restaurar o recuperar archivos
|
||||
a su estado anterior usando la opción -f, --filter:
|
||||
|
|
@ -308,15 +315,15 @@ Getting Started
|
|||
|
||||
:snapraid fix -m
|
||||
|
||||
Recovering
|
||||
Recuperación (Recovering)
|
||||
Ha sucedido lo peor, ¡y ha perdido uno o más discos!
|
||||
|
||||
¡NO ENTRE EN PÁNICO! ¡Podrá recuperarlos!
|
||||
|
||||
Lo primero que debe hacer es evitar más cambios en su array de discos.
|
||||
Deshabilite cualquier conexión remota a él y cualquier proceso
|
||||
programado, incluida cualquier sincronización o fregado nocturno
|
||||
programado de SnapRAID.
|
||||
programado, incluida cualquier sincronización o depuración nocturna
|
||||
programada de SnapRAID.
|
||||
|
||||
Luego, proceda con los siguientes pasos.
|
||||
|
||||
|
|
@ -400,14 +407,14 @@ Getting Started
|
|||
|
||||
Si todo se recupera, este comando es inmediato.
|
||||
|
||||
Commands
|
||||
SnapRAID proporciona algunos comandos simples que le permiten:
|
||||
Comandos (Commands)
|
||||
SnapRAID proporciona unos pocos comandos simples que le permiten:
|
||||
|
||||
* Imprimir el estado del array -> `status`
|
||||
* Mostrar el estado del array -> `status`
|
||||
* Controlar los discos -> `smart`, `probe`, `up`, `down`
|
||||
* Hacer una copia de seguridad/instantánea -> `sync`
|
||||
* Crear un punto de copia de seguridad/recuperación -> `sync`
|
||||
* Comprobar periódicamente los datos -> `scrub`
|
||||
* Restaurar la última copia de seguridad/instantánea -> `fix`.
|
||||
* Restaurar el último punto de copia de seguridad/recuperación -> `fix`.
|
||||
|
||||
Los comandos deben escribirse en minúsculas.
|
||||
|
||||
|
|
@ -416,7 +423,7 @@ Commands
|
|||
|
||||
Incluye información sobre la fragmentación de la paridad, la antigüedad
|
||||
de los bloques sin verificar y todos los errores silenciosos
|
||||
registrados encontrados durante el fregado.
|
||||
registrados encontrados durante la depuración.
|
||||
|
||||
La información presentada se refiere a la última vez que ejecutó
|
||||
`sync`. Las modificaciones posteriores no se tienen en cuenta.
|
||||
|
|
@ -425,8 +432,8 @@ Commands
|
|||
Para corregirlos, puede usar el comando `fix -e`.
|
||||
|
||||
También muestra un gráfico que representa la última vez que cada
|
||||
bloque fue fregado o sincronizado. Los bloques fregados se muestran
|
||||
con `*`, los bloques sincronizados pero aún no fregados con `o`.
|
||||
bloque fue depurado o sincronizado. Los bloques depurados se muestran
|
||||
con `*`, los bloques sincronizados pero aún no depurados con `o`.
|
||||
|
||||
Nada se modifica.
|
||||
|
||||
|
|
@ -575,38 +582,38 @@ Commands
|
|||
Los archivos en el array NO se modifican.
|
||||
|
||||
scrub
|
||||
Frota (scrubs) el array, buscando errores silenciosos o de
|
||||
Depura (scrubs) el array, buscando errores silenciosos o de
|
||||
entrada/salida en los discos de datos y paridad.
|
||||
|
||||
Cada invocación verifica aproximadamente el 8% del array, excluyendo
|
||||
los datos ya fregados en los últimos 10 días.
|
||||
Esto significa que fregar una vez a la semana asegura que cada bit de
|
||||
los datos ya depurados en los últimos 10 días.
|
||||
Esto significa que depurar una vez a la semana asegura que cada bit de
|
||||
datos se verifique al menos una vez cada tres meses.
|
||||
|
||||
Puede definir un plan de fregado o una cantidad diferente utilizando
|
||||
Puede definir un plan de depuración o una cantidad diferente utilizando
|
||||
la opción -p, --plan, que acepta:
|
||||
bad - Fregar bloques marcados como defectuosos.
|
||||
new - Fregar bloques recién sincronizados que aún no han sido fregados.
|
||||
full - Fregar todo.
|
||||
0-100 - Fregar el porcentaje especificado de bloques.
|
||||
bad - Depurar bloques marcados como defectuosos.
|
||||
new - Depurar bloques recién sincronizados que aún no han sido depurados.
|
||||
full - Depurar todo.
|
||||
0-100 - Depurar el porcentaje especificado de bloques.
|
||||
|
||||
Si especifica un valor de porcentaje, también puede usar la opción -o,
|
||||
--older-than para definir la antigüedad del bloque.
|
||||
Los bloques más antiguos se friegan primero, asegurando una verificación
|
||||
Los bloques más antiguos se depuran primero, asegurando una verificación
|
||||
óptima.
|
||||
Si desea fregar solo los bloques recién sincronizados que aún no han
|
||||
sido fregados, use la opción `-p new`.
|
||||
Si desea depurar solo los bloques recién sincronizados que aún no han
|
||||
sido depurados, use la opción `-p new`.
|
||||
|
||||
Para obtener detalles del estado del fregado, use el comando `status`.
|
||||
Para obtener detalles del estado de la depuración, use el comando `status`.
|
||||
|
||||
Para cualquier error silencioso o de entrada/salida encontrado, los
|
||||
bloques correspondientes se marcan como defectuosos en el archivo
|
||||
`content`.
|
||||
Estos bloques defectuosos se enumeran en `status` y se pueden
|
||||
corregir con `fix -e`.
|
||||
Después de la corrección, en el siguiente fregado, se volverán a
|
||||
Después de la corrección, en la siguiente depuración, se volverán a
|
||||
verificar y, si se encuentran corregidos, se eliminará la marca de defectuoso.
|
||||
Para fregar solo los bloques defectuosos, puede usar el comando
|
||||
Para depurar solo los bloques defectuosos, puede usar el comando
|
||||
`scrub -p bad`.
|
||||
|
||||
Se recomienda ejecutar `scrub` solo en un array sincronizado para evitar
|
||||
|
|
@ -621,15 +628,14 @@ Commands
|
|||
Los archivos en el array NO se modifican.
|
||||
|
||||
fix
|
||||
Corrige todos los archivos y la información de paridad.
|
||||
Repara todos los archivos y los datos de paridad.
|
||||
|
||||
Todos los archivos y la información de paridad se comparan con el
|
||||
estado de instantánea guardado en el último `sync`.
|
||||
Si se encuentra una diferencia, se revierte a la instantánea almacenada.
|
||||
Todos los archivos y datos de paridad si comparan con el estado guardado en
|
||||
el último `sync`. Si se encuentra una diferencia, se revierte al estado almacenado.
|
||||
|
||||
¡ADVERTENCIA! El comando `fix` no diferencia entre errores y
|
||||
modificaciones intencionales. Revierte incondicionalmente el estado
|
||||
del archivo al último `sync`.
|
||||
¡ADVERTENCIA!
|
||||
El comando `fix` no diferencia entre errores y modificaciones intencionadas.
|
||||
Revierte incondicionalmente el estado del archivo al del último `sync`.
|
||||
|
||||
Si no se especifica otra opción, se procesa todo el array.
|
||||
Utilice las opciones de filtro para seleccionar un subconjunto de
|
||||
|
|
@ -769,7 +775,7 @@ Commands
|
|||
Tenga en cuenta que dichos archivos no estarán protegidos por la paridad durante
|
||||
el proceso de reasignación.
|
||||
|
||||
Options
|
||||
Opciones (Options)
|
||||
SnapRAID proporciona las siguientes opciones:
|
||||
|
||||
-c, --conf CONFIG
|
||||
|
|
@ -826,19 +832,19 @@ Options
|
|||
Esta opción solo se puede usar con `check` y `fix`.
|
||||
|
||||
-p, --plan PERC|bad|new|full
|
||||
Selecciona el plan de fregado (scrub). Si PERC es un valor
|
||||
Selecciona el plan de depuración (scrub). Si PERC es un valor
|
||||
numérico de 0 a 100, se interpreta como el porcentaje de
|
||||
bloques a fregar.
|
||||
bloques a depurar.
|
||||
En lugar de un porcentaje, puede especificar un plan:
|
||||
`bad` friega bloques defectuosos, `new` friega bloques aún
|
||||
no fregados, y `full` friega todo.
|
||||
`bad` depura bloques defectuosos, `new` depura bloques aún
|
||||
no depurados, y `full` depura todo.
|
||||
Esta opción solo se puede usar con `scrub`.
|
||||
|
||||
-o, --older-than DAYS
|
||||
Selecciona la parte más antigua del array para procesar en `scrub`.
|
||||
DAYS es la edad mínima en días para que un bloque sea fregado;
|
||||
DAYS es la edad mínima en días para que un bloque sea depurado;
|
||||
el valor predeterminado es 10.
|
||||
Los bloques marcados como defectuosos siempre se friegan
|
||||
Los bloques marcados como defectuosos siempre se depuran
|
||||
independientemente de esta opción.
|
||||
Esta opción solo se puede usar con `scrub`.
|
||||
|
||||
|
|
@ -894,7 +900,7 @@ Options
|
|||
RATE es el número de bytes por segundo. Puede especificar un
|
||||
multiplicador como K, M o G (por ejemplo, --bw-limit 1G).
|
||||
|
||||
-t, --tail TAMAÑO
|
||||
-t, --tail SIZE
|
||||
Limita la lista de archivos a aquellos que no usan más del
|
||||
tamaño de cola especificado de los discos de paridad.
|
||||
Puede usar multiplicadores como K, M, G o T (por ejemplo, --tail 1G).
|
||||
|
|
@ -1002,9 +1008,9 @@ Options
|
|||
recomienda encarecidamente no usarla.
|
||||
NO tiene protección de datos durante la operación `sync`.
|
||||
|
||||
-W, --force-realloc-tail TAMAÑO
|
||||
-W, --force-realloc-tail SIZE
|
||||
Funciona como -R, --force-realloc, pero limitado a la porción final
|
||||
especificada (últimos TAMAÑO bytes) de cada archivo de paridad.
|
||||
especificada (últimos SIZE bytes) de cada archivo de paridad.
|
||||
Fuerza la reasignación (movimiento) de cualquier fragmento/bloque de archivo
|
||||
actualmente almacenado en esa sección final, permitiendo que se coloquen
|
||||
en cualquier lugar de los archivos de paridad donde haya espacio libre
|
||||
|
|
@ -1091,7 +1097,7 @@ Options
|
|||
-V, --version
|
||||
Imprime la versión del programa.
|
||||
|
||||
Configuration
|
||||
Configuración (Configuration)
|
||||
SnapRAID requiere un archivo de configuración para saber dónde se
|
||||
encuentra su array de discos y dónde almacenar la información de paridad.
|
||||
|
||||
|
|
@ -1196,13 +1202,38 @@ Configuration
|
|||
Define el nombre y el punto de montaje de discos adicionales para monitorear
|
||||
con los comandos `smart` y `probe`.
|
||||
|
||||
Esto es útil para monitorear discos que no forman parte de la
|
||||
matriz pero que son necesarios para que el sistema funcione, como
|
||||
Esto es útil para monitorear discos que no forman parte del
|
||||
array pero que son necesarios para que el sistema funcione, como
|
||||
el disco de arranque.
|
||||
|
||||
Tenga en cuenta que dichos discos no se ven afectados por los comandos `up` y `down`
|
||||
porque se espera que estén siempre girando.
|
||||
|
||||
snapshot
|
||||
Habilita el uso de instantáneas del sistema de archivos para los comandos `sync`, `scrub`,
|
||||
`check` y `fix`.
|
||||
|
||||
Cuando está habilitado, SnapRAID crea una instantánea de solo lectura de sus datos al
|
||||
comienzo de un 'sync'. Esto asegura una vista consistente y en un punto en el tiempo de sus
|
||||
archivos, evitando errores causados por modificaciones concurrentes de archivos.
|
||||
|
||||
Esto mejora significativamente la recuperación: si un archivo se elimina del sistema de archivos activo,
|
||||
permanece preservado en la instantánea. Esto evita que la paridad se "rompa"
|
||||
para ese bloque, asegurando que aún pueda recuperar los datos con éxito
|
||||
si falla otro disco.
|
||||
|
||||
Esta opción se aplica exclusivamente a discos de datos formateados con los sistemas de
|
||||
archivos Btrfs, Bcachefs o ZFS en Linux y NTFS en Windows.
|
||||
Los discos de paridad, o los discos de datos que usen otros sistemas de archivos, siempre usarán
|
||||
la versión activa del sistema de archivos.
|
||||
|
||||
La creación y eliminación de instantáneas requieren privilegios administrativos.
|
||||
Asegúrese de que SnapRAID se ejecute con los permisos necesarios (por ejemplo, sudo) cuando
|
||||
esta opción esté habilitada.
|
||||
|
||||
Consulte la sección SNAPSHOTS para obtener una explicación detallada del ciclo de vida
|
||||
de las instantáneas.
|
||||
|
||||
nohidden
|
||||
Excluye todos los archivos y directorios ocultos.
|
||||
En Unix, los archivos ocultos son los que comienzan con `.`.
|
||||
|
|
@ -1314,7 +1345,7 @@ Configuration
|
|||
:RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0.51 GiB
|
||||
|
||||
autosave SIZE_IN_GIGABYTES
|
||||
Guarda automáticamente el estado al sincronizar o fregar después de
|
||||
Guarda automáticamente el estado al sincronizar o depurar después de
|
||||
la cantidad especificada de GB procesados.
|
||||
Esta opción es útil para evitar reiniciar comandos `sync` largos
|
||||
desde cero si son interrumpidos por un fallo de la máquina o
|
||||
|
|
@ -1397,6 +1428,10 @@ Configuration
|
|||
el nombre del dispositivo. Para los controladores RAID, el dispositivo
|
||||
es probable que sea fijo y es posible que no necesite usar `%s`.
|
||||
|
||||
También puede especificar una cadena de opciones de información
|
||||
personalizada mediante la etiqueta `[info: ...]` para sustituir
|
||||
la opción `-a` predeterminada.
|
||||
|
||||
Consulte la documentación de smartmontools para conocer las posibles
|
||||
opciones:
|
||||
|
||||
|
|
@ -1405,6 +1440,7 @@ Configuration
|
|||
|
||||
Por ejemplo:
|
||||
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl parity -d sat %s
|
||||
|
||||
smartignore DISK/PARITY ATTR [ATTR...]
|
||||
|
|
@ -1418,14 +1454,19 @@ Configuration
|
|||
El valor especial * se puede usar para ignorar el atributo en todos
|
||||
los discos.
|
||||
|
||||
Por ejemplo, para ignorar el atributo `Current Pending Sector Count`
|
||||
en todos los discos:
|
||||
Se pueden especificar múltiples atributos separados por espacios.
|
||||
Cada atributo se puede especificar como un número del 1 al 255, o como un
|
||||
nombre que no distingue entre mayúsculas y minúsculas (p. ej., `Current_Pending_Sector`).
|
||||
|
||||
:smartignore * 197
|
||||
Por ejemplo, para ignorar los atributos `Current Pending Sector Count` y
|
||||
`Reallocated Sectors Count` en todos los discos por su número o nombre:
|
||||
|
||||
Para ignorarlo solo en el primer disco de paridad:
|
||||
:smartignore * 197 5
|
||||
:smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
:smartignore parity 197
|
||||
Para ignorarlos solo en el primer disco de paridad:
|
||||
|
||||
:smartignore parity 197 5
|
||||
|
||||
Examples
|
||||
Un ejemplo de una configuración típica para Unix es:
|
||||
|
|
@ -1438,7 +1479,7 @@ Configuration
|
|||
:data d3 /mnt/disk3/
|
||||
:exclude /lost+found/
|
||||
:exclude /tmp/
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/sg0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1454,12 +1495,124 @@ Configuration
|
|||
:exclude Thumbs.db
|
||||
:exclude \$RECYCLE.BIN
|
||||
:exclude \System Volume Information
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
Pattern
|
||||
Instantáneas (Snapshots)
|
||||
Si la opción de instantánea está habilitada en la configuración, SnapRAID
|
||||
utiliza la funcionalidad de instantáneas del sistema de archivos para garantizar operaciones atómicas
|
||||
y consistentes.
|
||||
|
||||
La gestión de las instantáneas es completamente automática y transparente.
|
||||
Puede continuar usando SnapRAID exactamente como antes, con la
|
||||
protección adicional proporcionada por las instantáneas gestionadas completamente en
|
||||
segundo plano.
|
||||
|
||||
Esto proporciona dos beneficios primordiales:
|
||||
|
||||
Consistencia - Los archivos modificados en el sistema de archivos activo durante un sync o scrub de
|
||||
larga duración no causarán desajustes de paridad ni operaciones abortadas,
|
||||
ya que SnapRAID ve una imagen congelada en el tiempo.
|
||||
Recuperación - Si un archivo se actualiza o elimina del sistema de archivos activo,
|
||||
permanece preservado en la instantánea. Si ocurre un fallo de disco
|
||||
antes de que se ejecute el siguiente sync, SnapRAID utiliza los datos preservados
|
||||
en la instantánea para reconstruir el disco fallido.
|
||||
|
||||
En caso de fallo de un disco durante un proceso de sync activo,
|
||||
SnapRAID también es capaz de leer automáticamente tanto de la instantánea
|
||||
del cómputo de paridad anterior como del actual.
|
||||
Esto maximiza la probabilidad de una recuperación completa al
|
||||
proporcionar acceso a los bloques de datos exactos requeridos para resolver
|
||||
las ecuaciones de paridad, incluso si esos bloques fueron modificados
|
||||
o eliminados entre syncs.
|
||||
|
||||
Sin instantáneas, un archivo actualizado o eliminado en un disco sano
|
||||
da como resultado la pérdida de bloques de datos que pueden ser necesarios para
|
||||
reparar otros discos fallidos.
|
||||
|
||||
Las instantáneas se crean solo para discos de datos y solo si el sistema de archivos
|
||||
subyacente admite esta funcionalidad. Los discos de paridad siempre usan
|
||||
el sistema de archivos activo.
|
||||
|
||||
Actualmente, esto es compatible con Btrfs, Bcachefs y ZFS en Linux
|
||||
y con NTFS en Windows.
|
||||
|
||||
Puede mezclar discos de datos con diferentes sistemas de archivos. Solo aquellos que
|
||||
admitan instantáneas las utilizarán, mientras que los demás discos continuarán
|
||||
operando directamente en el sistema de archivos activo.
|
||||
|
||||
La creación y eliminación de instantáneas requieren privilegios administrativos.
|
||||
Asegúrese de que SnapRAID se ejecute con los permisos necesarios (por ejemplo, sudo)
|
||||
cuando las instantáneas estén habilitadas.
|
||||
|
||||
Comportamiento de comandos con instantáneas
|
||||
Los comandos `sync` y `scrub` operan exclusivamente en instantáneas
|
||||
para garantizar que todas las operaciones de datos se realicen contra un estado consistente
|
||||
y congelado. Al utilizar estas instantáneas, SnapRAID evita desajustes de paridad
|
||||
que de otro modo serian provocados por modificaciones de archivos concurrentes en el sistema de archivos activo.
|
||||
Durante un `sync`, el comando utiliza una nueva instantánea creada al
|
||||
inicio del proceso para capturar el estado actual para el cómputo de paridad.
|
||||
Por el contrario, el comando `scrub` utiliza la última instantánea, la
|
||||
creada durante el sync más reciente, para mantener un punto de referencia confiable
|
||||
que coincida con la paridad existente.
|
||||
|
||||
Para los comandos `check` y `fix`, el uso de la última instantánea
|
||||
depende de si se seleccionan discos específicos mediante la opción
|
||||
-d, --filter-disk.
|
||||
|
||||
Un disco seleccionado explícitamente mediante -d (el "objetivo" de la operación)
|
||||
siempre utiliza el sistema de archivos activo. Para `fix`, esto permite restaurar
|
||||
datos en el reemplazo de disco activo. Para `check`, permite simular
|
||||
la operación `fix` bajo las mismas condiciones.
|
||||
|
||||
Todos los demás discos de datos (los discos de "referencia") se accederán a través de
|
||||
sus instantáneas. Esto garantiza que incluso si está modificando archivos
|
||||
en sus discos sanos mientras se realiza una recuperación, SnapRAID
|
||||
tenga una referencia estable y congelada para resolver las ecuaciones de paridad.
|
||||
|
||||
Si no se proporciona la opción -d, SnapRAID asume que la operación se aplica
|
||||
a todo el array, en cuyo caso, `check` y `fix` usarán los sistemas
|
||||
de archivos activos exclusivamente.
|
||||
|
||||
Todos los demás comandos funcionan exclusivamente en el sistema de archivos activo.
|
||||
|
||||
Ciclo de vida de las instantáneas (Snapshots Lifecycle)
|
||||
SnapRAID gestiona dos instantáneas específicas, `stable` y `pending`,
|
||||
dentro de un directorio oculto en la raíz de cada subvolumen de datos.
|
||||
En Btrfs, Bcachefs y NTFS se utiliza el directorio `.snapraid/`,
|
||||
en ZFS el estándar `.zfs/snapshot/`.
|
||||
|
||||
La instantánea `stable` representa el estado del último
|
||||
`sync` completado con éxito, que contiene los datos exactos utilizados para
|
||||
calcular la paridad actual. Sirve como fuente de datos principal
|
||||
para los comandos `scrub`, `check` y `fix`.
|
||||
|
||||
La instantánea `pending` es una imagen temporal creada al inicio
|
||||
de un `sync` para proporcionar un estado congelado para el cómputo de paridad.
|
||||
Una vez completada con éxito la operación, la instantánea `stable` anterior
|
||||
se elimina y la instantánea `pending` se promueve para
|
||||
tomar su lugar como la nueva referencia estable.
|
||||
|
||||
Si un `sync` se interrumpe, la instantánea `pending` se conserva.
|
||||
Los comandos posteriores `scrub`, `check` y `fix` utilizarán esta
|
||||
instantánea pendiente, ya que coincide con el estado del sistema de archivos registrado en
|
||||
el archivo .content, incluso si la paridad solo está parcialmente sincronizada.
|
||||
|
||||
En caso de interrupción de un `sync`, los comandos `check` y `fix`
|
||||
también leen de la instantánea `stable` para recuperar bloques de datos
|
||||
de archivos que se actualizaron o eliminaron durante el sync.
|
||||
Esto es posible porque el archivo .content conserva los metadatos de
|
||||
todos los archivos modificados o eliminados durante todo el proceso de sync.
|
||||
Esta información histórica solo se borra una vez que el sync finaliza
|
||||
con éxito y se guarda la versión final del archivo .content.
|
||||
|
||||
Si un `sync` se reinicia después de una interrupción, la instantánea pending existente
|
||||
se elimina y se crea una nueva para
|
||||
capturar el estado actual del sistema de archivos activo.
|
||||
|
||||
Patrones (Pattern)
|
||||
Los patrones proporcionan una forma flexible de filtrar archivos para su inclusión o
|
||||
exclusión. Al usar caracteres de globbing, puede definir reglas que coincidan con
|
||||
nombres de archivos específicos o estructuras de directorios completas sin
|
||||
|
|
@ -1579,7 +1732,7 @@ Pattern
|
|||
En Unix, al usar caracteres globbing en la línea de comandos, debe
|
||||
ponerlos entre comillas para evitar que el shell los expanda.
|
||||
|
||||
Ignorar Archivos
|
||||
Ignorar Archivos (Ignore File)
|
||||
Además de las reglas globales en el archivo de configuración, puedes
|
||||
colocar archivos `.snapraidignore` en cualquier directorio dentro del array
|
||||
para definir reglas de exclusión descentralizadas.
|
||||
|
|
@ -1621,7 +1774,7 @@ Ignorar Archivos
|
|||
:# Excluye cualquier archivo .tmp dentro de projects/ o sus subcarpetas
|
||||
:*.tmp
|
||||
|
||||
Content
|
||||
Contenido (Content)
|
||||
SnapRAID almacena la lista y las sumas de comprobación de sus
|
||||
archivos en el archivo de contenido.
|
||||
|
||||
|
|
@ -1629,10 +1782,12 @@ Content
|
|||
su array de discos, junto con todas las sumas de comprobación para
|
||||
verificar su integridad.
|
||||
|
||||
Este archivo es leído y escrito por los comandos `sync` y `scrub`
|
||||
y leído por los comandos `fix`, `check` y `status`.
|
||||
El archivo de contenido es leído y escrito por los comandos `sync`,
|
||||
`scrub`, `touch` y `rehash`. Es leído por los comandos `status`, `diff`,
|
||||
`check`, `fix`, `list`, `dup`, `locate` y `pool`, y es completamente
|
||||
ignorado por los comandos `smart`, `probe`, `up`, `down` y `devices`.
|
||||
|
||||
Parity
|
||||
Paridad (Parity)
|
||||
SnapRAID almacena la información de paridad de su array en los
|
||||
archivos de paridad.
|
||||
|
||||
|
|
@ -1642,7 +1797,7 @@ Parity
|
|||
Estos archivos son leídos y escritos por los comandos `sync` y `fix`
|
||||
y solo leídos por los comandos `scrub` y `check`.
|
||||
|
||||
Encoding
|
||||
Codificación (Encoding)
|
||||
SnapRAID en Unix ignora cualquier codificación. Lee y almacena los
|
||||
nombres de archivo con la misma codificación utilizada por el sistema
|
||||
de archivos.
|
||||
|
|
@ -1657,8 +1812,19 @@ Encoding
|
|||
archivo impresos; si redirige la salida de la consola a un archivo,
|
||||
el archivo resultante siempre está en formato UTF-8.
|
||||
|
||||
Copyright
|
||||
Este archivo es Copyright (C) 2025 Andrea Mazzoleni
|
||||
Código de salida (Exit Code)
|
||||
SnapRAID termina con los siguientes códigos de error:
|
||||
|
||||
See Also
|
||||
snapraid_log(1), snapraidd(1)
|
||||
0 - Todo bien.
|
||||
1 - El comando encontró algunos errores.
|
||||
2 - El comando `diff` determinó que todo está bien, pero se necesita un `sync`.
|
||||
|
||||
Traducción (Translation)
|
||||
Este documento es una traducción automática del manual en inglés.
|
||||
Consulte el manual en inglés para obtener la versión oficial.
|
||||
|
||||
Copyright
|
||||
Este archivo es Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
Véase también (See Also)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
=====================================
|
||||
|
||||
|
||||
1 SYNOPSIS
|
||||
==========
|
||||
1 SINOPSIS (SYNOPSIS)
|
||||
=====================
|
||||
|
||||
snapraid [-c, --conf CONFIG]
|
||||
[-f, --filter PATTERN] [-d, --filter-disk NAME]
|
||||
|
|
@ -28,8 +28,8 @@ snapraid [-c, --conf CONFIG]
|
|||
snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
|
||||
2 DESCRIPTION
|
||||
=============
|
||||
2 DESCRIPCIóN (DESCRIPTION)
|
||||
===========================
|
||||
|
||||
SnapRAID es un programa de copia de seguridad diseñado para arrays
|
||||
de discos, que almacena información de paridad para la recuperación
|
||||
|
|
@ -41,7 +41,7 @@ características:
|
|||
|
||||
* Puede utilizar discos ya llenos de archivos sin la necesidad de
|
||||
reformatearlos, accediendo a ellos como de costumbre.
|
||||
* Todos sus datos son hasheados para asegurar la integridad de los datos
|
||||
* Todos sus datos son procesados con hash para asegurar la integridad de los datos
|
||||
y prevenir la corrupción silenciosa.
|
||||
* Cuando el número de discos fallidos excede el recuento de paridad,
|
||||
la pérdida de datos se limita a los discos afectados; los datos en
|
||||
|
|
@ -60,25 +60,32 @@ Para más información, visite el sitio oficial de SnapRAID:
|
|||
https://www.snapraid.it/
|
||||
|
||||
|
||||
3 LIMITATIONS
|
||||
=============
|
||||
3 LIMITACIONES (LIMITATIONS)
|
||||
============================
|
||||
|
||||
SnapRAID es un híbrido entre un programa RAID y un programa de copia
|
||||
de seguridad, con el objetivo de combinar los mejores beneficios de
|
||||
ambos. Sin embargo, tiene algunas limitaciones que debe considerar
|
||||
antes de usarlo.
|
||||
SnapRAID es un híbrido entre un RAID y un programa de copia de seguridad, con el objetivo de combinar
|
||||
los mejores beneficios de ambos. Sin embargo, tiene algunas limitaciones que debería
|
||||
considerar antes de usarlo.
|
||||
|
||||
La principal limitación es que si un disco falla y no ha sincronizado
|
||||
recientemente, es posible que no pueda recuperarse por completo.
|
||||
Más específicamente, es posible que no pueda recuperar hasta el tamaño
|
||||
de los archivos cambiados o eliminados desde la última operación de
|
||||
sincronización. Esto ocurre incluso si los archivos cambiados o
|
||||
eliminados no están en el disco fallido. Esta es la razón por la que
|
||||
SnapRAID es más adecuado para datos que rara vez cambian.
|
||||
La principal limitación es que si un disco falla, solo puede recuperar datos hasta el
|
||||
estado de la última operación de sincronización (`sync`). Cualquier dato añadido o modificación realizada
|
||||
desde la última sincronización que se encuentre en el disco dañado se perderá.
|
||||
|
||||
Por otro lado, los archivos recién agregados no impiden la recuperación
|
||||
de los archivos ya existentes. Solo perderá los archivos recién
|
||||
agregados si están en el disco fallido.
|
||||
Por lo tanto, SnapRAID es adecuado principalmente para datos que cambian raramente.
|
||||
|
||||
Para los datos que ya existían en la última sincronización, la fiabilidad de la recuperación depende
|
||||
de si se utiliza la opción de instantánea (`snapshot`):
|
||||
|
||||
* Con soporte para instantáneas (disponible en Btrfs, ZFS, Bcachefs y NTFS),
|
||||
SnapRAID puede mantener automáticamente una referencia congelada de sus discos de datos.
|
||||
Esto garantiza que incluso si modifica o elimina archivos en su sistema de archivos activo
|
||||
durante o después de un sync, el proceso de recuperación se mantenga consistente y confiable.
|
||||
|
||||
* Sin soporte para instantáneas, eliminar o cambiar archivos después de un `sync`
|
||||
puede impedir la recuperación completa de otros discos fallidos. Esto ocurre
|
||||
porque la paridad ya no coincide con los archivos modificados, incluso si
|
||||
esos archivos no están en el disco fallido. Por otro lado, los archivos recién añadidos
|
||||
no impiden la recuperación de los archivos ya existentes.
|
||||
|
||||
Otras limitaciones de SnapRAID son:
|
||||
|
||||
|
|
@ -92,12 +99,12 @@ Otras limitaciones de SnapRAID son:
|
|||
Con una copia de seguridad, puede recuperarse de un fallo completo
|
||||
de todo el array de discos.
|
||||
* Solo se guardan nombres de archivo, marcas de tiempo, enlaces simbólicos
|
||||
y enlaces duros. Los permisos, la propiedad y los atributos
|
||||
y enlaces físicos. Los permisos, la propiedad y los atributos
|
||||
extendidos no se guardan.
|
||||
|
||||
|
||||
4 GETTING STARTED
|
||||
=================
|
||||
4 PRIMEROS PASOS (GETTING STARTED)
|
||||
==================================
|
||||
|
||||
Para usar SnapRAID, primero debe seleccionar un disco en su array de
|
||||
discos para dedicarlo a la información de `parity` (paridad). Con un
|
||||
|
|
@ -181,11 +188,11 @@ Cuando este comando se complete, sus datos estarán SEGUROS.
|
|||
Ahora puede comenzar a usar su array como desee y periódicamente
|
||||
actualizar la información de paridad ejecutando el comando `sync`.
|
||||
|
||||
4.1 Scrubbing
|
||||
-------------
|
||||
4.1 Limpieza (Scrubbing)
|
||||
------------------------
|
||||
|
||||
Para verificar periódicamente los datos y la paridad en busca de
|
||||
errores, puede ejecutar el comando `scrub` (fregar/limpiar).
|
||||
errores, puede ejecutar el comando `scrub` (depurar/limpiar).
|
||||
|
||||
snapraid scrub
|
||||
|
||||
|
|
@ -193,7 +200,7 @@ Este comando compara los datos de su array con el hash calculado
|
|||
durante el comando `sync` para verificar la integridad.
|
||||
|
||||
Cada ejecución del comando verifica aproximadamente el 8% del array,
|
||||
excluyendo los datos ya fregados en los 10 días anteriores.
|
||||
excluyendo los datos ya depurados en los 10 días anteriores.
|
||||
Puede usar la opción -p, --plan para especificar una cantidad
|
||||
diferente y la opción -o, --older-than para especificar una edad
|
||||
diferente en días. Por ejemplo, para verificar el 5% del array en
|
||||
|
|
@ -212,9 +219,9 @@ por bloques defectuosos con la opción -e, --filter-error:
|
|||
|
||||
snapraid -e fix
|
||||
|
||||
En el siguiente `scrub`, los errores desaparecerán del informe de
|
||||
En la siguiente depuración (`scrub`), los errores desaparecerán del informe de
|
||||
`status` si realmente se han corregido. Para hacerlo más rápido,
|
||||
puede usar -p bad para fregar solo los bloques marcados como defectuosos.
|
||||
puede usar -p bad para depurar solo los bloques marcados como defectuosos.
|
||||
|
||||
snapraid -p bad scrub
|
||||
|
||||
|
|
@ -223,13 +230,13 @@ causados por archivos eliminados o modificados. Estos errores se
|
|||
informan en la salida de `scrub`, pero los bloques relacionados no
|
||||
se marcan como defectuosos.
|
||||
|
||||
4.2 Pooling
|
||||
-----------
|
||||
4.2 Agrupación (Pooling)
|
||||
------------------------
|
||||
|
||||
Nota: La función de pooling descrita a continuación ha sido
|
||||
sustituida por la herramienta mergerfs, que ahora es la opción
|
||||
recomendada para los usuarios de Linux en la comunidad SnapRAID.
|
||||
Mergefs proporciona una forma más flexible y eficiente de agrupar
|
||||
Mergerfs proporciona una forma más flexible y eficiente de agrupar
|
||||
múltiples unidades en un único punto de montaje unificado,
|
||||
permitiendo un acceso sin problemas a los archivos en todo su array
|
||||
sin depender de enlaces simbólicos. Se integra bien con SnapRAID
|
||||
|
|
@ -303,8 +310,8 @@ el acceso a enlaces simbólicos remotos con el comando:
|
|||
|
||||
fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
||||
|
||||
4.3 Undeleting
|
||||
--------------
|
||||
4.3 Restauración (Undeleting)
|
||||
-----------------------------
|
||||
|
||||
SnapRAID funciona más como un programa de copia de seguridad que como
|
||||
un sistema RAID, y se puede usar para restaurar o recuperar archivos
|
||||
|
|
@ -327,8 +334,8 @@ O para recuperar todos los archivos eliminados en todas las unidades con:
|
|||
|
||||
snapraid fix -m
|
||||
|
||||
4.4 Recovering
|
||||
--------------
|
||||
4.4 Recuperación (Recovering)
|
||||
-----------------------------
|
||||
|
||||
Ha sucedido lo peor, ¡y ha perdido uno o más discos!
|
||||
|
||||
|
|
@ -336,8 +343,8 @@ Ha sucedido lo peor, ¡y ha perdido uno o más discos!
|
|||
|
||||
Lo primero que debe hacer es evitar más cambios en su array de discos.
|
||||
Deshabilite cualquier conexión remota a él y cualquier proceso
|
||||
programado, incluida cualquier sincronización o fregado nocturno
|
||||
programado de SnapRAID.
|
||||
programado, incluida cualquier sincronización o depuración nocturna
|
||||
programada de SnapRAID.
|
||||
|
||||
Luego, proceda con los siguientes pasos.
|
||||
|
||||
|
|
@ -422,16 +429,16 @@ Ejecute el comando `sync` para resincronizar el array con el nuevo disco.
|
|||
Si todo se recupera, este comando es inmediato.
|
||||
|
||||
|
||||
5 COMMANDS
|
||||
==========
|
||||
5 COMANDOS (COMMANDS)
|
||||
=====================
|
||||
|
||||
SnapRAID proporciona algunos comandos simples que le permiten:
|
||||
SnapRAID proporciona unos pocos comandos simples que le permiten:
|
||||
|
||||
* Imprimir el estado del array -> `status`
|
||||
* Mostrar el estado del array -> `status`
|
||||
* Controlar los discos -> `smart`, `probe`, `up`, `down`
|
||||
* Hacer una copia de seguridad/instantánea -> `sync`
|
||||
* Crear un punto de copia de seguridad/recuperación -> `sync`
|
||||
* Comprobar periódicamente los datos -> `scrub`
|
||||
* Restaurar la última copia de seguridad/instantánea -> `fix`.
|
||||
* Restaurar el último punto de copia de seguridad/recuperación -> `fix`.
|
||||
|
||||
Los comandos deben escribirse en minúsculas.
|
||||
|
||||
|
|
@ -442,7 +449,7 @@ Imprime un resumen del estado del array de discos.
|
|||
|
||||
Incluye información sobre la fragmentación de la paridad, la antigüedad
|
||||
de los bloques sin verificar y todos los errores silenciosos
|
||||
registrados encontrados durante el fregado.
|
||||
registrados encontrados durante la depuración.
|
||||
|
||||
La información presentada se refiere a la última vez que ejecutó
|
||||
`sync`. Las modificaciones posteriores no se tienen en cuenta.
|
||||
|
|
@ -451,8 +458,8 @@ Si se detectaron bloques defectuosos, se enumeran sus números de bloque.
|
|||
Para corregirlos, puede usar el comando `fix -e`.
|
||||
|
||||
También muestra un gráfico que representa la última vez que cada
|
||||
bloque fue fregado o sincronizado. Los bloques fregados se muestran
|
||||
con `*`, los bloques sincronizados pero aún no fregados con `o`.
|
||||
bloque fue depurado o sincronizado. Los bloques depurados se muestran
|
||||
con `*`, los bloques sincronizados pero aún no depurados con `o`.
|
||||
|
||||
Nada se modifica.
|
||||
|
||||
|
|
@ -615,38 +622,38 @@ Los archivos en el array NO se modifican.
|
|||
5.8 scrub
|
||||
---------
|
||||
|
||||
Frota (scrubs) el array, buscando errores silenciosos o de
|
||||
Depura (scrubs) el array, buscando errores silenciosos o de
|
||||
entrada/salida en los discos de datos y paridad.
|
||||
|
||||
Cada invocación verifica aproximadamente el 8% del array, excluyendo
|
||||
los datos ya fregados en los últimos 10 días.
|
||||
Esto significa que fregar una vez a la semana asegura que cada bit de
|
||||
los datos ya depurados en los últimos 10 días.
|
||||
Esto significa que depurar una vez a la semana asegura que cada bit de
|
||||
datos se verifique al menos una vez cada tres meses.
|
||||
|
||||
Puede definir un plan de fregado o una cantidad diferente utilizando
|
||||
Puede definir un plan de depuración o una cantidad diferente utilizando
|
||||
la opción -p, --plan, que acepta:
|
||||
bad - Fregar bloques marcados como defectuosos.
|
||||
new - Fregar bloques recién sincronizados que aún no han sido fregados.
|
||||
full - Fregar todo.
|
||||
0-100 - Fregar el porcentaje especificado de bloques.
|
||||
bad - Depurar bloques marcados como defectuosos.
|
||||
new - Depurar bloques recién sincronizados que aún no han sido depurados.
|
||||
full - Depurar todo.
|
||||
0-100 - Depurar el porcentaje especificado de bloques.
|
||||
|
||||
Si especifica un valor de porcentaje, también puede usar la opción -o,
|
||||
--older-than para definir la antigüedad del bloque.
|
||||
Los bloques más antiguos se friegan primero, asegurando una verificación
|
||||
Los bloques más antiguos se depuran primero, asegurando una verificación
|
||||
óptima.
|
||||
Si desea fregar solo los bloques recién sincronizados que aún no han
|
||||
sido fregados, use la opción `-p new`.
|
||||
Si desea depurar solo los bloques recién sincronizados que aún no han
|
||||
sido depurados, use la opción `-p new`.
|
||||
|
||||
Para obtener detalles del estado del fregado, use el comando `status`.
|
||||
Para obtener detalles del estado de la depuración, use el comando `status`.
|
||||
|
||||
Para cualquier error silencioso o de entrada/salida encontrado, los
|
||||
bloques correspondientes se marcan como defectuosos en el archivo
|
||||
`content`.
|
||||
Estos bloques defectuosos se enumeran en `status` y se pueden
|
||||
corregir con `fix -e`.
|
||||
Después de la corrección, en el siguiente fregado, se volverán a
|
||||
Después de la corrección, en la siguiente depuración, se volverán a
|
||||
verificar y, si se encuentran corregidos, se eliminará la marca de defectuoso.
|
||||
Para fregar solo los bloques defectuosos, puede usar el comando
|
||||
Para depurar solo los bloques defectuosos, puede usar el comando
|
||||
`scrub -p bad`.
|
||||
|
||||
Se recomienda ejecutar `scrub` solo en un array sincronizado para evitar
|
||||
|
|
@ -663,15 +670,14 @@ Los archivos en el array NO se modifican.
|
|||
5.9 fix
|
||||
-------
|
||||
|
||||
Corrige todos los archivos y la información de paridad.
|
||||
Repara todos los archivos y los datos de paridad.
|
||||
|
||||
Todos los archivos y la información de paridad se comparan con el
|
||||
estado de instantánea guardado en el último `sync`.
|
||||
Si se encuentra una diferencia, se revierte a la instantánea almacenada.
|
||||
Todos los archivos y datos de paridad si comparan con el estado guardado en
|
||||
el último `sync`. Si se encuentra una diferencia, se revierte al estado almacenado.
|
||||
|
||||
¡ADVERTENCIA! El comando `fix` no diferencia entre errores y
|
||||
modificaciones intencionales. Revierte incondicionalmente el estado
|
||||
del archivo al último `sync`.
|
||||
¡ADVERTENCIA!
|
||||
El comando `fix` no diferencia entre errores y modificaciones intencionadas.
|
||||
Revierte incondicionalmente el estado del archivo al del último `sync`.
|
||||
|
||||
Si no se especifica otra opción, se procesa todo el array.
|
||||
Utilice las opciones de filtro para seleccionar un subconjunto de
|
||||
|
|
@ -828,8 +834,8 @@ Tenga en cuenta que dichos archivos no estarán protegidos por la paridad durant
|
|||
el proceso de reasignación.
|
||||
|
||||
|
||||
6 OPTIONS
|
||||
=========
|
||||
6 OPCIONES (OPTIONS)
|
||||
====================
|
||||
|
||||
SnapRAID proporciona las siguientes opciones:
|
||||
|
||||
|
|
@ -887,19 +893,19 @@ SnapRAID proporciona las siguientes opciones:
|
|||
Esta opción solo se puede usar con `check` y `fix`.
|
||||
|
||||
-p, --plan PERC|bad|new|full
|
||||
Selecciona el plan de fregado (scrub). Si PERC es un valor
|
||||
Selecciona el plan de depuración (scrub). Si PERC es un valor
|
||||
numérico de 0 a 100, se interpreta como el porcentaje de
|
||||
bloques a fregar.
|
||||
bloques a depurar.
|
||||
En lugar de un porcentaje, puede especificar un plan:
|
||||
`bad` friega bloques defectuosos, `new` friega bloques aún
|
||||
no fregados, y `full` friega todo.
|
||||
`bad` depura bloques defectuosos, `new` depura bloques aún
|
||||
no depurados, y `full` depura todo.
|
||||
Esta opción solo se puede usar con `scrub`.
|
||||
|
||||
-o, --older-than DAYS
|
||||
Selecciona la parte más antigua del array para procesar en `scrub`.
|
||||
DAYS es la edad mínima en días para que un bloque sea fregado;
|
||||
DAYS es la edad mínima en días para que un bloque sea depurado;
|
||||
el valor predeterminado es 10.
|
||||
Los bloques marcados como defectuosos siempre se friegan
|
||||
Los bloques marcados como defectuosos siempre se depuran
|
||||
independientemente de esta opción.
|
||||
Esta opción solo se puede usar con `scrub`.
|
||||
|
||||
|
|
@ -955,7 +961,7 @@ SnapRAID proporciona las siguientes opciones:
|
|||
RATE es el número de bytes por segundo. Puede especificar un
|
||||
multiplicador como K, M o G (por ejemplo, --bw-limit 1G).
|
||||
|
||||
-t, --tail TAMAÑO
|
||||
-t, --tail SIZE
|
||||
Limita la lista de archivos a aquellos que no usan más del
|
||||
tamaño de cola especificado de los discos de paridad.
|
||||
Puede usar multiplicadores como K, M, G o T (por ejemplo, --tail 1G).
|
||||
|
|
@ -1063,9 +1069,9 @@ SnapRAID proporciona las siguientes opciones:
|
|||
recomienda encarecidamente no usarla.
|
||||
NO tiene protección de datos durante la operación `sync`.
|
||||
|
||||
-W, --force-realloc-tail TAMAÑO
|
||||
-W, --force-realloc-tail SIZE
|
||||
Funciona como -R, --force-realloc, pero limitado a la porción final
|
||||
especificada (últimos TAMAÑO bytes) de cada archivo de paridad.
|
||||
especificada (últimos SIZE bytes) de cada archivo de paridad.
|
||||
Fuerza la reasignación (movimiento) de cualquier fragmento/bloque de archivo
|
||||
actualmente almacenado en esa sección final, permitiendo que se coloquen
|
||||
en cualquier lugar de los archivos de paridad donde haya espacio libre
|
||||
|
|
@ -1153,8 +1159,8 @@ SnapRAID proporciona las siguientes opciones:
|
|||
Imprime la versión del programa.
|
||||
|
||||
|
||||
7 CONFIGURATION
|
||||
===============
|
||||
7 CONFIGURACIóN (CONFIGURATION)
|
||||
===============================
|
||||
|
||||
SnapRAID requiere un archivo de configuración para saber dónde se
|
||||
encuentra su array de discos y dónde almacenar la información de paridad.
|
||||
|
|
@ -1272,21 +1278,48 @@ realiza utilizando el UUID almacenado de los discos.
|
|||
Define el nombre y el punto de montaje de discos adicionales para monitorear
|
||||
con los comandos `smart` y `probe`.
|
||||
|
||||
Esto es útil para monitorear discos que no forman parte de la
|
||||
matriz pero que son necesarios para que el sistema funcione, como
|
||||
Esto es útil para monitorear discos que no forman parte del
|
||||
array pero que son necesarios para que el sistema funcione, como
|
||||
el disco de arranque.
|
||||
|
||||
Tenga en cuenta que dichos discos no se ven afectados por los comandos `up` y `down`
|
||||
porque se espera que estén siempre girando.
|
||||
|
||||
7.7 nohidden
|
||||
7.7 snapshot
|
||||
------------
|
||||
|
||||
Habilita el uso de instantáneas del sistema de archivos para los comandos `sync`, `scrub`,
|
||||
`check` y `fix`.
|
||||
|
||||
Cuando está habilitado, SnapRAID crea una instantánea de solo lectura de sus datos al
|
||||
comienzo de un 'sync'. Esto asegura una vista consistente y en un punto en el tiempo de sus
|
||||
archivos, evitando errores causados por modificaciones concurrentes de archivos.
|
||||
|
||||
Esto mejora significativamente la recuperación: si un archivo se elimina del sistema de archivos activo,
|
||||
permanece preservado en la instantánea. Esto evita que la paridad se "rompa"
|
||||
para ese bloque, asegurando que aún pueda recuperar los datos con éxito
|
||||
si falla otro disco.
|
||||
|
||||
Esta opción se aplica exclusivamente a discos de datos formateados con los sistemas de
|
||||
archivos Btrfs, Bcachefs o ZFS en Linux y NTFS en Windows.
|
||||
Los discos de paridad, o los discos de datos que usen otros sistemas de archivos, siempre usarán
|
||||
la versión activa del sistema de archivos.
|
||||
|
||||
La creación y eliminación de instantáneas requieren privilegios administrativos.
|
||||
Asegúrese de que SnapRAID se ejecute con los permisos necesarios (por ejemplo, sudo) cuando
|
||||
esta opción esté habilitada.
|
||||
|
||||
Consulte la sección SNAPSHOTS para obtener una explicación detallada del ciclo de vida
|
||||
de las instantáneas.
|
||||
|
||||
7.8 nohidden
|
||||
------------
|
||||
|
||||
Excluye todos los archivos y directorios ocultos.
|
||||
En Unix, los archivos ocultos son los que comienzan con `.`.
|
||||
En Windows, son los que tienen el atributo oculto.
|
||||
|
||||
7.8 exclude/include PATTERN
|
||||
7.9 exclude/include PATTERN
|
||||
---------------------------
|
||||
|
||||
Define los patrones de archivo o directorio a excluir o incluir
|
||||
|
|
@ -1304,8 +1337,8 @@ las especificaciones de patrones.
|
|||
|
||||
Esta opción se puede usar varias veces.
|
||||
|
||||
7.9 blocksize SIZE_IN_KIBIBYTES
|
||||
-------------------------------
|
||||
7.10 blocksize SIZE_IN_KIBIBYTES
|
||||
--------------------------------
|
||||
|
||||
Define el tamaño de bloque básico en kibibytes para la paridad.
|
||||
Un kibibyte es 1024 bytes.
|
||||
|
|
@ -1358,7 +1391,7 @@ aproximadamente 60 GB para un disco de 4 TB, lo que permite
|
|||
alrededor de 460,000 archivos en cada disco de datos sin ningún
|
||||
espacio desperdiciado.
|
||||
|
||||
7.10 hashsize SIZE_IN_BYTES
|
||||
7.11 hashsize SIZE_IN_BYTES
|
||||
---------------------------
|
||||
|
||||
Define el tamaño del hash en bytes para los bloques guardados.
|
||||
|
|
@ -1397,16 +1430,16 @@ obtiene:
|
|||
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0.51 GiB
|
||||
|
||||
7.11 autosave SIZE_IN_GIGABYTES
|
||||
7.12 autosave SIZE_IN_GIGABYTES
|
||||
-------------------------------
|
||||
|
||||
Guarda automáticamente el estado al sincronizar o fregar después de
|
||||
Guarda automáticamente el estado al sincronizar o depurar después de
|
||||
la cantidad especificada de GB procesados.
|
||||
Esta opción es útil para evitar reiniciar comandos `sync` largos
|
||||
desde cero si son interrumpidos por un fallo de la máquina o
|
||||
cualquier otro evento.
|
||||
|
||||
7.12 temp_limit TEMPERATURE_CELSIUS
|
||||
7.13 temp_limit TEMPERATURE_CELSIUS
|
||||
-----------------------------------
|
||||
|
||||
Establece la temperatura máxima permitida del disco en Celsius.
|
||||
|
|
@ -1443,14 +1476,14 @@ Normalmente, SnapRAID solo muestra la temperatura del disco más
|
|||
caliente. Para mostrar la temperatura de todos los discos, use
|
||||
la opción -A o --stats.
|
||||
|
||||
7.13 temp_sleep TIME_IN_MINUTES
|
||||
7.14 temp_sleep TIME_IN_MINUTES
|
||||
-------------------------------
|
||||
|
||||
Establece el tiempo de espera, en minutos, cuando se alcanza el
|
||||
límite de temperatura. Durante este período, los discos permanecen
|
||||
detenidos. El valor predeterminado es de 5 minutos.
|
||||
|
||||
7.14 pool DIR
|
||||
7.15 pool DIR
|
||||
-------------
|
||||
|
||||
Define el directorio de agrupación (pooling) donde se crea la vista
|
||||
|
|
@ -1458,7 +1491,7 @@ virtual del array de discos utilizando el comando `pool`.
|
|||
|
||||
El directorio ya debe existir.
|
||||
|
||||
7.15 share UNC_DIR
|
||||
7.16 share UNC_DIR
|
||||
------------------
|
||||
|
||||
Define la ruta UNC de Windows requerida para acceder a los discos
|
||||
|
|
@ -1476,7 +1509,7 @@ y finalmente agregando el directorio y el nombre del archivo.
|
|||
|
||||
Esta opción solo es necesaria para Windows.
|
||||
|
||||
7.16 smartctl DISK/PARITY OPTIONS...
|
||||
7.17 smartctl DISK/PARITY OPTIONS...
|
||||
------------------------------------
|
||||
|
||||
Define opciones personalizadas de smartctl para obtener los atributos
|
||||
|
|
@ -1493,6 +1526,10 @@ En las OPCIONES especificadas, la cadena `%s` se reemplaza por
|
|||
el nombre del dispositivo. Para los controladores RAID, el dispositivo
|
||||
es probable que sea fijo y es posible que no necesite usar `%s`.
|
||||
|
||||
También puede especificar una cadena de opciones de información
|
||||
personalizada mediante la etiqueta `[info: ...]` para sustituir
|
||||
la opción `-a` predeterminada.
|
||||
|
||||
Consulte la documentación de smartmontools para conocer las posibles
|
||||
opciones:
|
||||
|
||||
|
|
@ -1501,9 +1538,10 @@ opciones:
|
|||
|
||||
Por ejemplo:
|
||||
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl parity -d sat %s
|
||||
|
||||
7.17 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
7.18 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
-------------------------------------------
|
||||
|
||||
Ignora el atributo SMART especificado al calcular la probabilidad
|
||||
|
|
@ -1516,16 +1554,21 @@ PARITY es uno de los nombres de paridad: `parity`, `2-parity`,
|
|||
El valor especial * se puede usar para ignorar el atributo en todos
|
||||
los discos.
|
||||
|
||||
Por ejemplo, para ignorar el atributo `Current Pending Sector Count`
|
||||
en todos los discos:
|
||||
Se pueden especificar múltiples atributos separados por espacios.
|
||||
Cada atributo se puede especificar como un número del 1 al 255, o como un
|
||||
nombre que no distingue entre mayúsculas y minúsculas (p. ej., `Current_Pending_Sector`).
|
||||
|
||||
smartignore * 197
|
||||
Por ejemplo, para ignorar los atributos `Current Pending Sector Count` y
|
||||
`Reallocated Sectors Count` en todos los discos por su número o nombre:
|
||||
|
||||
Para ignorarlo solo en el primer disco de paridad:
|
||||
smartignore * 197 5
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
smartignore parity 197
|
||||
Para ignorarlos solo en el primer disco de paridad:
|
||||
|
||||
7.18 Examples
|
||||
smartignore parity 197 5
|
||||
|
||||
7.19 Examples
|
||||
-------------
|
||||
|
||||
Un ejemplo de una configuración típica para Unix es:
|
||||
|
|
@ -1538,7 +1581,7 @@ Un ejemplo de una configuración típica para Unix es:
|
|||
data d3 /mnt/disk3/
|
||||
exclude /lost+found/
|
||||
exclude /tmp/
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/sg0
|
||||
smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1554,14 +1597,134 @@ Un ejemplo de una configuración típica para Windows es:
|
|||
exclude Thumbs.db
|
||||
exclude \$RECYCLE.BIN
|
||||
exclude \System Volume Information
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
|
||||
8 PATTERN
|
||||
=========
|
||||
8 INSTANTáNEAS (SNAPSHOTS)
|
||||
==========================
|
||||
|
||||
Si la opción de instantánea está habilitada en la configuración, SnapRAID
|
||||
utiliza la funcionalidad de instantáneas del sistema de archivos para garantizar operaciones atómicas
|
||||
y consistentes.
|
||||
|
||||
La gestión de las instantáneas es completamente automática y transparente.
|
||||
Puede continuar usando SnapRAID exactamente como antes, con la
|
||||
protección adicional proporcionada por las instantáneas gestionadas completamente en
|
||||
segundo plano.
|
||||
|
||||
Esto proporciona dos beneficios primordiales:
|
||||
|
||||
Consistencia - Los archivos modificados en el sistema de archivos activo durante un sync o scrub de
|
||||
larga duración no causarán desajustes de paridad ni operaciones abortadas,
|
||||
ya que SnapRAID ve una imagen congelada en el tiempo.
|
||||
Recuperación - Si un archivo se actualiza o elimina del sistema de archivos activo,
|
||||
permanece preservado en la instantánea. Si ocurre un fallo de disco
|
||||
antes de que se ejecute el siguiente sync, SnapRAID utiliza los datos preservados
|
||||
en la instantánea para reconstruir el disco fallido.
|
||||
|
||||
En caso de fallo de un disco durante un proceso de sync activo,
|
||||
SnapRAID también es capaz de leer automáticamente tanto de la instantánea
|
||||
del cómputo de paridad anterior como del actual.
|
||||
Esto maximiza la probabilidad de una recuperación completa al
|
||||
proporcionar acceso a los bloques de datos exactos requeridos para resolver
|
||||
las ecuaciones de paridad, incluso si esos bloques fueron modificados
|
||||
o eliminados entre syncs.
|
||||
|
||||
Sin instantáneas, un archivo actualizado o eliminado en un disco sano
|
||||
da como resultado la pérdida de bloques de datos que pueden ser necesarios para
|
||||
reparar otros discos fallidos.
|
||||
|
||||
Las instantáneas se crean solo para discos de datos y solo si el sistema de archivos
|
||||
subyacente admite esta funcionalidad. Los discos de paridad siempre usan
|
||||
el sistema de archivos activo.
|
||||
|
||||
Actualmente, esto es compatible con Btrfs, Bcachefs y ZFS en Linux
|
||||
y con NTFS en Windows.
|
||||
|
||||
Puede mezclar discos de datos con diferentes sistemas de archivos. Solo aquellos que
|
||||
admitan instantáneas las utilizarán, mientras que los demás discos continuarán
|
||||
operando directamente en el sistema de archivos activo.
|
||||
|
||||
La creación y eliminación de instantáneas requieren privilegios administrativos.
|
||||
Asegúrese de que SnapRAID se ejecute con los permisos necesarios (por ejemplo, sudo)
|
||||
cuando las instantáneas estén habilitadas.
|
||||
|
||||
8.1 Comportamiento de comandos con instantáneas
|
||||
-----------------------------------------------
|
||||
|
||||
Los comandos `sync` y `scrub` operan exclusivamente en instantáneas
|
||||
para garantizar que todas las operaciones de datos se realicen contra un estado consistente
|
||||
y congelado. Al utilizar estas instantáneas, SnapRAID evita desajustes de paridad
|
||||
que de otro modo serian provocados por modificaciones de archivos concurrentes en el sistema de archivos activo.
|
||||
Durante un `sync`, el comando utiliza una nueva instantánea creada al
|
||||
inicio del proceso para capturar el estado actual para el cómputo de paridad.
|
||||
Por el contrario, el comando `scrub` utiliza la última instantánea, la
|
||||
creada durante el sync más reciente, para mantener un punto de referencia confiable
|
||||
que coincida con la paridad existente.
|
||||
|
||||
Para los comandos `check` y `fix`, el uso de la última instantánea
|
||||
depende de si se seleccionan discos específicos mediante la opción
|
||||
-d, --filter-disk.
|
||||
|
||||
Un disco seleccionado explícitamente mediante -d (el "objetivo" de la operación)
|
||||
siempre utiliza el sistema de archivos activo. Para `fix`, esto permite restaurar
|
||||
datos en el reemplazo de disco activo. Para `check`, permite simular
|
||||
la operación `fix` bajo las mismas condiciones.
|
||||
|
||||
Todos los demás discos de datos (los discos de "referencia") se accederán a través de
|
||||
sus instantáneas. Esto garantiza que incluso si está modificando archivos
|
||||
en sus discos sanos mientras se realiza una recuperación, SnapRAID
|
||||
tenga una referencia estable y congelada para resolver las ecuaciones de paridad.
|
||||
|
||||
Si no se proporciona la opción -d, SnapRAID asume que la operación se aplica
|
||||
a todo el array, en cuyo caso, `check` y `fix` usarán los sistemas
|
||||
de archivos activos exclusivamente.
|
||||
|
||||
Todos los demás comandos funcionan exclusivamente en el sistema de archivos activo.
|
||||
|
||||
|
||||
9 CICLO DE VIDA DE LAS INSTANTáNEAS (SNAPSHOTS LIFECYCLE)
|
||||
=========================================================
|
||||
|
||||
SnapRAID gestiona dos instantáneas específicas, `stable` y `pending`,
|
||||
dentro de un directorio oculto en la raíz de cada subvolumen de datos.
|
||||
En Btrfs, Bcachefs y NTFS se utiliza el directorio `.snapraid/`,
|
||||
en ZFS el estándar `.zfs/snapshot/`.
|
||||
|
||||
La instantánea `stable` representa el estado del último
|
||||
`sync` completado con éxito, que contiene los datos exactos utilizados para
|
||||
calcular la paridad actual. Sirve como fuente de datos principal
|
||||
para los comandos `scrub`, `check` y `fix`.
|
||||
|
||||
La instantánea `pending` es una imagen temporal creada al inicio
|
||||
de un `sync` para proporcionar un estado congelado para el cómputo de paridad.
|
||||
Una vez completada con éxito la operación, la instantánea `stable` anterior
|
||||
se elimina y la instantánea `pending` se promueve para
|
||||
tomar su lugar como la nueva referencia estable.
|
||||
|
||||
Si un `sync` se interrumpe, la instantánea `pending` se conserva.
|
||||
Los comandos posteriores `scrub`, `check` y `fix` utilizarán esta
|
||||
instantánea pendiente, ya que coincide con el estado del sistema de archivos registrado en
|
||||
el archivo .content, incluso si la paridad solo está parcialmente sincronizada.
|
||||
|
||||
En caso de interrupción de un `sync`, los comandos `check` y `fix`
|
||||
también leen de la instantánea `stable` para recuperar bloques de datos
|
||||
de archivos que se actualizaron o eliminaron durante el sync.
|
||||
Esto es posible porque el archivo .content conserva los metadatos de
|
||||
todos los archivos modificados o eliminados durante todo el proceso de sync.
|
||||
Esta información histórica solo se borra una vez que el sync finaliza
|
||||
con éxito y se guarda la versión final del archivo .content.
|
||||
|
||||
Si un `sync` se reinicia después de una interrupción, la instantánea pending existente
|
||||
se elimina y se crea una nueva para
|
||||
capturar el estado actual del sistema de archivos activo.
|
||||
|
||||
|
||||
10 PATRONES (PATTERN)
|
||||
=====================
|
||||
|
||||
Los patrones proporcionan una forma flexible de filtrar archivos para su inclusión o
|
||||
exclusión. Al usar caracteres de globbing, puede definir reglas que coincidan con
|
||||
|
|
@ -1683,8 +1846,8 @@ En Unix, al usar caracteres globbing en la línea de comandos, debe
|
|||
ponerlos entre comillas para evitar que el shell los expanda.
|
||||
|
||||
|
||||
9 IGNORAR ARCHIVOS
|
||||
==================
|
||||
11 IGNORAR ARCHIVOS (IGNORE FILE)
|
||||
=================================
|
||||
|
||||
Además de las reglas globales en el archivo de configuración, puedes
|
||||
colocar archivos `.snapraidignore` en cualquier directorio dentro del array
|
||||
|
|
@ -1728,8 +1891,8 @@ Por ejemplo, si tienes un `.snapraidignore` en `/mnt/disk1/projects/`:
|
|||
*.tmp
|
||||
|
||||
|
||||
10 CONTENT
|
||||
==========
|
||||
12 CONTENIDO (CONTENT)
|
||||
======================
|
||||
|
||||
SnapRAID almacena la lista y las sumas de comprobación de sus
|
||||
archivos en el archivo de contenido.
|
||||
|
|
@ -1738,12 +1901,14 @@ Es un archivo binario que enumera todos los archivos presentes en
|
|||
su array de discos, junto con todas las sumas de comprobación para
|
||||
verificar su integridad.
|
||||
|
||||
Este archivo es leído y escrito por los comandos `sync` y `scrub`
|
||||
y leído por los comandos `fix`, `check` y `status`.
|
||||
El archivo de contenido es leído y escrito por los comandos `sync`,
|
||||
`scrub`, `touch` y `rehash`. Es leído por los comandos `status`, `diff`,
|
||||
`check`, `fix`, `list`, `dup`, `locate` y `pool`, y es completamente
|
||||
ignorado por los comandos `smart`, `probe`, `up`, `down` y `devices`.
|
||||
|
||||
|
||||
11 PARITY
|
||||
=========
|
||||
13 PARIDAD (PARITY)
|
||||
===================
|
||||
|
||||
SnapRAID almacena la información de paridad de su array en los
|
||||
archivos de paridad.
|
||||
|
|
@ -1755,8 +1920,8 @@ Estos archivos son leídos y escritos por los comandos `sync` y `fix`
|
|||
y solo leídos por los comandos `scrub` y `check`.
|
||||
|
||||
|
||||
12 ENCODING
|
||||
===========
|
||||
14 CODIFICACIóN (ENCODING)
|
||||
==========================
|
||||
|
||||
SnapRAID en Unix ignora cualquier codificación. Lee y almacena los
|
||||
nombres de archivo con la misma codificación utilizada por el sistema
|
||||
|
|
@ -1773,13 +1938,30 @@ archivo impresos; si redirige la salida de la consola a un archivo,
|
|||
el archivo resultante siempre está en formato UTF-8.
|
||||
|
||||
|
||||
13 COPYRIGHT
|
||||
15 CóDIGO DE SALIDA (EXIT CODE)
|
||||
===============================
|
||||
|
||||
SnapRAID termina con los siguientes códigos de error:
|
||||
|
||||
0 - Todo bien.
|
||||
1 - El comando encontró algunos errores.
|
||||
2 - El comando `diff` determinó que todo está bien, pero se necesita un `sync`.
|
||||
|
||||
|
||||
16 TRADUCCIóN (TRANSLATION)
|
||||
===========================
|
||||
|
||||
Este documento es una traducción automática del manual en inglés.
|
||||
Consulte el manual en inglés para obtener la versión oficial.
|
||||
|
||||
|
||||
17 COPYRIGHT
|
||||
============
|
||||
|
||||
Este archivo es Copyright (C) 2025 Andrea Mazzoleni
|
||||
Este archivo es Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
|
||||
14 SEE ALSO
|
||||
===========
|
||||
18 VéASE TAMBIéN (SEE ALSO)
|
||||
===========================
|
||||
|
||||
snapraid_log(1), snapraidd(1)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ snapraid [\-c, \-\-conf CONFIG]
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
[\-f, \-\-filter MOTIF] [\-d, \-\-filter\-disk NOM]
|
||||
[\-f, \-\-filter PATTERN] [\-d, \-\-filter\-disk NAME]
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -14,19 +14,23 @@ snapraid [\-c, \-\-conf CONFIG]
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
[\-a, \-\-audit\-only] [\-h, \-\-pre\-hash] [\-i, \-\-import DOSSIER]
|
||||
[\-a, \-\-audit\-only] [\-h, \-\-pre\-hash] [\-i, \-\-import DIR]
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
[\-p, \-\-plan PERC|mauvais|nouveau|complet]
|
||||
[\-p, \-\-plan PERC|bad|new|full]
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
[\-o, \-\-older\-than JOURS] [\-l, \-\-log FICHIER]
|
||||
[\-o, \-\-older\-than DAYS] [\-l, \-\-log FILE]
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
[\-s, \-\-spin\-down\-on\-error] [\-w, \-\-bw\-limit DÉBIT]
|
||||
[\-s, \-\-spin\-down\-on\-error] [\-w, \-\-bw\-limit RATE]
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
[\-t, \-\-tail]
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -50,7 +54,7 @@ snapraid [\-c, \-\-conf CONFIG]
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
[\-L, \-\-error\-limit NOMBRE]
|
||||
[\-L, \-\-error\-limit NUMBER]
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -70,7 +74,7 @@ snapraid [\-c, \-\-conf CONFIG]
|
|||
.PD 0
|
||||
.PD
|
||||
.PP
|
||||
snapraid [\-V, \-\-version] [\-H, \-\-help] [\-C, \-\-gen\-conf CONTENU]
|
||||
snapraid [\-V, \-\-version] [\-H, \-\-help] [\-C, \-\-gen\-conf CONTENT]
|
||||
.PD 0
|
||||
.PD
|
||||
.SH DESCRIPTION
|
||||
|
|
@ -114,23 +118,33 @@ https://www.snapraid.it/
|
|||
.PD
|
||||
.RE
|
||||
.SH LIMITATIONS
|
||||
SnapRAID est un hybride entre un programme RAID et un programme de sauvegarde,
|
||||
visant à combiner les meilleurs avantages des deux. Cependant, il a quelques
|
||||
limitations que vous devriez considérer avant de l\'utiliser.
|
||||
SnapRAID est un hybride entre un RAID et un programme de sauvegarde, visant à combiner
|
||||
les meilleurs avantages des deux. Cependant, il présente certaines limitations que vous devriez
|
||||
prendre en compte avant de l\'utiliser.
|
||||
.PP
|
||||
La principale limitation est que si un disque tombe en panne et que vous
|
||||
n\'avez pas synchronisé récemment, vous pourriez ne pas être en mesure de
|
||||
récupérer complètement.
|
||||
Plus précisément, vous pourriez ne pas être en mesure de récupérer jusqu\'à
|
||||
la taille des fichiers modifiés ou supprimés depuis la dernière opération
|
||||
de synchronisation.
|
||||
Cela se produit même si les fichiers modifiés ou supprimés ne se trouvent
|
||||
pas sur le disque défaillant. C\'est pourquoi SnapRAID est mieux adapté
|
||||
aux données qui changent rarement.
|
||||
La principale limitation est que si un disque tombe en panne, vous ne pouvez récupérer les données que jusqu\'à
|
||||
l\'état du dernier processus \`sync\`. Toutes les données ajoutées ou modifications effectuées
|
||||
depuis la dernière synchronisation situées sur le disque défectueux seront perdues.
|
||||
.PP
|
||||
D\'un autre côté, les fichiers nouvellement ajoutés n\'empêchent pas
|
||||
la récupération des fichiers déjà existants. Vous ne perdrez que les
|
||||
fichiers récemment ajoutés s\'ils se trouvent sur le disque défaillant.
|
||||
Par conséquent, SnapRAID est principalement adapté aux données qui changent rarement.
|
||||
.PP
|
||||
Pour les données qui existaient déjà lors de la dernière synchronisation, la fiabilité de la récupération dépend
|
||||
de l\'utilisation ou non de l\'option \`snapshot\` :
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Avec la prise en charge des instantanés (disponible sur Btrfs, ZFS, Bcachefs et NTFS),
|
||||
SnapRAID peut maintenir automatiquement une référence figée de vos disques de données.
|
||||
Cela garantit que même si vous modifiez ou supprimez des fichiers sur votre système de fichiers actif
|
||||
pendant ou après une synchronisation, le processus de récupération reste cohérent et fiable.
|
||||
.PD
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Sans la prise en charge des instantanés, la suppression ou la modification de fichiers après un \`sync\`
|
||||
peut empêcher la récupération complète d\'autres disques en panne. Cela se produit
|
||||
parce que la parité ne correspond plus aux fichiers modifiés, même si
|
||||
ces fichiers ne se trouvent pas sur le disque défectueux. D\'un autre côté, les fichiers nouvellement ajoutés
|
||||
n\'empêchent pas la récupération des fichiers déjà existants.
|
||||
.PD
|
||||
.PP
|
||||
Les autres limitations de SnapRAID sont :
|
||||
.PD 0
|
||||
|
|
@ -151,10 +165,10 @@ de défaillances de disques. Avec une sauvegarde, vous pouvez
|
|||
récupérer d\'une défaillance complète de toute la baie de disques.
|
||||
.IP \(bu
|
||||
Seuls les noms de fichiers, les horodatages, les liens symboliques
|
||||
et les liens matériels sont sauvegardés. Les permissions, la
|
||||
et les liens physiques sont sauvegardés. Les permissions, la
|
||||
propriété et les attributs étendus ne sont pas sauvegardés.
|
||||
.PD
|
||||
.SH DéMARRER
|
||||
.SH DéMARRER (GETTING STARTED)
|
||||
Pour utiliser SnapRAID, vous devez d\'abord sélectionner un disque
|
||||
dans votre baie de disques pour le dédier aux informations de \`parité\`.
|
||||
Avec un disque pour la parité, vous pourrez récupérer d\'une
|
||||
|
|
@ -351,7 +365,7 @@ snapraid \-e fix
|
|||
.PP
|
||||
Lors du prochain \`scrub\`, les erreurs disparaîtront du rapport
|
||||
\`status\` si elles sont réellement corrigées. Pour accélérer,
|
||||
vous pouvez utiliser \-p mauvais pour nettoyer uniquement les blocs
|
||||
vous pouvez utiliser \-p bad pour nettoyer uniquement les blocs
|
||||
marqués comme mauvais.
|
||||
.PP
|
||||
.RS 4
|
||||
|
|
@ -367,7 +381,7 @@ ne sont pas marqués comme mauvais.
|
|||
.SS Mise en commun (Pooling)
|
||||
Note : La fonctionnalité de mise en commun décrite ci\-dessous a été
|
||||
remplacée par l\'outil mergerfs, qui est désormais l\'option recommandée
|
||||
pour les utilisateurs Linux de la communauté SnapRAID. Mergefs offre
|
||||
pour les utilisateurs Linux de la communauté SnapRAID. Mergerfs offre
|
||||
un moyen plus flexible et efficace de regrouper plusieurs disques
|
||||
dans un seul point de montage unifié, permettant un accès transparent
|
||||
aux fichiers sur toute votre baie sans dépendre de liens symboliques.
|
||||
|
|
@ -529,7 +543,7 @@ ou récupérer des fichiers dans leur état précédent à l\'aide
|
|||
de l\'option \-f, \-\-filter :
|
||||
.PP
|
||||
.RS 4
|
||||
snapraid fix \-f FICHIER
|
||||
snapraid fix \-f FILE
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
|
|
@ -537,7 +551,7 @@ snapraid fix \-f FICHIER
|
|||
ou pour un répertoire :
|
||||
.PP
|
||||
.RS 4
|
||||
snapraid fix \-f DOSSIER/
|
||||
snapraid fix \-f DIR/
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
|
|
@ -549,7 +563,7 @@ qui ne restaure que les fichiers manquants, laissant tous
|
|||
les autres intacts.
|
||||
.PP
|
||||
.RS 4
|
||||
snapraid fix \-m \-f DOSSIER/
|
||||
snapraid fix \-m \-f DIR/
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
|
|
@ -562,7 +576,7 @@ snapraid fix \-m
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Récupération
|
||||
.SS Récupération (Recovering)
|
||||
Le pire est arrivé, et vous avez perdu un ou plusieurs disques !
|
||||
.PP
|
||||
NE PANIQUEZ PAS ! Vous pourrez les récupérer !
|
||||
|
|
@ -607,12 +621,12 @@ Exécutez la commande fix, en stockant le journal dans un fichier
|
|||
externe avec :
|
||||
.PP
|
||||
.RS 4
|
||||
snapraid \-d NOM \-l fix.log fix
|
||||
snapraid \-d NAME \-l fix.log fix
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.PP
|
||||
Où NOM est le nom du disque, tel que \`d1\` dans notre exemple précédent.
|
||||
Où NAME est le nom du disque, tel que \`d1\` dans notre exemple précédent.
|
||||
Si le disque à récupérer est un disque de parité, utilisez les noms
|
||||
\`parity\`, \`2\-parity\`, etc.
|
||||
Si vous avez plusieurs disques défaillants, utilisez plusieurs
|
||||
|
|
@ -648,12 +662,12 @@ Par précaution, vous pouvez maintenant exécuter une commande \`check\`
|
|||
pour vous assurer que tout est correct sur le disque récupéré.
|
||||
.PP
|
||||
.RS 4
|
||||
snapraid \-d NOM \-a check
|
||||
snapraid \-d NAME \-a check
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.PP
|
||||
Où NOM est le nom du disque, tel que \`d1\` dans notre exemple précédent.
|
||||
Où NAME est le nom du disque, tel que \`d1\` dans notre exemple précédent.
|
||||
.PP
|
||||
Les options \-d et \-a indiquent à SnapRAID de vérifier uniquement le
|
||||
disque spécifié et d\'ignorer toutes les données de parité.
|
||||
|
|
@ -671,19 +685,19 @@ snapraid sync
|
|||
.RE
|
||||
.PP
|
||||
Si tout est récupéré, cette commande est immédiate.
|
||||
.SH COMMANDES
|
||||
.SH COMMANDES (COMMANDS)
|
||||
SnapRAID fournit quelques commandes simples qui vous permettent de :
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Afficher l\'état de la baie de disques \-> \`status\`
|
||||
Afficher l\'état de la grappe \-> \`status\`
|
||||
.IP \(bu
|
||||
Contrôler les disques \-> \`smart\`, \`probe\`, \`up\`, \`down\`
|
||||
.IP \(bu
|
||||
Faire une sauvegarde/instantané \-> \`sync\`
|
||||
Créer un point de sauvegarde/récupération \-> \`sync\`
|
||||
.IP \(bu
|
||||
Vérifier périodiquement les données \-> \`scrub\`
|
||||
.IP \(bu
|
||||
Restaurer la dernière sauvegarde/instantané \-> \`fix\`.
|
||||
Restaurer le dernier point de sauvegarde/récupération \-> \`fix\`.
|
||||
.PD
|
||||
.PP
|
||||
Les commandes doivent être écrites en minuscules.
|
||||
|
|
@ -742,7 +756,7 @@ Le journal d\'auto\-test du périphérique contient des erreurs.
|
|||
.PD
|
||||
.RE
|
||||
.PP
|
||||
Si l\'option \-v, \-\-verbose est spécifiée, une analyse statistique
|
||||
Si l\'option \`\-v, \-\-verbose\` est spécifiée, une analyse statistique
|
||||
plus approfondie est fournie. Cette analyse peut vous aider à
|
||||
décider si vous avez besoin de plus ou moins de parité.
|
||||
.PP
|
||||
|
|
@ -927,15 +941,15 @@ vérification de chaque bloc et pour marquer les mauvais blocs.
|
|||
Les fichiers \`parity\` NE SONT PAS modifiés.
|
||||
Les fichiers dans la baie NE SONT PAS modifiés.
|
||||
.SS fix
|
||||
Corrige tous les fichiers et les données de parité.
|
||||
Répare tous les fichiers et les données de parité.
|
||||
.PP
|
||||
Tous les fichiers et les données de parité sont comparés à l\'état
|
||||
de l\'instantané enregistré lors du dernier \`sync\`.
|
||||
Si une différence est trouvée, elle est rétablie à l\'instantané stocké.
|
||||
Tous les fichiers et les données de parité sont comparés à l\'état sauvegardé lors
|
||||
du dernier \`sync\`. Si une différence est trouvée, elle est restaurée à l\'état enregistré.
|
||||
.PP
|
||||
AVERTISSEMENT ! La commande \`fix\` ne fait pas de distinction entre
|
||||
les erreurs et les modifications intentionnelles. Elle rétablit
|
||||
inconditionnellement l\'état du fichier au dernier \`sync\`.
|
||||
AVERTISSEMENT !
|
||||
La commande \`fix\` ne fait pas de différence entre les erreurs et
|
||||
les modifications intentionnelles. Elle rétablit inconditionnellement l\'état des fichiers
|
||||
tel qu\'il était lors du dernier \`sync\`.
|
||||
.PP
|
||||
Si aucune autre option n\'est spécifiée, l\'intégralité de la baie est traitée.
|
||||
Utilisez les options de filtre pour sélectionner un sous\-ensemble de
|
||||
|
|
@ -1081,11 +1095,11 @@ s\'il existe, sinon \`/etc/snapraid.conf\`.
|
|||
Sous Windows, il utilise le fichier \`snapraid.conf\` dans le même
|
||||
répertoire que \`snapraid.exe\`.
|
||||
.TP
|
||||
.B \-f, \-\-filter MOTIF
|
||||
.B \-f, \-\-filter PATTERN
|
||||
Filtre les fichiers à traiter dans \`check\` et \`fix\`.
|
||||
Seuls les fichiers correspondant au motif spécifié sont traités.
|
||||
Cette option peut être utilisée plusieurs fois.
|
||||
Voir la section MOTIF pour plus de détails sur les
|
||||
Voir la section PATTERN pour plus de détails sur les
|
||||
spécifications de motifs.
|
||||
Sous Unix, assurez\-vous que les caractères de globbing sont
|
||||
entre guillemets s\'ils sont utilisés.
|
||||
|
|
@ -1093,7 +1107,7 @@ Cette option ne peut être utilisée qu\'avec \`check\` et \`fix\`.
|
|||
Elle ne peut pas être utilisée avec \`sync\` et \`scrub\`, car ils
|
||||
traitent toujours l\'intégralité de la baie.
|
||||
.TP
|
||||
.B \-d, \-\-filter\-disk NOM
|
||||
.B \-d, \-\-filter\-disk NAME
|
||||
Filtre les disques à traiter dans \`check\`, \`fix\`, \`up\` et \`down\`.
|
||||
Vous devez spécifier un nom de disque tel que défini dans le fichier
|
||||
de configuration.
|
||||
|
|
@ -1137,9 +1151,9 @@ Au lieu d\'un pourcentage, vous pouvez spécifier un plan :
|
|||
qui n\'ont pas encore été nettoyés, et \`full\` nettoie tout.
|
||||
Cette option ne peut être utilisée qu\'avec \`scrub\`.
|
||||
.TP
|
||||
.B \-o, \-\-older\-than JOURS
|
||||
.B \-o, \-\-older\-than DAYS
|
||||
Sélectionne la partie la plus ancienne de la baie à traiter dans \`scrub\`.
|
||||
JOURS est l\'âge minimum en jours pour qu\'un bloc soit nettoyé ;
|
||||
DAYS est l\'âge minimum en jours pour qu\'un bloc soit nettoyé ;
|
||||
la valeur par défaut est 10.
|
||||
Les blocs marqués comme mauvais sont toujours nettoyés,
|
||||
quelle que soit cette option.
|
||||
|
|
@ -1176,7 +1190,7 @@ réussi et, si nécessaire, vous permet d\'exécuter une
|
|||
opération fix avant de continuer.
|
||||
Cette option ne peut être utilisée qu\'avec \`sync\`.
|
||||
.TP
|
||||
.B \-i, \-\-import DOSSIER
|
||||
.B \-i, \-\-import DIR
|
||||
Importe à partir du répertoire spécifié tous les fichiers supprimés
|
||||
de la baie après le dernier \`sync\`.
|
||||
Si vous avez toujours de tels fichiers, ils peuvent être utilisés
|
||||
|
|
@ -1194,12 +1208,12 @@ et une consommation d\'énergie. Utilisez cette option pour vous
|
|||
assurer que les disques sont arrêtés en toute sécurité
|
||||
même lorsqu\'une commande échoue.
|
||||
.TP
|
||||
.B \-w, \-\-bw\-limit DÉBIT
|
||||
.B \-w, \-\-bw\-limit RATE
|
||||
Applique une limite de bande passante globale pour tous les disques.
|
||||
Le DÉBIT est le nombre d\'octets par seconde. Vous pouvez spécifier
|
||||
un multiplicateur tel que K, M ou G (par exemple, \-\-bw\-limit 1G).
|
||||
Le RATE est le nombre d\'octets par seconde. Vous pouvez spécifier
|
||||
un multiplicateur tel que K, M, G ou T (par exemple, \-\-bw\-limit 1G).
|
||||
.TP
|
||||
.B \-t, \-\-tail TAILLE
|
||||
.B \-t, \-\-tail SIZE
|
||||
Limite la liste des fichiers à ceux n\'utilisant pas plus que la
|
||||
taille de queue spécifiée des disques de parité.
|
||||
Vous pouvez utiliser des multiplicateurs tels que K, M, G ou T (ex: \-\-tail 1G).
|
||||
|
|
@ -1312,9 +1326,9 @@ AVERTISSEMENT ! Cette option est réservée aux experts, et il est
|
|||
fortement recommandé de ne pas l\'utiliser.
|
||||
Vous N\'AVEZ AUCUNE protection des données pendant l\'opération \`sync\`.
|
||||
.TP
|
||||
.B \-W, \-\-force\-realloc\-tail TAILLE
|
||||
Fonctionne comme \-R, \-\-force\-realloc, maar limité à la partie terminale
|
||||
spécifiée (les derniers TAILLE octets) de chaque fichier de parité.
|
||||
.B \-W, \-\-force\-realloc\-tail SIZE
|
||||
Fonctionne comme \-R, \-\-force\-realloc, mais limité à la partie terminale
|
||||
spécifiée (les derniers SIZE octets) de chaque fichier de parité.
|
||||
Force la réallocation (déplacement) de tout fragment/bloc de fichier
|
||||
actuellement stocké dans cette section terminale, leur permettant d\'être
|
||||
placés n\'importe où dans le(s) fichier(s) de parité où de l\'espace libre
|
||||
|
|
@ -1334,7 +1348,7 @@ recommandé de ne pas l\'utiliser.
|
|||
Vous n\'avez PAS de protection des données pendant l\'opération \`sync\`
|
||||
pour les fichiers affectés.
|
||||
.TP
|
||||
.B \-l, \-\-log FICHIER
|
||||
.B \-l, \-\-log FILE
|
||||
Écrit un journal détaillé dans le fichier spécifié.
|
||||
Si cette option n\'est pas spécifiée, les erreurs inattendues
|
||||
sont imprimées à l\'écran, ce qui peut entraîner une sortie
|
||||
|
|
@ -1354,7 +1368,7 @@ respectivement.
|
|||
Consultez le fichier ou la page de manuel snapraid_log.txt
|
||||
pour les descriptions des balises de journal.
|
||||
.TP
|
||||
.B \-L, \-\-error\-limit NOMBRE
|
||||
.B \-L, \-\-error\-limit NUMBER
|
||||
Définit une nouvelle limite d\'erreurs avant d\'arrêter l\'exécution.
|
||||
Par défaut, SnapRAID s\'arrête s\'il rencontre plus de 100
|
||||
erreurs d\'entrée/sortie, indiquant qu\'un disque est
|
||||
|
|
@ -1374,7 +1388,7 @@ Cette option est principalement destinée à la récupération manuelle avancée
|
|||
Ne traite que le nombre de blocs spécifié.
|
||||
Cette option est principalement destinée à la récupération manuelle avancée.
|
||||
.TP
|
||||
.B \-C, \-\-gen\-conf CONTENU
|
||||
.B \-C, \-\-gen\-conf CONTENT
|
||||
Génère un fichier de configuration factice à partir d\'un
|
||||
fichier de contenu existant.
|
||||
Le fichier de configuration est écrit sur la sortie standard
|
||||
|
|
@ -1412,7 +1426,7 @@ Sous Windows, il utilise le fichier \`snapraid.conf\` dans le même
|
|||
répertoire que \`snapraid.exe\`.
|
||||
.PP
|
||||
Il doit contenir les options suivantes (sensibles à la casse) :
|
||||
.SS parity FICHIER [,FICHIER] ...
|
||||
.SS parity FILE [,FILE] ...
|
||||
Définit les fichiers à utiliser pour stocker les informations de parité.
|
||||
La parité permet une protection contre une seule défaillance
|
||||
de disque, similaire au RAID5.
|
||||
|
|
@ -1433,7 +1447,7 @@ Sous Windows, 256 Mo sont laissés inutilisés sur chaque disque pour
|
|||
éviter l\'avertissement concernant les disques pleins.
|
||||
.PP
|
||||
Cette option est obligatoire et ne peut être utilisée qu\'une seule fois.
|
||||
.SS (2,3,4,5,6)\-parity FICHIER [,FICHIER] ...
|
||||
.SS (2,3,4,5,6)\-parity FILE [,FILE] ...
|
||||
Définit les fichiers à utiliser pour stocker les informations de parité
|
||||
supplémentaires.
|
||||
.PP
|
||||
|
|
@ -1458,7 +1472,7 @@ de parité précédents.
|
|||
Les mêmes considérations que pour l\'option \`parity\` s\'appliquent.
|
||||
.PP
|
||||
Ces options sont facultatives et ne peuvent être utilisées qu\'une seule fois.
|
||||
.SS z\-parity FICHIER [,FICHIER] ...
|
||||
.SS z\-parity FILE [,FILE] ...
|
||||
Définit un fichier et un format alternatifs pour stocker la triple parité.
|
||||
.PP
|
||||
Cette option est une alternative à \`3\-parity\`, principalement destinée
|
||||
|
|
@ -1476,7 +1490,7 @@ performances.
|
|||
Il est possible de convertir d\'un format à l\'autre en ajustant
|
||||
le fichier de configuration avec le fichier z\-parity ou 3\-parity souhaité
|
||||
et en utilisant \`fix\` pour le recréer.
|
||||
.SS content FICHIER
|
||||
.SS content FILE
|
||||
Définit le fichier à utiliser pour stocker la liste et les sommes de
|
||||
contrôle de tous les fichiers présents dans votre baie de disques.
|
||||
.PP
|
||||
|
|
@ -1490,19 +1504,19 @@ enregistrer plusieurs copies du même fichier.
|
|||
.PP
|
||||
Vous devez stocker au moins une copie pour chaque disque de parité
|
||||
utilisé plus un. L\'utilisation de copies supplémentaires ne nuit pas.
|
||||
.SS data NOM DOSSIER
|
||||
.SS data NAME DIR
|
||||
Définit le nom et le point de montage des disques de données dans
|
||||
la baie. NOM est utilisé pour identifier le disque et doit
|
||||
être unique. DOSSIER est le point de montage du disque dans le
|
||||
la baie. NAME est utilisé pour identifier le disque et doit
|
||||
être unique. DIR est le point de montage du disque dans le
|
||||
système de fichiers.
|
||||
.PP
|
||||
Vous pouvez modifier le point de montage au besoin, tant que
|
||||
vous gardez le NOM fixe.
|
||||
vous gardez le NAME fixe.
|
||||
.PP
|
||||
Vous devriez utiliser une option pour chaque disque de données
|
||||
de la baie.
|
||||
.PP
|
||||
Vous pouvez renommer un disque plus tard en changeant le NOM directement
|
||||
Vous pouvez renommer un disque plus tard en changeant le NAME directement
|
||||
dans le fichier de configuration, puis en exécutant une commande \`sync\`.
|
||||
Dans le cas d\'un renommage, l\'association est faite en utilisant l\'UUID
|
||||
stocké des disques.
|
||||
|
|
@ -1516,11 +1530,35 @@ comme le disque de démarrage.
|
|||
.PP
|
||||
Notez que ces disques ne sont pas affectés par les commandes \`up\` et
|
||||
\`down\` car ils sont censés toujours être en rotation.
|
||||
.SS snapshot
|
||||
Active l\'utilisation des instantanés du système de fichiers pour les commandes \`sync\`, \`scrub\`,
|
||||
\`check\` et \`fix\`.
|
||||
.PP
|
||||
Lorsqu\'elle est activée, SnapRAID crée un instantané en lecture seule de vos données au
|
||||
début d\'un \'sync\'. Cela garantit une vue cohérente et temporelle de vos
|
||||
fichiers, évitant les erreurs causées par des modifications de fichiers simultanées.
|
||||
.PP
|
||||
Cela améliore considérablement la récupération : si un fichier est supprimé du système de fichiers actif,
|
||||
il reste préservé dans l\'instantané. Cela évite que la parité ne devienne \[dq]rompue\[dq]
|
||||
pour ce bloc, garantissant que vous pouvez toujours récupérer les données avec succès
|
||||
si un autre disque tombe en panne.
|
||||
.PP
|
||||
Cette option s\'applique exclusivement aux disques de données formatés avec les
|
||||
systèmes de fichiers Btrfs, Bcachefs ou ZFS sous Linux et NTFS sous Windows.
|
||||
Les disques de parité, ou les disques de données utilisant d\'autres systèmes de fichiers, utiliseront toujours
|
||||
la version active du système de fichiers.
|
||||
.PP
|
||||
La création et la suppression d\'instantanés nécessitent des privilèges d\'administration.
|
||||
Assurez\-vous que SnapRAID est exécuté avec les autorisations nécessaires (par exemple, sudo) lorsque
|
||||
cette option est activée.
|
||||
.PP
|
||||
Consultez la section SNAPSHOTS pour une explication détaillée du cycle de vie
|
||||
des instantanés.
|
||||
.SS nohidden
|
||||
Exclut tous les fichiers et répertoires cachés.
|
||||
Sous Unix, les fichiers cachés sont ceux commençant par \`.\`.
|
||||
Sous Windows, ce sont ceux avec l\'attribut caché.
|
||||
.SS exclude/include MOTIF
|
||||
.SS exclude/include PATTERN
|
||||
Définit les motifs de fichiers ou de répertoires à exclure ou à inclure
|
||||
dans le processus de synchronisation.
|
||||
Tous les motifs sont traités dans l\'ordre spécifié.
|
||||
|
|
@ -1531,11 +1569,11 @@ Si aucun motif ne correspond, le fichier est exclu si le dernier motif
|
|||
spécifié est un \`include\`, ou inclus si le dernier motif
|
||||
spécifié est un \`exclude\`.
|
||||
.PP
|
||||
Voir la section MOTIF pour plus de détails sur les
|
||||
Voir la section PATTERN pour plus de détails sur les
|
||||
spécifications de motifs.
|
||||
.PP
|
||||
Cette option peut être utilisée plusieurs fois.
|
||||
.SS blocksize TAILLE_EN_KIBIOCTETS
|
||||
.SS blocksize SIZE_IN_KIBIBYTES
|
||||
Définit la taille de bloc de base en kibioctets pour la parité.
|
||||
Un kibioctet est de 1024 octets.
|
||||
.PP
|
||||
|
|
@ -1591,7 +1629,7 @@ mkfs.ext4 \-m 0 \-T largefile4 DEVICE
|
|||
Cela se traduit par environ 1,5 % d\'espace supplémentaire, environ 60 Go
|
||||
pour un disque de 4 To, ce qui permet environ 460 000 fichiers sur
|
||||
chaque disque de données sans aucun espace gaspillé.
|
||||
.SS hashsize TAILLE_EN_OCTETS
|
||||
.SS hashsize SIZE_IN_BYTES
|
||||
Définit la taille du hachage en octets pour les blocs enregistrés.
|
||||
.PP
|
||||
La taille de hachage par défaut est de 16 octets (128 bits),
|
||||
|
|
@ -1603,7 +1641,7 @@ cette valeur à l\'avenir, vous devrez recréer l\'intégralité de la parité !
|
|||
.PP
|
||||
Une raison d\'utiliser une taille de hachage différente est si votre
|
||||
système a une mémoire limitée. En règle générale, SnapRAID nécessite
|
||||
généralement 1 Gio de RAM pour chaque 16 To de données dans la baie.
|
||||
1 Gio de RAM pour chaque 16 To de données dans la baie.
|
||||
.PP
|
||||
Plus précisément, pour stocker les hachages des données, SnapRAID
|
||||
nécessite environ TS*(1+HS)/BS octets de RAM,
|
||||
|
|
@ -1635,13 +1673,13 @@ bloc de 512, vous obtenez :
|
|||
RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0,51 Gio
|
||||
.PD 0
|
||||
.PD
|
||||
.SS autosave TAILLE_EN_GIGAOCTETS
|
||||
.SS autosave SIZE_IN_GIGABYTES
|
||||
Enregistre automatiquement l\'état lors de la synchronisation ou du
|
||||
nettoyage après la quantité spécifiée de Go traités.
|
||||
Cette option est utile pour éviter de redémarrer de longues commandes
|
||||
\`sync\` à partir de zéro si elles sont interrompues par un plantage
|
||||
de la machine ou tout autre événement.
|
||||
.SS temp_limit TEMPÉRATURE_CELSIUS
|
||||
.SS temp_limit TEMPERATURE_CELSIUS
|
||||
Définit la température maximale autorisée du disque en Celsius.
|
||||
Lorsqu\'elle est spécifiée, SnapRAID vérifie périodiquement la
|
||||
température de tous les disques à l\'aide de l\'outil smartctl.
|
||||
|
|
@ -1673,17 +1711,17 @@ au début de l\'exécution comme référence de secours.
|
|||
.PP
|
||||
Normalement, SnapRAID n\'affiche que la température du disque le plus chaud.
|
||||
Pour afficher la température de tous les disques, utilisez l\'option
|
||||
\-A ou \-\-stats.
|
||||
.SS temp_sleep TEMPS_EN_MINUTES
|
||||
\`\-A, \-\-stats\`.
|
||||
.SS temp_sleep TIME_IN_MINUTES
|
||||
Définit le temps de veille, en minutes, lorsque la limite de température
|
||||
est atteinte. Pendant cette période, les disques restent arrêtés.
|
||||
La valeur par défaut est de 5 minutes.
|
||||
.SS pool DOSSIER
|
||||
.SS pool DIR
|
||||
Définit le répertoire de mise en commun où la vue virtuelle de la
|
||||
baie de disques est créée à l\'aide de la commande \`pool\`.
|
||||
.PP
|
||||
Le répertoire doit déjà exister.
|
||||
.SS share CHEMIN_UNC
|
||||
.SS share UNC_DIR
|
||||
Définit le chemin UNC Windows requis pour accéder aux disques à distance.
|
||||
.PP
|
||||
Si cette option est spécifiée, les liens symboliques créés dans le
|
||||
|
|
@ -1697,7 +1735,7 @@ en ajoutant le nom du disque tel que spécifié dans l\'option \`data\`,
|
|||
et en ajoutant enfin le répertoire et le nom du fichier.
|
||||
.PP
|
||||
Cette option est requise uniquement pour Windows.
|
||||
.SS smartctl DISQUE/PARITÉ OPTIONS...
|
||||
.SS smartctl DISK/PARITY OPTIONS...
|
||||
Définit les options smartctl personnalisées pour obtenir les attributs
|
||||
SMART de chaque disque. Cela peut être nécessaire pour les contrôleurs
|
||||
RAID et certains disques USB qui ne peuvent pas être détectés
|
||||
|
|
@ -1705,14 +1743,18 @@ automatiquement. Le placeholder %s est remplacé par le nom du
|
|||
périphérique, mais il est facultatif pour les périphériques fixes
|
||||
comme les contrôleurs RAID.
|
||||
.PP
|
||||
DISQUE est le même nom de disque spécifié dans l\'option \`data\`.
|
||||
PARITÉ est l\'un des noms de parité : \`parity\`, \`2\-parity\`, \`3\-parity\`,
|
||||
DISK est le même nom de disque spécifié dans l\'option \`data\`.
|
||||
PARITY est l\'un des noms de parité : \`parity\`, \`2\-parity\`, \`3\-parity\`,
|
||||
\`4\-parity\`, \`5\-parity\`, \`6\-parity\` ou \`z\-parity\`.
|
||||
.PP
|
||||
Dans les OPTIONS spécifiées, la chaîne \`%s\` est remplacée par le
|
||||
nom du périphérique. Pour les contrôleurs RAID, le périphérique est
|
||||
probablement fixe, et vous n\'aurez peut\-être pas besoin d\'utiliser \`%s\`.
|
||||
.PP
|
||||
Vous pouvez également spécifier une chaîne d\'options d\'information
|
||||
personnalisée à l\'aide de la balise \`[info: ...]\` pour remplacer
|
||||
l\'option \`\-a\` par défaut.
|
||||
.PP
|
||||
Consultez la documentation smartmontools pour les options possibles :
|
||||
.PP
|
||||
.RS 4
|
||||
|
|
@ -1728,38 +1770,50 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices
|
|||
Par exemple :
|
||||
.PP
|
||||
.RS 4
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl parity \-d sat %s
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS smartignore DISQUE/PARITÉ ATTR [ATTR...]
|
||||
.SS smartignore DISK/PARITY ATTR [ATTR...]
|
||||
Ignore l\'attribut SMART spécifié lors du calcul de la probabilité
|
||||
de défaillance du disque. Cette option est utile si un disque signale
|
||||
des valeurs inhabituelles ou trompeuses pour un attribut particulier.
|
||||
.PP
|
||||
DISQUE est le même nom de disque spécifié dans l\'option \`data\`.
|
||||
PARITÉ est l\'un des noms de parité : \`parity\`, \`2\-parity\`, \`3\-parity\`,
|
||||
DISK est le même nom de disque spécifié dans l\'option \`data\`.
|
||||
PARITY est l\'un des noms de parité : \`parity\`, \`2\-parity\`, \`3\-parity\`,
|
||||
\`4\-parity\`, \`5\-parity\`, \`6\-parity\` ou \`z\-parity\`.
|
||||
La valeur spéciale * peut être utilisée pour ignorer l\'attribut
|
||||
sur tous les disques.
|
||||
.PP
|
||||
Par exemple, pour ignorer l\'attribut \`Current Pending Sector Count\`
|
||||
sur tous les disques :
|
||||
Plusieurs attributs peuvent être spécifiés séparés par des espaces.
|
||||
Chaque attribut peut être spécifié sous forme de nombre de 1 à 255, ou sous
|
||||
forme de nom insensible à la casse (par exemple \`Current_Pending_Sector\`).
|
||||
.PP
|
||||
Par exemple, pour ignorer les attributs \`Current Pending Sector Count\` et
|
||||
\`Reallocated Sectors Count\` sur tous les disques par leur numéro ou leur nom :
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore * 197
|
||||
smartignore * 197 5
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.PP
|
||||
Pour l\'ignorer uniquement sur le premier disque de parité :
|
||||
Pour les ignorer uniquement sur le premier disque de parité :
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore parity 197
|
||||
smartignore parity 197 5
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Exemples
|
||||
.SS Exemples (Examples)
|
||||
Un exemple de configuration typique pour Unix est :
|
||||
.PP
|
||||
.RS 4
|
||||
|
|
@ -1795,7 +1849,7 @@ exclude /tmp/
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1851,7 +1905,7 @@ exclude \\System Volume Information
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1867,6 +1921,128 @@ smartctl 2\-parity \-d areca,2/1 /dev/arcmsr0
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH SNAPSHOTS
|
||||
Si l\'option snapshot est activée dans la configuration, SnapRAID
|
||||
utilise la fonctionnalité d\'instantané du système de fichiers pour garantir des opérations atomiques
|
||||
et cohérentes.
|
||||
.PP
|
||||
La gestion des instantanés est entièrement automatique et transparente.
|
||||
Vous pouvez continuer à utiliser SnapRAID exactement comme avant, avec la
|
||||
protection supplémentaire fournie par les instantanés gérés entièrement en
|
||||
arrière\-plan.
|
||||
.PP
|
||||
Cela offre deux avantages principaux :
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I Cohérence
|
||||
Les fichiers modifiés sur le système de fichiers actif pendant un sync ou un scrub
|
||||
de longue durée ne provoqueront pas de déséquilibres de parité ni d\'opérations abandonnées,
|
||||
car SnapRAID voit une image figée dans le temps.
|
||||
.HP 4
|
||||
.I Récupération
|
||||
Si un fichier est mis à jour ou supprimé du système de fichiers actif,
|
||||
il reste préservé dans l\'instantané. Si une panne de disque survient
|
||||
avant l\'exécution du prochain sync, SnapRAID utilise les données préservées
|
||||
dans l\'instantané pour reconstruire le disque défaillant.
|
||||
.PD
|
||||
.PP
|
||||
.RS 4
|
||||
.PD 0
|
||||
En cas de panne de disque pendant un processus de sync actif,
|
||||
SnapRAID est également capable de lire automatiquement à la fois l\'instantané
|
||||
du calcul de parité précédent et celui en cours.
|
||||
Cela maximise la probabilité d\'une récupération complète en
|
||||
fournissant un accès aux blocs de données exacts requis pour résoudre
|
||||
les équations de parité, même si ces blocs ont été modifiés
|
||||
ou supprimés entre les syncs.
|
||||
.PD
|
||||
.PP
|
||||
.PD 0
|
||||
Sans instantanés, un fichier mis à jour ou supprimé sur un disque sain
|
||||
entraîne des blocs de données manquants qui pourraient être nécessaires pour
|
||||
réparer d\'autres disques défaillants.
|
||||
.PD
|
||||
.RE
|
||||
.RE
|
||||
.PP
|
||||
Les instantanés sont créés uniquement pour les disques de données et uniquement si le système de fichiers
|
||||
sous\-jacent prend en charge cette fonctionnalité. Les disques de parité utilisent toujours
|
||||
le système de fichiers actif.
|
||||
.PP
|
||||
Actuellement, cela est pris en charge sur Btrfs, Bcachefs et ZFS sous Linux
|
||||
et sur NTFS sous Windows.
|
||||
.PP
|
||||
Vous pouvez mélanger des disques de données avec différents systèmes de fichiers. Seuls ceux qui
|
||||
prennent en charge les instantanés les utiliseront, tandis que les autres disques continueront
|
||||
à fonctionner directement sur le système de fichiers actif.
|
||||
.PP
|
||||
La création et la suppression d\'instantanés nécessitent des privilèges d\'administration.
|
||||
Assurez\-vous que SnapRAID est exécuté avec les autorisations nécessaires (par exemple, sudo)
|
||||
lorsque les instantanés sont activés.
|
||||
.SS Comportement des commandes avec les instantanés (Command Behavior with Snapshots)
|
||||
Les commandes \`sync\` et \`scrub\` fonctionnent toutes deux exclusivement sur les instantanés
|
||||
pour garantir que toutes les opérations sur les données sont effectuées par rapport à un état cohérent
|
||||
et figé. En utilisant ces instantanés, SnapRAID empêche les écarts de parité
|
||||
qui seraient autrement déclenchés par des modifications simultanées de fichiers sur le système de fichiers actif.
|
||||
Pendant un \`sync\`, la commande utilise un nouvel instantané créé au
|
||||
début du processus pour capturer l\'état actuel pour le calcul de la parité.
|
||||
En contrepartie, la commande \`scrub\` utilise le dernier instantané, celui
|
||||
créé lors du sync le plus récent, pour maintenir un point de référence fiable
|
||||
qui correspond à la parité existante.
|
||||
.PP
|
||||
Pour les commandes \`check\` et \`fix\`, l\'utilisation du dernier instantané
|
||||
dépend du ciblage ou non de disques spécifiques à l\'aide de l\'option
|
||||
\-d, \-\-filter\-disk.
|
||||
.PP
|
||||
Un disque explicitement sélectionné via \-d (la \[dq]cible\[dq] de l\'opération)
|
||||
utilise toujours le système de fichiers actif. Pour \`fix\`, cela permet de restaurer
|
||||
les données sur le disque de remplacement actif. Pour \`check\`, cela permet de simuler
|
||||
l\'opération \`fix\` dans les mêmes conditions.
|
||||
.PP
|
||||
Tous les autres disques de données (les disques de \[dq]référence\[dq]) seront accessibles via
|
||||
leurs instantanés. Cela garantit que même si vous modifiez des fichiers
|
||||
sur vos disques sains pendant qu\'une récupération est en cours, SnapRAID
|
||||
dispose d\'une référence stable et figée pour résoudre les équations de parité.
|
||||
.PP
|
||||
Si aucune option \-d n\'est fournie, SnapRAID suppose que l\'opération s\'applique
|
||||
à l\'ensemble de la grappe, dans ce cas, \`check\` et \`fix\` utiliseront exclusivement
|
||||
les systèmes de fichiers actifs.
|
||||
.PP
|
||||
Toutes les autres commandes fonctionnent exclusivement sur le système de fichiers actif.
|
||||
.SH CYCLE DE VIE DES INSTANTANéS (SNAPSHOTS LIFECYCLE)
|
||||
SnapRAID gère deux instantanés spécifiques, \`stable\` et \`pending\`,
|
||||
dans un répertoire caché à la racine de chaque sous\-volume de données.
|
||||
Dans Btrfs, Bcachefs et NTFS, le répertoire \`.snapraid/\` est utilisé,
|
||||
dans ZFS, le répertoire standard \`.zfs/snapshot/\`.
|
||||
.PP
|
||||
L\'instantané \`stable\` représente l\'état du dernier
|
||||
\`sync\` terminé avec succès, contenant les données exactes utilisées pour
|
||||
calculer la parité actuelle. Il sert de source de données principale
|
||||
pour les commandes \`scrub\`, \`check\` et \`fix\`.
|
||||
.PP
|
||||
L\'instantané \`pending\` est une image temporaire créée au début
|
||||
d\'un \`sync\` pour fournir un état figé pour le calcul de la parité.
|
||||
Une fois l\'opération terminée avec succès, l\'instantané \`stable\` précédent
|
||||
est supprimé, et l\'instantané \`pending\` est promu pour
|
||||
prendre sa place en tant que nouvelle référence stable.
|
||||
.PP
|
||||
Si un \`sync\` est interrompu, l\'instantané \`pending\` est préservé.
|
||||
Les commandes ultérieures \`scrub\`, \`check\` et \`fix\` utiliseront cet
|
||||
instantané en attente car il correspond à l\'état du système de fichiers enregistré dans
|
||||
le fichier .content, même si la parité n\'est que partiellement synchronisée.
|
||||
.PP
|
||||
En cas d\'interruption de \`sync\`, les commandes \`check\` et \`fix\`
|
||||
lisent également à partir de l\'instantané \`stable\` pour récupérer les blocs de données
|
||||
des fichiers qui ont été mis à jour ou supprimés pendant le sync.
|
||||
Cela est possible car le fichier .content conserve les métadonnées de
|
||||
tous les fichiers modifiés ou supprimés tout au long du processus de sync.
|
||||
Ces informations historiques ne sont effacées qu\'une fois qu\'un sync se termine
|
||||
avec succès et que la version finale du fichier .content est enregistrée.
|
||||
.PP
|
||||
Si un \`sync\` est redémarré après une interruption, l\'instantané pending existant
|
||||
est supprimé et un nouveau est créé pour
|
||||
capturer l\'état actuel du système de fichiers actif.
|
||||
.SH MOTIF (PATTERN)
|
||||
Les motifs offrent un moyen flexible de filtrer les fichiers à inclure ou
|
||||
à exclure. En utilisant des caractères de \[dq]globbing\[dq], vous pouvez définir des règles qui
|
||||
|
|
@ -2060,7 +2236,7 @@ snapraid \-f \[dq]*.mp3\[dq] check
|
|||
Sous Unix, lorsque vous utilisez des caractères de globbing sur la
|
||||
ligne de commande, vous devez les mettre entre guillemets pour empêcher
|
||||
le shell de les développer.
|
||||
.SH IGNORER DES FICHIERS (IGNORE FILES)
|
||||
.SH IGNORER DES FICHIERS (IGNORE FILE)
|
||||
En plus des règles globales du fichier de configuration, vous pouvez
|
||||
placer des fichiers \`.snapraidignore\` dans n\'importe quel répertoire de la grappe
|
||||
pour définir des règles d\'exclusion décentralisées.
|
||||
|
|
@ -2128,8 +2304,10 @@ Il s\'agit d\'un fichier binaire qui répertorie tous les fichiers
|
|||
présents dans votre baie de disques, ainsi que toutes les sommes
|
||||
de contrôle pour vérifier leur intégrité.
|
||||
.PP
|
||||
Ce fichier est lu et écrit par les commandes \`sync\` et \`scrub\` et
|
||||
lu par les commandes \`fix\`, \`check\` et \`status\`.
|
||||
Le fichier de contenu est lu et écrit par les commandes \`sync\`, \`scrub\`,
|
||||
\`touch\` et \`rehash\`. Il est lu par les commandes \`status\`, \`diff\`,
|
||||
\`check\`, \`fix\`, \`list\`, \`dup\`, \`locate\` et \`pool\`, et il est complètement
|
||||
ignoré par les commandes \`smart\`, \`probe\`, \`up\`, \`down\` et \`devices\`.
|
||||
.SH PARITé (PARITY)
|
||||
SnapRAID stocke les informations de parité de votre baie dans
|
||||
les fichiers de parité.
|
||||
|
|
@ -2139,7 +2317,7 @@ blocs définis dans le fichier \`content\`.
|
|||
.PP
|
||||
Ces fichiers sont lus et écrits par les commandes \`sync\` et \`fix\` et
|
||||
lus uniquement par les commandes \`scrub\` et \`check\`.
|
||||
.SH ENCODAGE
|
||||
.SH ENCODAGE (ENCODING)
|
||||
SnapRAID sous Unix ignore tout encodage. Il lit et stocke les
|
||||
noms de fichiers avec le même encodage utilisé par le système
|
||||
de fichiers.
|
||||
|
|
@ -2154,7 +2332,25 @@ de console.
|
|||
Cela n\'affecte que les noms de fichiers imprimés ; si vous
|
||||
redirigez la sortie de la console vers un fichier, le fichier
|
||||
résultant est toujours au format UTF\-8.
|
||||
.SH CODE DE SORTIE (EXIT CODE)
|
||||
SnapRAID se termine avec les codes d\'erreur suivants :
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I 0
|
||||
Tout est OK.
|
||||
.HP 4
|
||||
.I 1
|
||||
La commande a rencontré des erreurs.
|
||||
.HP 4
|
||||
.I 2
|
||||
La commande \`diff\` a trouvé que tout est OK, mais un \`sync\` est requis.
|
||||
.PD
|
||||
.RE
|
||||
.SH TRADUCTION (TRANSLATION)
|
||||
Ce document est une traduction automatique du manuel en anglais.
|
||||
Veuillez vous référer au manuel en anglais pour la version officielle.
|
||||
.SH DROITS D\'AUTEUR (COPYRIGHT)
|
||||
Ce fichier est Copyright (C) 2025 Andrea Mazzoleni
|
||||
Ce fichier est Copyright (C) 2026 Andrea Mazzoleni
|
||||
.SH VOIR AUSSI (SEE ALSO)
|
||||
snapraid_log(1), snapraidd(1)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -3,24 +3,25 @@ Name{number}
|
|||
|
||||
Synopsis
|
||||
:snapraid [-c, --conf CONFIG]
|
||||
: [-f, --filter MOTIF] [-d, --filter-disk NOM]
|
||||
: [-f, --filter PATTERN] [-d, --filter-disk NAME]
|
||||
: [-m, --filter-missing] [-e, --filter-error]
|
||||
: [-a, --audit-only] [-h, --pre-hash] [-i, --import DOSSIER]
|
||||
: [-p, --plan PERC|mauvais|nouveau|complet]
|
||||
: [-o, --older-than JOURS] [-l, --log FICHIER]
|
||||
: [-s, --spin-down-on-error] [-w, --bw-limit DÉBIT]
|
||||
: [-a, --audit-only] [-h, --pre-hash] [-i, --import DIR]
|
||||
: [-p, --plan PERC|bad|new|full]
|
||||
: [-o, --older-than DAYS] [-l, --log FILE]
|
||||
: [-s, --spin-down-on-error] [-w, --bw-limit RATE]
|
||||
: [-t, --tail]
|
||||
: [-Z, --force-zero] [-E, --force-empty]
|
||||
: [-U, --force-uuid] [-D, --force-device]
|
||||
: [-N, --force-nocopy] [-F, --force-full]
|
||||
: [-R, --force-realloc] [-W, --force-realloc-tail]
|
||||
: [-S, --start BLKSTART] [-B, --count BLKCOUNT]
|
||||
: [-L, --error-limit NOMBRE]
|
||||
: [-L, --error-limit NUMBER]
|
||||
: [-A, --stats]
|
||||
: [-v, --verbose] [-q, --quiet]
|
||||
: status|smart|probe|up|down|diff|sync|scrub|fix|check
|
||||
: |list|dup|pool|devices|touch|rehash|locate
|
||||
|
||||
:snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENU]
|
||||
:snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
Description
|
||||
SnapRAID est un programme de sauvegarde conçu pour les baies de disques,
|
||||
|
|
@ -51,23 +52,29 @@ Description
|
|||
:https://www.snapraid.it/
|
||||
|
||||
Limitations
|
||||
SnapRAID est un hybride entre un programme RAID et un programme de sauvegarde,
|
||||
visant à combiner les meilleurs avantages des deux. Cependant, il a quelques
|
||||
limitations que vous devriez considérer avant de l'utiliser.
|
||||
SnapRAID est un hybride entre un RAID et un programme de sauvegarde, visant à combiner
|
||||
les meilleurs avantages des deux. Cependant, il présente certaines limitations que vous devriez
|
||||
prendre en compte avant de l'utiliser.
|
||||
|
||||
La principale limitation est que si un disque tombe en panne et que vous
|
||||
n'avez pas synchronisé récemment, vous pourriez ne pas être en mesure de
|
||||
récupérer complètement.
|
||||
Plus précisément, vous pourriez ne pas être en mesure de récupérer jusqu'à
|
||||
la taille des fichiers modifiés ou supprimés depuis la dernière opération
|
||||
de synchronisation.
|
||||
Cela se produit même si les fichiers modifiés ou supprimés ne se trouvent
|
||||
pas sur le disque défaillant. C'est pourquoi SnapRAID est mieux adapté
|
||||
aux données qui changent rarement.
|
||||
La principale limitation est que si un disque tombe en panne, vous ne pouvez récupérer les données que jusqu'à
|
||||
l'état du dernier processus `sync`. Toutes les données ajoutées ou modifications effectuées
|
||||
depuis la dernière synchronisation situées sur le disque défectueux seront perdues.
|
||||
|
||||
D'un autre côté, les fichiers nouvellement ajoutés n'empêchent pas
|
||||
la récupération des fichiers déjà existants. Vous ne perdrez que les
|
||||
fichiers récemment ajoutés s'ils se trouvent sur le disque défaillant.
|
||||
Par conséquent, SnapRAID est principalement adapté aux données qui changent rarement.
|
||||
|
||||
Pour les données qui existaient déjà lors de la dernière synchronisation, la fiabilité de la récupération dépend
|
||||
de l'utilisation ou non de l'option `snapshot` :
|
||||
|
||||
* Avec la prise en charge des instantanés (disponible sur Btrfs, ZFS, Bcachefs et NTFS),
|
||||
SnapRAID peut maintenir automatiquement une référence figée de vos disques de données.
|
||||
Cela garantit que même si vous modifiez ou supprimez des fichiers sur votre système de fichiers actif
|
||||
pendant ou après une synchronisation, le processus de récupération reste cohérent et fiable.
|
||||
|
||||
* Sans la prise en charge des instantanés, la suppression ou la modification de fichiers après un `sync`
|
||||
peut empêcher la récupération complète d'autres disques en panne. Cela se produit
|
||||
parce que la parité ne correspond plus aux fichiers modifiés, même si
|
||||
ces fichiers ne se trouvent pas sur le disque défectueux. D'un autre côté, les fichiers nouvellement ajoutés
|
||||
n'empêchent pas la récupération des fichiers déjà existants.
|
||||
|
||||
Les autres limitations de SnapRAID sont :
|
||||
|
||||
|
|
@ -83,10 +90,10 @@ Limitations
|
|||
de défaillances de disques. Avec une sauvegarde, vous pouvez
|
||||
récupérer d'une défaillance complète de toute la baie de disques.
|
||||
* Seuls les noms de fichiers, les horodatages, les liens symboliques
|
||||
et les liens matériels sont sauvegardés. Les permissions, la
|
||||
et les liens physiques sont sauvegardés. Les permissions, la
|
||||
propriété et les attributs étendus ne sont pas sauvegardés.
|
||||
|
||||
Démarrer
|
||||
Démarrer (Getting Started)
|
||||
Pour utiliser SnapRAID, vous devez d'abord sélectionner un disque
|
||||
dans votre baie de disques pour le dédier aux informations de `parité`.
|
||||
Avec un disque pour la parité, vous pourrez récupérer d'une
|
||||
|
|
@ -203,7 +210,7 @@ Démarrer
|
|||
|
||||
Lors du prochain `scrub`, les erreurs disparaîtront du rapport
|
||||
`status` si elles sont réellement corrigées. Pour accélérer,
|
||||
vous pouvez utiliser -p mauvais pour nettoyer uniquement les blocs
|
||||
vous pouvez utiliser -p bad pour nettoyer uniquement les blocs
|
||||
marqués comme mauvais.
|
||||
|
||||
:snapraid -p bad scrub
|
||||
|
|
@ -216,7 +223,7 @@ Démarrer
|
|||
Mise en commun (Pooling)
|
||||
Note : La fonctionnalité de mise en commun décrite ci-dessous a été
|
||||
remplacée par l'outil mergerfs, qui est désormais l'option recommandée
|
||||
pour les utilisateurs Linux de la communauté SnapRAID. Mergefs offre
|
||||
pour les utilisateurs Linux de la communauté SnapRAID. Mergerfs offre
|
||||
un moyen plus flexible et efficace de regrouper plusieurs disques
|
||||
dans un seul point de montage unifié, permettant un accès transparent
|
||||
aux fichiers sur toute votre baie sans dépendre de liens symboliques.
|
||||
|
|
@ -301,11 +308,11 @@ Démarrer
|
|||
ou récupérer des fichiers dans leur état précédent à l'aide
|
||||
de l'option -f, --filter :
|
||||
|
||||
:snapraid fix -f FICHIER
|
||||
:snapraid fix -f FILE
|
||||
|
||||
ou pour un répertoire :
|
||||
|
||||
:snapraid fix -f DOSSIER/
|
||||
:snapraid fix -f DIR/
|
||||
|
||||
Vous pouvez également l'utiliser pour récupérer uniquement les
|
||||
fichiers accidentellement supprimés à l'intérieur d'un
|
||||
|
|
@ -313,14 +320,14 @@ Démarrer
|
|||
qui ne restaure que les fichiers manquants, laissant tous
|
||||
les autres intacts.
|
||||
|
||||
:snapraid fix -m -f DOSSIER/
|
||||
:snapraid fix -m -f DIR/
|
||||
|
||||
Ou pour récupérer tous les fichiers supprimés sur tous les
|
||||
lecteurs avec :
|
||||
|
||||
:snapraid fix -m
|
||||
|
||||
Récupération
|
||||
Récupération (Recovering)
|
||||
Le pire est arrivé, et vous avez perdu un ou plusieurs disques !
|
||||
|
||||
NE PANIQUEZ PAS ! Vous pourrez les récupérer !
|
||||
|
|
@ -358,9 +365,9 @@ Démarrer
|
|||
Exécutez la commande fix, en stockant le journal dans un fichier
|
||||
externe avec :
|
||||
|
||||
:snapraid -d NOM -l fix.log fix
|
||||
:snapraid -d NAME -l fix.log fix
|
||||
|
||||
Où NOM est le nom du disque, tel que `d1` dans notre exemple précédent.
|
||||
Où NAME est le nom du disque, tel que `d1` dans notre exemple précédent.
|
||||
Si le disque à récupérer est un disque de parité, utilisez les noms
|
||||
`parity`, `2-parity`, etc.
|
||||
Si vous avez plusieurs disques défaillants, utilisez plusieurs
|
||||
|
|
@ -396,9 +403,9 @@ Démarrer
|
|||
Par précaution, vous pouvez maintenant exécuter une commande `check`
|
||||
pour vous assurer que tout est correct sur le disque récupéré.
|
||||
|
||||
:snapraid -d NOM -a check
|
||||
:snapraid -d NAME -a check
|
||||
|
||||
Où NOM est le nom du disque, tel que `d1` dans notre exemple précédent.
|
||||
Où NAME est le nom du disque, tel que `d1` dans notre exemple précédent.
|
||||
|
||||
Les options -d et -a indiquent à SnapRAID de vérifier uniquement le
|
||||
disque spécifié et d'ignorer toutes les données de parité.
|
||||
|
|
@ -414,14 +421,14 @@ Démarrer
|
|||
|
||||
Si tout est récupéré, cette commande est immédiate.
|
||||
|
||||
Commandes
|
||||
Commandes (Commands)
|
||||
SnapRAID fournit quelques commandes simples qui vous permettent de :
|
||||
|
||||
* Afficher l'état de la baie de disques -> `status`
|
||||
* Afficher l'état de la grappe -> `status`
|
||||
* Contrôler les disques -> `smart`, `probe`, `up`, `down`
|
||||
* Faire une sauvegarde/instantané -> `sync`
|
||||
* Créer un point de sauvegarde/récupération -> `sync`
|
||||
* Vérifier périodiquement les données -> `scrub`
|
||||
* Restaurer la dernière sauvegarde/instantané -> `fix`.
|
||||
* Restaurer le dernier point de sauvegarde/récupération -> `fix`.
|
||||
|
||||
Les commandes doivent être écrites en minuscules.
|
||||
|
||||
|
|
@ -467,7 +474,7 @@ Commandes
|
|||
logerr - Le journal d'erreurs du périphérique contient des erreurs.
|
||||
selferr - Le journal d'auto-test du périphérique contient des erreurs.
|
||||
|
||||
Si l'option -v, --verbose est spécifiée, une analyse statistique
|
||||
Si l'option `-v, --verbose` est spécifiée, une analyse statistique
|
||||
plus approfondie est fournie. Cette analyse peut vous aider à
|
||||
décider si vous avez besoin de plus ou moins de parité.
|
||||
|
||||
|
|
@ -639,15 +646,15 @@ Commandes
|
|||
Les fichiers dans la baie NE SONT PAS modifiés.
|
||||
|
||||
fix
|
||||
Corrige tous les fichiers et les données de parité.
|
||||
Répare tous les fichiers et les données de parité.
|
||||
|
||||
Tous les fichiers et les données de parité sont comparés à l'état
|
||||
de l'instantané enregistré lors du dernier `sync`.
|
||||
Si une différence est trouvée, elle est rétablie à l'instantané stocké.
|
||||
Tous les fichiers et les données de parité sont comparés à l'état sauvegardé lors
|
||||
du dernier `sync`. Si une différence est trouvée, elle est restaurée à l'état enregistré.
|
||||
|
||||
AVERTISSEMENT ! La commande `fix` ne fait pas de distinction entre
|
||||
les erreurs et les modifications intentionnelles. Elle rétablit
|
||||
inconditionnellement l'état du fichier au dernier `sync`.
|
||||
AVERTISSEMENT !
|
||||
La commande `fix` ne fait pas de différence entre les erreurs et
|
||||
les modifications intentionnelles. Elle rétablit inconditionnellement l'état des fichiers
|
||||
tel qu'il était lors du dernier `sync`.
|
||||
|
||||
Si aucune autre option n'est spécifiée, l'intégralité de la baie est traitée.
|
||||
Utilisez les options de filtre pour sélectionner un sous-ensemble de
|
||||
|
|
@ -802,11 +809,11 @@ Options
|
|||
Sous Windows, il utilise le fichier `snapraid.conf` dans le même
|
||||
répertoire que `snapraid.exe`.
|
||||
|
||||
-f, --filter MOTIF
|
||||
-f, --filter PATTERN
|
||||
Filtre les fichiers à traiter dans `check` et `fix`.
|
||||
Seuls les fichiers correspondant au motif spécifié sont traités.
|
||||
Cette option peut être utilisée plusieurs fois.
|
||||
Voir la section MOTIF pour plus de détails sur les
|
||||
Voir la section PATTERN pour plus de détails sur les
|
||||
spécifications de motifs.
|
||||
Sous Unix, assurez-vous que les caractères de globbing sont
|
||||
entre guillemets s'ils sont utilisés.
|
||||
|
|
@ -814,7 +821,7 @@ Options
|
|||
Elle ne peut pas être utilisée avec `sync` et `scrub`, car ils
|
||||
traitent toujours l'intégralité de la baie.
|
||||
|
||||
-d, --filter-disk NOM
|
||||
-d, --filter-disk NAME
|
||||
Filtre les disques à traiter dans `check`, `fix`, `up` et `down`.
|
||||
Vous devez spécifier un nom de disque tel que défini dans le fichier
|
||||
de configuration.
|
||||
|
|
@ -858,9 +865,9 @@ Options
|
|||
qui n'ont pas encore été nettoyés, et `full` nettoie tout.
|
||||
Cette option ne peut être utilisée qu'avec `scrub`.
|
||||
|
||||
-o, --older-than JOURS
|
||||
-o, --older-than DAYS
|
||||
Sélectionne la partie la plus ancienne de la baie à traiter dans `scrub`.
|
||||
JOURS est l'âge minimum en jours pour qu'un bloc soit nettoyé ;
|
||||
DAYS est l'âge minimum en jours pour qu'un bloc soit nettoyé ;
|
||||
la valeur par défaut est 10.
|
||||
Les blocs marqués comme mauvais sont toujours nettoyés,
|
||||
quelle que soit cette option.
|
||||
|
|
@ -897,7 +904,7 @@ Options
|
|||
opération fix avant de continuer.
|
||||
Cette option ne peut être utilisée qu'avec `sync`.
|
||||
|
||||
-i, --import DOSSIER
|
||||
-i, --import DIR
|
||||
Importe à partir du répertoire spécifié tous les fichiers supprimés
|
||||
de la baie après le dernier `sync`.
|
||||
Si vous avez toujours de tels fichiers, ils peuvent être utilisés
|
||||
|
|
@ -915,12 +922,12 @@ Options
|
|||
assurer que les disques sont arrêtés en toute sécurité
|
||||
même lorsqu'une commande échoue.
|
||||
|
||||
-w, --bw-limit DÉBIT
|
||||
-w, --bw-limit RATE
|
||||
Applique une limite de bande passante globale pour tous les disques.
|
||||
Le DÉBIT est le nombre d'octets par seconde. Vous pouvez spécifier
|
||||
un multiplicateur tel que K, M ou G (par exemple, --bw-limit 1G).
|
||||
Le RATE est le nombre d'octets par seconde. Vous pouvez spécifier
|
||||
un multiplicateur tel que K, M, G ou T (par exemple, --bw-limit 1G).
|
||||
|
||||
-t, --tail TAILLE
|
||||
-t, --tail SIZE
|
||||
Limite la liste des fichiers à ceux n'utilisant pas plus que la
|
||||
taille de queue spécifiée des disques de parité.
|
||||
Vous pouvez utiliser des multiplicateurs tels que K, M, G ou T (ex: --tail 1G).
|
||||
|
|
@ -1033,9 +1040,9 @@ Options
|
|||
fortement recommandé de ne pas l'utiliser.
|
||||
Vous N'AVEZ AUCUNE protection des données pendant l'opération `sync`.
|
||||
|
||||
-W, --force-realloc-tail TAILLE
|
||||
Fonctionne comme -R, --force-realloc, maar limité à la partie terminale
|
||||
spécifiée (les derniers TAILLE octets) de chaque fichier de parité.
|
||||
-W, --force-realloc-tail SIZE
|
||||
Fonctionne comme -R, --force-realloc, mais limité à la partie terminale
|
||||
spécifiée (les derniers SIZE octets) de chaque fichier de parité.
|
||||
Force la réallocation (déplacement) de tout fragment/bloc de fichier
|
||||
actuellement stocké dans cette section terminale, leur permettant d'être
|
||||
placés n'importe où dans le(s) fichier(s) de parité où de l'espace libre
|
||||
|
|
@ -1055,7 +1062,7 @@ Options
|
|||
Vous n'avez PAS de protection des données pendant l'opération `sync`
|
||||
pour les fichiers affectés.
|
||||
|
||||
-l, --log FICHIER
|
||||
-l, --log FILE
|
||||
Écrit un journal détaillé dans le fichier spécifié.
|
||||
Si cette option n'est pas spécifiée, les erreurs inattendues
|
||||
sont imprimées à l'écran, ce qui peut entraîner une sortie
|
||||
|
|
@ -1075,7 +1082,7 @@ Options
|
|||
Consultez le fichier ou la page de manuel snapraid_log.txt
|
||||
pour les descriptions des balises de journal.
|
||||
|
||||
-L, --error-limit NOMBRE
|
||||
-L, --error-limit NUMBER
|
||||
Définit une nouvelle limite d'erreurs avant d'arrêter l'exécution.
|
||||
Par défaut, SnapRAID s'arrête s'il rencontre plus de 100
|
||||
erreurs d'entrée/sortie, indiquant qu'un disque est
|
||||
|
|
@ -1095,7 +1102,7 @@ Options
|
|||
Ne traite que le nombre de blocs spécifié.
|
||||
Cette option est principalement destinée à la récupération manuelle avancée.
|
||||
|
||||
-C, --gen-conf CONTENU
|
||||
-C, --gen-conf CONTENT
|
||||
Génère un fichier de configuration factice à partir d'un
|
||||
fichier de contenu existant.
|
||||
Le fichier de configuration est écrit sur la sortie standard
|
||||
|
|
@ -1135,7 +1142,7 @@ Configuration
|
|||
|
||||
Il doit contenir les options suivantes (sensibles à la casse) :
|
||||
|
||||
parity FICHIER [,FICHIER] ...
|
||||
parity FILE [,FILE] ...
|
||||
Définit les fichiers à utiliser pour stocker les informations de parité.
|
||||
La parité permet une protection contre une seule défaillance
|
||||
de disque, similaire au RAID5.
|
||||
|
|
@ -1157,7 +1164,7 @@ Configuration
|
|||
|
||||
Cette option est obligatoire et ne peut être utilisée qu'une seule fois.
|
||||
|
||||
(2,3,4,5,6)-parity FICHIER [,FICHIER] ...
|
||||
(2,3,4,5,6)-parity FILE [,FILE] ...
|
||||
Définit les fichiers à utiliser pour stocker les informations de parité
|
||||
supplémentaires.
|
||||
|
||||
|
|
@ -1177,7 +1184,7 @@ Configuration
|
|||
|
||||
Ces options sont facultatives et ne peuvent être utilisées qu'une seule fois.
|
||||
|
||||
z-parity FICHIER [,FICHIER] ...
|
||||
z-parity FILE [,FILE] ...
|
||||
Définit un fichier et un format alternatifs pour stocker la triple parité.
|
||||
|
||||
Cette option est une alternative à `3-parity`, principalement destinée
|
||||
|
|
@ -1196,7 +1203,7 @@ Configuration
|
|||
le fichier de configuration avec le fichier z-parity ou 3-parity souhaité
|
||||
et en utilisant `fix` pour le recréer.
|
||||
|
||||
content FICHIER
|
||||
content FILE
|
||||
Définit le fichier à utiliser pour stocker la liste et les sommes de
|
||||
contrôle de tous les fichiers présents dans votre baie de disques.
|
||||
|
||||
|
|
@ -1211,19 +1218,19 @@ Configuration
|
|||
Vous devez stocker au moins une copie pour chaque disque de parité
|
||||
utilisé plus un. L'utilisation de copies supplémentaires ne nuit pas.
|
||||
|
||||
data NOM DOSSIER
|
||||
data NAME DIR
|
||||
Définit le nom et le point de montage des disques de données dans
|
||||
la baie. NOM est utilisé pour identifier le disque et doit
|
||||
être unique. DOSSIER est le point de montage du disque dans le
|
||||
la baie. NAME est utilisé pour identifier le disque et doit
|
||||
être unique. DIR est le point de montage du disque dans le
|
||||
système de fichiers.
|
||||
|
||||
Vous pouvez modifier le point de montage au besoin, tant que
|
||||
vous gardez le NOM fixe.
|
||||
vous gardez le NAME fixe.
|
||||
|
||||
Vous devriez utiliser une option pour chaque disque de données
|
||||
de la baie.
|
||||
|
||||
Vous pouvez renommer un disque plus tard en changeant le NOM directement
|
||||
Vous pouvez renommer un disque plus tard en changeant le NAME directement
|
||||
dans le fichier de configuration, puis en exécutant une commande `sync`.
|
||||
Dans le cas d'un renommage, l'association est faite en utilisant l'UUID
|
||||
stocké des disques.
|
||||
|
|
@ -1239,12 +1246,37 @@ Configuration
|
|||
Notez que ces disques ne sont pas affectés par les commandes `up` et
|
||||
`down` car ils sont censés toujours être en rotation.
|
||||
|
||||
snapshot
|
||||
Active l'utilisation des instantanés du système de fichiers pour les commandes `sync`, `scrub`,
|
||||
`check` et `fix`.
|
||||
|
||||
Lorsqu'elle est activée, SnapRAID crée un instantané en lecture seule de vos données au
|
||||
début d'un 'sync'. Cela garantit une vue cohérente et temporelle de vos
|
||||
fichiers, évitant les erreurs causées par des modifications de fichiers simultanées.
|
||||
|
||||
Cela améliore considérablement la récupération : si un fichier est supprimé du système de fichiers actif,
|
||||
il reste préservé dans l'instantané. Cela évite que la parité ne devienne "rompue"
|
||||
pour ce bloc, garantissant que vous pouvez toujours récupérer les données avec succès
|
||||
si un autre disque tombe en panne.
|
||||
|
||||
Cette option s'applique exclusivement aux disques de données formatés avec les
|
||||
systèmes de fichiers Btrfs, Bcachefs ou ZFS sous Linux et NTFS sous Windows.
|
||||
Les disques de parité, ou les disques de données utilisant d'autres systèmes de fichiers, utiliseront toujours
|
||||
la version active du système de fichiers.
|
||||
|
||||
La création et la suppression d'instantanés nécessitent des privilèges d'administration.
|
||||
Assurez-vous que SnapRAID est exécuté avec les autorisations nécessaires (par exemple, sudo) lorsque
|
||||
cette option est activée.
|
||||
|
||||
Consultez la section SNAPSHOTS pour une explication détaillée du cycle de vie
|
||||
des instantanés.
|
||||
|
||||
nohidden
|
||||
Exclut tous les fichiers et répertoires cachés.
|
||||
Sous Unix, les fichiers cachés sont ceux commençant par `.`.
|
||||
Sous Windows, ce sont ceux avec l'attribut caché.
|
||||
|
||||
exclude/include MOTIF
|
||||
exclude/include PATTERN
|
||||
Définit les motifs de fichiers ou de répertoires à exclure ou à inclure
|
||||
dans le processus de synchronisation.
|
||||
Tous les motifs sont traités dans l'ordre spécifié.
|
||||
|
|
@ -1255,12 +1287,12 @@ Configuration
|
|||
spécifié est un `include`, ou inclus si le dernier motif
|
||||
spécifié est un `exclude`.
|
||||
|
||||
Voir la section MOTIF pour plus de détails sur les
|
||||
Voir la section PATTERN pour plus de détails sur les
|
||||
spécifications de motifs.
|
||||
|
||||
Cette option peut être utilisée plusieurs fois.
|
||||
|
||||
blocksize TAILLE_EN_KIBIOCTETS
|
||||
blocksize SIZE_IN_KIBIBYTES
|
||||
Définit la taille de bloc de base en kibioctets pour la parité.
|
||||
Un kibioctet est de 1024 octets.
|
||||
|
||||
|
|
@ -1313,7 +1345,7 @@ Configuration
|
|||
pour un disque de 4 To, ce qui permet environ 460 000 fichiers sur
|
||||
chaque disque de données sans aucun espace gaspillé.
|
||||
|
||||
hashsize TAILLE_EN_OCTETS
|
||||
hashsize SIZE_IN_BYTES
|
||||
Définit la taille du hachage en octets pour les blocs enregistrés.
|
||||
|
||||
La taille de hachage par défaut est de 16 octets (128 bits),
|
||||
|
|
@ -1325,7 +1357,7 @@ Configuration
|
|||
|
||||
Une raison d'utiliser une taille de hachage différente est si votre
|
||||
système a une mémoire limitée. En règle générale, SnapRAID nécessite
|
||||
généralement 1 Gio de RAM pour chaque 16 To de données dans la baie.
|
||||
1 Gio de RAM pour chaque 16 To de données dans la baie.
|
||||
|
||||
Plus précisément, pour stocker les hachages des données, SnapRAID
|
||||
nécessite environ TS*(1+HS)/BS octets de RAM,
|
||||
|
|
@ -1350,14 +1382,14 @@ Configuration
|
|||
|
||||
:RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0,51 Gio
|
||||
|
||||
autosave TAILLE_EN_GIGAOCTETS
|
||||
autosave SIZE_IN_GIGABYTES
|
||||
Enregistre automatiquement l'état lors de la synchronisation ou du
|
||||
nettoyage après la quantité spécifiée de Go traités.
|
||||
Cette option est utile pour éviter de redémarrer de longues commandes
|
||||
`sync` à partir de zéro si elles sont interrompues par un plantage
|
||||
de la machine ou tout autre événement.
|
||||
|
||||
temp_limit TEMPÉRATURE_CELSIUS
|
||||
temp_limit TEMPERATURE_CELSIUS
|
||||
Définit la température maximale autorisée du disque en Celsius.
|
||||
Lorsqu'elle est spécifiée, SnapRAID vérifie périodiquement la
|
||||
température de tous les disques à l'aide de l'outil smartctl.
|
||||
|
|
@ -1389,20 +1421,20 @@ Configuration
|
|||
|
||||
Normalement, SnapRAID n'affiche que la température du disque le plus chaud.
|
||||
Pour afficher la température de tous les disques, utilisez l'option
|
||||
-A ou --stats.
|
||||
`-A, --stats`.
|
||||
|
||||
temp_sleep TEMPS_EN_MINUTES
|
||||
temp_sleep TIME_IN_MINUTES
|
||||
Définit le temps de veille, en minutes, lorsque la limite de température
|
||||
est atteinte. Pendant cette période, les disques restent arrêtés.
|
||||
La valeur par défaut est de 5 minutes.
|
||||
|
||||
pool DOSSIER
|
||||
pool DIR
|
||||
Définit le répertoire de mise en commun où la vue virtuelle de la
|
||||
baie de disques est créée à l'aide de la commande `pool`.
|
||||
|
||||
Le répertoire doit déjà exister.
|
||||
|
||||
share CHEMIN_UNC
|
||||
share UNC_DIR
|
||||
Définit le chemin UNC Windows requis pour accéder aux disques à distance.
|
||||
|
||||
Si cette option est spécifiée, les liens symboliques créés dans le
|
||||
|
|
@ -1417,7 +1449,7 @@ Configuration
|
|||
|
||||
Cette option est requise uniquement pour Windows.
|
||||
|
||||
smartctl DISQUE/PARITÉ OPTIONS...
|
||||
smartctl DISK/PARITY OPTIONS...
|
||||
Définit les options smartctl personnalisées pour obtenir les attributs
|
||||
SMART de chaque disque. Cela peut être nécessaire pour les contrôleurs
|
||||
RAID et certains disques USB qui ne peuvent pas être détectés
|
||||
|
|
@ -1425,14 +1457,18 @@ Configuration
|
|||
périphérique, mais il est facultatif pour les périphériques fixes
|
||||
comme les contrôleurs RAID.
|
||||
|
||||
DISQUE est le même nom de disque spécifié dans l'option `data`.
|
||||
PARITÉ est l'un des noms de parité : `parity`, `2-parity`, `3-parity`,
|
||||
DISK est le même nom de disque spécifié dans l'option `data`.
|
||||
PARITY est l'un des noms de parité : `parity`, `2-parity`, `3-parity`,
|
||||
`4-parity`, `5-parity`, `6-parity` ou `z-parity`.
|
||||
|
||||
Dans les OPTIONS spécifiées, la chaîne `%s` est remplacée par le
|
||||
nom du périphérique. Pour les contrôleurs RAID, le périphérique est
|
||||
probablement fixe, et vous n'aurez peut-être pas besoin d'utiliser `%s`.
|
||||
|
||||
Vous pouvez également spécifier une chaîne d'options d'information
|
||||
personnalisée à l'aide de la balise `[info: ...]` pour remplacer
|
||||
l'option `-a` par défaut.
|
||||
|
||||
Consultez la documentation smartmontools pour les options possibles :
|
||||
|
||||
:https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
|
|
@ -1440,29 +1476,35 @@ Configuration
|
|||
|
||||
Par exemple :
|
||||
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl parity -d sat %s
|
||||
|
||||
smartignore DISQUE/PARITÉ ATTR [ATTR...]
|
||||
smartignore DISK/PARITY ATTR [ATTR...]
|
||||
Ignore l'attribut SMART spécifié lors du calcul de la probabilité
|
||||
de défaillance du disque. Cette option est utile si un disque signale
|
||||
des valeurs inhabituelles ou trompeuses pour un attribut particulier.
|
||||
|
||||
DISQUE est le même nom de disque spécifié dans l'option `data`.
|
||||
PARITÉ est l'un des noms de parité : `parity`, `2-parity`, `3-parity`,
|
||||
DISK est le même nom de disque spécifié dans l'option `data`.
|
||||
PARITY est l'un des noms de parité : `parity`, `2-parity`, `3-parity`,
|
||||
`4-parity`, `5-parity`, `6-parity` ou `z-parity`.
|
||||
La valeur spéciale * peut être utilisée pour ignorer l'attribut
|
||||
sur tous les disques.
|
||||
|
||||
Par exemple, pour ignorer l'attribut `Current Pending Sector Count`
|
||||
sur tous les disques :
|
||||
Plusieurs attributs peuvent être spécifiés séparés par des espaces.
|
||||
Chaque attribut peut être spécifié sous forme de nombre de 1 à 255, ou sous
|
||||
forme de nom insensible à la casse (par exemple `Current_Pending_Sector`).
|
||||
|
||||
:smartignore * 197
|
||||
Par exemple, pour ignorer les attributs `Current Pending Sector Count` et
|
||||
`Reallocated Sectors Count` sur tous les disques par leur numéro ou leur nom :
|
||||
|
||||
Pour l'ignorer uniquement sur le premier disque de parité :
|
||||
:smartignore * 197 5
|
||||
:smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
:smartignore parity 197
|
||||
Pour les ignorer uniquement sur le premier disque de parité :
|
||||
|
||||
Exemples
|
||||
:smartignore parity 197 5
|
||||
|
||||
Exemples (Examples)
|
||||
Un exemple de configuration typique pour Unix est :
|
||||
|
||||
:parity /mnt/diskp/snapraid.parity
|
||||
|
|
@ -1473,7 +1515,7 @@ Configuration
|
|||
:data d3 /mnt/disk3/
|
||||
:exclude /lost+found/
|
||||
:exclude /tmp/
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/sg0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1489,11 +1531,123 @@ Configuration
|
|||
:exclude Thumbs.db
|
||||
:exclude \$RECYCLE.BIN
|
||||
:exclude \System Volume Information
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
Snapshots
|
||||
Si l'option snapshot est activée dans la configuration, SnapRAID
|
||||
utilise la fonctionnalité d'instantané du système de fichiers pour garantir des opérations atomiques
|
||||
et cohérentes.
|
||||
|
||||
La gestion des instantanés est entièrement automatique et transparente.
|
||||
Vous pouvez continuer à utiliser SnapRAID exactement comme avant, avec la
|
||||
protection supplémentaire fournie par les instantanés gérés entièrement en
|
||||
arrière-plan.
|
||||
|
||||
Cela offre deux avantages principaux :
|
||||
|
||||
Cohérence - Les fichiers modifiés sur le système de fichiers actif pendant un sync ou un scrub
|
||||
de longue durée ne provoqueront pas de déséquilibres de parité ni d'opérations abandonnées,
|
||||
car SnapRAID voit une image figée dans le temps.
|
||||
Récupération - Si un fichier est mis à jour ou supprimé du système de fichiers actif,
|
||||
il reste préservé dans l'instantané. Si une panne de disque survient
|
||||
avant l'exécution du prochain sync, SnapRAID utilise les données préservées
|
||||
dans l'instantané pour reconstruire le disque défaillant.
|
||||
|
||||
En cas de panne de disque pendant un processus de sync actif,
|
||||
SnapRAID est également capable de lire automatiquement à la fois l'instantané
|
||||
du calcul de parité précédent et celui en cours.
|
||||
Cela maximise la probabilité d'une récupération complète en
|
||||
fournissant un accès aux blocs de données exacts requis pour résoudre
|
||||
les équations de parité, même si ces blocs ont été modifiés
|
||||
ou supprimés entre les syncs.
|
||||
|
||||
Sans instantanés, un fichier mis à jour ou supprimé sur un disque sain
|
||||
entraîne des blocs de données manquants qui pourraient être nécessaires pour
|
||||
réparer d'autres disques défaillants.
|
||||
|
||||
Les instantanés sont créés uniquement pour les disques de données et uniquement si le système de fichiers
|
||||
sous-jacent prend en charge cette fonctionnalité. Les disques de parité utilisent toujours
|
||||
le système de fichiers actif.
|
||||
|
||||
Actuellement, cela est pris en charge sur Btrfs, Bcachefs et ZFS sous Linux
|
||||
et sur NTFS sous Windows.
|
||||
|
||||
Vous pouvez mélanger des disques de données avec différents systèmes de fichiers. Seuls ceux qui
|
||||
prennent en charge les instantanés les utiliseront, tandis que les autres disques continueront
|
||||
à fonctionner directement sur le système de fichiers actif.
|
||||
|
||||
La création et la suppression d'instantanés nécessitent des privilèges d'administration.
|
||||
Assurez-vous que SnapRAID est exécuté avec les autorisations nécessaires (par exemple, sudo)
|
||||
lorsque les instantanés sont activés.
|
||||
|
||||
Comportement des commandes avec les instantanés (Command Behavior with Snapshots)
|
||||
Les commandes `sync` et `scrub` fonctionnent toutes deux exclusivement sur les instantanés
|
||||
pour garantir que toutes les opérations sur les données sont effectuées par rapport à un état cohérent
|
||||
et figé. En utilisant ces instantanés, SnapRAID empêche les écarts de parité
|
||||
qui seraient autrement déclenchés par des modifications simultanées de fichiers sur le système de fichiers actif.
|
||||
Pendant un `sync`, la commande utilise un nouvel instantané créé au
|
||||
début du processus pour capturer l'état actuel pour le calcul de la parité.
|
||||
En contrepartie, la commande `scrub` utilise le dernier instantané, celui
|
||||
créé lors du sync le plus récent, pour maintenir un point de référence fiable
|
||||
qui correspond à la parité existante.
|
||||
|
||||
Pour les commandes `check` et `fix`, l'utilisation du dernier instantané
|
||||
dépend du ciblage ou non de disques spécifiques à l'aide de l'option
|
||||
-d, --filter-disk.
|
||||
|
||||
Un disque explicitement sélectionné via -d (la "cible" de l'opération)
|
||||
utilise toujours le système de fichiers actif. Pour `fix`, cela permet de restaurer
|
||||
les données sur le disque de remplacement actif. Pour `check`, cela permet de simuler
|
||||
l'opération `fix` dans les mêmes conditions.
|
||||
|
||||
Tous les autres disques de données (les disques de "référence") seront accessibles via
|
||||
leurs instantanés. Cela garantit que même si vous modifiez des fichiers
|
||||
sur vos disques sains pendant qu'une récupération est en cours, SnapRAID
|
||||
dispose d'une référence stable et figée pour résoudre les équations de parité.
|
||||
|
||||
Si aucune option -d n'est fournie, SnapRAID suppose que l'opération s'applique
|
||||
à l'ensemble de la grappe, dans ce cas, `check` et `fix` utiliseront exclusivement
|
||||
les systèmes de fichiers actifs.
|
||||
|
||||
Toutes les autres commandes fonctionnent exclusivement sur le système de fichiers actif.
|
||||
|
||||
Cycle de vie des instantanés (Snapshots Lifecycle)
|
||||
SnapRAID gère deux instantanés spécifiques, `stable` et `pending`,
|
||||
dans un répertoire caché à la racine de chaque sous-volume de données.
|
||||
Dans Btrfs, Bcachefs et NTFS, le répertoire `.snapraid/` est utilisé,
|
||||
dans ZFS, le répertoire standard `.zfs/snapshot/`.
|
||||
|
||||
L'instantané `stable` représente l'état du dernier
|
||||
`sync` terminé avec succès, contenant les données exactes utilisées pour
|
||||
calculer la parité actuelle. Il sert de source de données principale
|
||||
pour les commandes `scrub`, `check` et `fix`.
|
||||
|
||||
L'instantané `pending` est une image temporaire créée au début
|
||||
d'un `sync` pour fournir un état figé pour le calcul de la parité.
|
||||
Une fois l'opération terminée avec succès, l'instantané `stable` précédent
|
||||
est supprimé, et l'instantané `pending` est promu pour
|
||||
prendre sa place en tant que nouvelle référence stable.
|
||||
|
||||
Si un `sync` est interrompu, l'instantané `pending` est préservé.
|
||||
Les commandes ultérieures `scrub`, `check` et `fix` utiliseront cet
|
||||
instantané en attente car il correspond à l'état du système de fichiers enregistré dans
|
||||
le fichier .content, même si la parité n'est que partiellement synchronisée.
|
||||
|
||||
En cas d'interruption de `sync`, les commandes `check` et `fix`
|
||||
lisent également à partir de l'instantané `stable` pour récupérer les blocs de données
|
||||
des fichiers qui ont été mis à jour ou supprimés pendant le sync.
|
||||
Cela est possible car le fichier .content conserve les métadonnées de
|
||||
tous les fichiers modifiés ou supprimés tout au long du processus de sync.
|
||||
Ces informations historiques ne sont effacées qu'une fois qu'un sync se termine
|
||||
avec succès et que la version finale du fichier .content est enregistrée.
|
||||
|
||||
Si un `sync` est redémarré après une interruption, l'instantané pending existant
|
||||
est supprimé et un nouveau est créé pour
|
||||
capturer l'état actuel du système de fichiers actif.
|
||||
|
||||
Motif (Pattern)
|
||||
Les motifs offrent un moyen flexible de filtrer les fichiers à inclure ou
|
||||
à exclure. En utilisant des caractères de "globbing", vous pouvez définir des règles qui
|
||||
|
|
@ -1618,7 +1772,7 @@ Motif (Pattern)
|
|||
ligne de commande, vous devez les mettre entre guillemets pour empêcher
|
||||
le shell de les développer.
|
||||
|
||||
Ignorer des Fichiers (Ignore Files)
|
||||
Ignorer des Fichiers (Ignore File)
|
||||
En plus des règles globales du fichier de configuration, vous pouvez
|
||||
placer des fichiers `.snapraidignore` dans n'importe quel répertoire de la grappe
|
||||
pour définir des règles d'exclusion décentralisées.
|
||||
|
|
@ -1668,8 +1822,10 @@ Contenu (Content)
|
|||
présents dans votre baie de disques, ainsi que toutes les sommes
|
||||
de contrôle pour vérifier leur intégrité.
|
||||
|
||||
Ce fichier est lu et écrit par les commandes `sync` et `scrub` et
|
||||
lu par les commandes `fix`, `check` et `status`.
|
||||
Le fichier de contenu est lu et écrit par les commandes `sync`, `scrub`,
|
||||
`touch` et `rehash`. Il est lu par les commandes `status`, `diff`,
|
||||
`check`, `fix`, `list`, `dup`, `locate` et `pool`, et il est complètement
|
||||
ignoré par les commandes `smart`, `probe`, `up`, `down` et `devices`.
|
||||
|
||||
Parité (Parity)
|
||||
SnapRAID stocke les informations de parité de votre baie dans
|
||||
|
|
@ -1681,7 +1837,7 @@ Parité (Parity)
|
|||
Ces fichiers sont lus et écrits par les commandes `sync` et `fix` et
|
||||
lus uniquement par les commandes `scrub` et `check`.
|
||||
|
||||
Encodage
|
||||
Encodage (Encoding)
|
||||
SnapRAID sous Unix ignore tout encodage. Il lit et stocke les
|
||||
noms de fichiers avec le même encodage utilisé par le système
|
||||
de fichiers.
|
||||
|
|
@ -1697,8 +1853,19 @@ Encodage
|
|||
redirigez la sortie de la console vers un fichier, le fichier
|
||||
résultant est toujours au format UTF-8.
|
||||
|
||||
Code de sortie (Exit Code)
|
||||
SnapRAID se termine avec les codes d'erreur suivants :
|
||||
|
||||
0 - Tout est OK.
|
||||
1 - La commande a rencontré des erreurs.
|
||||
2 - La commande `diff` a trouvé que tout est OK, mais un `sync` est requis.
|
||||
|
||||
Traduction (Translation)
|
||||
Ce document est une traduction automatique du manuel en anglais.
|
||||
Veuillez vous référer au manuel en anglais pour la version officielle.
|
||||
|
||||
Droits d'auteur (Copyright)
|
||||
Ce fichier est Copyright (C) 2025 Andrea Mazzoleni
|
||||
Ce fichier est Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
Voir aussi (See Also)
|
||||
snapraid_log(1), snapraidd(1)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -7,24 +7,25 @@
|
|||
==========
|
||||
|
||||
snapraid [-c, --conf CONFIG]
|
||||
[-f, --filter MOTIF] [-d, --filter-disk NOM]
|
||||
[-f, --filter PATTERN] [-d, --filter-disk NAME]
|
||||
[-m, --filter-missing] [-e, --filter-error]
|
||||
[-a, --audit-only] [-h, --pre-hash] [-i, --import DOSSIER]
|
||||
[-p, --plan PERC|mauvais|nouveau|complet]
|
||||
[-o, --older-than JOURS] [-l, --log FICHIER]
|
||||
[-s, --spin-down-on-error] [-w, --bw-limit DÉBIT]
|
||||
[-a, --audit-only] [-h, --pre-hash] [-i, --import DIR]
|
||||
[-p, --plan PERC|bad|new|full]
|
||||
[-o, --older-than DAYS] [-l, --log FILE]
|
||||
[-s, --spin-down-on-error] [-w, --bw-limit RATE]
|
||||
[-t, --tail]
|
||||
[-Z, --force-zero] [-E, --force-empty]
|
||||
[-U, --force-uuid] [-D, --force-device]
|
||||
[-N, --force-nocopy] [-F, --force-full]
|
||||
[-R, --force-realloc] [-W, --force-realloc-tail]
|
||||
[-S, --start BLKSTART] [-B, --count BLKCOUNT]
|
||||
[-L, --error-limit NOMBRE]
|
||||
[-L, --error-limit NUMBER]
|
||||
[-A, --stats]
|
||||
[-v, --verbose] [-q, --quiet]
|
||||
status|smart|probe|up|down|diff|sync|scrub|fix|check
|
||||
|list|dup|pool|devices|touch|rehash|locate
|
||||
|
||||
snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENU]
|
||||
snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
|
||||
2 DESCRIPTION
|
||||
|
|
@ -61,23 +62,29 @@ Pour plus d'informations, veuillez visiter le site officiel de SnapRAID :
|
|||
3 LIMITATIONS
|
||||
=============
|
||||
|
||||
SnapRAID est un hybride entre un programme RAID et un programme de sauvegarde,
|
||||
visant à combiner les meilleurs avantages des deux. Cependant, il a quelques
|
||||
limitations que vous devriez considérer avant de l'utiliser.
|
||||
SnapRAID est un hybride entre un RAID et un programme de sauvegarde, visant à combiner
|
||||
les meilleurs avantages des deux. Cependant, il présente certaines limitations que vous devriez
|
||||
prendre en compte avant de l'utiliser.
|
||||
|
||||
La principale limitation est que si un disque tombe en panne et que vous
|
||||
n'avez pas synchronisé récemment, vous pourriez ne pas être en mesure de
|
||||
récupérer complètement.
|
||||
Plus précisément, vous pourriez ne pas être en mesure de récupérer jusqu'à
|
||||
la taille des fichiers modifiés ou supprimés depuis la dernière opération
|
||||
de synchronisation.
|
||||
Cela se produit même si les fichiers modifiés ou supprimés ne se trouvent
|
||||
pas sur le disque défaillant. C'est pourquoi SnapRAID est mieux adapté
|
||||
aux données qui changent rarement.
|
||||
La principale limitation est que si un disque tombe en panne, vous ne pouvez récupérer les données que jusqu'à
|
||||
l'état du dernier processus `sync`. Toutes les données ajoutées ou modifications effectuées
|
||||
depuis la dernière synchronisation situées sur le disque défectueux seront perdues.
|
||||
|
||||
D'un autre côté, les fichiers nouvellement ajoutés n'empêchent pas
|
||||
la récupération des fichiers déjà existants. Vous ne perdrez que les
|
||||
fichiers récemment ajoutés s'ils se trouvent sur le disque défaillant.
|
||||
Par conséquent, SnapRAID est principalement adapté aux données qui changent rarement.
|
||||
|
||||
Pour les données qui existaient déjà lors de la dernière synchronisation, la fiabilité de la récupération dépend
|
||||
de l'utilisation ou non de l'option `snapshot` :
|
||||
|
||||
* Avec la prise en charge des instantanés (disponible sur Btrfs, ZFS, Bcachefs et NTFS),
|
||||
SnapRAID peut maintenir automatiquement une référence figée de vos disques de données.
|
||||
Cela garantit que même si vous modifiez ou supprimez des fichiers sur votre système de fichiers actif
|
||||
pendant ou après une synchronisation, le processus de récupération reste cohérent et fiable.
|
||||
|
||||
* Sans la prise en charge des instantanés, la suppression ou la modification de fichiers après un `sync`
|
||||
peut empêcher la récupération complète d'autres disques en panne. Cela se produit
|
||||
parce que la parité ne correspond plus aux fichiers modifiés, même si
|
||||
ces fichiers ne se trouvent pas sur le disque défectueux. D'un autre côté, les fichiers nouvellement ajoutés
|
||||
n'empêchent pas la récupération des fichiers déjà existants.
|
||||
|
||||
Les autres limitations de SnapRAID sont :
|
||||
|
||||
|
|
@ -93,12 +100,12 @@ Les autres limitations de SnapRAID sont :
|
|||
de défaillances de disques. Avec une sauvegarde, vous pouvez
|
||||
récupérer d'une défaillance complète de toute la baie de disques.
|
||||
* Seuls les noms de fichiers, les horodatages, les liens symboliques
|
||||
et les liens matériels sont sauvegardés. Les permissions, la
|
||||
et les liens physiques sont sauvegardés. Les permissions, la
|
||||
propriété et les attributs étendus ne sont pas sauvegardés.
|
||||
|
||||
|
||||
4 DéMARRER
|
||||
==========
|
||||
4 DéMARRER (GETTING STARTED)
|
||||
============================
|
||||
|
||||
Pour utiliser SnapRAID, vous devez d'abord sélectionner un disque
|
||||
dans votre baie de disques pour le dédier aux informations de `parité`.
|
||||
|
|
@ -218,7 +225,7 @@ les mauvais blocs avec l'option -e, --filter-error :
|
|||
|
||||
Lors du prochain `scrub`, les erreurs disparaîtront du rapport
|
||||
`status` si elles sont réellement corrigées. Pour accélérer,
|
||||
vous pouvez utiliser -p mauvais pour nettoyer uniquement les blocs
|
||||
vous pouvez utiliser -p bad pour nettoyer uniquement les blocs
|
||||
marqués comme mauvais.
|
||||
|
||||
snapraid -p bad scrub
|
||||
|
|
@ -233,7 +240,7 @@ ne sont pas marqués comme mauvais.
|
|||
|
||||
Note : La fonctionnalité de mise en commun décrite ci-dessous a été
|
||||
remplacée par l'outil mergerfs, qui est désormais l'option recommandée
|
||||
pour les utilisateurs Linux de la communauté SnapRAID. Mergefs offre
|
||||
pour les utilisateurs Linux de la communauté SnapRAID. Mergerfs offre
|
||||
un moyen plus flexible et efficace de regrouper plusieurs disques
|
||||
dans un seul point de montage unifié, permettant un accès transparent
|
||||
aux fichiers sur toute votre baie sans dépendre de liens symboliques.
|
||||
|
|
@ -320,11 +327,11 @@ qu'un système RAID, et il peut être utilisé pour restaurer
|
|||
ou récupérer des fichiers dans leur état précédent à l'aide
|
||||
de l'option -f, --filter :
|
||||
|
||||
snapraid fix -f FICHIER
|
||||
snapraid fix -f FILE
|
||||
|
||||
ou pour un répertoire :
|
||||
|
||||
snapraid fix -f DOSSIER/
|
||||
snapraid fix -f DIR/
|
||||
|
||||
Vous pouvez également l'utiliser pour récupérer uniquement les
|
||||
fichiers accidentellement supprimés à l'intérieur d'un
|
||||
|
|
@ -332,15 +339,15 @@ répertoire en utilisant l'option -m, --filter-missing,
|
|||
qui ne restaure que les fichiers manquants, laissant tous
|
||||
les autres intacts.
|
||||
|
||||
snapraid fix -m -f DOSSIER/
|
||||
snapraid fix -m -f DIR/
|
||||
|
||||
Ou pour récupérer tous les fichiers supprimés sur tous les
|
||||
lecteurs avec :
|
||||
|
||||
snapraid fix -m
|
||||
|
||||
4.4 Récupération
|
||||
----------------
|
||||
4.4 Récupération (Recovering)
|
||||
-----------------------------
|
||||
|
||||
Le pire est arrivé, et vous avez perdu un ou plusieurs disques !
|
||||
|
||||
|
|
@ -379,9 +386,9 @@ leurs options de configuration.
|
|||
Exécutez la commande fix, en stockant le journal dans un fichier
|
||||
externe avec :
|
||||
|
||||
snapraid -d NOM -l fix.log fix
|
||||
snapraid -d NAME -l fix.log fix
|
||||
|
||||
Où NOM est le nom du disque, tel que `d1` dans notre exemple précédent.
|
||||
Où NAME est le nom du disque, tel que `d1` dans notre exemple précédent.
|
||||
Si le disque à récupérer est un disque de parité, utilisez les noms
|
||||
`parity`, `2-parity`, etc.
|
||||
Si vous avez plusieurs disques défaillants, utilisez plusieurs
|
||||
|
|
@ -417,9 +424,9 @@ la commande `fix` !
|
|||
Par précaution, vous pouvez maintenant exécuter une commande `check`
|
||||
pour vous assurer que tout est correct sur le disque récupéré.
|
||||
|
||||
snapraid -d NOM -a check
|
||||
snapraid -d NAME -a check
|
||||
|
||||
Où NOM est le nom du disque, tel que `d1` dans notre exemple précédent.
|
||||
Où NAME est le nom du disque, tel que `d1` dans notre exemple précédent.
|
||||
|
||||
Les options -d et -a indiquent à SnapRAID de vérifier uniquement le
|
||||
disque spécifié et d'ignorer toutes les données de parité.
|
||||
|
|
@ -436,16 +443,16 @@ disque.
|
|||
Si tout est récupéré, cette commande est immédiate.
|
||||
|
||||
|
||||
5 COMMANDES
|
||||
===========
|
||||
5 COMMANDES (COMMANDS)
|
||||
======================
|
||||
|
||||
SnapRAID fournit quelques commandes simples qui vous permettent de :
|
||||
|
||||
* Afficher l'état de la baie de disques -> `status`
|
||||
* Afficher l'état de la grappe -> `status`
|
||||
* Contrôler les disques -> `smart`, `probe`, `up`, `down`
|
||||
* Faire une sauvegarde/instantané -> `sync`
|
||||
* Créer un point de sauvegarde/récupération -> `sync`
|
||||
* Vérifier périodiquement les données -> `scrub`
|
||||
* Restaurer la dernière sauvegarde/instantané -> `fix`.
|
||||
* Restaurer le dernier point de sauvegarde/récupération -> `fix`.
|
||||
|
||||
Les commandes doivent être écrites en minuscules.
|
||||
|
||||
|
|
@ -495,7 +502,7 @@ Les autres chaînes d'état possibles sont :
|
|||
logerr - Le journal d'erreurs du périphérique contient des erreurs.
|
||||
selferr - Le journal d'auto-test du périphérique contient des erreurs.
|
||||
|
||||
Si l'option -v, --verbose est spécifiée, une analyse statistique
|
||||
Si l'option `-v, --verbose` est spécifiée, une analyse statistique
|
||||
plus approfondie est fournie. Cette analyse peut vous aider à
|
||||
décider si vous avez besoin de plus ou moins de parité.
|
||||
|
||||
|
|
@ -681,15 +688,15 @@ Les fichiers dans la baie NE SONT PAS modifiés.
|
|||
5.9 fix
|
||||
-------
|
||||
|
||||
Corrige tous les fichiers et les données de parité.
|
||||
Répare tous les fichiers et les données de parité.
|
||||
|
||||
Tous les fichiers et les données de parité sont comparés à l'état
|
||||
de l'instantané enregistré lors du dernier `sync`.
|
||||
Si une différence est trouvée, elle est rétablie à l'instantané stocké.
|
||||
Tous les fichiers et les données de parité sont comparés à l'état sauvegardé lors
|
||||
du dernier `sync`. Si une différence est trouvée, elle est restaurée à l'état enregistré.
|
||||
|
||||
AVERTISSEMENT ! La commande `fix` ne fait pas de distinction entre
|
||||
les erreurs et les modifications intentionnelles. Elle rétablit
|
||||
inconditionnellement l'état du fichier au dernier `sync`.
|
||||
AVERTISSEMENT !
|
||||
La commande `fix` ne fait pas de différence entre les erreurs et
|
||||
les modifications intentionnelles. Elle rétablit inconditionnellement l'état des fichiers
|
||||
tel qu'il était lors du dernier `sync`.
|
||||
|
||||
Si aucune autre option n'est spécifiée, l'intégralité de la baie est traitée.
|
||||
Utilisez les options de filtre pour sélectionner un sous-ensemble de
|
||||
|
|
@ -863,11 +870,11 @@ SnapRAID fournit les options suivantes :
|
|||
Sous Windows, il utilise le fichier `snapraid.conf` dans le même
|
||||
répertoire que `snapraid.exe`.
|
||||
|
||||
-f, --filter MOTIF
|
||||
-f, --filter PATTERN
|
||||
Filtre les fichiers à traiter dans `check` et `fix`.
|
||||
Seuls les fichiers correspondant au motif spécifié sont traités.
|
||||
Cette option peut être utilisée plusieurs fois.
|
||||
Voir la section MOTIF pour plus de détails sur les
|
||||
Voir la section PATTERN pour plus de détails sur les
|
||||
spécifications de motifs.
|
||||
Sous Unix, assurez-vous que les caractères de globbing sont
|
||||
entre guillemets s'ils sont utilisés.
|
||||
|
|
@ -875,7 +882,7 @@ SnapRAID fournit les options suivantes :
|
|||
Elle ne peut pas être utilisée avec `sync` et `scrub`, car ils
|
||||
traitent toujours l'intégralité de la baie.
|
||||
|
||||
-d, --filter-disk NOM
|
||||
-d, --filter-disk NAME
|
||||
Filtre les disques à traiter dans `check`, `fix`, `up` et `down`.
|
||||
Vous devez spécifier un nom de disque tel que défini dans le fichier
|
||||
de configuration.
|
||||
|
|
@ -919,9 +926,9 @@ SnapRAID fournit les options suivantes :
|
|||
qui n'ont pas encore été nettoyés, et `full` nettoie tout.
|
||||
Cette option ne peut être utilisée qu'avec `scrub`.
|
||||
|
||||
-o, --older-than JOURS
|
||||
-o, --older-than DAYS
|
||||
Sélectionne la partie la plus ancienne de la baie à traiter dans `scrub`.
|
||||
JOURS est l'âge minimum en jours pour qu'un bloc soit nettoyé ;
|
||||
DAYS est l'âge minimum en jours pour qu'un bloc soit nettoyé ;
|
||||
la valeur par défaut est 10.
|
||||
Les blocs marqués comme mauvais sont toujours nettoyés,
|
||||
quelle que soit cette option.
|
||||
|
|
@ -958,7 +965,7 @@ SnapRAID fournit les options suivantes :
|
|||
opération fix avant de continuer.
|
||||
Cette option ne peut être utilisée qu'avec `sync`.
|
||||
|
||||
-i, --import DOSSIER
|
||||
-i, --import DIR
|
||||
Importe à partir du répertoire spécifié tous les fichiers supprimés
|
||||
de la baie après le dernier `sync`.
|
||||
Si vous avez toujours de tels fichiers, ils peuvent être utilisés
|
||||
|
|
@ -976,12 +983,12 @@ SnapRAID fournit les options suivantes :
|
|||
assurer que les disques sont arrêtés en toute sécurité
|
||||
même lorsqu'une commande échoue.
|
||||
|
||||
-w, --bw-limit DÉBIT
|
||||
-w, --bw-limit RATE
|
||||
Applique une limite de bande passante globale pour tous les disques.
|
||||
Le DÉBIT est le nombre d'octets par seconde. Vous pouvez spécifier
|
||||
un multiplicateur tel que K, M ou G (par exemple, --bw-limit 1G).
|
||||
Le RATE est le nombre d'octets par seconde. Vous pouvez spécifier
|
||||
un multiplicateur tel que K, M, G ou T (par exemple, --bw-limit 1G).
|
||||
|
||||
-t, --tail TAILLE
|
||||
-t, --tail SIZE
|
||||
Limite la liste des fichiers à ceux n'utilisant pas plus que la
|
||||
taille de queue spécifiée des disques de parité.
|
||||
Vous pouvez utiliser des multiplicateurs tels que K, M, G ou T (ex: --tail 1G).
|
||||
|
|
@ -1094,9 +1101,9 @@ SnapRAID fournit les options suivantes :
|
|||
fortement recommandé de ne pas l'utiliser.
|
||||
Vous N'AVEZ AUCUNE protection des données pendant l'opération `sync`.
|
||||
|
||||
-W, --force-realloc-tail TAILLE
|
||||
Fonctionne comme -R, --force-realloc, maar limité à la partie terminale
|
||||
spécifiée (les derniers TAILLE octets) de chaque fichier de parité.
|
||||
-W, --force-realloc-tail SIZE
|
||||
Fonctionne comme -R, --force-realloc, mais limité à la partie terminale
|
||||
spécifiée (les derniers SIZE octets) de chaque fichier de parité.
|
||||
Force la réallocation (déplacement) de tout fragment/bloc de fichier
|
||||
actuellement stocké dans cette section terminale, leur permettant d'être
|
||||
placés n'importe où dans le(s) fichier(s) de parité où de l'espace libre
|
||||
|
|
@ -1116,7 +1123,7 @@ SnapRAID fournit les options suivantes :
|
|||
Vous n'avez PAS de protection des données pendant l'opération `sync`
|
||||
pour les fichiers affectés.
|
||||
|
||||
-l, --log FICHIER
|
||||
-l, --log FILE
|
||||
Écrit un journal détaillé dans le fichier spécifié.
|
||||
Si cette option n'est pas spécifiée, les erreurs inattendues
|
||||
sont imprimées à l'écran, ce qui peut entraîner une sortie
|
||||
|
|
@ -1136,7 +1143,7 @@ SnapRAID fournit les options suivantes :
|
|||
Consultez le fichier ou la page de manuel snapraid_log.txt
|
||||
pour les descriptions des balises de journal.
|
||||
|
||||
-L, --error-limit NOMBRE
|
||||
-L, --error-limit NUMBER
|
||||
Définit une nouvelle limite d'erreurs avant d'arrêter l'exécution.
|
||||
Par défaut, SnapRAID s'arrête s'il rencontre plus de 100
|
||||
erreurs d'entrée/sortie, indiquant qu'un disque est
|
||||
|
|
@ -1156,7 +1163,7 @@ SnapRAID fournit les options suivantes :
|
|||
Ne traite que le nombre de blocs spécifié.
|
||||
Cette option est principalement destinée à la récupération manuelle avancée.
|
||||
|
||||
-C, --gen-conf CONTENU
|
||||
-C, --gen-conf CONTENT
|
||||
Génère un fichier de configuration factice à partir d'un
|
||||
fichier de contenu existant.
|
||||
Le fichier de configuration est écrit sur la sortie standard
|
||||
|
|
@ -1199,8 +1206,8 @@ répertoire que `snapraid.exe`.
|
|||
|
||||
Il doit contenir les options suivantes (sensibles à la casse) :
|
||||
|
||||
7.1 parity FICHIER [,FICHIER] ...
|
||||
---------------------------------
|
||||
7.1 parity FILE [,FILE] ...
|
||||
---------------------------
|
||||
|
||||
Définit les fichiers à utiliser pour stocker les informations de parité.
|
||||
La parité permet une protection contre une seule défaillance
|
||||
|
|
@ -1223,8 +1230,8 @@ Sous Windows, 256 Mo sont laissés inutilisés sur chaque disque pour
|
|||
|
||||
Cette option est obligatoire et ne peut être utilisée qu'une seule fois.
|
||||
|
||||
7.2 (2,3,4,5,6)-parity FICHIER [,FICHIER] ...
|
||||
---------------------------------------------
|
||||
7.2 (2,3,4,5,6)-parity FILE [,FILE] ...
|
||||
---------------------------------------
|
||||
|
||||
Définit les fichiers à utiliser pour stocker les informations de parité
|
||||
supplémentaires.
|
||||
|
|
@ -1245,8 +1252,8 @@ Les mêmes considérations que pour l'option `parity` s'appliquent.
|
|||
|
||||
Ces options sont facultatives et ne peuvent être utilisées qu'une seule fois.
|
||||
|
||||
7.3 z-parity FICHIER [,FICHIER] ...
|
||||
-----------------------------------
|
||||
7.3 z-parity FILE [,FILE] ...
|
||||
-----------------------------
|
||||
|
||||
Définit un fichier et un format alternatifs pour stocker la triple parité.
|
||||
|
||||
|
|
@ -1266,8 +1273,8 @@ Il est possible de convertir d'un format à l'autre en ajustant
|
|||
le fichier de configuration avec le fichier z-parity ou 3-parity souhaité
|
||||
et en utilisant `fix` pour le recréer.
|
||||
|
||||
7.4 content FICHIER
|
||||
-------------------
|
||||
7.4 content FILE
|
||||
----------------
|
||||
|
||||
Définit le fichier à utiliser pour stocker la liste et les sommes de
|
||||
contrôle de tous les fichiers présents dans votre baie de disques.
|
||||
|
|
@ -1283,21 +1290,21 @@ enregistrer plusieurs copies du même fichier.
|
|||
Vous devez stocker au moins une copie pour chaque disque de parité
|
||||
utilisé plus un. L'utilisation de copies supplémentaires ne nuit pas.
|
||||
|
||||
7.5 data NOM DOSSIER
|
||||
--------------------
|
||||
7.5 data NAME DIR
|
||||
-----------------
|
||||
|
||||
Définit le nom et le point de montage des disques de données dans
|
||||
la baie. NOM est utilisé pour identifier le disque et doit
|
||||
être unique. DOSSIER est le point de montage du disque dans le
|
||||
la baie. NAME est utilisé pour identifier le disque et doit
|
||||
être unique. DIR est le point de montage du disque dans le
|
||||
système de fichiers.
|
||||
|
||||
Vous pouvez modifier le point de montage au besoin, tant que
|
||||
vous gardez le NOM fixe.
|
||||
vous gardez le NAME fixe.
|
||||
|
||||
Vous devriez utiliser une option pour chaque disque de données
|
||||
de la baie.
|
||||
|
||||
Vous pouvez renommer un disque plus tard en changeant le NOM directement
|
||||
Vous pouvez renommer un disque plus tard en changeant le NAME directement
|
||||
dans le fichier de configuration, puis en exécutant une commande `sync`.
|
||||
Dans le cas d'un renommage, l'association est faite en utilisant l'UUID
|
||||
stocké des disques.
|
||||
|
|
@ -1315,15 +1322,42 @@ comme le disque de démarrage.
|
|||
Notez que ces disques ne sont pas affectés par les commandes `up` et
|
||||
`down` car ils sont censés toujours être en rotation.
|
||||
|
||||
7.7 nohidden
|
||||
7.7 snapshot
|
||||
------------
|
||||
|
||||
Active l'utilisation des instantanés du système de fichiers pour les commandes `sync`, `scrub`,
|
||||
`check` et `fix`.
|
||||
|
||||
Lorsqu'elle est activée, SnapRAID crée un instantané en lecture seule de vos données au
|
||||
début d'un 'sync'. Cela garantit une vue cohérente et temporelle de vos
|
||||
fichiers, évitant les erreurs causées par des modifications de fichiers simultanées.
|
||||
|
||||
Cela améliore considérablement la récupération : si un fichier est supprimé du système de fichiers actif,
|
||||
il reste préservé dans l'instantané. Cela évite que la parité ne devienne "rompue"
|
||||
pour ce bloc, garantissant que vous pouvez toujours récupérer les données avec succès
|
||||
si un autre disque tombe en panne.
|
||||
|
||||
Cette option s'applique exclusivement aux disques de données formatés avec les
|
||||
systèmes de fichiers Btrfs, Bcachefs ou ZFS sous Linux et NTFS sous Windows.
|
||||
Les disques de parité, ou les disques de données utilisant d'autres systèmes de fichiers, utiliseront toujours
|
||||
la version active du système de fichiers.
|
||||
|
||||
La création et la suppression d'instantanés nécessitent des privilèges d'administration.
|
||||
Assurez-vous que SnapRAID est exécuté avec les autorisations nécessaires (par exemple, sudo) lorsque
|
||||
cette option est activée.
|
||||
|
||||
Consultez la section SNAPSHOTS pour une explication détaillée du cycle de vie
|
||||
des instantanés.
|
||||
|
||||
7.8 nohidden
|
||||
------------
|
||||
|
||||
Exclut tous les fichiers et répertoires cachés.
|
||||
Sous Unix, les fichiers cachés sont ceux commençant par `.`.
|
||||
Sous Windows, ce sont ceux avec l'attribut caché.
|
||||
|
||||
7.8 exclude/include MOTIF
|
||||
-------------------------
|
||||
7.9 exclude/include PATTERN
|
||||
---------------------------
|
||||
|
||||
Définit les motifs de fichiers ou de répertoires à exclure ou à inclure
|
||||
dans le processus de synchronisation.
|
||||
|
|
@ -1335,13 +1369,13 @@ Si aucun motif ne correspond, le fichier est exclu si le dernier motif
|
|||
spécifié est un `include`, ou inclus si le dernier motif
|
||||
spécifié est un `exclude`.
|
||||
|
||||
Voir la section MOTIF pour plus de détails sur les
|
||||
Voir la section PATTERN pour plus de détails sur les
|
||||
spécifications de motifs.
|
||||
|
||||
Cette option peut être utilisée plusieurs fois.
|
||||
|
||||
7.9 blocksize TAILLE_EN_KIBIOCTETS
|
||||
----------------------------------
|
||||
7.10 blocksize SIZE_IN_KIBIBYTES
|
||||
--------------------------------
|
||||
|
||||
Définit la taille de bloc de base en kibioctets pour la parité.
|
||||
Un kibioctet est de 1024 octets.
|
||||
|
|
@ -1395,8 +1429,8 @@ Cela se traduit par environ 1,5 % d'espace supplémentaire, environ 60 Go
|
|||
pour un disque de 4 To, ce qui permet environ 460 000 fichiers sur
|
||||
chaque disque de données sans aucun espace gaspillé.
|
||||
|
||||
7.10 hashsize TAILLE_EN_OCTETS
|
||||
------------------------------
|
||||
7.11 hashsize SIZE_IN_BYTES
|
||||
---------------------------
|
||||
|
||||
Définit la taille du hachage en octets pour les blocs enregistrés.
|
||||
|
||||
|
|
@ -1409,7 +1443,7 @@ cette valeur à l'avenir, vous devrez recréer l'intégralité de la parité !
|
|||
|
||||
Une raison d'utiliser une taille de hachage différente est si votre
|
||||
système a une mémoire limitée. En règle générale, SnapRAID nécessite
|
||||
généralement 1 Gio de RAM pour chaque 16 To de données dans la baie.
|
||||
1 Gio de RAM pour chaque 16 To de données dans la baie.
|
||||
|
||||
Plus précisément, pour stocker les hachages des données, SnapRAID
|
||||
nécessite environ TS*(1+HS)/BS octets de RAM,
|
||||
|
|
@ -1434,8 +1468,8 @@ bloc de 512, vous obtenez :
|
|||
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0,51 Gio
|
||||
|
||||
7.11 autosave TAILLE_EN_GIGAOCTETS
|
||||
----------------------------------
|
||||
7.12 autosave SIZE_IN_GIGABYTES
|
||||
-------------------------------
|
||||
|
||||
Enregistre automatiquement l'état lors de la synchronisation ou du
|
||||
nettoyage après la quantité spécifiée de Go traités.
|
||||
|
|
@ -1443,7 +1477,7 @@ Cette option est utile pour éviter de redémarrer de longues commandes
|
|||
`sync` à partir de zéro si elles sont interrompues par un plantage
|
||||
de la machine ou tout autre événement.
|
||||
|
||||
7.12 temp_limit TEMPÉRATURE_CELSIUS
|
||||
7.13 temp_limit TEMPERATURE_CELSIUS
|
||||
-----------------------------------
|
||||
|
||||
Définit la température maximale autorisée du disque en Celsius.
|
||||
|
|
@ -1477,25 +1511,25 @@ au début de l'exécution comme référence de secours.
|
|||
|
||||
Normalement, SnapRAID n'affiche que la température du disque le plus chaud.
|
||||
Pour afficher la température de tous les disques, utilisez l'option
|
||||
-A ou --stats.
|
||||
`-A, --stats`.
|
||||
|
||||
7.13 temp_sleep TEMPS_EN_MINUTES
|
||||
--------------------------------
|
||||
7.14 temp_sleep TIME_IN_MINUTES
|
||||
-------------------------------
|
||||
|
||||
Définit le temps de veille, en minutes, lorsque la limite de température
|
||||
est atteinte. Pendant cette période, les disques restent arrêtés.
|
||||
La valeur par défaut est de 5 minutes.
|
||||
|
||||
7.14 pool DOSSIER
|
||||
-----------------
|
||||
7.15 pool DIR
|
||||
-------------
|
||||
|
||||
Définit le répertoire de mise en commun où la vue virtuelle de la
|
||||
baie de disques est créée à l'aide de la commande `pool`.
|
||||
|
||||
Le répertoire doit déjà exister.
|
||||
|
||||
7.15 share CHEMIN_UNC
|
||||
---------------------
|
||||
7.16 share UNC_DIR
|
||||
------------------
|
||||
|
||||
Définit le chemin UNC Windows requis pour accéder aux disques à distance.
|
||||
|
||||
|
|
@ -1511,8 +1545,8 @@ et en ajoutant enfin le répertoire et le nom du fichier.
|
|||
|
||||
Cette option est requise uniquement pour Windows.
|
||||
|
||||
7.16 smartctl DISQUE/PARITÉ OPTIONS...
|
||||
--------------------------------------
|
||||
7.17 smartctl DISK/PARITY OPTIONS...
|
||||
------------------------------------
|
||||
|
||||
Définit les options smartctl personnalisées pour obtenir les attributs
|
||||
SMART de chaque disque. Cela peut être nécessaire pour les contrôleurs
|
||||
|
|
@ -1521,14 +1555,18 @@ automatiquement. Le placeholder %s est remplacé par le nom du
|
|||
périphérique, mais il est facultatif pour les périphériques fixes
|
||||
comme les contrôleurs RAID.
|
||||
|
||||
DISQUE est le même nom de disque spécifié dans l'option `data`.
|
||||
PARITÉ est l'un des noms de parité : `parity`, `2-parity`, `3-parity`,
|
||||
DISK est le même nom de disque spécifié dans l'option `data`.
|
||||
PARITY est l'un des noms de parité : `parity`, `2-parity`, `3-parity`,
|
||||
`4-parity`, `5-parity`, `6-parity` ou `z-parity`.
|
||||
|
||||
Dans les OPTIONS spécifiées, la chaîne `%s` est remplacée par le
|
||||
nom du périphérique. Pour les contrôleurs RAID, le périphérique est
|
||||
probablement fixe, et vous n'aurez peut-être pas besoin d'utiliser `%s`.
|
||||
|
||||
Vous pouvez également spécifier une chaîne d'options d'information
|
||||
personnalisée à l'aide de la balise `[info: ...]` pour remplacer
|
||||
l'option `-a` par défaut.
|
||||
|
||||
Consultez la documentation smartmontools pour les options possibles :
|
||||
|
||||
https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
|
|
@ -1536,32 +1574,38 @@ Consultez la documentation smartmontools pour les options possibles :
|
|||
|
||||
Par exemple :
|
||||
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl parity -d sat %s
|
||||
|
||||
7.17 smartignore DISQUE/PARITÉ ATTR [ATTR...]
|
||||
---------------------------------------------
|
||||
7.18 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
-------------------------------------------
|
||||
|
||||
Ignore l'attribut SMART spécifié lors du calcul de la probabilité
|
||||
de défaillance du disque. Cette option est utile si un disque signale
|
||||
des valeurs inhabituelles ou trompeuses pour un attribut particulier.
|
||||
|
||||
DISQUE est le même nom de disque spécifié dans l'option `data`.
|
||||
PARITÉ est l'un des noms de parité : `parity`, `2-parity`, `3-parity`,
|
||||
DISK est le même nom de disque spécifié dans l'option `data`.
|
||||
PARITY est l'un des noms de parité : `parity`, `2-parity`, `3-parity`,
|
||||
`4-parity`, `5-parity`, `6-parity` ou `z-parity`.
|
||||
La valeur spéciale * peut être utilisée pour ignorer l'attribut
|
||||
sur tous les disques.
|
||||
|
||||
Par exemple, pour ignorer l'attribut `Current Pending Sector Count`
|
||||
sur tous les disques :
|
||||
Plusieurs attributs peuvent être spécifiés séparés par des espaces.
|
||||
Chaque attribut peut être spécifié sous forme de nombre de 1 à 255, ou sous
|
||||
forme de nom insensible à la casse (par exemple `Current_Pending_Sector`).
|
||||
|
||||
smartignore * 197
|
||||
Par exemple, pour ignorer les attributs `Current Pending Sector Count` et
|
||||
`Reallocated Sectors Count` sur tous les disques par leur numéro ou leur nom :
|
||||
|
||||
Pour l'ignorer uniquement sur le premier disque de parité :
|
||||
smartignore * 197 5
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
smartignore parity 197
|
||||
Pour les ignorer uniquement sur le premier disque de parité :
|
||||
|
||||
7.18 Exemples
|
||||
-------------
|
||||
smartignore parity 197 5
|
||||
|
||||
7.19 Exemples (Examples)
|
||||
------------------------
|
||||
|
||||
Un exemple de configuration typique pour Unix est :
|
||||
|
||||
|
|
@ -1573,7 +1617,7 @@ Un exemple de configuration typique pour Unix est :
|
|||
data d3 /mnt/disk3/
|
||||
exclude /lost+found/
|
||||
exclude /tmp/
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/sg0
|
||||
smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1589,14 +1633,134 @@ Un exemple de configuration typique pour Windows est :
|
|||
exclude Thumbs.db
|
||||
exclude \$RECYCLE.BIN
|
||||
exclude \System Volume Information
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
|
||||
8 MOTIF (PATTERN)
|
||||
=================
|
||||
8 SNAPSHOTS
|
||||
===========
|
||||
|
||||
Si l'option snapshot est activée dans la configuration, SnapRAID
|
||||
utilise la fonctionnalité d'instantané du système de fichiers pour garantir des opérations atomiques
|
||||
et cohérentes.
|
||||
|
||||
La gestion des instantanés est entièrement automatique et transparente.
|
||||
Vous pouvez continuer à utiliser SnapRAID exactement comme avant, avec la
|
||||
protection supplémentaire fournie par les instantanés gérés entièrement en
|
||||
arrière-plan.
|
||||
|
||||
Cela offre deux avantages principaux :
|
||||
|
||||
Cohérence - Les fichiers modifiés sur le système de fichiers actif pendant un sync ou un scrub
|
||||
de longue durée ne provoqueront pas de déséquilibres de parité ni d'opérations abandonnées,
|
||||
car SnapRAID voit une image figée dans le temps.
|
||||
Récupération - Si un fichier est mis à jour ou supprimé du système de fichiers actif,
|
||||
il reste préservé dans l'instantané. Si une panne de disque survient
|
||||
avant l'exécution du prochain sync, SnapRAID utilise les données préservées
|
||||
dans l'instantané pour reconstruire le disque défaillant.
|
||||
|
||||
En cas de panne de disque pendant un processus de sync actif,
|
||||
SnapRAID est également capable de lire automatiquement à la fois l'instantané
|
||||
du calcul de parité précédent et celui en cours.
|
||||
Cela maximise la probabilité d'une récupération complète en
|
||||
fournissant un accès aux blocs de données exacts requis pour résoudre
|
||||
les équations de parité, même si ces blocs ont été modifiés
|
||||
ou supprimés entre les syncs.
|
||||
|
||||
Sans instantanés, un fichier mis à jour ou supprimé sur un disque sain
|
||||
entraîne des blocs de données manquants qui pourraient être nécessaires pour
|
||||
réparer d'autres disques défaillants.
|
||||
|
||||
Les instantanés sont créés uniquement pour les disques de données et uniquement si le système de fichiers
|
||||
sous-jacent prend en charge cette fonctionnalité. Les disques de parité utilisent toujours
|
||||
le système de fichiers actif.
|
||||
|
||||
Actuellement, cela est pris en charge sur Btrfs, Bcachefs et ZFS sous Linux
|
||||
et sur NTFS sous Windows.
|
||||
|
||||
Vous pouvez mélanger des disques de données avec différents systèmes de fichiers. Seuls ceux qui
|
||||
prennent en charge les instantanés les utiliseront, tandis que les autres disques continueront
|
||||
à fonctionner directement sur le système de fichiers actif.
|
||||
|
||||
La création et la suppression d'instantanés nécessitent des privilèges d'administration.
|
||||
Assurez-vous que SnapRAID est exécuté avec les autorisations nécessaires (par exemple, sudo)
|
||||
lorsque les instantanés sont activés.
|
||||
|
||||
8.1 Comportement des commandes avec les instantanés (Command Behavior with Snapshots)
|
||||
-------------------------------------------------------------------------------------
|
||||
|
||||
Les commandes `sync` et `scrub` fonctionnent toutes deux exclusivement sur les instantanés
|
||||
pour garantir que toutes les opérations sur les données sont effectuées par rapport à un état cohérent
|
||||
et figé. En utilisant ces instantanés, SnapRAID empêche les écarts de parité
|
||||
qui seraient autrement déclenchés par des modifications simultanées de fichiers sur le système de fichiers actif.
|
||||
Pendant un `sync`, la commande utilise un nouvel instantané créé au
|
||||
début du processus pour capturer l'état actuel pour le calcul de la parité.
|
||||
En contrepartie, la commande `scrub` utilise le dernier instantané, celui
|
||||
créé lors du sync le plus récent, pour maintenir un point de référence fiable
|
||||
qui correspond à la parité existante.
|
||||
|
||||
Pour les commandes `check` et `fix`, l'utilisation du dernier instantané
|
||||
dépend du ciblage ou non de disques spécifiques à l'aide de l'option
|
||||
-d, --filter-disk.
|
||||
|
||||
Un disque explicitement sélectionné via -d (la "cible" de l'opération)
|
||||
utilise toujours le système de fichiers actif. Pour `fix`, cela permet de restaurer
|
||||
les données sur le disque de remplacement actif. Pour `check`, cela permet de simuler
|
||||
l'opération `fix` dans les mêmes conditions.
|
||||
|
||||
Tous les autres disques de données (les disques de "référence") seront accessibles via
|
||||
leurs instantanés. Cela garantit que même si vous modifiez des fichiers
|
||||
sur vos disques sains pendant qu'une récupération est en cours, SnapRAID
|
||||
dispose d'une référence stable et figée pour résoudre les équations de parité.
|
||||
|
||||
Si aucune option -d n'est fournie, SnapRAID suppose que l'opération s'applique
|
||||
à l'ensemble de la grappe, dans ce cas, `check` et `fix` utiliseront exclusivement
|
||||
les systèmes de fichiers actifs.
|
||||
|
||||
Toutes les autres commandes fonctionnent exclusivement sur le système de fichiers actif.
|
||||
|
||||
|
||||
9 CYCLE DE VIE DES INSTANTANéS (SNAPSHOTS LIFECYCLE)
|
||||
====================================================
|
||||
|
||||
SnapRAID gère deux instantanés spécifiques, `stable` et `pending`,
|
||||
dans un répertoire caché à la racine de chaque sous-volume de données.
|
||||
Dans Btrfs, Bcachefs et NTFS, le répertoire `.snapraid/` est utilisé,
|
||||
dans ZFS, le répertoire standard `.zfs/snapshot/`.
|
||||
|
||||
L'instantané `stable` représente l'état du dernier
|
||||
`sync` terminé avec succès, contenant les données exactes utilisées pour
|
||||
calculer la parité actuelle. Il sert de source de données principale
|
||||
pour les commandes `scrub`, `check` et `fix`.
|
||||
|
||||
L'instantané `pending` est une image temporaire créée au début
|
||||
d'un `sync` pour fournir un état figé pour le calcul de la parité.
|
||||
Une fois l'opération terminée avec succès, l'instantané `stable` précédent
|
||||
est supprimé, et l'instantané `pending` est promu pour
|
||||
prendre sa place en tant que nouvelle référence stable.
|
||||
|
||||
Si un `sync` est interrompu, l'instantané `pending` est préservé.
|
||||
Les commandes ultérieures `scrub`, `check` et `fix` utiliseront cet
|
||||
instantané en attente car il correspond à l'état du système de fichiers enregistré dans
|
||||
le fichier .content, même si la parité n'est que partiellement synchronisée.
|
||||
|
||||
En cas d'interruption de `sync`, les commandes `check` et `fix`
|
||||
lisent également à partir de l'instantané `stable` pour récupérer les blocs de données
|
||||
des fichiers qui ont été mis à jour ou supprimés pendant le sync.
|
||||
Cela est possible car le fichier .content conserve les métadonnées de
|
||||
tous les fichiers modifiés ou supprimés tout au long du processus de sync.
|
||||
Ces informations historiques ne sont effacées qu'une fois qu'un sync se termine
|
||||
avec succès et que la version finale du fichier .content est enregistrée.
|
||||
|
||||
Si un `sync` est redémarré après une interruption, l'instantané pending existant
|
||||
est supprimé et un nouveau est créé pour
|
||||
capturer l'état actuel du système de fichiers actif.
|
||||
|
||||
|
||||
10 MOTIF (PATTERN)
|
||||
==================
|
||||
|
||||
Les motifs offrent un moyen flexible de filtrer les fichiers à inclure ou
|
||||
à exclure. En utilisant des caractères de "globbing", vous pouvez définir des règles qui
|
||||
|
|
@ -1722,7 +1886,7 @@ ligne de commande, vous devez les mettre entre guillemets pour empêcher
|
|||
le shell de les développer.
|
||||
|
||||
|
||||
9 IGNORER DES FICHIERS (IGNORE FILES)
|
||||
11 IGNORER DES FICHIERS (IGNORE FILE)
|
||||
=====================================
|
||||
|
||||
En plus des règles globales du fichier de configuration, vous pouvez
|
||||
|
|
@ -1767,7 +1931,7 @@ Par exemple, si vous avez un `.snapraidignore` dans `/mnt/disk1/projects/` :
|
|||
*.tmp
|
||||
|
||||
|
||||
10 CONTENU (CONTENT)
|
||||
12 CONTENU (CONTENT)
|
||||
====================
|
||||
|
||||
SnapRAID stocke la liste et les sommes de contrôle de vos fichiers
|
||||
|
|
@ -1777,11 +1941,13 @@ Il s'agit d'un fichier binaire qui répertorie tous les fichiers
|
|||
présents dans votre baie de disques, ainsi que toutes les sommes
|
||||
de contrôle pour vérifier leur intégrité.
|
||||
|
||||
Ce fichier est lu et écrit par les commandes `sync` et `scrub` et
|
||||
lu par les commandes `fix`, `check` et `status`.
|
||||
Le fichier de contenu est lu et écrit par les commandes `sync`, `scrub`,
|
||||
`touch` et `rehash`. Il est lu par les commandes `status`, `diff`,
|
||||
`check`, `fix`, `list`, `dup`, `locate` et `pool`, et il est complètement
|
||||
ignoré par les commandes `smart`, `probe`, `up`, `down` et `devices`.
|
||||
|
||||
|
||||
11 PARITé (PARITY)
|
||||
13 PARITé (PARITY)
|
||||
==================
|
||||
|
||||
SnapRAID stocke les informations de parité de votre baie dans
|
||||
|
|
@ -1794,8 +1960,8 @@ Ces fichiers sont lus et écrits par les commandes `sync` et `fix` et
|
|||
lus uniquement par les commandes `scrub` et `check`.
|
||||
|
||||
|
||||
12 ENCODAGE
|
||||
===========
|
||||
14 ENCODAGE (ENCODING)
|
||||
======================
|
||||
|
||||
SnapRAID sous Unix ignore tout encodage. Il lit et stocke les
|
||||
noms de fichiers avec le même encodage utilisé par le système
|
||||
|
|
@ -1813,13 +1979,30 @@ redirigez la sortie de la console vers un fichier, le fichier
|
|||
résultant est toujours au format UTF-8.
|
||||
|
||||
|
||||
13 DROITS D'AUTEUR (COPYRIGHT)
|
||||
15 CODE DE SORTIE (EXIT CODE)
|
||||
=============================
|
||||
|
||||
SnapRAID se termine avec les codes d'erreur suivants :
|
||||
|
||||
0 - Tout est OK.
|
||||
1 - La commande a rencontré des erreurs.
|
||||
2 - La commande `diff` a trouvé que tout est OK, mais un `sync` est requis.
|
||||
|
||||
|
||||
16 TRADUCTION (TRANSLATION)
|
||||
===========================
|
||||
|
||||
Ce document est une traduction automatique du manuel en anglais.
|
||||
Veuillez vous référer au manuel en anglais pour la version officielle.
|
||||
|
||||
|
||||
17 DROITS D'AUTEUR (COPYRIGHT)
|
||||
==============================
|
||||
|
||||
Ce fichier est Copyright (C) 2025 Andrea Mazzoleni
|
||||
Ce fichier est Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
|
||||
14 VOIR AUSSI (SEE ALSO)
|
||||
18 VOIR AUSSI (SEE ALSO)
|
||||
========================
|
||||
|
||||
snapraid_log(1), snapraidd(1)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
.TH "Backup SnapRAID per Array di Dischi" 1
|
||||
.SH NAME
|
||||
snapraid \- Backup SnapRAID per Array di Dischi
|
||||
.SH SINOSSI
|
||||
.SH SINOSSI (SYNOPSIS)
|
||||
snapraid [\-c, \-\-conf CONFIG]
|
||||
.PD 0
|
||||
.PP
|
||||
|
|
@ -77,7 +77,7 @@ snapraid [\-c, \-\-conf CONFIG]
|
|||
snapraid [\-V, \-\-version] [\-H, \-\-help] [\-C, \-\-gen\-conf CONTENT]
|
||||
.PD 0
|
||||
.PD
|
||||
.SH DESCRIZIONE
|
||||
.SH DESCRIZIONE (DESCRIPTION)
|
||||
SnapRAID è un programma di backup progettato per array di dischi, che
|
||||
memorizza informazioni di parità per il recupero dati in caso di guasto
|
||||
fino a sei dischi.
|
||||
|
|
@ -106,7 +106,7 @@ I dischi possono avere dimensioni diverse.
|
|||
SnapRAID non blocca i dati; è possibile smettere di usarlo in qualsiasi
|
||||
momento senza riformattare o spostare i dati.
|
||||
.IP \(bu
|
||||
Per accedere a un file, è necessario far girare solo un singolo disco,
|
||||
Per accedere a un file, è necessario avviare la rotazione di solo un singolo disco,
|
||||
risparmiando energia e riducendo il rumore.
|
||||
.PD
|
||||
.PP
|
||||
|
|
@ -117,23 +117,34 @@ https://www.snapraid.it/
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH LIMITAZIONI
|
||||
SnapRAID è un ibrido tra un programma RAID e un programma di backup,
|
||||
che mira a combinare i migliori vantaggi di entrambi. Tuttavia, ha
|
||||
alcune limitazioni che si dovrebbero considerare prima di usarlo.
|
||||
.SH LIMITAZIONI (LIMITATIONS)
|
||||
SnapRAID è un ibrido tra un RAID e un programma di backup, con l\'obiettivo di combinare
|
||||
i migliori vantaggi di entrambi. Tuttavia, presenta alcune limitazioni che dovresti
|
||||
considerare prima di usarlo.
|
||||
.PP
|
||||
La limitazione principale è che se un disco si guasta e non si è
|
||||
effettuato un sync di recente, potrebbe non essere possibile recuperare
|
||||
completamente.
|
||||
Più specificamente, potrebbe non essere possibile recuperare fino alla
|
||||
dimensione dei file modificati o eliminati dall\'ultima operazione di sync.
|
||||
Ciò accade anche se i file modificati o eliminati non si trovano sul
|
||||
disco guasto. Questo è il motivo per cui SnapRAID è più adatto per dati
|
||||
che cambiano raramente.
|
||||
La limitazione principale è che se un disco si guasta, puoi recuperare i dati solo fino allo
|
||||
stato dell\'ultima operazione di \`sync\`. Qualsiasi dato aggiunto o modifica apportata
|
||||
dopo l\'ultimo sync sul disco guasto andrà perso.
|
||||
.PP
|
||||
D\'altra parte, i file appena aggiunti non impediscono il recupero dei
|
||||
file già esistenti. Si perderanno solo i file aggiunti di recente se si
|
||||
trovano sul disco guasto.
|
||||
Di conseguenza, SnapRAID è adatto principalmente per dati che cambiano raramente.
|
||||
.PP
|
||||
Per i dati che esistevano già all\'ultimo sync, l\'affidabilità del recupero dipende
|
||||
dall\'uso o meno dell\'opzione \`snapshot\`:
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Con il supporto snapshot (disponibile su Btrfs, ZFS, Bcachefs e NTFS),
|
||||
SnapRAID può mantenere automaticamente un\'immagine congelata dei dischi dati.
|
||||
Ciò garantisce che anche se si modificano o si eliminano file sul file system live
|
||||
durante o dopo un sync, il processo di recupero rimane coerente e affidabile.
|
||||
.PD
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Senza il supporto snapshot, eliminare o modificare file dopo un \`sync\`
|
||||
può impedire il recupero completo di altri dischi guasti. Ciò accade
|
||||
perché la parità non corrisponde più ai file modificati, anche se
|
||||
quei file non si trovano sul disco guasto. D\'altra parte, i file aggiunti di recente
|
||||
non impediscono il recupero dei file già esistenti.
|
||||
.PD
|
||||
.PP
|
||||
Altre limitazioni di SnapRAID sono:
|
||||
.PD 0
|
||||
|
|
@ -155,7 +166,7 @@ dell\'intero array di dischi.
|
|||
Vengono salvati solo nomi di file, timestamp, symlink e hardlink.
|
||||
Permessi, proprietà e attributi estesi non vengono salvati.
|
||||
.PD
|
||||
.SH INIZIARE
|
||||
.SH PRIMI PASSI (GETTING STARTED)
|
||||
Per usare SnapRAID, è necessario prima selezionare un disco nell\'array
|
||||
di dischi da dedicare alle informazioni di \`parity\` (parità). Con un
|
||||
disco per la parità, si sarà in grado di recuperare da un singolo guasto
|
||||
|
|
@ -169,7 +180,7 @@ Come dischi di parità, è necessario scegliere i dischi più grandi
|
|||
dell\'array, poiché le informazioni di parità possono crescere fino alle
|
||||
dimensioni del più grande disco dati nell\'array.
|
||||
.PP
|
||||
Questi dischi saranno dedicati alla memorizzazione dei file di \`parity\`.
|
||||
Questi dischi saranno dedicati alla memorizzazione dei file di parità.
|
||||
Non si dovrebbero memorizzare i propri dati su di essi.
|
||||
.PP
|
||||
Quindi, è necessario definire i dischi \`data\` (dati) che si desidera
|
||||
|
|
@ -184,7 +195,7 @@ Questo file contiene i dettagli del backup, inclusi tutti i checksum
|
|||
per verificarne l\'integrità.
|
||||
Il file \`content\` viene memorizzato in più copie e ogni copia deve
|
||||
essere su un disco diverso per garantire che, anche in caso di guasti
|
||||
multipli del disco, sia disponibile almeno una copia.
|
||||
multipli ai dischi, sia disponibile almeno una copia.
|
||||
.PP
|
||||
Ad esempio, supponiamo di essere interessati a un solo livello di
|
||||
protezione con parità e che i dischi si trovino in:
|
||||
|
|
@ -302,7 +313,7 @@ Quando questo comando è completato, i dati sono SICURI.
|
|||
.PP
|
||||
Ora è possibile iniziare a usare l\'array come si desidera e aggiornare
|
||||
periodicamente le informazioni di parità eseguendo il comando \`sync\`.
|
||||
.SS Scrubbing
|
||||
.SS Scrubbing (Scrubbing)
|
||||
Per controllare periodicamente i dati e la parità per gli errori, è
|
||||
possibile eseguire il comando \`scrub\`.
|
||||
.PP
|
||||
|
|
@ -317,8 +328,8 @@ durante il comando \`sync\` per verificarne l\'integrità.
|
|||
.PP
|
||||
Ogni esecuzione del comando controlla circa l\'8% dell\'array, escludendo
|
||||
i dati già sottoposti a scrub nei 10 giorni precedenti.
|
||||
È possibile utilizzare l\'opzione \-p, \-\-plan per specificare un importo
|
||||
diverso e l\'opzione \-o, \-\-older\-than per specificare un\'età diversa
|
||||
È possibile utilizzare l\'opzione \-p, \-\-plan per specificare una quantità
|
||||
diversa e l\'opzione \-o, \-\-older\-than per specificare un\'età diversa
|
||||
in giorni.
|
||||
Ad esempio, per controllare il 5% dell\'array per blocchi più vecchi di
|
||||
20 giorni, usare:
|
||||
|
|
@ -330,7 +341,7 @@ snapraid \-p 5 \-o 20 scrub
|
|||
.RE
|
||||
.PP
|
||||
Se vengono trovati errori silenti o di input/output durante il processo,
|
||||
i blocchi corrispondenti vengono contrassegnati come bad (cattivi) nel
|
||||
i blocchi corrispondenti vengono contrassegnati come \`bad\` (danneggiati) nel
|
||||
file \`content\` ed elencati nel comando \`status\`.
|
||||
.PP
|
||||
.RS 4
|
||||
|
|
@ -340,7 +351,7 @@ snapraid status
|
|||
.RE
|
||||
.PP
|
||||
Per correggerli, è possibile utilizzare il comando \`fix\`, filtrando
|
||||
i blocchi bad con l\'opzione \-e, \-\-filter\-error:
|
||||
i blocchi danneggiati con l\'opzione \-e, \-\-filter\-error:
|
||||
.PP
|
||||
.RS 4
|
||||
snapraid \-e fix
|
||||
|
|
@ -351,7 +362,7 @@ snapraid \-e fix
|
|||
Al prossimo \`scrub\`, gli errori scompariranno dal report \`status\`
|
||||
se sono stati veramente corretti. Per renderlo più veloce, è possibile
|
||||
utilizzare \-p bad per eseguire lo scrub solo dei blocchi contrassegnati
|
||||
come bad.
|
||||
come \`bad\`.
|
||||
.PP
|
||||
.RS 4
|
||||
snapraid \-p bad scrub
|
||||
|
|
@ -362,11 +373,11 @@ snapraid \-p bad scrub
|
|||
L\'esecuzione di \`scrub\` su un array non sincronizzato può riportare
|
||||
errori causati da file rimossi o modificati. Questi errori sono riportati
|
||||
nell\'output di \`scrub\`, ma i blocchi correlati non sono contrassegnati
|
||||
come bad.
|
||||
.SS Pooling
|
||||
come \`bad\`.
|
||||
.SS Pooling (Pooling)
|
||||
Nota: La funzionalità di pooling descritta di seguito è stata
|
||||
sostituita dallo strumento mergerfs, che è ora l\'opzione consigliata
|
||||
per gli utenti Linux nella comunità SnapRAID. Mergefs fornisce un modo
|
||||
per gli utenti Linux nella comunità SnapRAID. Mergerfs fornisce un modo
|
||||
più flessibile ed efficiente per raggruppare più unità in un singolo
|
||||
punto di montaggio unificato, consentendo un accesso trasparente ai
|
||||
file attraverso l\'array senza fare affidamento sui collegamenti
|
||||
|
|
@ -518,10 +529,10 @@ fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Annullamento Eliminazione
|
||||
.SS Annullamento eliminazione (Undeleting)
|
||||
SnapRAID funziona più come un programma di backup che come un sistema RAID
|
||||
e può essere utilizzato per ripristinare o annullare l\'eliminazione dei
|
||||
file al loro stato precedente utilizzando l\'opzione \-f, \-\-filter:
|
||||
e può essere utilizzato per ripristinare i file al loro stato precedente
|
||||
o annullarne l\'eliminazione utilizzando l\'opzione \-f, \-\-filter:
|
||||
.PP
|
||||
.RS 4
|
||||
snapraid fix \-f FILE
|
||||
|
|
@ -555,8 +566,8 @@ snapraid fix \-m
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Recupero
|
||||
È successo il peggio e si è perso uno o più dischi!
|
||||
.SS Recupero (Recovering)
|
||||
È successo il peggio e si sono persi uno o più dischi!
|
||||
.PP
|
||||
NON FARSI PRENDERE DAL PANICO! Sarà possibile recuperarli!
|
||||
.PP
|
||||
|
|
@ -565,7 +576,7 @@ Disabilitare qualsiasi connessione remota ad esso e qualsiasi processo
|
|||
pianificato, incluso qualsiasi sync o scrub notturno pianificato di SnapRAID.
|
||||
.PP
|
||||
Quindi procedere con i seguenti passaggi.
|
||||
.SS PASSO 1 \-> Riconfigurazione
|
||||
.SS PASSO 1 \-> Riconfigurazione (Reconfigure)
|
||||
È necessario un po\' di spazio per recuperare, idealmente su dischi di
|
||||
riserva aggiuntivi, ma un disco USB esterno o un disco remoto saranno
|
||||
sufficienti.
|
||||
|
|
@ -660,7 +671,7 @@ snapraid sync
|
|||
.RE
|
||||
.PP
|
||||
Se tutto è recuperato, questo comando è immediato.
|
||||
.SH COMANDI
|
||||
.SH COMANDI (COMMANDS)
|
||||
SnapRAID fornisce alcuni semplici comandi che consentono di:
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
|
|
@ -668,14 +679,14 @@ Stampare lo stato dell\'array \-> \`status\`
|
|||
.IP \(bu
|
||||
Controllare i dischi \-> \`smart\`, \`probe\`, \`up\`, \`down\`
|
||||
.IP \(bu
|
||||
Effettuare un backup/snapshot \-> \`sync\`
|
||||
Creare un punto di backup/recupero \-> \`sync\`
|
||||
.IP \(bu
|
||||
Controllare periodicamente i dati \-> \`scrub\`
|
||||
.IP \(bu
|
||||
Ripristinare l\'ultimo backup/snapshot \-> \`fix\`.
|
||||
Ripristinare l\'ultimo punto di backup/recupero \-> \`fix\`.
|
||||
.PD
|
||||
.PP
|
||||
I comandi devono essere scritti in minuscolo.
|
||||
I comandi devono essere scritti in lettere minuscole.
|
||||
.SS status
|
||||
Stampa un riepilogo dello stato dell\'array di dischi.
|
||||
.PP
|
||||
|
|
@ -687,7 +698,7 @@ Le informazioni presentate si riferiscono all\'ultima volta che si è
|
|||
eseguito \`sync\`. Le modifiche successive non vengono prese in
|
||||
considerazione.
|
||||
.PP
|
||||
Se sono stati rilevati blocchi bad, vengono elencati i loro numeri
|
||||
Se sono stati rilevati blocchi danneggiati, vengono elencati i loro numeri
|
||||
di blocco. Per correggerli, è possibile utilizzare il comando \`fix \-e\`.
|
||||
.PP
|
||||
Mostra anche un grafico che rappresenta l\'ultima volta che ogni blocco
|
||||
|
|
@ -748,8 +759,8 @@ Nulla viene modificato.
|
|||
.SS probe
|
||||
Stampa lo stato POWER di tutti i dischi nel sistema.
|
||||
.PP
|
||||
\`Standby\` significa che il disco non sta girando. \`Active\` significa
|
||||
che il disco sta girando.
|
||||
\`Standby\` significa che il disco non è in rotazione. \`Active\` significa
|
||||
che il disco è in rotazione.
|
||||
.PP
|
||||
Questo comando utilizza lo strumento \`smartctl\` ed è equivalente
|
||||
all\'esecuzione di \`smartctl \-n standby \-i\` su tutti i dispositivi.
|
||||
|
|
@ -760,12 +771,12 @@ possibile specificare un comando personalizzato utilizzando l\'opzione
|
|||
.PP
|
||||
Nulla viene modificato.
|
||||
.SS up
|
||||
Fa girare tutti i dischi dell\'array.
|
||||
Avvia la rotazione di tutti i dischi dell\'array.
|
||||
.PP
|
||||
È possibile far girare solo dischi specifici utilizzando l\'opzione \-d,
|
||||
È possibile avviare la rotazione di soli dischi specifici utilizzando l\'opzione \-d,
|
||||
\-\-filter\-disk.
|
||||
.PP
|
||||
Far girare tutti i dischi contemporaneamente richiede molta energia.
|
||||
Avviare la rotazione di tutti i dischi contemporaneamente richiede molta energia.
|
||||
Assicurarsi che l\'alimentatore possa sostenerlo.
|
||||
.PP
|
||||
Nulla viene modificato.
|
||||
|
|
@ -824,13 +835,13 @@ identificato, non solo il nome.
|
|||
.HP 4
|
||||
.I relocated
|
||||
File spostati sullo stesso disco o su un disco
|
||||
diverso dove l\'originale è scomparso.
|
||||
Sono identificati dall\' avere lo stesso nome, dimensione
|
||||
diverso dove l\'originale è scomparso.
|
||||
Sono identificati dall\'avere lo stesso nome, dimensione
|
||||
e timestamp.
|
||||
Se il timestamp al sottomultiplo del secondo è zero,
|
||||
il percorso completo deve corrispondere per essere
|
||||
identificato.
|
||||
A differenza dei file \`moved\` sullo stesso disco,
|
||||
A differenza dei file \'moved\' sullo stesso disco,
|
||||
i file ricollocati hanno un inode diverso.
|
||||
.HP 4
|
||||
.I restored
|
||||
|
|
@ -857,7 +868,7 @@ Alla prossima esecuzione, il processo \`sync\` riprenderà da dove
|
|||
è stato interrotto.
|
||||
.PP
|
||||
Se vengono trovati errori silenti o di input/output durante il processo,
|
||||
i blocchi corrispondenti vengono contrassegnati come bad.
|
||||
i blocchi corrispondenti vengono contrassegnati come \`bad\` (danneggiati).
|
||||
.PP
|
||||
I file sono identificati dal percorso e/o dall\'inode e controllati
|
||||
per dimensione e timestamp.
|
||||
|
|
@ -882,7 +893,7 @@ ogni tre mesi.
|
|||
.PP
|
||||
È possibile definire un piano o una quantità di scrub diversa
|
||||
utilizzando l\'opzione \-p, \-\-plan, che accetta:
|
||||
bad \- Esegue lo scrub dei blocchi contrassegnati come bad.
|
||||
bad \- Esegue lo scrub dei blocchi contrassegnati come \`bad\`.
|
||||
new \- Esegue lo scrub dei blocchi appena sincronizzati non ancora
|
||||
.PP
|
||||
.RS 4
|
||||
|
|
@ -911,41 +922,39 @@ Per ottenere i dettagli dello stato dello scrub, utilizzare il comando
|
|||
\`status\`.
|
||||
.PP
|
||||
Per qualsiasi errore silente o di input/output trovato, i blocchi
|
||||
corrispondenti vengono contrassegnati come bad nel file \`content\`.
|
||||
Questi blocchi bad sono elencati in \`status\` e possono essere corretti
|
||||
corrispondenti vengono contrassegnati come \`bad\` nel file \`content\`.
|
||||
Questi blocchi danneggiati sono elencati in \`status\` e possono essere corretti
|
||||
con \`fix \-e\`.
|
||||
Dopo la correzione, al prossimo scrub, verranno ricontrollati e, se
|
||||
trovati corretti, il contrassegno bad verrà rimosso.
|
||||
Per eseguire lo scrub solo dei blocchi bad, è possibile utilizzare
|
||||
trovati corretti, il contrassegno \`bad\` verrà rimosso.
|
||||
Per eseguire lo scrub solo dei blocchi danneggiati, è possibile utilizzare
|
||||
il comando \`scrub \-p bad\`.
|
||||
.PP
|
||||
Si consiglia di eseguire \`scrub\` solo su un array sincronizzato per
|
||||
evitare errori segnalati causati da dati non sincronizzati. Questi
|
||||
errori sono riconosciuti come non essendo errori silenti e i blocchi non
|
||||
vengono contrassegnati come bad, ma tali errori sono riportati
|
||||
vengono contrassegnati come \`bad\`, ma tali errori sono riportati
|
||||
nell\'output del comando.
|
||||
.PP
|
||||
Il file \`content\` viene modificato per aggiornare l\'ora dell\'ultimo
|
||||
controllo per ogni blocco e per contrassegnare i blocchi bad.
|
||||
controllo per ogni blocco e per contrassegnare i blocchi danneggiati.
|
||||
I file \`parity\` NON vengono modificati.
|
||||
I file nell\'array NON vengono modificati.
|
||||
.SS fix
|
||||
Corregge tutti i file e i dati di parità.
|
||||
Ripristina tutti i file e i dati di parità.
|
||||
.PP
|
||||
Tutti i file e i dati di parità vengono confrontati con lo stato
|
||||
snapshot salvato nell\'ultimo \`sync\`.
|
||||
Se viene trovata una differenza, viene ripristinata allo snapshot
|
||||
memorizzato.
|
||||
Tutti i file e i dati di parità vengono confrontati con lo stato salvato nell\'ultimo
|
||||
\`sync\`. Se viene trovata una differenza, questa viene ripristinata allo stato memorizzato.
|
||||
.PP
|
||||
ATTENZIONE! Il comando \`fix\` non differenzia tra errori e modifiche
|
||||
intenzionali. Ripristina incondizionatamente lo stato del file
|
||||
all\'ultimo \`sync\`.
|
||||
ATTENZIONE!
|
||||
Il comando \`fix\` non distingue tra errori e modifiche intenzionali.
|
||||
Ripristina incondizionatamente lo stato del file all\'ultimo \`sync\`.
|
||||
.PP
|
||||
Se non viene specificata nessun\'altra opzione, l\'intero array viene
|
||||
elaborato. Utilizzare le opzioni di filtro per selezionare un
|
||||
sottoinsieme di file o dischi su cui operare.
|
||||
.PP
|
||||
Per correggere solo i blocchi contrassegnati come bad durante \`sync\`
|
||||
Per correggere solo i blocchi contrassegnati come \`bad\` (danneggiati) durante \`sync\`
|
||||
e \`scrub\`, utilizzare l\'opzione \-e, \-\-filter\-error.
|
||||
A differenza di altre opzioni di filtro, questa applica correzioni solo
|
||||
ai file che sono invariati dall\'ultimo \`sync\`.
|
||||
|
|
@ -977,8 +986,8 @@ Questo comando è destinato principalmente alla verifica manuale,
|
|||
ad esempio dopo un processo di recupero o in altre condizioni speciali.
|
||||
Per i controlli periodici e pianificati, utilizzare \`scrub\`.
|
||||
.PP
|
||||
Se si utilizza l\'opzione \-a, \-\-audit\-only, viene controllato solo
|
||||
l\'hash dei file e i dati di parità vengono ignorati per un\'esecuzione
|
||||
Se si utilizza l\'opzione \-a, \-\-audit\-only, vengono controllati solo
|
||||
i dati dei file e i dati di parità vengono ignorati per un\'esecuzione
|
||||
più veloce.
|
||||
.PP
|
||||
I file sono identificati solo dal percorso, non dall\'inode.
|
||||
|
|
@ -1066,12 +1075,11 @@ che occupa.
|
|||
.PP
|
||||
È possibile utilizzare l\'opzione \-t, \-\-tail per limitare l\'operazione ai file
|
||||
che occupano la porzione di coda specificata della parità.
|
||||
Se si desidera riallocare questi file, è possibile utilizzare l\'opzione
|
||||
\-W, \-\-force\-realloc\-tail.
|
||||
.PP
|
||||
Si tenga presente che tali file non saranno protetti dalla parità durante
|
||||
il processo di riallocazione.
|
||||
.SH OPZIONI
|
||||
Se si desidera riallocare questi file, è possibile utilizzare l\'opzione
|
||||
\-W, \-\-force\-realloc\-tail. Si tenga presente che tali file non saranno
|
||||
protetti dalla parità durante il processo di riallocazione.
|
||||
.SH OPZIONI (OPTIONS)
|
||||
SnapRAID fornisce le seguenti opzioni:
|
||||
.TP
|
||||
.B \-c, \-\-conf CONFIG
|
||||
|
|
@ -1083,11 +1091,11 @@ directory di \`snapraid.exe\`.
|
|||
.TP
|
||||
.B \-f, \-\-filter PATTERN
|
||||
Filtra i file da elaborare in \`check\` e \`fix\`.
|
||||
Vengono elaborati solo i file che corrispondono al modello
|
||||
Vengono elaborati solo i file che corrispondono al pattern
|
||||
specificato.
|
||||
Questa opzione può essere utilizzata più volte.
|
||||
Vedere la sezione PATTERN per maggiori dettagli sulle
|
||||
specifiche del modello.
|
||||
specifiche del pattern.
|
||||
In Unix, assicurarsi che i caratteri di globbing siano citati
|
||||
se usati.
|
||||
Questa opzione può essere utilizzata solo con \`check\` e \`fix\`.
|
||||
|
|
@ -1134,7 +1142,7 @@ Seleziona il piano di scrub. Se PERC è un valore numerico da 0 a
|
|||
100, viene interpretato come la percentuale di blocchi da
|
||||
sottoporre a scrub.
|
||||
Invece di una percentuale, è possibile specificare un piano:
|
||||
\`bad\` esegue lo scrub dei blocchi bad, \`new\` esegue lo scrub
|
||||
\`bad\` esegue lo scrub dei blocchi danneggiati, \`new\` esegue lo scrub
|
||||
dei blocchi non ancora sottoposti a scrub, e \`full\` esegue lo
|
||||
scrub di tutto.
|
||||
Questa opzione può essere utilizzata solo con \`scrub\`.
|
||||
|
|
@ -1143,7 +1151,7 @@ Questa opzione può essere utilizzata solo con \`scrub\`.
|
|||
Seleziona la parte più vecchia dell\'array da elaborare in \`scrub\`.
|
||||
DAYS è l\'età minima in giorni per un blocco da sottoporre a
|
||||
scrub; il valore predefinito è 10.
|
||||
I blocchi contrassegnati come bad vengono sempre sottoposti a scrub
|
||||
I blocchi contrassegnati come \`bad\` vengono sempre sottoposti a scrub
|
||||
indipendentemente da questa opzione.
|
||||
Questa opzione può essere utilizzata solo con \`scrub\`.
|
||||
.TP
|
||||
|
|
@ -1196,9 +1204,9 @@ Applica un limite di larghezza di banda globale per tutti i dischi.
|
|||
RATE è il numero di byte al secondo. È possibile specificare un
|
||||
moltiplicatore come K, M, G o T (ad esempio, \-\-bw\-limit 1G).
|
||||
.TP
|
||||
.B \-t, \-\-tail DIMENSIONE
|
||||
.B \-t, \-\-tail SIZE
|
||||
Limita l\'elenco dei file a quelli che non utilizzano più della
|
||||
dimensione di coda specificata dei dischi di parità.
|
||||
porzione finale specificata dei dischi di parità.
|
||||
È possibile utilizzare moltiplicatori come K, M, G o T (ad es. \-\-tail 1G).
|
||||
Questa opzione è valida solo se utilizzata insieme al comando
|
||||
\`locate\`.
|
||||
|
|
@ -1307,9 +1315,9 @@ ATTENZIONE! Questa opzione è solo per esperti ed è vivamente
|
|||
sconsigliato utilizzarla.
|
||||
NON si ha protezione dei dati durante l\'operazione \`sync\`.
|
||||
.TP
|
||||
.B \-W, \-\-force\-realloc\-tail DIMENSIONE
|
||||
.B \-W, \-\-force\-realloc\-tail SIZE
|
||||
Funziona come \-R, \-\-force\-realloc, ma limitatamente alla porzione
|
||||
di coda specificata (ultimi DIMENSIONE byte) di ogni file di parità.
|
||||
di coda specificata (ultimi SIZE byte) di ogni file di parità.
|
||||
Forza la riallocazione (spostamento) di qualsiasi frammento/blocco di file
|
||||
attualmente memorizzato in quella sezione di coda, consentendo loro di essere
|
||||
posizionati ovunque nei file di parità dove sia disponibile spazio libero
|
||||
|
|
@ -1332,7 +1340,7 @@ per i file interessati.
|
|||
.B \-l, \-\-log FILE
|
||||
Scrive un log dettagliato nel file specificato.
|
||||
Se questa opzione non è specificata, gli errori imprevisti vengono
|
||||
stampati sullo schermo, potenzialmente resulting in un output
|
||||
stampati sullo schermo, potenzialmente producendo un output
|
||||
eccessivo in caso di molti errori. Quando \-l, \-\-log è specificato,
|
||||
vengono stampati sullo schermo solo gli errori fatali che
|
||||
causano l\'arresto di SnapRAID.
|
||||
|
|
@ -1396,7 +1404,7 @@ Stampa una breve schermata di aiuto.
|
|||
.TP
|
||||
.B \-V, \-\-version
|
||||
Stampa la versione del programma.
|
||||
.SH CONFIGURAZIONE
|
||||
.SH CONFIGURAZIONE (CONFIGURATION)
|
||||
SnapRAID richiede un file di configurazione per sapere dove si trova
|
||||
l\'array di dischi e dove memorizzare le informazioni di parità.
|
||||
.PP
|
||||
|
|
@ -1491,7 +1499,7 @@ essere unico. DIR è il punto di montaggio del disco nel file system.
|
|||
È possibile cambiare il punto di montaggio secondo necessità,
|
||||
purché si mantenga fisso NAME.
|
||||
.PP
|
||||
È necessario utilizzare un\'opzione per ogni disco dati nell\'array.
|
||||
Si dovrebbe utilizzare un\'opzione per ogni disco dati nell\'array.
|
||||
.PP
|
||||
È possibile rinominare un disco in seguito modificando NAME
|
||||
direttamente nel file di configurazione e quindi eseguendo un
|
||||
|
|
@ -1508,23 +1516,47 @@ il disco di avvio.
|
|||
.PP
|
||||
Si noti che tali dischi non sono influenzati dai comandi \`up\` e \`down\`
|
||||
perché si prevede che siano sempre in rotazione.
|
||||
.SS snapshot
|
||||
Abilita l\'uso degli snapshot del file system per i comandi \`sync\`, \`scrub\`,
|
||||
\`check\` e \`fix\`.
|
||||
.PP
|
||||
Quando abilitato, SnapRAID crea uno snapshot in sola lettura dei dati all\'inizio
|
||||
di un \'sync\'. Ciò garantisce una vista coerente e puntuale dei tuoi file,
|
||||
prevenendo errori causati da modifiche simultanee dei file.
|
||||
.PP
|
||||
Questo migliora significativamente il recupero: se un file viene eliminato dal file system live,
|
||||
rimane preservato nello snapshot. Ciò impedisce alla parità di diventare \[dq]corrotta\[dq]
|
||||
per quel blocco, assicurando che sia ancora possibile recuperare correttamente i dati
|
||||
se un altro disco si guasta.
|
||||
.PP
|
||||
Questa opzione si applica esclusivamente ai dischi dati formattati con i file system
|
||||
Btrfs, Bcachefs o ZFS in Linux e NTFS in Windows.
|
||||
I dischi di parità, o i dischi dati che utilizzano altri file system, utilizzeranno sempre
|
||||
la versione live del file system.
|
||||
.PP
|
||||
La creazione e l\'eliminazione degli snapshot richiedono privilegi amministrativi.
|
||||
Assicurati che SnapRAID sia eseguito con i permessi necessari (es. sudo) quando
|
||||
questa opzione è abilitata.
|
||||
.PP
|
||||
Vedere la sezione SNAPSHOTS per una spiegazione dettagliata del ciclo di vita
|
||||
degli snapshot.
|
||||
.SS nohidden
|
||||
Esclude tutti i file e le directory nascosti.
|
||||
In Unix, i file nascosti sono quelli che iniziano con \`.\`.
|
||||
In Windows, sono quelli con l\'attributo nascosto.
|
||||
.SS exclude/include PATTERN
|
||||
Definisce i modelli di file o directory da escludere o includere
|
||||
Definisce i pattern di file o directory da escludere o includere
|
||||
nel processo di sync.
|
||||
Tutti i modelli vengono elaborati nell\'ordine specificato.
|
||||
Tutti i pattern vengono elaborati nell\'ordine specificato.
|
||||
.PP
|
||||
Se il primo modello che corrisponde è un \`exclude\`, il file
|
||||
Se il primo pattern che corrisponde è un \`exclude\`, il file
|
||||
viene escluso. Se è un \`include\`, il file viene incluso.
|
||||
Se nessun modello corrisponde, il file viene escluso se l\'ultimo
|
||||
modello specificato è un \`include\`, o incluso se l\'ultimo modello
|
||||
Se nessun pattern corrisponde, il file viene escluso se l\'ultimo
|
||||
pattern specificato è un \`include\`, o incluso se l\'ultimo pattern
|
||||
specificato è un \`exclude\`.
|
||||
.PP
|
||||
Vedere la sezione PATTERN per maggiori dettagli sulle specifiche
|
||||
del modello.
|
||||
del pattern.
|
||||
.PP
|
||||
Questa opzione può essere utilizzata più volte.
|
||||
.SS blocksize SIZE_IN_KIBIBYTES
|
||||
|
|
@ -1597,33 +1629,33 @@ sistema ha memoria limitata. Come regola generale, SnapRAID
|
|||
tipicamente richiede 1 GiB di RAM per ogni 16 TB di dati nell\'array.
|
||||
.PP
|
||||
Nello specifico, per memorizzare gli hash dei dati, SnapRAID richiede
|
||||
circa $TS*(1+HS)/BS$ byte di RAM,
|
||||
dove $TS$ è la dimensione totale in byte dell\'array di dischi, $BS$ è la
|
||||
dimensione del blocco in byte e $HS$ è la dimensione dell\'hash in byte.
|
||||
circa TS*(1+HS)/BS byte di RAM,
|
||||
dove TS è la dimensione totale in byte dell\'array di dischi, BS è la
|
||||
dimensione del blocco in byte e HS è la dimensione dell\'hash in byte.
|
||||
.PP
|
||||
Ad esempio, con 8 dischi da 4 TB, una dimensione di blocco di 256 KiB
|
||||
($1 \\text{ KiB} = 1024 \\text{ byte}$) e una dimensione di hash di 16, si ottiene:
|
||||
(1 KiB = 1024 byte) e una dimensione di hash di 16, si ottiene:
|
||||
.PP
|
||||
RAM = $(8 * 4 * 10^{12}) * (1+16) / (256 * 2^{10}) = 1.93 \\text{ GiB}$
|
||||
RAM = (8 * 4 * 10^12) * (1+16) / (256 * 2^10) = 1.93 GiB
|
||||
.PD 0
|
||||
.PD
|
||||
.PP
|
||||
Passando a una dimensione di hash di 8, si ottiene:
|
||||
.PP
|
||||
RAM = $(8 * 4 * 10^{12}) * (1+8) / (256 * 2^{10}) = 1.02 \\text{ GiB}$
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (256 * 2^10) = 1.02 GiB
|
||||
.PD 0
|
||||
.PD
|
||||
.PP
|
||||
Passando a una dimensione di blocco di 512, si ottiene:
|
||||
.PP
|
||||
RAM = $(8 * 4 * 10^{12}) * (1+16) / (512 * 2^{10}) = 0.96 \\text{ GiB}$
|
||||
RAM = (8 * 4 * 10^12) * (1+16) / (512 * 2^10) = 0.96 GiB
|
||||
.PD 0
|
||||
.PD
|
||||
.PP
|
||||
Passando sia a una dimensione di hash di 8 che a una dimensione di
|
||||
Passando sia a una dimensione di hash di 8 sia a una dimensione di
|
||||
blocco di 512, si ottiene:
|
||||
.PP
|
||||
RAM = $(8 * 4 * 10^{12}) * (1+8) / (512 * 2^{10}) = 0.51 \\text{ GiB}$
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0.51 GiB
|
||||
.PD 0
|
||||
.PD
|
||||
.SS autosave SIZE_IN_GIGABYTES
|
||||
|
|
@ -1704,6 +1736,10 @@ Nelle OPTIONS specificate, la stringa \`%s\` viene sostituita dal
|
|||
nome del dispositivo. Per i controller RAID, il dispositivo è
|
||||
probabilmente fisso e potrebbe non essere necessario utilizzare \`%s\`.
|
||||
.PP
|
||||
È inoltre possibile specificare una stringa di opzioni di informazioni
|
||||
personalizzate tramite il tag \`[info: ...]\` per sostituire l\'opzione
|
||||
\`\-a\` predefinita.
|
||||
.PP
|
||||
Fare riferimento alla documentazione di smartmontools per le possibili
|
||||
opzioni:
|
||||
.PP
|
||||
|
|
@ -1720,6 +1756,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices
|
|||
Ad esempio:
|
||||
.PP
|
||||
.RS 4
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl parity \-d sat %s
|
||||
.PD 0
|
||||
.PD
|
||||
|
|
@ -1735,23 +1775,31 @@ PARITY è uno dei nomi di parità: \`parity\`, \`2\-parity\`, \`3\-parity\`,
|
|||
Il valore speciale * può essere utilizzato per ignorare l\'attributo
|
||||
su tutti i dischi.
|
||||
.PP
|
||||
Ad esempio, per ignorare l\'attributo \`Current Pending Sector Count\`
|
||||
su tutti i dischi:
|
||||
È possibile specificare più attributi separati da spazi.
|
||||
Ciascun attributo può essere specificato come un numero da 1 a 255, o come
|
||||
un nome insensibile al maiuscolo/minuscolo (ad es. \`Current_Pending_Sector\`).
|
||||
.PP
|
||||
Ad esempio, per ignorare gli attributi \`Current Pending Sector Count\` e
|
||||
\`Reallocated Sectors Count\` su tutti i dischi per numero o nome:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore * 197
|
||||
smartignore * 197 5
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.PP
|
||||
Per ignorarlo solo sul primo disco di parità:
|
||||
Per ignorarli solo sul primo disco di parità:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore parity 197
|
||||
smartignore parity 197 5
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Esempi
|
||||
.SS Esempi (Examples)
|
||||
Un esempio di configurazione tipica per Unix è:
|
||||
.PP
|
||||
.RS 4
|
||||
|
|
@ -1787,7 +1835,7 @@ exclude /tmp/
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1843,7 +1891,7 @@ exclude \\System Volume Information
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1859,6 +1907,128 @@ smartctl 2\-parity \-d areca,2/1 /dev/arcmsr0
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH SNAPSHOT (SNAPSHOTS)
|
||||
Se l\'opzione snapshot è abilitata nella configurazione, SnapRAID
|
||||
utilizza le funzionalità di snapshot del file system per garantire operazioni atomiche
|
||||
e coerenti.
|
||||
.PP
|
||||
La gestione degli snapshot è completamente automatica e trasparente.
|
||||
È possibile continuare a utilizzare SnapRAID esattamente come prima, con la
|
||||
protezione aggiuntiva fornita dagli snapshot gestiti interamente in
|
||||
background.
|
||||
.PP
|
||||
Ciò fornisce due vantaggi primari:
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I Coerenza
|
||||
I file modificati sul file system live durante un sync o uno scrub di
|
||||
lunga durata non causeranno discrepanze di parità o operazioni interrotte,
|
||||
poiché SnapRAID vede un\'immagine congelata nel tempo.
|
||||
.HP 4
|
||||
.I Recupero
|
||||
Se un file viene aggiornato o eliminato dal file system live,
|
||||
rimane preservato nello snapshot. Se si verifica un guasto al disco
|
||||
prima dell\'esecuzione del sync successivo, SnapRAID utilizza i dati preservati
|
||||
nello snapshot per ricostruire il disco guasto.
|
||||
.PD
|
||||
.PP
|
||||
.RS 4
|
||||
.PD 0
|
||||
In caso di guasto al disco durante un processo di sync attivo,
|
||||
SnapRAID è anche in grado di leggere automaticamente sia dallo snapshot
|
||||
del calcolo della parità precedente che da quello corrente.
|
||||
Ciò massimizza la probabilità di un recupero completo fornendo
|
||||
l\'accesso agli esatti blocchi di dati richiesti per risolvere
|
||||
le equazioni di parità, anche se quei blocchi sono stati modificati
|
||||
o eliminati tra i sync.
|
||||
.PD
|
||||
.PP
|
||||
.PD 0
|
||||
Senza snapshot, un file aggiornato o eliminato su un disco integro
|
||||
comporta la mancanza di blocchi di dati che potrebbero essere richiesti per
|
||||
ripristinare altri dischi guasti.
|
||||
.PD
|
||||
.RE
|
||||
.RE
|
||||
.PP
|
||||
Gli snapshot vengono creati solo per i dischi dati e solo se il file system
|
||||
sottostante supporta questa funzionalità. I dischi di parità usano sempre
|
||||
il file system live.
|
||||
.PP
|
||||
Attualmente, questo è supportato su Btrfs, Bcachefs e ZFS in Linux
|
||||
e su NTFS in Windows.
|
||||
.PP
|
||||
È possibile combinare dischi dati con file system diversi. Solo quelli che
|
||||
supportano gli snapshot li utilizzeranno, mentre gli altri dischi continueranno
|
||||
a operare direttamente sul file system live.
|
||||
.PP
|
||||
La creazione e l\'eliminazione degli snapshot richiedono privilegi amministrativi.
|
||||
Assicurati che SnapRAID sia eseguito con i permessi necessari (es. sudo)
|
||||
quando gli snapshot sono abilitati.
|
||||
.SS Comportamento dei comandi con gli snapshot (Command Behavior with Snapshots)
|
||||
I comandi \`sync\` e \`scrub\` operano entrambi esclusivamente sugli snapshot
|
||||
per garantire che tutte le operazioni sui dati siano eseguite rispetto a uno stato coerente
|
||||
e congelato. Utilizzando questi snapshot, SnapRAID previene le discrepanze di parità
|
||||
che verrebbero altrimenti innescate da modifiche simultanee dei file sul file system live.
|
||||
Durante un \`sync\`, il comando utilizza un nuovo snapshot creato all\'inizio
|
||||
del processo per catturare lo stato corrente per il calcolo della parità.
|
||||
Al contrario, il comando \`scrub\` utilizza l\'ultimo snapshot, quello
|
||||
creato durante il sync più recente, per mantenere un punto di riferimento affidabile
|
||||
che corrisponda alla parità esistente.
|
||||
.PP
|
||||
Per i comandi \`check\` e \`fix\`, l\'uso dell\'ultimo snapshot
|
||||
dipende dal fatto che vengano presi di mira dischi specifici utilizzando l\'opzione
|
||||
\-d, \-\-filter\-disk.
|
||||
.PP
|
||||
Un disco esplicitamente selezionato tramite \-d (il \[dq]target\[dq] dell\'operazione)
|
||||
utilizza sempre il file system live. Per \`fix\`, questo consente di ripristinare
|
||||
i dati sul disco sostitutivo attivo. Per \`check\`, consente di simulare
|
||||
l\'operazione \`fix\` nelle stesse condizioni.
|
||||
.PP
|
||||
Tutti gli altri dischi dati (i dischi di \[dq]riferimento\[dq]) verranno acceduti tramite
|
||||
i loro snapshot. Ciò garantisce che anche se si stanno modificando file
|
||||
sui dischi integri mentre è in corso un recupero, SnapRAID
|
||||
ha un riferimento stabile e congelato per risolvere le equazioni di parità.
|
||||
.PP
|
||||
Se non viene fornita alcuna opzione \-d, SnapRAID assume che l\'operazione si applichi
|
||||
all\'intero array; in questo caso, \`check\` e \`fix\` utilizzeranno esclusivamente
|
||||
i file system live.
|
||||
.PP
|
||||
Tutti gli altri comandi operano esclusivamente sul file system live.
|
||||
.SH CICLO DI VITA DEGLI SNAPSHOT (SNAPSHOTS LIFECYCLE)
|
||||
SnapRAID gestisce due snapshot specifici, \`stable\` e \`pending\`,
|
||||
all\'interno di una directory nascosta alla radice di ogni sottovolume dati.
|
||||
In Btrfs, Bcachefs e NTFS viene utilizzata la directory \`.snapraid/\`,
|
||||
in ZFS quella standard \`.zfs/snapshot/\`.
|
||||
.PP
|
||||
Lo snapshot \`stable\` rappresenta lo stato dell\'ultimo
|
||||
\`sync\` completato con successo, contenente gli esatti dati utilizzati per
|
||||
computare la parità corrente. Funge da fonte di dati primaria
|
||||
per i comandi \`scrub\`, \`check\` e \`fix\`.
|
||||
.PP
|
||||
Lo snapshot \`pending\` è un\'immagine temporanea creata all\'inizio
|
||||
di un \`sync\` per fornire uno stato congelato per il calcolo della parità.
|
||||
Al completamento con successo dell\'operazione, il precedente snapshot \`stable\`
|
||||
viene eliminato e lo snapshot \`pending\` viene promosso per
|
||||
prendere il suo posto come nuovo riferimento stabile.
|
||||
.PP
|
||||
Se un \`sync\` viene interrotto, lo snapshot \`pending\` viene preservato.
|
||||
I successivi comandi \`scrub\`, \`check\` e \`fix\` utilizzeranno questo
|
||||
snapshot in sospeso poiché corrisponde allo stato del file system registrato nel
|
||||
file .content, anche se la parità è sincronizzata solo parzialmente.
|
||||
.PP
|
||||
In caso di interruzione del \`sync\`, anche i comandi \`check\` e \`fix\`
|
||||
leggono dallo snapshot \`stable\` per recuperare i blocchi di dati
|
||||
da file che sono stati aggiornati o eliminati durante il sync.
|
||||
Ciò è possibile perché il file .content conserva i metadati per
|
||||
tutti i file modificati o eliminati durante l\'intero processo di sync.
|
||||
Queste informazioni storiche vengono cancellate solo al termine di un sync
|
||||
avvenuto con successo e quando viene salvata la versione finale del file .content.
|
||||
.PP
|
||||
Se un \`sync\` viene riavviato dopo un\'interruzione, lo snapshot pending esistente
|
||||
viene eliminato e ne viene creato uno nuovo per
|
||||
acquisire lo stato corrente del file system live.
|
||||
.SH PATTERN
|
||||
I pattern offrono un modo flessibile per filtrare i file da includere o
|
||||
escludere. Usando i caratteri globbing, è possibile definire regole che
|
||||
|
|
@ -2050,7 +2220,7 @@ snapraid \-f \[dq]*.mp3\[dq] check
|
|||
.PP
|
||||
In Unix, quando si utilizzano caratteri di globbing sulla riga di
|
||||
comando, è necessario citarli per impedire alla shell di espanderli.
|
||||
.SH IGNORE FILE
|
||||
.SH FILE DA IGNORARE (IGNORE FILE)
|
||||
In aggiunta alle regole globali nel file di configurazione, è possibile
|
||||
inserire file \`.snapraidignore\` in qualsiasi directory all\'interno dell\'array
|
||||
per definire regole di esclusione decentralizzate.
|
||||
|
|
@ -2062,7 +2232,7 @@ configurazione globale. In pratica, se una regola locale corrisponde, il file vi
|
|||
escluso indipendentemente dalle impostazioni di inclusione globali.
|
||||
.PP
|
||||
La logica dei pattern in \`.snapraidignore\` rispecchia la configurazione globale
|
||||
ma ancora i pattern alla directory in cui si trova il file:
|
||||
ma vincola i pattern alla directory in cui si trova il file:
|
||||
.TP
|
||||
.B FILE
|
||||
Seleziona qualsiasi file chiamato FILE in questa directory o sotto di essa.
|
||||
|
|
@ -2110,15 +2280,17 @@ build/
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH CONTENT
|
||||
.SH CONTENUTO (CONTENT)
|
||||
SnapRAID memorizza l\'elenco e i checksum dei file nel file di contenuto.
|
||||
.PP
|
||||
È un file binario che elenca tutti i file presenti nell\'array di dischi,
|
||||
insieme a tutti i checksum per verificarne l\'integrità.
|
||||
.PP
|
||||
Questo file viene letto e scritto dai comandi \`sync\` e \`scrub\` e
|
||||
letto dai comandi \`fix\`, \`check\` e \`status\`.
|
||||
.SH PARITY
|
||||
Il file di contenuto viene letto e scritto dai comandi \`sync\`, \`scrub\`,
|
||||
\`touch\` e \`rehash\`. Viene letto dai comandi \`status\`, \`diff\`, \`check\`,
|
||||
\`fix\`, \`list\`, \`dup\`, \`locate\` e \`pool\`, e viene completamente ignorato
|
||||
dai comandi \`smart\`, \`probe\`, \`up\`, \`down\` e \`devices\`.
|
||||
.SH PARITà (PARITY)
|
||||
SnapRAID memorizza le informazioni di parità dell\'array nei file di
|
||||
parità.
|
||||
.PP
|
||||
|
|
@ -2127,7 +2299,7 @@ blocchi definiti nel file \`content\`.
|
|||
.PP
|
||||
Questi file vengono letti e scritti dai comandi \`sync\` e \`fix\` e
|
||||
solo letti dai comandi \`scrub\` e \`check\`.
|
||||
.SH CODIFICA
|
||||
.SH CODIFICA (ENCODING)
|
||||
SnapRAID in Unix ignora qualsiasi codifica. Legge e memorizza i
|
||||
nomi dei file con la stessa codifica utilizzata dal file system.
|
||||
.PP
|
||||
|
|
@ -2141,7 +2313,25 @@ della console.
|
|||
Questo influisce solo sui nomi dei file stampati; se si
|
||||
reindirizza l\'output della console a un file, il file risultante è
|
||||
sempre in formato UTF\-8.
|
||||
.SH CODICE DI USCITA (EXIT CODE)
|
||||
SnapRAID termina con i seguenti codici di errore:
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I 0
|
||||
Tutto OK.
|
||||
.HP 4
|
||||
.I 1
|
||||
Il comando ha riscontrato alcuni errori.
|
||||
.HP 4
|
||||
.I 2
|
||||
Il comando \`diff\` ha rilevato che tutto è OK, ma è necessario un \`sync\`.
|
||||
.PD
|
||||
.RE
|
||||
.SH TRADUZIONE (TRANSLATION)
|
||||
Questo documento è una traduzione automatica del manuale in inglese.
|
||||
Fare riferimento al manuale in inglese per la versione ufficiale.
|
||||
.SH COPYRIGHT
|
||||
Questo file è Copyright (C) 2025 Andrea Mazzoleni
|
||||
.SH VEDI ANCHE
|
||||
snapraid_log(1), snapraidd(1)
|
||||
Questo file è Copyright (C) 2026 Andrea Mazzoleni
|
||||
.SH VEDI ANCHE (SEE ALSO)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
Name{number}
|
||||
snapraid - Backup SnapRAID per Array di Dischi
|
||||
|
||||
Sinossi
|
||||
Sinossi (Synopsis)
|
||||
:snapraid [-c, --conf CONFIG]
|
||||
: [-f, --filter PATTERN] [-d, --filter-disk NAME]
|
||||
: [-m, --filter-missing] [-e, --filter-error]
|
||||
|
|
@ -23,7 +23,7 @@ Sinossi
|
|||
|
||||
:snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
Descrizione
|
||||
Descrizione (Description)
|
||||
SnapRAID è un programma di backup progettato per array di dischi, che
|
||||
memorizza informazioni di parità per il recupero dati in caso di guasto
|
||||
fino a sei dischi.
|
||||
|
|
@ -44,30 +44,37 @@ Descrizione
|
|||
* È possibile aggiungere dischi in qualsiasi momento.
|
||||
* SnapRAID non blocca i dati; è possibile smettere di usarlo in qualsiasi
|
||||
momento senza riformattare o spostare i dati.
|
||||
* Per accedere a un file, è necessario far girare solo un singolo disco,
|
||||
* Per accedere a un file, è necessario avviare la rotazione di solo un singolo disco,
|
||||
risparmiando energia e riducendo il rumore.
|
||||
|
||||
Per maggiori informazioni, si prega di visitare il sito ufficiale SnapRAID:
|
||||
|
||||
:https://www.snapraid.it/
|
||||
|
||||
Limitazioni
|
||||
SnapRAID è un ibrido tra un programma RAID e un programma di backup,
|
||||
che mira a combinare i migliori vantaggi di entrambi. Tuttavia, ha
|
||||
alcune limitazioni che si dovrebbero considerare prima di usarlo.
|
||||
Limitazioni (Limitations)
|
||||
SnapRAID è un ibrido tra un RAID e un programma di backup, con l'obiettivo di combinare
|
||||
i migliori vantaggi di entrambi. Tuttavia, presenta alcune limitazioni che dovresti
|
||||
considerare prima di usarlo.
|
||||
|
||||
La limitazione principale è che se un disco si guasta e non si è
|
||||
effettuato un sync di recente, potrebbe non essere possibile recuperare
|
||||
completamente.
|
||||
Più specificamente, potrebbe non essere possibile recuperare fino alla
|
||||
dimensione dei file modificati o eliminati dall'ultima operazione di sync.
|
||||
Ciò accade anche se i file modificati o eliminati non si trovano sul
|
||||
disco guasto. Questo è il motivo per cui SnapRAID è più adatto per dati
|
||||
che cambiano raramente.
|
||||
La limitazione principale è che se un disco si guasta, puoi recuperare i dati solo fino allo
|
||||
stato dell'ultima operazione di `sync`. Qualsiasi dato aggiunto o modifica apportata
|
||||
dopo l'ultimo sync sul disco guasto andrà perso.
|
||||
|
||||
D'altra parte, i file appena aggiunti non impediscono il recupero dei
|
||||
file già esistenti. Si perderanno solo i file aggiunti di recente se si
|
||||
trovano sul disco guasto.
|
||||
Di conseguenza, SnapRAID è adatto principalmente per dati che cambiano raramente.
|
||||
|
||||
Per i dati che esistevano già all'ultimo sync, l'affidabilità del recupero dipende
|
||||
dall'uso o meno dell'opzione `snapshot`:
|
||||
|
||||
* Con il supporto snapshot (disponibile su Btrfs, ZFS, Bcachefs e NTFS),
|
||||
SnapRAID può mantenere automaticamente un'immagine congelata dei dischi dati.
|
||||
Ciò garantisce che anche se si modificano o si eliminano file sul file system live
|
||||
durante o dopo un sync, il processo di recupero rimane coerente e affidabile.
|
||||
|
||||
* Senza il supporto snapshot, eliminare o modificare file dopo un `sync`
|
||||
può impedire il recupero completo di altri dischi guasti. Ciò accade
|
||||
perché la parità non corrisponde più ai file modificati, anche se
|
||||
quei file non si trovano sul disco guasto. D'altra parte, i file aggiunti di recente
|
||||
non impediscono il recupero dei file già esistenti.
|
||||
|
||||
Altre limitazioni di SnapRAID sono:
|
||||
|
||||
|
|
@ -84,7 +91,7 @@ Limitazioni
|
|||
* Vengono salvati solo nomi di file, timestamp, symlink e hardlink.
|
||||
Permessi, proprietà e attributi estesi non vengono salvati.
|
||||
|
||||
Iniziare
|
||||
Primi passi (Getting Started)
|
||||
Per usare SnapRAID, è necessario prima selezionare un disco nell'array
|
||||
di dischi da dedicare alle informazioni di `parity` (parità). Con un
|
||||
disco per la parità, si sarà in grado di recuperare da un singolo guasto
|
||||
|
|
@ -98,7 +105,7 @@ Iniziare
|
|||
dell'array, poiché le informazioni di parità possono crescere fino alle
|
||||
dimensioni del più grande disco dati nell'array.
|
||||
|
||||
Questi dischi saranno dedicati alla memorizzazione dei file di `parity`.
|
||||
Questi dischi saranno dedicati alla memorizzazione dei file di parità.
|
||||
Non si dovrebbero memorizzare i propri dati su di essi.
|
||||
|
||||
Quindi, è necessario definire i dischi `data` (dati) che si desidera
|
||||
|
|
@ -113,7 +120,7 @@ Iniziare
|
|||
per verificarne l'integrità.
|
||||
Il file `content` viene memorizzato in più copie e ogni copia deve
|
||||
essere su un disco diverso per garantire che, anche in caso di guasti
|
||||
multipli del disco, sia disponibile almeno una copia.
|
||||
multipli ai dischi, sia disponibile almeno una copia.
|
||||
|
||||
Ad esempio, supponiamo di essere interessati a un solo livello di
|
||||
protezione con parità e che i dischi si trovino in:
|
||||
|
|
@ -167,7 +174,7 @@ Iniziare
|
|||
Ora è possibile iniziare a usare l'array come si desidera e aggiornare
|
||||
periodicamente le informazioni di parità eseguendo il comando `sync`.
|
||||
|
||||
Scrubbing
|
||||
Scrubbing (Scrubbing)
|
||||
Per controllare periodicamente i dati e la parità per gli errori, è
|
||||
possibile eseguire il comando `scrub`.
|
||||
|
||||
|
|
@ -178,8 +185,8 @@ Iniziare
|
|||
|
||||
Ogni esecuzione del comando controlla circa l'8% dell'array, escludendo
|
||||
i dati già sottoposti a scrub nei 10 giorni precedenti.
|
||||
È possibile utilizzare l'opzione -p, --plan per specificare un importo
|
||||
diverso e l'opzione -o, --older-than per specificare un'età diversa
|
||||
È possibile utilizzare l'opzione -p, --plan per specificare una quantità
|
||||
diversa e l'opzione -o, --older-than per specificare un'età diversa
|
||||
in giorni.
|
||||
Ad esempio, per controllare il 5% dell'array per blocchi più vecchi di
|
||||
20 giorni, usare:
|
||||
|
|
@ -187,32 +194,32 @@ Iniziare
|
|||
:snapraid -p 5 -o 20 scrub
|
||||
|
||||
Se vengono trovati errori silenti o di input/output durante il processo,
|
||||
i blocchi corrispondenti vengono contrassegnati come bad (cattivi) nel
|
||||
i blocchi corrispondenti vengono contrassegnati come `bad` (danneggiati) nel
|
||||
file `content` ed elencati nel comando `status`.
|
||||
|
||||
:snapraid status
|
||||
|
||||
Per correggerli, è possibile utilizzare il comando `fix`, filtrando
|
||||
i blocchi bad con l'opzione -e, --filter-error:
|
||||
i blocchi danneggiati con l'opzione -e, --filter-error:
|
||||
|
||||
:snapraid -e fix
|
||||
|
||||
Al prossimo `scrub`, gli errori scompariranno dal report `status`
|
||||
se sono stati veramente corretti. Per renderlo più veloce, è possibile
|
||||
utilizzare -p bad per eseguire lo scrub solo dei blocchi contrassegnati
|
||||
come bad.
|
||||
come `bad`.
|
||||
|
||||
:snapraid -p bad scrub
|
||||
|
||||
L'esecuzione di `scrub` su un array non sincronizzato può riportare
|
||||
errori causati da file rimossi o modificati. Questi errori sono riportati
|
||||
nell'output di `scrub`, ma i blocchi correlati non sono contrassegnati
|
||||
come bad.
|
||||
come `bad`.
|
||||
|
||||
Pooling
|
||||
Pooling (Pooling)
|
||||
Nota: La funzionalità di pooling descritta di seguito è stata
|
||||
sostituita dallo strumento mergerfs, che è ora l'opzione consigliata
|
||||
per gli utenti Linux nella comunità SnapRAID. Mergefs fornisce un modo
|
||||
per gli utenti Linux nella comunità SnapRAID. Mergerfs fornisce un modo
|
||||
più flessibile ed efficiente per raggruppare più unità in un singolo
|
||||
punto di montaggio unificato, consentendo un accesso trasparente ai
|
||||
file attraverso l'array senza fare affidamento sui collegamenti
|
||||
|
|
@ -288,10 +295,10 @@ Iniziare
|
|||
|
||||
:fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
||||
|
||||
Annullamento Eliminazione
|
||||
Annullamento eliminazione (Undeleting)
|
||||
SnapRAID funziona più come un programma di backup che come un sistema RAID
|
||||
e può essere utilizzato per ripristinare o annullare l'eliminazione dei
|
||||
file al loro stato precedente utilizzando l'opzione -f, --filter:
|
||||
e può essere utilizzato per ripristinare i file al loro stato precedente
|
||||
o annullarne l'eliminazione utilizzando l'opzione -f, --filter:
|
||||
|
||||
:snapraid fix -f FILE
|
||||
|
||||
|
|
@ -310,8 +317,8 @@ Iniziare
|
|||
|
||||
:snapraid fix -m
|
||||
|
||||
Recupero
|
||||
È successo il peggio e si è perso uno o più dischi!
|
||||
Recupero (Recovering)
|
||||
È successo il peggio e si sono persi uno o più dischi!
|
||||
|
||||
NON FARSI PRENDERE DAL PANICO! Sarà possibile recuperarli!
|
||||
|
||||
|
|
@ -321,7 +328,7 @@ Iniziare
|
|||
|
||||
Quindi procedere con i seguenti passaggi.
|
||||
|
||||
PASSO 1 -> Riconfigurazione
|
||||
PASSO 1 -> Riconfigurazione (Reconfigure)
|
||||
È necessario un po' di spazio per recuperare, idealmente su dischi di
|
||||
riserva aggiuntivi, ma un disco USB esterno o un disco remoto saranno
|
||||
sufficienti.
|
||||
|
|
@ -400,16 +407,16 @@ Iniziare
|
|||
|
||||
Se tutto è recuperato, questo comando è immediato.
|
||||
|
||||
Comandi
|
||||
Comandi (Commands)
|
||||
SnapRAID fornisce alcuni semplici comandi che consentono di:
|
||||
|
||||
* Stampare lo stato dell'array -> `status`
|
||||
* Controllare i dischi -> `smart`, `probe`, `up`, `down`
|
||||
* Effettuare un backup/snapshot -> `sync`
|
||||
* Creare un punto di backup/recupero -> `sync`
|
||||
* Controllare periodicamente i dati -> `scrub`
|
||||
* Ripristinare l'ultimo backup/snapshot -> `fix`.
|
||||
* Ripristinare l'ultimo punto di backup/recupero -> `fix`.
|
||||
|
||||
I comandi devono essere scritti in minuscolo.
|
||||
I comandi devono essere scritti in lettere minuscole.
|
||||
|
||||
status
|
||||
Stampa un riepilogo dello stato dell'array di dischi.
|
||||
|
|
@ -422,7 +429,7 @@ Comandi
|
|||
eseguito `sync`. Le modifiche successive non vengono prese in
|
||||
considerazione.
|
||||
|
||||
Se sono stati rilevati blocchi bad, vengono elencati i loro numeri
|
||||
Se sono stati rilevati blocchi danneggiati, vengono elencati i loro numeri
|
||||
di blocco. Per correggerli, è possibile utilizzare il comando `fix -e`.
|
||||
|
||||
Mostra anche un grafico che rappresenta l'ultima volta che ogni blocco
|
||||
|
|
@ -471,8 +478,8 @@ Comandi
|
|||
probe
|
||||
Stampa lo stato POWER di tutti i dischi nel sistema.
|
||||
|
||||
`Standby` significa che il disco non sta girando. `Active` significa
|
||||
che il disco sta girando.
|
||||
`Standby` significa che il disco non è in rotazione. `Active` significa
|
||||
che il disco è in rotazione.
|
||||
|
||||
Questo comando utilizza lo strumento `smartctl` ed è equivalente
|
||||
all'esecuzione di `smartctl -n standby -i` su tutti i dispositivi.
|
||||
|
|
@ -484,12 +491,12 @@ Comandi
|
|||
Nulla viene modificato.
|
||||
|
||||
up
|
||||
Fa girare tutti i dischi dell'array.
|
||||
Avvia la rotazione di tutti i dischi dell'array.
|
||||
|
||||
È possibile far girare solo dischi specifici utilizzando l'opzione -d,
|
||||
È possibile avviare la rotazione di soli dischi specifici utilizzando l'opzione -d,
|
||||
--filter-disk.
|
||||
|
||||
Far girare tutti i dischi contemporaneamente richiede molta energia.
|
||||
Avviare la rotazione di tutti i dischi contemporaneamente richiede molta energia.
|
||||
Assicurarsi che l'alimentatore possa sostenerlo.
|
||||
|
||||
Nulla viene modificato.
|
||||
|
|
@ -534,13 +541,13 @@ Comandi
|
|||
il percorso completo deve corrispondere per essere
|
||||
identificato, non solo il nome.
|
||||
relocated - File spostati sullo stesso disco o su un disco
|
||||
diverso dove l'originale è scomparso.
|
||||
Sono identificati dall' avere lo stesso nome, dimensione
|
||||
diverso dove l'originale è scomparso.
|
||||
Sono identificati dall'avere lo stesso nome, dimensione
|
||||
e timestamp.
|
||||
Se il timestamp al sottomultiplo del secondo è zero,
|
||||
il percorso completo deve corrispondere per essere
|
||||
identificato.
|
||||
A differenza dei file `moved` sullo stesso disco,
|
||||
A differenza dei file 'moved' sullo stesso disco,
|
||||
i file ricollocati hanno un inode diverso.
|
||||
restored - File con un inode diverso ma directory,
|
||||
nome, dimensione e timestamp corrispondenti.
|
||||
|
|
@ -564,7 +571,7 @@ Comandi
|
|||
è stato interrotto.
|
||||
|
||||
Se vengono trovati errori silenti o di input/output durante il processo,
|
||||
i blocchi corrispondenti vengono contrassegnati come bad.
|
||||
i blocchi corrispondenti vengono contrassegnati come `bad` (danneggiati).
|
||||
|
||||
I file sono identificati dal percorso e/o dall'inode e controllati
|
||||
per dimensione e timestamp.
|
||||
|
|
@ -590,7 +597,7 @@ Comandi
|
|||
|
||||
È possibile definire un piano o una quantità di scrub diversa
|
||||
utilizzando l'opzione -p, --plan, che accetta:
|
||||
bad - Esegue lo scrub dei blocchi contrassegnati come bad.
|
||||
bad - Esegue lo scrub dei blocchi contrassegnati come `bad`.
|
||||
new - Esegue lo scrub dei blocchi appena sincronizzati non ancora
|
||||
sottoposti a scrub.
|
||||
full - Esegue lo scrub di tutto.
|
||||
|
|
@ -608,42 +615,40 @@ Comandi
|
|||
`status`.
|
||||
|
||||
Per qualsiasi errore silente o di input/output trovato, i blocchi
|
||||
corrispondenti vengono contrassegnati come bad nel file `content`.
|
||||
Questi blocchi bad sono elencati in `status` e possono essere corretti
|
||||
corrispondenti vengono contrassegnati come `bad` nel file `content`.
|
||||
Questi blocchi danneggiati sono elencati in `status` e possono essere corretti
|
||||
con `fix -e`.
|
||||
Dopo la correzione, al prossimo scrub, verranno ricontrollati e, se
|
||||
trovati corretti, il contrassegno bad verrà rimosso.
|
||||
Per eseguire lo scrub solo dei blocchi bad, è possibile utilizzare
|
||||
trovati corretti, il contrassegno `bad` verrà rimosso.
|
||||
Per eseguire lo scrub solo dei blocchi danneggiati, è possibile utilizzare
|
||||
il comando `scrub -p bad`.
|
||||
|
||||
Si consiglia di eseguire `scrub` solo su un array sincronizzato per
|
||||
evitare errori segnalati causati da dati non sincronizzati. Questi
|
||||
errori sono riconosciuti come non essendo errori silenti e i blocchi non
|
||||
vengono contrassegnati come bad, ma tali errori sono riportati
|
||||
vengono contrassegnati come `bad`, ma tali errori sono riportati
|
||||
nell'output del comando.
|
||||
|
||||
Il file `content` viene modificato per aggiornare l'ora dell'ultimo
|
||||
controllo per ogni blocco e per contrassegnare i blocchi bad.
|
||||
controllo per ogni blocco e per contrassegnare i blocchi danneggiati.
|
||||
I file `parity` NON vengono modificati.
|
||||
I file nell'array NON vengono modificati.
|
||||
|
||||
fix
|
||||
Corregge tutti i file e i dati di parità.
|
||||
Ripristina tutti i file e i dati di parità.
|
||||
|
||||
Tutti i file e i dati di parità vengono confrontati con lo stato
|
||||
snapshot salvato nell'ultimo `sync`.
|
||||
Se viene trovata una differenza, viene ripristinata allo snapshot
|
||||
memorizzato.
|
||||
Tutti i file e i dati di parità vengono confrontati con lo stato salvato nell'ultimo
|
||||
`sync`. Se viene trovata una differenza, questa viene ripristinata allo stato memorizzato.
|
||||
|
||||
ATTENZIONE! Il comando `fix` non differenzia tra errori e modifiche
|
||||
intenzionali. Ripristina incondizionatamente lo stato del file
|
||||
all'ultimo `sync`.
|
||||
ATTENZIONE!
|
||||
Il comando `fix` non distingue tra errori e modifiche intenzionali.
|
||||
Ripristina incondizionatamente lo stato del file all'ultimo `sync`.
|
||||
|
||||
Se non viene specificata nessun'altra opzione, l'intero array viene
|
||||
elaborato. Utilizzare le opzioni di filtro per selezionare un
|
||||
sottoinsieme di file o dischi su cui operare.
|
||||
|
||||
Per correggere solo i blocchi contrassegnati come bad durante `sync`
|
||||
Per correggere solo i blocchi contrassegnati come `bad` (danneggiati) durante `sync`
|
||||
e `scrub`, utilizzare l'opzione -e, --filter-error.
|
||||
A differenza di altre opzioni di filtro, questa applica correzioni solo
|
||||
ai file che sono invariati dall'ultimo `sync`.
|
||||
|
|
@ -676,8 +681,8 @@ Comandi
|
|||
ad esempio dopo un processo di recupero o in altre condizioni speciali.
|
||||
Per i controlli periodici e pianificati, utilizzare `scrub`.
|
||||
|
||||
Se si utilizza l'opzione -a, --audit-only, viene controllato solo
|
||||
l'hash dei file e i dati di parità vengono ignorati per un'esecuzione
|
||||
Se si utilizza l'opzione -a, --audit-only, vengono controllati solo
|
||||
i dati dei file e i dati di parità vengono ignorati per un'esecuzione
|
||||
più veloce.
|
||||
|
||||
I file sono identificati solo dal percorso, non dall'inode.
|
||||
|
|
@ -772,13 +777,12 @@ Comandi
|
|||
|
||||
È possibile utilizzare l'opzione -t, --tail per limitare l'operazione ai file
|
||||
che occupano la porzione di coda specificata della parità.
|
||||
|
||||
Se si desidera riallocare questi file, è possibile utilizzare l'opzione
|
||||
-W, --force-realloc-tail.
|
||||
-W, --force-realloc-tail. Si tenga presente che tali file non saranno
|
||||
protetti dalla parità durante il processo di riallocazione.
|
||||
|
||||
Si tenga presente che tali file non saranno protetti dalla parità durante
|
||||
il processo di riallocazione.
|
||||
|
||||
Opzioni
|
||||
Opzioni (Options)
|
||||
SnapRAID fornisce le seguenti opzioni:
|
||||
|
||||
-c, --conf CONFIG
|
||||
|
|
@ -790,11 +794,11 @@ Opzioni
|
|||
|
||||
-f, --filter PATTERN
|
||||
Filtra i file da elaborare in `check` e `fix`.
|
||||
Vengono elaborati solo i file che corrispondono al modello
|
||||
Vengono elaborati solo i file che corrispondono al pattern
|
||||
specificato.
|
||||
Questa opzione può essere utilizzata più volte.
|
||||
Vedere la sezione PATTERN per maggiori dettagli sulle
|
||||
specifiche del modello.
|
||||
specifiche del pattern.
|
||||
In Unix, assicurarsi che i caratteri di globbing siano citati
|
||||
se usati.
|
||||
Questa opzione può essere utilizzata solo con `check` e `fix`.
|
||||
|
|
@ -841,7 +845,7 @@ Opzioni
|
|||
100, viene interpretato come la percentuale di blocchi da
|
||||
sottoporre a scrub.
|
||||
Invece di una percentuale, è possibile specificare un piano:
|
||||
`bad` esegue lo scrub dei blocchi bad, `new` esegue lo scrub
|
||||
`bad` esegue lo scrub dei blocchi danneggiati, `new` esegue lo scrub
|
||||
dei blocchi non ancora sottoposti a scrub, e `full` esegue lo
|
||||
scrub di tutto.
|
||||
Questa opzione può essere utilizzata solo con `scrub`.
|
||||
|
|
@ -850,7 +854,7 @@ Opzioni
|
|||
Seleziona la parte più vecchia dell'array da elaborare in `scrub`.
|
||||
DAYS è l'età minima in giorni per un blocco da sottoporre a
|
||||
scrub; il valore predefinito è 10.
|
||||
I blocchi contrassegnati come bad vengono sempre sottoposti a scrub
|
||||
I blocchi contrassegnati come `bad` vengono sempre sottoposti a scrub
|
||||
indipendentemente da questa opzione.
|
||||
Questa opzione può essere utilizzata solo con `scrub`.
|
||||
|
||||
|
|
@ -903,9 +907,9 @@ Opzioni
|
|||
RATE è il numero di byte al secondo. È possibile specificare un
|
||||
moltiplicatore come K, M, G o T (ad esempio, --bw-limit 1G).
|
||||
|
||||
-t, --tail DIMENSIONE
|
||||
-t, --tail SIZE
|
||||
Limita l'elenco dei file a quelli che non utilizzano più della
|
||||
dimensione di coda specificata dei dischi di parità.
|
||||
porzione finale specificata dei dischi di parità.
|
||||
È possibile utilizzare moltiplicatori come K, M, G o T (ad es. --tail 1G).
|
||||
Questa opzione è valida solo se utilizzata insieme al comando
|
||||
`locate`.
|
||||
|
|
@ -1014,9 +1018,9 @@ Opzioni
|
|||
sconsigliato utilizzarla.
|
||||
NON si ha protezione dei dati durante l'operazione `sync`.
|
||||
|
||||
-W, --force-realloc-tail DIMENSIONE
|
||||
-W, --force-realloc-tail SIZE
|
||||
Funziona come -R, --force-realloc, ma limitatamente alla porzione
|
||||
di coda specificata (ultimi DIMENSIONE byte) di ogni file di parità.
|
||||
di coda specificata (ultimi SIZE byte) di ogni file di parità.
|
||||
Forza la riallocazione (spostamento) di qualsiasi frammento/blocco di file
|
||||
attualmente memorizzato in quella sezione di coda, consentendo loro di essere
|
||||
posizionati ovunque nei file di parità dove sia disponibile spazio libero
|
||||
|
|
@ -1039,7 +1043,7 @@ Opzioni
|
|||
-l, --log FILE
|
||||
Scrive un log dettagliato nel file specificato.
|
||||
Se questa opzione non è specificata, gli errori imprevisti vengono
|
||||
stampati sullo schermo, potenzialmente resulting in un output
|
||||
stampati sullo schermo, potenzialmente producendo un output
|
||||
eccessivo in caso di molti errori. Quando -l, --log è specificato,
|
||||
vengono stampati sullo schermo solo gli errori fatali che
|
||||
causano l'arresto di SnapRAID.
|
||||
|
|
@ -1104,7 +1108,7 @@ Opzioni
|
|||
-V, --version
|
||||
Stampa la versione del programma.
|
||||
|
||||
Configurazione
|
||||
Configurazione (Configuration)
|
||||
SnapRAID richiede un file di configurazione per sapere dove si trova
|
||||
l'array di dischi e dove memorizzare le informazioni di parità.
|
||||
|
||||
|
|
@ -1198,7 +1202,7 @@ Configurazione
|
|||
È possibile cambiare il punto di montaggio secondo necessità,
|
||||
purché si mantenga fisso NAME.
|
||||
|
||||
È necessario utilizzare un'opzione per ogni disco dati nell'array.
|
||||
Si dovrebbe utilizzare un'opzione per ogni disco dati nell'array.
|
||||
|
||||
È possibile rinominare un disco in seguito modificando NAME
|
||||
direttamente nel file di configurazione e quindi eseguendo un
|
||||
|
|
@ -1217,24 +1221,49 @@ Configurazione
|
|||
Si noti che tali dischi non sono influenzati dai comandi `up` e `down`
|
||||
perché si prevede che siano sempre in rotazione.
|
||||
|
||||
snapshot
|
||||
Abilita l'uso degli snapshot del file system per i comandi `sync`, `scrub`,
|
||||
`check` e `fix`.
|
||||
|
||||
Quando abilitato, SnapRAID crea uno snapshot in sola lettura dei dati all'inizio
|
||||
di un 'sync'. Ciò garantisce una vista coerente e puntuale dei tuoi file,
|
||||
prevenendo errori causati da modifiche simultanee dei file.
|
||||
|
||||
Questo migliora significativamente il recupero: se un file viene eliminato dal file system live,
|
||||
rimane preservato nello snapshot. Ciò impedisce alla parità di diventare "corrotta"
|
||||
per quel blocco, assicurando che sia ancora possibile recuperare correttamente i dati
|
||||
se un altro disco si guasta.
|
||||
|
||||
Questa opzione si applica esclusivamente ai dischi dati formattati con i file system
|
||||
Btrfs, Bcachefs o ZFS in Linux e NTFS in Windows.
|
||||
I dischi di parità, o i dischi dati che utilizzano altri file system, utilizzeranno sempre
|
||||
la versione live del file system.
|
||||
|
||||
La creazione e l'eliminazione degli snapshot richiedono privilegi amministrativi.
|
||||
Assicurati che SnapRAID sia eseguito con i permessi necessari (es. sudo) quando
|
||||
questa opzione è abilitata.
|
||||
|
||||
Vedere la sezione SNAPSHOTS per una spiegazione dettagliata del ciclo di vita
|
||||
degli snapshot.
|
||||
|
||||
nohidden
|
||||
Esclude tutti i file e le directory nascosti.
|
||||
In Unix, i file nascosti sono quelli che iniziano con `.`.
|
||||
In Windows, sono quelli con l'attributo nascosto.
|
||||
|
||||
exclude/include PATTERN
|
||||
Definisce i modelli di file o directory da escludere o includere
|
||||
Definisce i pattern di file o directory da escludere o includere
|
||||
nel processo di sync.
|
||||
Tutti i modelli vengono elaborati nell'ordine specificato.
|
||||
Tutti i pattern vengono elaborati nell'ordine specificato.
|
||||
|
||||
Se il primo modello che corrisponde è un `exclude`, il file
|
||||
Se il primo pattern che corrisponde è un `exclude`, il file
|
||||
viene escluso. Se è un `include`, il file viene incluso.
|
||||
Se nessun modello corrisponde, il file viene escluso se l'ultimo
|
||||
modello specificato è un `include`, o incluso se l'ultimo modello
|
||||
Se nessun pattern corrisponde, il file viene escluso se l'ultimo
|
||||
pattern specificato è un `include`, o incluso se l'ultimo pattern
|
||||
specificato è un `exclude`.
|
||||
|
||||
Vedere la sezione PATTERN per maggiori dettagli sulle specifiche
|
||||
del modello.
|
||||
del pattern.
|
||||
|
||||
Questa opzione può essere utilizzata più volte.
|
||||
|
||||
|
|
@ -1305,27 +1334,27 @@ Configurazione
|
|||
tipicamente richiede 1 GiB di RAM per ogni 16 TB di dati nell'array.
|
||||
|
||||
Nello specifico, per memorizzare gli hash dei dati, SnapRAID richiede
|
||||
circa $TS*(1+HS)/BS$ byte di RAM,
|
||||
dove $TS$ è la dimensione totale in byte dell'array di dischi, $BS$ è la
|
||||
dimensione del blocco in byte e $HS$ è la dimensione dell'hash in byte.
|
||||
circa TS*(1+HS)/BS byte di RAM,
|
||||
dove TS è la dimensione totale in byte dell'array di dischi, BS è la
|
||||
dimensione del blocco in byte e HS è la dimensione dell'hash in byte.
|
||||
|
||||
Ad esempio, con 8 dischi da 4 TB, una dimensione di blocco di 256 KiB
|
||||
($1 \text{ KiB} = 1024 \text{ byte}$) e una dimensione di hash di 16, si ottiene:
|
||||
(1 KiB = 1024 byte) e una dimensione di hash di 16, si ottiene:
|
||||
|
||||
:RAM = $(8 * 4 * 10^{12}) * (1+16) / (256 * 2^{10}) = 1.93 \text{ GiB}$
|
||||
:RAM = (8 * 4 * 10^12) * (1+16) / (256 * 2^10) = 1.93 GiB
|
||||
|
||||
Passando a una dimensione di hash di 8, si ottiene:
|
||||
|
||||
:RAM = $(8 * 4 * 10^{12}) * (1+8) / (256 * 2^{10}) = 1.02 \text{ GiB}$
|
||||
:RAM = (8 * 4 * 10^12) * (1+8) / (256 * 2^10) = 1.02 GiB
|
||||
|
||||
Passando a una dimensione di blocco di 512, si ottiene:
|
||||
|
||||
:RAM = $(8 * 4 * 10^{12}) * (1+16) / (512 * 2^{10}) = 0.96 \text{ GiB}$
|
||||
:RAM = (8 * 4 * 10^12) * (1+16) / (512 * 2^10) = 0.96 GiB
|
||||
|
||||
Passando sia a una dimensione di hash di 8 che a una dimensione di
|
||||
Passando sia a una dimensione di hash di 8 sia a una dimensione di
|
||||
blocco di 512, si ottiene:
|
||||
|
||||
:RAM = $(8 * 4 * 10^{12}) * (1+8) / (512 * 2^{10}) = 0.51 \text{ GiB}$
|
||||
:RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0.51 GiB
|
||||
|
||||
autosave SIZE_IN_GIGABYTES
|
||||
Salva automaticamente lo stato durante la sincronizzazione o lo scrubbing
|
||||
|
|
@ -1410,6 +1439,10 @@ Configurazione
|
|||
nome del dispositivo. Per i controller RAID, il dispositivo è
|
||||
probabilmente fisso e potrebbe non essere necessario utilizzare `%s`.
|
||||
|
||||
È inoltre possibile specificare una stringa di opzioni di informazioni
|
||||
personalizzate tramite il tag `[info: ...]` per sostituire l'opzione
|
||||
`-a` predefinita.
|
||||
|
||||
Fare riferimento alla documentazione di smartmontools per le possibili
|
||||
opzioni:
|
||||
|
||||
|
|
@ -1418,6 +1451,7 @@ Configurazione
|
|||
|
||||
Ad esempio:
|
||||
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl parity -d sat %s
|
||||
|
||||
smartignore DISK/PARITY ATTR [ATTR...]
|
||||
|
|
@ -1431,16 +1465,21 @@ Configurazione
|
|||
Il valore speciale * può essere utilizzato per ignorare l'attributo
|
||||
su tutti i dischi.
|
||||
|
||||
Ad esempio, per ignorare l'attributo `Current Pending Sector Count`
|
||||
su tutti i dischi:
|
||||
È possibile specificare più attributi separati da spazi.
|
||||
Ciascun attributo può essere specificato come un numero da 1 a 255, o come
|
||||
un nome insensibile al maiuscolo/minuscolo (ad es. `Current_Pending_Sector`).
|
||||
|
||||
:smartignore * 197
|
||||
Ad esempio, per ignorare gli attributi `Current Pending Sector Count` e
|
||||
`Reallocated Sectors Count` su tutti i dischi per numero o nome:
|
||||
|
||||
Per ignorarlo solo sul primo disco di parità:
|
||||
:smartignore * 197 5
|
||||
:smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
:smartignore parity 197
|
||||
Per ignorarli solo sul primo disco di parità:
|
||||
|
||||
Esempi
|
||||
:smartignore parity 197 5
|
||||
|
||||
Esempi (Examples)
|
||||
Un esempio di configurazione tipica per Unix è:
|
||||
|
||||
:parity /mnt/diskp/snapraid.parity
|
||||
|
|
@ -1451,7 +1490,7 @@ Configurazione
|
|||
:data d3 /mnt/disk3/
|
||||
:exclude /lost+found/
|
||||
:exclude /tmp/
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/sg0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1467,11 +1506,123 @@ Configurazione
|
|||
:exclude Thumbs.db
|
||||
:exclude \$RECYCLE.BIN
|
||||
:exclude \System Volume Information
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
Snapshot (Snapshots)
|
||||
Se l'opzione snapshot è abilitata nella configurazione, SnapRAID
|
||||
utilizza le funzionalità di snapshot del file system per garantire operazioni atomiche
|
||||
e coerenti.
|
||||
|
||||
La gestione degli snapshot è completamente automatica e trasparente.
|
||||
È possibile continuare a utilizzare SnapRAID esattamente come prima, con la
|
||||
protezione aggiuntiva fornita dagli snapshot gestiti interamente in
|
||||
background.
|
||||
|
||||
Ciò fornisce due vantaggi primari:
|
||||
|
||||
Coerenza - I file modificati sul file system live durante un sync o uno scrub di
|
||||
lunga durata non causeranno discrepanze di parità o operazioni interrotte,
|
||||
poiché SnapRAID vede un'immagine congelata nel tempo.
|
||||
Recupero - Se un file viene aggiornato o eliminato dal file system live,
|
||||
rimane preservato nello snapshot. Se si verifica un guasto al disco
|
||||
prima dell'esecuzione del sync successivo, SnapRAID utilizza i dati preservati
|
||||
nello snapshot per ricostruire il disco guasto.
|
||||
|
||||
In caso di guasto al disco durante un processo di sync attivo,
|
||||
SnapRAID è anche in grado di leggere automaticamente sia dallo snapshot
|
||||
del calcolo della parità precedente che da quello corrente.
|
||||
Ciò massimizza la probabilità di un recupero completo fornendo
|
||||
l'accesso agli esatti blocchi di dati richiesti per risolvere
|
||||
le equazioni di parità, anche se quei blocchi sono stati modificati
|
||||
o eliminati tra i sync.
|
||||
|
||||
Senza snapshot, un file aggiornato o eliminato su un disco integro
|
||||
comporta la mancanza di blocchi di dati che potrebbero essere richiesti per
|
||||
ripristinare altri dischi guasti.
|
||||
|
||||
Gli snapshot vengono creati solo per i dischi dati e solo se il file system
|
||||
sottostante supporta questa funzionalità. I dischi di parità usano sempre
|
||||
il file system live.
|
||||
|
||||
Attualmente, questo è supportato su Btrfs, Bcachefs e ZFS in Linux
|
||||
e su NTFS in Windows.
|
||||
|
||||
È possibile combinare dischi dati con file system diversi. Solo quelli che
|
||||
supportano gli snapshot li utilizzeranno, mentre gli altri dischi continueranno
|
||||
a operare direttamente sul file system live.
|
||||
|
||||
La creazione e l'eliminazione degli snapshot richiedono privilegi amministrativi.
|
||||
Assicurati che SnapRAID sia eseguito con i permessi necessari (es. sudo)
|
||||
quando gli snapshot sono abilitati.
|
||||
|
||||
Comportamento dei comandi con gli snapshot (Command Behavior with Snapshots)
|
||||
I comandi `sync` e `scrub` operano entrambi esclusivamente sugli snapshot
|
||||
per garantire che tutte le operazioni sui dati siano eseguite rispetto a uno stato coerente
|
||||
e congelato. Utilizzando questi snapshot, SnapRAID previene le discrepanze di parità
|
||||
che verrebbero altrimenti innescate da modifiche simultanee dei file sul file system live.
|
||||
Durante un `sync`, il comando utilizza un nuovo snapshot creato all'inizio
|
||||
del processo per catturare lo stato corrente per il calcolo della parità.
|
||||
Al contrario, il comando `scrub` utilizza l'ultimo snapshot, quello
|
||||
creato durante il sync più recente, per mantenere un punto di riferimento affidabile
|
||||
che corrisponda alla parità esistente.
|
||||
|
||||
Per i comandi `check` e `fix`, l'uso dell'ultimo snapshot
|
||||
dipende dal fatto che vengano presi di mira dischi specifici utilizzando l'opzione
|
||||
-d, --filter-disk.
|
||||
|
||||
Un disco esplicitamente selezionato tramite -d (il "target" dell'operazione)
|
||||
utilizza sempre il file system live. Per `fix`, questo consente di ripristinare
|
||||
i dati sul disco sostitutivo attivo. Per `check`, consente di simulare
|
||||
l'operazione `fix` nelle stesse condizioni.
|
||||
|
||||
Tutti gli altri dischi dati (i dischi di "riferimento") verranno acceduti tramite
|
||||
i loro snapshot. Ciò garantisce che anche se si stanno modificando file
|
||||
sui dischi integri mentre è in corso un recupero, SnapRAID
|
||||
ha un riferimento stabile e congelato per risolvere le equazioni di parità.
|
||||
|
||||
Se non viene fornita alcuna opzione -d, SnapRAID assume che l'operazione si applichi
|
||||
all'intero array; in questo caso, `check` e `fix` utilizzeranno esclusivamente
|
||||
i file system live.
|
||||
|
||||
Tutti gli altri comandi operano esclusivamente sul file system live.
|
||||
|
||||
Ciclo di vita degli snapshot (Snapshots Lifecycle)
|
||||
SnapRAID gestisce due snapshot specifici, `stable` e `pending`,
|
||||
all'interno di una directory nascosta alla radice di ogni sottovolume dati.
|
||||
In Btrfs, Bcachefs e NTFS viene utilizzata la directory `.snapraid/`,
|
||||
in ZFS quella standard `.zfs/snapshot/`.
|
||||
|
||||
Lo snapshot `stable` rappresenta lo stato dell'ultimo
|
||||
`sync` completato con successo, contenente gli esatti dati utilizzati per
|
||||
computare la parità corrente. Funge da fonte di dati primaria
|
||||
per i comandi `scrub`, `check` e `fix`.
|
||||
|
||||
Lo snapshot `pending` è un'immagine temporanea creata all'inizio
|
||||
di un `sync` per fornire uno stato congelato per il calcolo della parità.
|
||||
Al completamento con successo dell'operazione, il precedente snapshot `stable`
|
||||
viene eliminato e lo snapshot `pending` viene promosso per
|
||||
prendere il suo posto come nuovo riferimento stabile.
|
||||
|
||||
Se un `sync` viene interrotto, lo snapshot `pending` viene preservato.
|
||||
I successivi comandi `scrub`, `check` e `fix` utilizzeranno questo
|
||||
snapshot in sospeso poiché corrisponde allo stato del file system registrato nel
|
||||
file .content, anche se la parità è sincronizzata solo parzialmente.
|
||||
|
||||
In caso di interruzione del `sync`, anche i comandi `check` e `fix`
|
||||
leggono dallo snapshot `stable` per recuperare i blocchi di dati
|
||||
da file che sono stati aggiornati o eliminati durante il sync.
|
||||
Ciò è possibile perché il file .content conserva i metadati per
|
||||
tutti i file modificati o eliminati durante l'intero processo di sync.
|
||||
Queste informazioni storiche vengono cancellate solo al termine di un sync
|
||||
avvenuto con successo e quando viene salvata la versione finale del file .content.
|
||||
|
||||
Se un `sync` viene riavviato dopo un'interruzione, lo snapshot pending esistente
|
||||
viene eliminato e ne viene creato uno nuovo per
|
||||
acquisire lo stato corrente del file system live.
|
||||
|
||||
Pattern
|
||||
I pattern offrono un modo flessibile per filtrare i file da includere o
|
||||
escludere. Usando i caratteri globbing, è possibile definire regole che
|
||||
|
|
@ -1594,7 +1745,7 @@ Pattern
|
|||
In Unix, quando si utilizzano caratteri di globbing sulla riga di
|
||||
comando, è necessario citarli per impedire alla shell di espanderli.
|
||||
|
||||
Ignore File
|
||||
File da ignorare (Ignore File)
|
||||
In aggiunta alle regole globali nel file di configurazione, è possibile
|
||||
inserire file `.snapraidignore` in qualsiasi directory all'interno dell'array
|
||||
per definire regole di esclusione decentralizzate.
|
||||
|
|
@ -1606,7 +1757,7 @@ Ignore File
|
|||
escluso indipendentemente dalle impostazioni di inclusione globali.
|
||||
|
||||
La logica dei pattern in `.snapraidignore` rispecchia la configurazione globale
|
||||
ma ancora i pattern alla directory in cui si trova il file:
|
||||
ma vincola i pattern alla directory in cui si trova il file:
|
||||
|
||||
=FILE
|
||||
Seleziona qualsiasi file chiamato FILE in questa directory o sotto di essa.
|
||||
|
|
@ -1636,16 +1787,18 @@ Ignore File
|
|||
:# Esclude qualsiasi file .tmp all'interno di projects/ o delle sue sottocartelle
|
||||
:*.tmp
|
||||
|
||||
Content
|
||||
Contenuto (Content)
|
||||
SnapRAID memorizza l'elenco e i checksum dei file nel file di contenuto.
|
||||
|
||||
È un file binario che elenca tutti i file presenti nell'array di dischi,
|
||||
insieme a tutti i checksum per verificarne l'integrità.
|
||||
|
||||
Questo file viene letto e scritto dai comandi `sync` e `scrub` e
|
||||
letto dai comandi `fix`, `check` e `status`.
|
||||
Il file di contenuto viene letto e scritto dai comandi `sync`, `scrub`,
|
||||
`touch` e `rehash`. Viene letto dai comandi `status`, `diff`, `check`,
|
||||
`fix`, `list`, `dup`, `locate` e `pool`, e viene completamente ignorato
|
||||
dai comandi `smart`, `probe`, `up`, `down` e `devices`.
|
||||
|
||||
Parity
|
||||
Parità (Parity)
|
||||
SnapRAID memorizza le informazioni di parità dell'array nei file di
|
||||
parità.
|
||||
|
||||
|
|
@ -1655,7 +1808,7 @@ Parity
|
|||
Questi file vengono letti e scritti dai comandi `sync` e `fix` e
|
||||
solo letti dai comandi `scrub` e `check`.
|
||||
|
||||
Codifica
|
||||
Codifica (Encoding)
|
||||
SnapRAID in Unix ignora qualsiasi codifica. Legge e memorizza i
|
||||
nomi dei file con la stessa codifica utilizzata dal file system.
|
||||
|
||||
|
|
@ -1670,8 +1823,19 @@ Codifica
|
|||
reindirizza l'output della console a un file, il file risultante è
|
||||
sempre in formato UTF-8.
|
||||
|
||||
Copyright
|
||||
Questo file è Copyright (C) 2025 Andrea Mazzoleni
|
||||
Codice di uscita (Exit Code)
|
||||
SnapRAID termina con i seguenti codici di errore:
|
||||
|
||||
Vedi Anche
|
||||
snapraid_log(1), snapraidd(1)
|
||||
0 - Tutto OK.
|
||||
1 - Il comando ha riscontrato alcuni errori.
|
||||
2 - Il comando `diff` ha rilevato che tutto è OK, ma è necessario un `sync`.
|
||||
|
||||
Traduzione (Translation)
|
||||
Questo documento è una traduzione automatica del manuale in inglese.
|
||||
Fare riferimento al manuale in inglese per la versione ufficiale.
|
||||
|
||||
Copyright
|
||||
Questo file è Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
Vedi anche (See Also)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
===================================
|
||||
|
||||
|
||||
1 SINOSSI
|
||||
=========
|
||||
1 SINOSSI (SYNOPSIS)
|
||||
====================
|
||||
|
||||
snapraid [-c, --conf CONFIG]
|
||||
[-f, --filter PATTERN] [-d, --filter-disk NAME]
|
||||
|
|
@ -28,8 +28,8 @@ snapraid [-c, --conf CONFIG]
|
|||
snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
|
||||
2 DESCRIZIONE
|
||||
=============
|
||||
2 DESCRIZIONE (DESCRIPTION)
|
||||
===========================
|
||||
|
||||
SnapRAID è un programma di backup progettato per array di dischi, che
|
||||
memorizza informazioni di parità per il recupero dati in caso di guasto
|
||||
|
|
@ -51,7 +51,7 @@ e che cambiano raramente, SnapRAID offre diverse funzionalità:
|
|||
* È possibile aggiungere dischi in qualsiasi momento.
|
||||
* SnapRAID non blocca i dati; è possibile smettere di usarlo in qualsiasi
|
||||
momento senza riformattare o spostare i dati.
|
||||
* Per accedere a un file, è necessario far girare solo un singolo disco,
|
||||
* Per accedere a un file, è necessario avviare la rotazione di solo un singolo disco,
|
||||
risparmiando energia e riducendo il rumore.
|
||||
|
||||
Per maggiori informazioni, si prega di visitare il sito ufficiale SnapRAID:
|
||||
|
|
@ -59,25 +59,32 @@ Per maggiori informazioni, si prega di visitare il sito ufficiale SnapRAID:
|
|||
https://www.snapraid.it/
|
||||
|
||||
|
||||
3 LIMITAZIONI
|
||||
=============
|
||||
3 LIMITAZIONI (LIMITATIONS)
|
||||
===========================
|
||||
|
||||
SnapRAID è un ibrido tra un programma RAID e un programma di backup,
|
||||
che mira a combinare i migliori vantaggi di entrambi. Tuttavia, ha
|
||||
alcune limitazioni che si dovrebbero considerare prima di usarlo.
|
||||
SnapRAID è un ibrido tra un RAID e un programma di backup, con l'obiettivo di combinare
|
||||
i migliori vantaggi di entrambi. Tuttavia, presenta alcune limitazioni che dovresti
|
||||
considerare prima di usarlo.
|
||||
|
||||
La limitazione principale è che se un disco si guasta e non si è
|
||||
effettuato un sync di recente, potrebbe non essere possibile recuperare
|
||||
completamente.
|
||||
Più specificamente, potrebbe non essere possibile recuperare fino alla
|
||||
dimensione dei file modificati o eliminati dall'ultima operazione di sync.
|
||||
Ciò accade anche se i file modificati o eliminati non si trovano sul
|
||||
disco guasto. Questo è il motivo per cui SnapRAID è più adatto per dati
|
||||
che cambiano raramente.
|
||||
La limitazione principale è che se un disco si guasta, puoi recuperare i dati solo fino allo
|
||||
stato dell'ultima operazione di `sync`. Qualsiasi dato aggiunto o modifica apportata
|
||||
dopo l'ultimo sync sul disco guasto andrà perso.
|
||||
|
||||
D'altra parte, i file appena aggiunti non impediscono il recupero dei
|
||||
file già esistenti. Si perderanno solo i file aggiunti di recente se si
|
||||
trovano sul disco guasto.
|
||||
Di conseguenza, SnapRAID è adatto principalmente per dati che cambiano raramente.
|
||||
|
||||
Per i dati che esistevano già all'ultimo sync, l'affidabilità del recupero dipende
|
||||
dall'uso o meno dell'opzione `snapshot`:
|
||||
|
||||
* Con il supporto snapshot (disponibile su Btrfs, ZFS, Bcachefs e NTFS),
|
||||
SnapRAID può mantenere automaticamente un'immagine congelata dei dischi dati.
|
||||
Ciò garantisce che anche se si modificano o si eliminano file sul file system live
|
||||
durante o dopo un sync, il processo di recupero rimane coerente e affidabile.
|
||||
|
||||
* Senza il supporto snapshot, eliminare o modificare file dopo un `sync`
|
||||
può impedire il recupero completo di altri dischi guasti. Ciò accade
|
||||
perché la parità non corrisponde più ai file modificati, anche se
|
||||
quei file non si trovano sul disco guasto. D'altra parte, i file aggiunti di recente
|
||||
non impediscono il recupero dei file già esistenti.
|
||||
|
||||
Altre limitazioni di SnapRAID sono:
|
||||
|
||||
|
|
@ -95,8 +102,8 @@ Altre limitazioni di SnapRAID sono:
|
|||
Permessi, proprietà e attributi estesi non vengono salvati.
|
||||
|
||||
|
||||
4 INIZIARE
|
||||
==========
|
||||
4 PRIMI PASSI (GETTING STARTED)
|
||||
===============================
|
||||
|
||||
Per usare SnapRAID, è necessario prima selezionare un disco nell'array
|
||||
di dischi da dedicare alle informazioni di `parity` (parità). Con un
|
||||
|
|
@ -111,7 +118,7 @@ Come dischi di parità, è necessario scegliere i dischi più grandi
|
|||
dell'array, poiché le informazioni di parità possono crescere fino alle
|
||||
dimensioni del più grande disco dati nell'array.
|
||||
|
||||
Questi dischi saranno dedicati alla memorizzazione dei file di `parity`.
|
||||
Questi dischi saranno dedicati alla memorizzazione dei file di parità.
|
||||
Non si dovrebbero memorizzare i propri dati su di essi.
|
||||
|
||||
Quindi, è necessario definire i dischi `data` (dati) che si desidera
|
||||
|
|
@ -126,7 +133,7 @@ Questo file contiene i dettagli del backup, inclusi tutti i checksum
|
|||
per verificarne l'integrità.
|
||||
Il file `content` viene memorizzato in più copie e ogni copia deve
|
||||
essere su un disco diverso per garantire che, anche in caso di guasti
|
||||
multipli del disco, sia disponibile almeno una copia.
|
||||
multipli ai dischi, sia disponibile almeno una copia.
|
||||
|
||||
Ad esempio, supponiamo di essere interessati a un solo livello di
|
||||
protezione con parità e che i dischi si trovino in:
|
||||
|
|
@ -180,8 +187,8 @@ Quando questo comando è completato, i dati sono SICURI.
|
|||
Ora è possibile iniziare a usare l'array come si desidera e aggiornare
|
||||
periodicamente le informazioni di parità eseguendo il comando `sync`.
|
||||
|
||||
4.1 Scrubbing
|
||||
-------------
|
||||
4.1 Scrubbing (Scrubbing)
|
||||
-------------------------
|
||||
|
||||
Per controllare periodicamente i dati e la parità per gli errori, è
|
||||
possibile eseguire il comando `scrub`.
|
||||
|
|
@ -193,8 +200,8 @@ durante il comando `sync` per verificarne l'integrità.
|
|||
|
||||
Ogni esecuzione del comando controlla circa l'8% dell'array, escludendo
|
||||
i dati già sottoposti a scrub nei 10 giorni precedenti.
|
||||
È possibile utilizzare l'opzione -p, --plan per specificare un importo
|
||||
diverso e l'opzione -o, --older-than per specificare un'età diversa
|
||||
È possibile utilizzare l'opzione -p, --plan per specificare una quantità
|
||||
diversa e l'opzione -o, --older-than per specificare un'età diversa
|
||||
in giorni.
|
||||
Ad esempio, per controllare il 5% dell'array per blocchi più vecchi di
|
||||
20 giorni, usare:
|
||||
|
|
@ -202,34 +209,34 @@ Ad esempio, per controllare il 5% dell'array per blocchi più vecchi di
|
|||
snapraid -p 5 -o 20 scrub
|
||||
|
||||
Se vengono trovati errori silenti o di input/output durante il processo,
|
||||
i blocchi corrispondenti vengono contrassegnati come bad (cattivi) nel
|
||||
i blocchi corrispondenti vengono contrassegnati come `bad` (danneggiati) nel
|
||||
file `content` ed elencati nel comando `status`.
|
||||
|
||||
snapraid status
|
||||
|
||||
Per correggerli, è possibile utilizzare il comando `fix`, filtrando
|
||||
i blocchi bad con l'opzione -e, --filter-error:
|
||||
i blocchi danneggiati con l'opzione -e, --filter-error:
|
||||
|
||||
snapraid -e fix
|
||||
|
||||
Al prossimo `scrub`, gli errori scompariranno dal report `status`
|
||||
se sono stati veramente corretti. Per renderlo più veloce, è possibile
|
||||
utilizzare -p bad per eseguire lo scrub solo dei blocchi contrassegnati
|
||||
come bad.
|
||||
come `bad`.
|
||||
|
||||
snapraid -p bad scrub
|
||||
|
||||
L'esecuzione di `scrub` su un array non sincronizzato può riportare
|
||||
errori causati da file rimossi o modificati. Questi errori sono riportati
|
||||
nell'output di `scrub`, ma i blocchi correlati non sono contrassegnati
|
||||
come bad.
|
||||
come `bad`.
|
||||
|
||||
4.2 Pooling
|
||||
-----------
|
||||
4.2 Pooling (Pooling)
|
||||
---------------------
|
||||
|
||||
Nota: La funzionalità di pooling descritta di seguito è stata
|
||||
sostituita dallo strumento mergerfs, che è ora l'opzione consigliata
|
||||
per gli utenti Linux nella comunità SnapRAID. Mergefs fornisce un modo
|
||||
per gli utenti Linux nella comunità SnapRAID. Mergerfs fornisce un modo
|
||||
più flessibile ed efficiente per raggruppare più unità in un singolo
|
||||
punto di montaggio unificato, consentendo un accesso trasparente ai
|
||||
file attraverso l'array senza fare affidamento sui collegamenti
|
||||
|
|
@ -305,12 +312,12 @@ abilitare l'accesso ai symlink remoti con il comando:
|
|||
|
||||
fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
||||
|
||||
4.3 Annullamento Eliminazione
|
||||
-----------------------------
|
||||
4.3 Annullamento eliminazione (Undeleting)
|
||||
------------------------------------------
|
||||
|
||||
SnapRAID funziona più come un programma di backup che come un sistema RAID
|
||||
e può essere utilizzato per ripristinare o annullare l'eliminazione dei
|
||||
file al loro stato precedente utilizzando l'opzione -f, --filter:
|
||||
e può essere utilizzato per ripristinare i file al loro stato precedente
|
||||
o annullarne l'eliminazione utilizzando l'opzione -f, --filter:
|
||||
|
||||
snapraid fix -f FILE
|
||||
|
||||
|
|
@ -329,10 +336,10 @@ O per recuperare tutti i file eliminati su tutte le unità con:
|
|||
|
||||
snapraid fix -m
|
||||
|
||||
4.4 Recupero
|
||||
------------
|
||||
4.4 Recupero (Recovering)
|
||||
-------------------------
|
||||
|
||||
È successo il peggio e si è perso uno o più dischi!
|
||||
È successo il peggio e si sono persi uno o più dischi!
|
||||
|
||||
NON FARSI PRENDERE DAL PANICO! Sarà possibile recuperarli!
|
||||
|
||||
|
|
@ -342,7 +349,7 @@ pianificato, incluso qualsiasi sync o scrub notturno pianificato di SnapRAID.
|
|||
|
||||
Quindi procedere con i seguenti passaggi.
|
||||
|
||||
---- 4.4.1 PASSO 1 -> Riconfigurazione ----
|
||||
---- 4.4.1 PASSO 1 -> Riconfigurazione (Reconfigure) ----
|
||||
È necessario un po' di spazio per recuperare, idealmente su dischi di
|
||||
riserva aggiuntivi, ma un disco USB esterno o un disco remoto saranno
|
||||
sufficienti.
|
||||
|
|
@ -422,18 +429,18 @@ Eseguire il comando `sync` per risincronizzare l'array con il nuovo disco.
|
|||
Se tutto è recuperato, questo comando è immediato.
|
||||
|
||||
|
||||
5 COMANDI
|
||||
=========
|
||||
5 COMANDI (COMMANDS)
|
||||
====================
|
||||
|
||||
SnapRAID fornisce alcuni semplici comandi che consentono di:
|
||||
|
||||
* Stampare lo stato dell'array -> `status`
|
||||
* Controllare i dischi -> `smart`, `probe`, `up`, `down`
|
||||
* Effettuare un backup/snapshot -> `sync`
|
||||
* Creare un punto di backup/recupero -> `sync`
|
||||
* Controllare periodicamente i dati -> `scrub`
|
||||
* Ripristinare l'ultimo backup/snapshot -> `fix`.
|
||||
* Ripristinare l'ultimo punto di backup/recupero -> `fix`.
|
||||
|
||||
I comandi devono essere scritti in minuscolo.
|
||||
I comandi devono essere scritti in lettere minuscole.
|
||||
|
||||
5.1 status
|
||||
----------
|
||||
|
|
@ -448,7 +455,7 @@ Le informazioni presentate si riferiscono all'ultima volta che si è
|
|||
eseguito `sync`. Le modifiche successive non vengono prese in
|
||||
considerazione.
|
||||
|
||||
Se sono stati rilevati blocchi bad, vengono elencati i loro numeri
|
||||
Se sono stati rilevati blocchi danneggiati, vengono elencati i loro numeri
|
||||
di blocco. Per correggerli, è possibile utilizzare il comando `fix -e`.
|
||||
|
||||
Mostra anche un grafico che rappresenta l'ultima volta che ogni blocco
|
||||
|
|
@ -501,8 +508,8 @@ Nulla viene modificato.
|
|||
|
||||
Stampa lo stato POWER di tutti i dischi nel sistema.
|
||||
|
||||
`Standby` significa che il disco non sta girando. `Active` significa
|
||||
che il disco sta girando.
|
||||
`Standby` significa che il disco non è in rotazione. `Active` significa
|
||||
che il disco è in rotazione.
|
||||
|
||||
Questo comando utilizza lo strumento `smartctl` ed è equivalente
|
||||
all'esecuzione di `smartctl -n standby -i` su tutti i dispositivi.
|
||||
|
|
@ -516,12 +523,12 @@ Nulla viene modificato.
|
|||
5.4 up
|
||||
------
|
||||
|
||||
Fa girare tutti i dischi dell'array.
|
||||
Avvia la rotazione di tutti i dischi dell'array.
|
||||
|
||||
È possibile far girare solo dischi specifici utilizzando l'opzione -d,
|
||||
È possibile avviare la rotazione di soli dischi specifici utilizzando l'opzione -d,
|
||||
--filter-disk.
|
||||
|
||||
Far girare tutti i dischi contemporaneamente richiede molta energia.
|
||||
Avviare la rotazione di tutti i dischi contemporaneamente richiede molta energia.
|
||||
Assicurarsi che l'alimentatore possa sostenerlo.
|
||||
|
||||
Nulla viene modificato.
|
||||
|
|
@ -570,13 +577,13 @@ riepilogo delle modifiche, raggruppate per:
|
|||
il percorso completo deve corrispondere per essere
|
||||
identificato, non solo il nome.
|
||||
relocated - File spostati sullo stesso disco o su un disco
|
||||
diverso dove l'originale è scomparso.
|
||||
Sono identificati dall' avere lo stesso nome, dimensione
|
||||
diverso dove l'originale è scomparso.
|
||||
Sono identificati dall'avere lo stesso nome, dimensione
|
||||
e timestamp.
|
||||
Se il timestamp al sottomultiplo del secondo è zero,
|
||||
il percorso completo deve corrispondere per essere
|
||||
identificato.
|
||||
A differenza dei file `moved` sullo stesso disco,
|
||||
A differenza dei file 'moved' sullo stesso disco,
|
||||
i file ricollocati hanno un inode diverso.
|
||||
restored - File con un inode diverso ma directory,
|
||||
nome, dimensione e timestamp corrispondenti.
|
||||
|
|
@ -602,7 +609,7 @@ Alla prossima esecuzione, il processo `sync` riprenderà da dove
|
|||
è stato interrotto.
|
||||
|
||||
Se vengono trovati errori silenti o di input/output durante il processo,
|
||||
i blocchi corrispondenti vengono contrassegnati come bad.
|
||||
i blocchi corrispondenti vengono contrassegnati come `bad` (danneggiati).
|
||||
|
||||
I file sono identificati dal percorso e/o dall'inode e controllati
|
||||
per dimensione e timestamp.
|
||||
|
|
@ -630,7 +637,7 @@ ogni tre mesi.
|
|||
|
||||
È possibile definire un piano o una quantità di scrub diversa
|
||||
utilizzando l'opzione -p, --plan, che accetta:
|
||||
bad - Esegue lo scrub dei blocchi contrassegnati come bad.
|
||||
bad - Esegue lo scrub dei blocchi contrassegnati come `bad`.
|
||||
new - Esegue lo scrub dei blocchi appena sincronizzati non ancora
|
||||
sottoposti a scrub.
|
||||
full - Esegue lo scrub di tutto.
|
||||
|
|
@ -648,44 +655,42 @@ Per ottenere i dettagli dello stato dello scrub, utilizzare il comando
|
|||
`status`.
|
||||
|
||||
Per qualsiasi errore silente o di input/output trovato, i blocchi
|
||||
corrispondenti vengono contrassegnati come bad nel file `content`.
|
||||
Questi blocchi bad sono elencati in `status` e possono essere corretti
|
||||
corrispondenti vengono contrassegnati come `bad` nel file `content`.
|
||||
Questi blocchi danneggiati sono elencati in `status` e possono essere corretti
|
||||
con `fix -e`.
|
||||
Dopo la correzione, al prossimo scrub, verranno ricontrollati e, se
|
||||
trovati corretti, il contrassegno bad verrà rimosso.
|
||||
Per eseguire lo scrub solo dei blocchi bad, è possibile utilizzare
|
||||
trovati corretti, il contrassegno `bad` verrà rimosso.
|
||||
Per eseguire lo scrub solo dei blocchi danneggiati, è possibile utilizzare
|
||||
il comando `scrub -p bad`.
|
||||
|
||||
Si consiglia di eseguire `scrub` solo su un array sincronizzato per
|
||||
evitare errori segnalati causati da dati non sincronizzati. Questi
|
||||
errori sono riconosciuti come non essendo errori silenti e i blocchi non
|
||||
vengono contrassegnati come bad, ma tali errori sono riportati
|
||||
vengono contrassegnati come `bad`, ma tali errori sono riportati
|
||||
nell'output del comando.
|
||||
|
||||
Il file `content` viene modificato per aggiornare l'ora dell'ultimo
|
||||
controllo per ogni blocco e per contrassegnare i blocchi bad.
|
||||
controllo per ogni blocco e per contrassegnare i blocchi danneggiati.
|
||||
I file `parity` NON vengono modificati.
|
||||
I file nell'array NON vengono modificati.
|
||||
|
||||
5.9 fix
|
||||
-------
|
||||
|
||||
Corregge tutti i file e i dati di parità.
|
||||
Ripristina tutti i file e i dati di parità.
|
||||
|
||||
Tutti i file e i dati di parità vengono confrontati con lo stato
|
||||
snapshot salvato nell'ultimo `sync`.
|
||||
Se viene trovata una differenza, viene ripristinata allo snapshot
|
||||
memorizzato.
|
||||
Tutti i file e i dati di parità vengono confrontati con lo stato salvato nell'ultimo
|
||||
`sync`. Se viene trovata una differenza, questa viene ripristinata allo stato memorizzato.
|
||||
|
||||
ATTENZIONE! Il comando `fix` non differenzia tra errori e modifiche
|
||||
intenzionali. Ripristina incondizionatamente lo stato del file
|
||||
all'ultimo `sync`.
|
||||
ATTENZIONE!
|
||||
Il comando `fix` non distingue tra errori e modifiche intenzionali.
|
||||
Ripristina incondizionatamente lo stato del file all'ultimo `sync`.
|
||||
|
||||
Se non viene specificata nessun'altra opzione, l'intero array viene
|
||||
elaborato. Utilizzare le opzioni di filtro per selezionare un
|
||||
sottoinsieme di file o dischi su cui operare.
|
||||
|
||||
Per correggere solo i blocchi contrassegnati come bad durante `sync`
|
||||
Per correggere solo i blocchi contrassegnati come `bad` (danneggiati) durante `sync`
|
||||
e `scrub`, utilizzare l'opzione -e, --filter-error.
|
||||
A differenza di altre opzioni di filtro, questa applica correzioni solo
|
||||
ai file che sono invariati dall'ultimo `sync`.
|
||||
|
|
@ -720,8 +725,8 @@ Questo comando è destinato principalmente alla verifica manuale,
|
|||
ad esempio dopo un processo di recupero o in altre condizioni speciali.
|
||||
Per i controlli periodici e pianificati, utilizzare `scrub`.
|
||||
|
||||
Se si utilizza l'opzione -a, --audit-only, viene controllato solo
|
||||
l'hash dei file e i dati di parità vengono ignorati per un'esecuzione
|
||||
Se si utilizza l'opzione -a, --audit-only, vengono controllati solo
|
||||
i dati dei file e i dati di parità vengono ignorati per un'esecuzione
|
||||
più veloce.
|
||||
|
||||
I file sono identificati solo dal percorso, non dall'inode.
|
||||
|
|
@ -830,15 +835,14 @@ che occupa.
|
|||
|
||||
È possibile utilizzare l'opzione -t, --tail per limitare l'operazione ai file
|
||||
che occupano la porzione di coda specificata della parità.
|
||||
|
||||
Se si desidera riallocare questi file, è possibile utilizzare l'opzione
|
||||
-W, --force-realloc-tail.
|
||||
|
||||
Si tenga presente che tali file non saranno protetti dalla parità durante
|
||||
il processo di riallocazione.
|
||||
-W, --force-realloc-tail. Si tenga presente che tali file non saranno
|
||||
protetti dalla parità durante il processo di riallocazione.
|
||||
|
||||
|
||||
6 OPZIONI
|
||||
=========
|
||||
6 OPZIONI (OPTIONS)
|
||||
===================
|
||||
|
||||
SnapRAID fornisce le seguenti opzioni:
|
||||
|
||||
|
|
@ -851,11 +855,11 @@ SnapRAID fornisce le seguenti opzioni:
|
|||
|
||||
-f, --filter PATTERN
|
||||
Filtra i file da elaborare in `check` e `fix`.
|
||||
Vengono elaborati solo i file che corrispondono al modello
|
||||
Vengono elaborati solo i file che corrispondono al pattern
|
||||
specificato.
|
||||
Questa opzione può essere utilizzata più volte.
|
||||
Vedere la sezione PATTERN per maggiori dettagli sulle
|
||||
specifiche del modello.
|
||||
specifiche del pattern.
|
||||
In Unix, assicurarsi che i caratteri di globbing siano citati
|
||||
se usati.
|
||||
Questa opzione può essere utilizzata solo con `check` e `fix`.
|
||||
|
|
@ -902,7 +906,7 @@ SnapRAID fornisce le seguenti opzioni:
|
|||
100, viene interpretato come la percentuale di blocchi da
|
||||
sottoporre a scrub.
|
||||
Invece di una percentuale, è possibile specificare un piano:
|
||||
`bad` esegue lo scrub dei blocchi bad, `new` esegue lo scrub
|
||||
`bad` esegue lo scrub dei blocchi danneggiati, `new` esegue lo scrub
|
||||
dei blocchi non ancora sottoposti a scrub, e `full` esegue lo
|
||||
scrub di tutto.
|
||||
Questa opzione può essere utilizzata solo con `scrub`.
|
||||
|
|
@ -911,7 +915,7 @@ SnapRAID fornisce le seguenti opzioni:
|
|||
Seleziona la parte più vecchia dell'array da elaborare in `scrub`.
|
||||
DAYS è l'età minima in giorni per un blocco da sottoporre a
|
||||
scrub; il valore predefinito è 10.
|
||||
I blocchi contrassegnati come bad vengono sempre sottoposti a scrub
|
||||
I blocchi contrassegnati come `bad` vengono sempre sottoposti a scrub
|
||||
indipendentemente da questa opzione.
|
||||
Questa opzione può essere utilizzata solo con `scrub`.
|
||||
|
||||
|
|
@ -964,9 +968,9 @@ SnapRAID fornisce le seguenti opzioni:
|
|||
RATE è il numero di byte al secondo. È possibile specificare un
|
||||
moltiplicatore come K, M, G o T (ad esempio, --bw-limit 1G).
|
||||
|
||||
-t, --tail DIMENSIONE
|
||||
-t, --tail SIZE
|
||||
Limita l'elenco dei file a quelli che non utilizzano più della
|
||||
dimensione di coda specificata dei dischi di parità.
|
||||
porzione finale specificata dei dischi di parità.
|
||||
È possibile utilizzare moltiplicatori come K, M, G o T (ad es. --tail 1G).
|
||||
Questa opzione è valida solo se utilizzata insieme al comando
|
||||
`locate`.
|
||||
|
|
@ -1075,9 +1079,9 @@ SnapRAID fornisce le seguenti opzioni:
|
|||
sconsigliato utilizzarla.
|
||||
NON si ha protezione dei dati durante l'operazione `sync`.
|
||||
|
||||
-W, --force-realloc-tail DIMENSIONE
|
||||
-W, --force-realloc-tail SIZE
|
||||
Funziona come -R, --force-realloc, ma limitatamente alla porzione
|
||||
di coda specificata (ultimi DIMENSIONE byte) di ogni file di parità.
|
||||
di coda specificata (ultimi SIZE byte) di ogni file di parità.
|
||||
Forza la riallocazione (spostamento) di qualsiasi frammento/blocco di file
|
||||
attualmente memorizzato in quella sezione di coda, consentendo loro di essere
|
||||
posizionati ovunque nei file di parità dove sia disponibile spazio libero
|
||||
|
|
@ -1100,7 +1104,7 @@ SnapRAID fornisce le seguenti opzioni:
|
|||
-l, --log FILE
|
||||
Scrive un log dettagliato nel file specificato.
|
||||
Se questa opzione non è specificata, gli errori imprevisti vengono
|
||||
stampati sullo schermo, potenzialmente resulting in un output
|
||||
stampati sullo schermo, potenzialmente producendo un output
|
||||
eccessivo in caso di molti errori. Quando -l, --log è specificato,
|
||||
vengono stampati sullo schermo solo gli errori fatali che
|
||||
causano l'arresto di SnapRAID.
|
||||
|
|
@ -1166,8 +1170,8 @@ SnapRAID fornisce le seguenti opzioni:
|
|||
Stampa la versione del programma.
|
||||
|
||||
|
||||
7 CONFIGURAZIONE
|
||||
================
|
||||
7 CONFIGURAZIONE (CONFIGURATION)
|
||||
================================
|
||||
|
||||
SnapRAID richiede un file di configurazione per sapere dove si trova
|
||||
l'array di dischi e dove memorizzare le informazioni di parità.
|
||||
|
|
@ -1272,7 +1276,7 @@ essere unico. DIR è il punto di montaggio del disco nel file system.
|
|||
È possibile cambiare il punto di montaggio secondo necessità,
|
||||
purché si mantenga fisso NAME.
|
||||
|
||||
È necessario utilizzare un'opzione per ogni disco dati nell'array.
|
||||
Si dovrebbe utilizzare un'opzione per ogni disco dati nell'array.
|
||||
|
||||
È possibile rinominare un disco in seguito modificando NAME
|
||||
direttamente nel file di configurazione e quindi eseguendo un
|
||||
|
|
@ -1293,33 +1297,60 @@ il disco di avvio.
|
|||
Si noti che tali dischi non sono influenzati dai comandi `up` e `down`
|
||||
perché si prevede che siano sempre in rotazione.
|
||||
|
||||
7.7 nohidden
|
||||
7.7 snapshot
|
||||
------------
|
||||
|
||||
Abilita l'uso degli snapshot del file system per i comandi `sync`, `scrub`,
|
||||
`check` e `fix`.
|
||||
|
||||
Quando abilitato, SnapRAID crea uno snapshot in sola lettura dei dati all'inizio
|
||||
di un 'sync'. Ciò garantisce una vista coerente e puntuale dei tuoi file,
|
||||
prevenendo errori causati da modifiche simultanee dei file.
|
||||
|
||||
Questo migliora significativamente il recupero: se un file viene eliminato dal file system live,
|
||||
rimane preservato nello snapshot. Ciò impedisce alla parità di diventare "corrotta"
|
||||
per quel blocco, assicurando che sia ancora possibile recuperare correttamente i dati
|
||||
se un altro disco si guasta.
|
||||
|
||||
Questa opzione si applica esclusivamente ai dischi dati formattati con i file system
|
||||
Btrfs, Bcachefs o ZFS in Linux e NTFS in Windows.
|
||||
I dischi di parità, o i dischi dati che utilizzano altri file system, utilizzeranno sempre
|
||||
la versione live del file system.
|
||||
|
||||
La creazione e l'eliminazione degli snapshot richiedono privilegi amministrativi.
|
||||
Assicurati che SnapRAID sia eseguito con i permessi necessari (es. sudo) quando
|
||||
questa opzione è abilitata.
|
||||
|
||||
Vedere la sezione SNAPSHOTS per una spiegazione dettagliata del ciclo di vita
|
||||
degli snapshot.
|
||||
|
||||
7.8 nohidden
|
||||
------------
|
||||
|
||||
Esclude tutti i file e le directory nascosti.
|
||||
In Unix, i file nascosti sono quelli che iniziano con `.`.
|
||||
In Windows, sono quelli con l'attributo nascosto.
|
||||
|
||||
7.8 exclude/include PATTERN
|
||||
7.9 exclude/include PATTERN
|
||||
---------------------------
|
||||
|
||||
Definisce i modelli di file o directory da escludere o includere
|
||||
Definisce i pattern di file o directory da escludere o includere
|
||||
nel processo di sync.
|
||||
Tutti i modelli vengono elaborati nell'ordine specificato.
|
||||
Tutti i pattern vengono elaborati nell'ordine specificato.
|
||||
|
||||
Se il primo modello che corrisponde è un `exclude`, il file
|
||||
Se il primo pattern che corrisponde è un `exclude`, il file
|
||||
viene escluso. Se è un `include`, il file viene incluso.
|
||||
Se nessun modello corrisponde, il file viene escluso se l'ultimo
|
||||
modello specificato è un `include`, o incluso se l'ultimo modello
|
||||
Se nessun pattern corrisponde, il file viene escluso se l'ultimo
|
||||
pattern specificato è un `include`, o incluso se l'ultimo pattern
|
||||
specificato è un `exclude`.
|
||||
|
||||
Vedere la sezione PATTERN per maggiori dettagli sulle specifiche
|
||||
del modello.
|
||||
del pattern.
|
||||
|
||||
Questa opzione può essere utilizzata più volte.
|
||||
|
||||
7.9 blocksize SIZE_IN_KIBIBYTES
|
||||
-------------------------------
|
||||
7.10 blocksize SIZE_IN_KIBIBYTES
|
||||
--------------------------------
|
||||
|
||||
Definisce la dimensione di blocco di base in kibibyte per la parità.
|
||||
Un kibibyte è 1024 byte.
|
||||
|
|
@ -1372,7 +1403,7 @@ Ciò si traduce in circa l'1,5% di spazio extra, circa 60 GB per
|
|||
un disco da 4 TB, che consente circa 460.000 file su ogni disco dati
|
||||
senza alcuno spreco di spazio.
|
||||
|
||||
7.10 hashsize SIZE_IN_BYTES
|
||||
7.11 hashsize SIZE_IN_BYTES
|
||||
---------------------------
|
||||
|
||||
Definisce la dimensione dell'hash in byte per i blocchi salvati.
|
||||
|
|
@ -1389,29 +1420,29 @@ sistema ha memoria limitata. Come regola generale, SnapRAID
|
|||
tipicamente richiede 1 GiB di RAM per ogni 16 TB di dati nell'array.
|
||||
|
||||
Nello specifico, per memorizzare gli hash dei dati, SnapRAID richiede
|
||||
circa $TS*(1+HS)/BS$ byte di RAM,
|
||||
dove $TS$ è la dimensione totale in byte dell'array di dischi, $BS$ è la
|
||||
dimensione del blocco in byte e $HS$ è la dimensione dell'hash in byte.
|
||||
circa TS*(1+HS)/BS byte di RAM,
|
||||
dove TS è la dimensione totale in byte dell'array di dischi, BS è la
|
||||
dimensione del blocco in byte e HS è la dimensione dell'hash in byte.
|
||||
|
||||
Ad esempio, con 8 dischi da 4 TB, una dimensione di blocco di 256 KiB
|
||||
($1 \text{ KiB} = 1024 \text{ byte}$) e una dimensione di hash di 16, si ottiene:
|
||||
(1 KiB = 1024 byte) e una dimensione di hash di 16, si ottiene:
|
||||
|
||||
RAM = $(8 * 4 * 10^{12}) * (1+16) / (256 * 2^{10}) = 1.93 \text{ GiB}$
|
||||
RAM = (8 * 4 * 10^12) * (1+16) / (256 * 2^10) = 1.93 GiB
|
||||
|
||||
Passando a una dimensione di hash di 8, si ottiene:
|
||||
|
||||
RAM = $(8 * 4 * 10^{12}) * (1+8) / (256 * 2^{10}) = 1.02 \text{ GiB}$
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (256 * 2^10) = 1.02 GiB
|
||||
|
||||
Passando a una dimensione di blocco di 512, si ottiene:
|
||||
|
||||
RAM = $(8 * 4 * 10^{12}) * (1+16) / (512 * 2^{10}) = 0.96 \text{ GiB}$
|
||||
RAM = (8 * 4 * 10^12) * (1+16) / (512 * 2^10) = 0.96 GiB
|
||||
|
||||
Passando sia a una dimensione di hash di 8 che a una dimensione di
|
||||
Passando sia a una dimensione di hash di 8 sia a una dimensione di
|
||||
blocco di 512, si ottiene:
|
||||
|
||||
RAM = $(8 * 4 * 10^{12}) * (1+8) / (512 * 2^{10}) = 0.51 \text{ GiB}$
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0.51 GiB
|
||||
|
||||
7.11 autosave SIZE_IN_GIGABYTES
|
||||
7.12 autosave SIZE_IN_GIGABYTES
|
||||
-------------------------------
|
||||
|
||||
Salva automaticamente lo stato durante la sincronizzazione o lo scrubbing
|
||||
|
|
@ -1420,7 +1451,7 @@ Questa opzione è utile per evitare di riavviare lunghi comandi `sync`
|
|||
da zero se interrotti da un arresto anomalo della macchina o qualsiasi
|
||||
altro evento.
|
||||
|
||||
7.12 temp_limit TEMPERATURE_CELSIUS
|
||||
7.13 temp_limit TEMPERATURE_CELSIUS
|
||||
-----------------------------------
|
||||
|
||||
Imposta la temperatura massima del disco consentita in Celsius. Se
|
||||
|
|
@ -1456,14 +1487,14 @@ Normalmente, SnapRAID mostra solo la temperatura del disco più caldo.
|
|||
Per visualizzare la temperatura di tutti i dischi, utilizzare l'opzione
|
||||
-A o --stats.
|
||||
|
||||
7.13 temp_sleep TIME_IN_MINUTES
|
||||
7.14 temp_sleep TIME_IN_MINUTES
|
||||
-------------------------------
|
||||
|
||||
Imposta il tempo di stand-by, in minuti, quando il limite di temperatura
|
||||
viene raggiunto. Durante questo periodo, i dischi rimangono fermi
|
||||
(spin down). Il valore predefinito è 5 minuti.
|
||||
|
||||
7.14 pool DIR
|
||||
7.15 pool DIR
|
||||
-------------
|
||||
|
||||
Definisce la directory di pooling in cui viene creata la vista virtuale
|
||||
|
|
@ -1471,7 +1502,7 @@ dell'array di dischi utilizzando il comando `pool`.
|
|||
|
||||
La directory deve già esistere.
|
||||
|
||||
7.15 share UNC_DIR
|
||||
7.16 share UNC_DIR
|
||||
------------------
|
||||
|
||||
Definisce il percorso UNC di Windows necessario per accedere ai dischi
|
||||
|
|
@ -1489,7 +1520,7 @@ specificato, aggiungendo il nome del disco come specificato nell'opzione
|
|||
|
||||
Questa opzione è richiesta solo per Windows.
|
||||
|
||||
7.16 smartctl DISK/PARITY OPTIONS...
|
||||
7.17 smartctl DISK/PARITY OPTIONS...
|
||||
------------------------------------
|
||||
|
||||
Definisce opzioni smartctl personalizzate per ottenere gli attributi
|
||||
|
|
@ -1506,6 +1537,10 @@ Nelle OPTIONS specificate, la stringa `%s` viene sostituita dal
|
|||
nome del dispositivo. Per i controller RAID, il dispositivo è
|
||||
probabilmente fisso e potrebbe non essere necessario utilizzare `%s`.
|
||||
|
||||
È inoltre possibile specificare una stringa di opzioni di informazioni
|
||||
personalizzate tramite il tag `[info: ...]` per sostituire l'opzione
|
||||
`-a` predefinita.
|
||||
|
||||
Fare riferimento alla documentazione di smartmontools per le possibili
|
||||
opzioni:
|
||||
|
||||
|
|
@ -1514,9 +1549,10 @@ opzioni:
|
|||
|
||||
Ad esempio:
|
||||
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl parity -d sat %s
|
||||
|
||||
7.17 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
7.18 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
-------------------------------------------
|
||||
|
||||
Ignora l'attributo SMART specificato durante il calcolo della
|
||||
|
|
@ -1529,17 +1565,22 @@ PARITY è uno dei nomi di parità: `parity`, `2-parity`, `3-parity`,
|
|||
Il valore speciale * può essere utilizzato per ignorare l'attributo
|
||||
su tutti i dischi.
|
||||
|
||||
Ad esempio, per ignorare l'attributo `Current Pending Sector Count`
|
||||
su tutti i dischi:
|
||||
È possibile specificare più attributi separati da spazi.
|
||||
Ciascun attributo può essere specificato come un numero da 1 a 255, o come
|
||||
un nome insensibile al maiuscolo/minuscolo (ad es. `Current_Pending_Sector`).
|
||||
|
||||
smartignore * 197
|
||||
Ad esempio, per ignorare gli attributi `Current Pending Sector Count` e
|
||||
`Reallocated Sectors Count` su tutti i dischi per numero o nome:
|
||||
|
||||
Per ignorarlo solo sul primo disco di parità:
|
||||
smartignore * 197 5
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
smartignore parity 197
|
||||
Per ignorarli solo sul primo disco di parità:
|
||||
|
||||
7.18 Esempi
|
||||
-----------
|
||||
smartignore parity 197 5
|
||||
|
||||
7.19 Esempi (Examples)
|
||||
----------------------
|
||||
|
||||
Un esempio di configurazione tipica per Unix è:
|
||||
|
||||
|
|
@ -1551,7 +1592,7 @@ Un esempio di configurazione tipica per Unix è:
|
|||
data d3 /mnt/disk3/
|
||||
exclude /lost+found/
|
||||
exclude /tmp/
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/sg0
|
||||
smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1567,14 +1608,134 @@ Un esempio di configurazione tipica per Windows è:
|
|||
exclude Thumbs.db
|
||||
exclude \$RECYCLE.BIN
|
||||
exclude \System Volume Information
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
|
||||
8 PATTERN
|
||||
=========
|
||||
8 SNAPSHOT (SNAPSHOTS)
|
||||
======================
|
||||
|
||||
Se l'opzione snapshot è abilitata nella configurazione, SnapRAID
|
||||
utilizza le funzionalità di snapshot del file system per garantire operazioni atomiche
|
||||
e coerenti.
|
||||
|
||||
La gestione degli snapshot è completamente automatica e trasparente.
|
||||
È possibile continuare a utilizzare SnapRAID esattamente come prima, con la
|
||||
protezione aggiuntiva fornita dagli snapshot gestiti interamente in
|
||||
background.
|
||||
|
||||
Ciò fornisce due vantaggi primari:
|
||||
|
||||
Coerenza - I file modificati sul file system live durante un sync o uno scrub di
|
||||
lunga durata non causeranno discrepanze di parità o operazioni interrotte,
|
||||
poiché SnapRAID vede un'immagine congelata nel tempo.
|
||||
Recupero - Se un file viene aggiornato o eliminato dal file system live,
|
||||
rimane preservato nello snapshot. Se si verifica un guasto al disco
|
||||
prima dell'esecuzione del sync successivo, SnapRAID utilizza i dati preservati
|
||||
nello snapshot per ricostruire il disco guasto.
|
||||
|
||||
In caso di guasto al disco durante un processo di sync attivo,
|
||||
SnapRAID è anche in grado di leggere automaticamente sia dallo snapshot
|
||||
del calcolo della parità precedente che da quello corrente.
|
||||
Ciò massimizza la probabilità di un recupero completo fornendo
|
||||
l'accesso agli esatti blocchi di dati richiesti per risolvere
|
||||
le equazioni di parità, anche se quei blocchi sono stati modificati
|
||||
o eliminati tra i sync.
|
||||
|
||||
Senza snapshot, un file aggiornato o eliminato su un disco integro
|
||||
comporta la mancanza di blocchi di dati che potrebbero essere richiesti per
|
||||
ripristinare altri dischi guasti.
|
||||
|
||||
Gli snapshot vengono creati solo per i dischi dati e solo se il file system
|
||||
sottostante supporta questa funzionalità. I dischi di parità usano sempre
|
||||
il file system live.
|
||||
|
||||
Attualmente, questo è supportato su Btrfs, Bcachefs e ZFS in Linux
|
||||
e su NTFS in Windows.
|
||||
|
||||
È possibile combinare dischi dati con file system diversi. Solo quelli che
|
||||
supportano gli snapshot li utilizzeranno, mentre gli altri dischi continueranno
|
||||
a operare direttamente sul file system live.
|
||||
|
||||
La creazione e l'eliminazione degli snapshot richiedono privilegi amministrativi.
|
||||
Assicurati che SnapRAID sia eseguito con i permessi necessari (es. sudo)
|
||||
quando gli snapshot sono abilitati.
|
||||
|
||||
8.1 Comportamento dei comandi con gli snapshot (Command Behavior with Snapshots)
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
I comandi `sync` e `scrub` operano entrambi esclusivamente sugli snapshot
|
||||
per garantire che tutte le operazioni sui dati siano eseguite rispetto a uno stato coerente
|
||||
e congelato. Utilizzando questi snapshot, SnapRAID previene le discrepanze di parità
|
||||
che verrebbero altrimenti innescate da modifiche simultanee dei file sul file system live.
|
||||
Durante un `sync`, il comando utilizza un nuovo snapshot creato all'inizio
|
||||
del processo per catturare lo stato corrente per il calcolo della parità.
|
||||
Al contrario, il comando `scrub` utilizza l'ultimo snapshot, quello
|
||||
creato durante il sync più recente, per mantenere un punto di riferimento affidabile
|
||||
che corrisponda alla parità esistente.
|
||||
|
||||
Per i comandi `check` e `fix`, l'uso dell'ultimo snapshot
|
||||
dipende dal fatto che vengano presi di mira dischi specifici utilizzando l'opzione
|
||||
-d, --filter-disk.
|
||||
|
||||
Un disco esplicitamente selezionato tramite -d (il "target" dell'operazione)
|
||||
utilizza sempre il file system live. Per `fix`, questo consente di ripristinare
|
||||
i dati sul disco sostitutivo attivo. Per `check`, consente di simulare
|
||||
l'operazione `fix` nelle stesse condizioni.
|
||||
|
||||
Tutti gli altri dischi dati (i dischi di "riferimento") verranno acceduti tramite
|
||||
i loro snapshot. Ciò garantisce che anche se si stanno modificando file
|
||||
sui dischi integri mentre è in corso un recupero, SnapRAID
|
||||
ha un riferimento stabile e congelato per risolvere le equazioni di parità.
|
||||
|
||||
Se non viene fornita alcuna opzione -d, SnapRAID assume che l'operazione si applichi
|
||||
all'intero array; in questo caso, `check` e `fix` utilizzeranno esclusivamente
|
||||
i file system live.
|
||||
|
||||
Tutti gli altri comandi operano esclusivamente sul file system live.
|
||||
|
||||
|
||||
9 CICLO DI VITA DEGLI SNAPSHOT (SNAPSHOTS LIFECYCLE)
|
||||
====================================================
|
||||
|
||||
SnapRAID gestisce due snapshot specifici, `stable` e `pending`,
|
||||
all'interno di una directory nascosta alla radice di ogni sottovolume dati.
|
||||
In Btrfs, Bcachefs e NTFS viene utilizzata la directory `.snapraid/`,
|
||||
in ZFS quella standard `.zfs/snapshot/`.
|
||||
|
||||
Lo snapshot `stable` rappresenta lo stato dell'ultimo
|
||||
`sync` completato con successo, contenente gli esatti dati utilizzati per
|
||||
computare la parità corrente. Funge da fonte di dati primaria
|
||||
per i comandi `scrub`, `check` e `fix`.
|
||||
|
||||
Lo snapshot `pending` è un'immagine temporanea creata all'inizio
|
||||
di un `sync` per fornire uno stato congelato per il calcolo della parità.
|
||||
Al completamento con successo dell'operazione, il precedente snapshot `stable`
|
||||
viene eliminato e lo snapshot `pending` viene promosso per
|
||||
prendere il suo posto come nuovo riferimento stabile.
|
||||
|
||||
Se un `sync` viene interrotto, lo snapshot `pending` viene preservato.
|
||||
I successivi comandi `scrub`, `check` e `fix` utilizzeranno questo
|
||||
snapshot in sospeso poiché corrisponde allo stato del file system registrato nel
|
||||
file .content, anche se la parità è sincronizzata solo parzialmente.
|
||||
|
||||
In caso di interruzione del `sync`, anche i comandi `check` e `fix`
|
||||
leggono dallo snapshot `stable` per recuperare i blocchi di dati
|
||||
da file che sono stati aggiornati o eliminati durante il sync.
|
||||
Ciò è possibile perché il file .content conserva i metadati per
|
||||
tutti i file modificati o eliminati durante l'intero processo di sync.
|
||||
Queste informazioni storiche vengono cancellate solo al termine di un sync
|
||||
avvenuto con successo e quando viene salvata la versione finale del file .content.
|
||||
|
||||
Se un `sync` viene riavviato dopo un'interruzione, lo snapshot pending esistente
|
||||
viene eliminato e ne viene creato uno nuovo per
|
||||
acquisire lo stato corrente del file system live.
|
||||
|
||||
|
||||
10 PATTERN
|
||||
==========
|
||||
|
||||
I pattern offrono un modo flessibile per filtrare i file da includere o
|
||||
escludere. Usando i caratteri globbing, è possibile definire regole che
|
||||
|
|
@ -1698,8 +1859,8 @@ In Unix, quando si utilizzano caratteri di globbing sulla riga di
|
|||
comando, è necessario citarli per impedire alla shell di espanderli.
|
||||
|
||||
|
||||
9 IGNORE FILE
|
||||
=============
|
||||
11 FILE DA IGNORARE (IGNORE FILE)
|
||||
=================================
|
||||
|
||||
In aggiunta alle regole globali nel file di configurazione, è possibile
|
||||
inserire file `.snapraidignore` in qualsiasi directory all'interno dell'array
|
||||
|
|
@ -1712,7 +1873,7 @@ configurazione globale. In pratica, se una regola locale corrisponde, il file vi
|
|||
escluso indipendentemente dalle impostazioni di inclusione globali.
|
||||
|
||||
La logica dei pattern in `.snapraidignore` rispecchia la configurazione globale
|
||||
ma ancora i pattern alla directory in cui si trova il file:
|
||||
ma vincola i pattern alla directory in cui si trova il file:
|
||||
|
||||
FILE
|
||||
Seleziona qualsiasi file chiamato FILE in questa directory o sotto di essa.
|
||||
|
|
@ -1743,20 +1904,22 @@ Ad esempio, se hai un `.snapraidignore` in `/mnt/disk1/projects/`:
|
|||
*.tmp
|
||||
|
||||
|
||||
10 CONTENT
|
||||
==========
|
||||
12 CONTENUTO (CONTENT)
|
||||
======================
|
||||
|
||||
SnapRAID memorizza l'elenco e i checksum dei file nel file di contenuto.
|
||||
|
||||
È un file binario che elenca tutti i file presenti nell'array di dischi,
|
||||
insieme a tutti i checksum per verificarne l'integrità.
|
||||
|
||||
Questo file viene letto e scritto dai comandi `sync` e `scrub` e
|
||||
letto dai comandi `fix`, `check` e `status`.
|
||||
Il file di contenuto viene letto e scritto dai comandi `sync`, `scrub`,
|
||||
`touch` e `rehash`. Viene letto dai comandi `status`, `diff`, `check`,
|
||||
`fix`, `list`, `dup`, `locate` e `pool`, e viene completamente ignorato
|
||||
dai comandi `smart`, `probe`, `up`, `down` e `devices`.
|
||||
|
||||
|
||||
11 PARITY
|
||||
=========
|
||||
13 PARITà (PARITY)
|
||||
==================
|
||||
|
||||
SnapRAID memorizza le informazioni di parità dell'array nei file di
|
||||
parità.
|
||||
|
|
@ -1768,8 +1931,8 @@ Questi file vengono letti e scritti dai comandi `sync` e `fix` e
|
|||
solo letti dai comandi `scrub` e `check`.
|
||||
|
||||
|
||||
12 CODIFICA
|
||||
===========
|
||||
14 CODIFICA (ENCODING)
|
||||
======================
|
||||
|
||||
SnapRAID in Unix ignora qualsiasi codifica. Legge e memorizza i
|
||||
nomi dei file con la stessa codifica utilizzata dal file system.
|
||||
|
|
@ -1786,13 +1949,30 @@ reindirizza l'output della console a un file, il file risultante è
|
|||
sempre in formato UTF-8.
|
||||
|
||||
|
||||
13 COPYRIGHT
|
||||
15 CODICE DI USCITA (EXIT CODE)
|
||||
===============================
|
||||
|
||||
SnapRAID termina con i seguenti codici di errore:
|
||||
|
||||
0 - Tutto OK.
|
||||
1 - Il comando ha riscontrato alcuni errori.
|
||||
2 - Il comando `diff` ha rilevato che tutto è OK, ma è necessario un `sync`.
|
||||
|
||||
|
||||
16 TRADUZIONE (TRANSLATION)
|
||||
===========================
|
||||
|
||||
Questo documento è una traduzione automatica del manuale in inglese.
|
||||
Fare riferimento al manuale in inglese per la versione ufficiale.
|
||||
|
||||
|
||||
17 COPYRIGHT
|
||||
============
|
||||
|
||||
Questo file è Copyright (C) 2025 Andrea Mazzoleni
|
||||
Questo file è Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
|
||||
14 VEDI ANCHE
|
||||
=============
|
||||
18 VEDI ANCHE (SEE ALSO)
|
||||
========================
|
||||
|
||||
snapraid_log(1), snapraidd(1)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
.TH "Disk Array用 SnapRAID バックアップ" 1
|
||||
.SH NAME
|
||||
snapraid \- Disk Array用 SnapRAID バックアップ
|
||||
.SH SYNOPSIS
|
||||
.SH 概要 (SYNOPSIS)
|
||||
snapraid [\-c, \-\-conf CONFIG]
|
||||
.PD 0
|
||||
.PP
|
||||
|
|
@ -77,7 +77,7 @@ snapraid [\-c, \-\-conf CONFIG]
|
|||
snapraid [\-V, \-\-version] [\-H, \-\-help] [\-C, \-\-gen\-conf CONTENT]
|
||||
.PD 0
|
||||
.PD
|
||||
.SH DESCRIPTION
|
||||
.SH 説明 (DESCRIPTION)
|
||||
SnapRAIDは、ディスクアレイ用のバックアッププログラムで、最大6台のディスク障害が発生した場合の
|
||||
データ復旧のためにパリティ情報を保存します。
|
||||
.PP
|
||||
|
|
@ -113,19 +113,33 @@ https://www.snapraid.it/
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH LIMITATIONS
|
||||
.SH 制限事項 (LIMITATIONS)
|
||||
SnapRAIDはRAIDとバックアッププログラムのハイブリッドであり、両方の利点を組み合わせることを
|
||||
目指しています。ただし、使用する前に考慮すべきいくつかの制限があります。
|
||||
目指しています。ただし、使用する前に考慮すべきいくつかの制限事項があります。
|
||||
.PP
|
||||
主な制限は、ディスクが故障し、最近 \`sync\` を実行していない場合、完全に復旧できない
|
||||
可能性があることです。
|
||||
より具体的には、最後の \`sync\` 操作以降に変更または削除されたファイルのサイズまでのデータが
|
||||
復旧できない可能性があります。
|
||||
これは、変更または削除されたファイルが故障したディスク上にない場合でも発生します。
|
||||
このため、SnapRAIDは**めったに変更されない**データに適しています。
|
||||
主な制限事項は、ディスクが故障した場合、最後の \`sync\`(同期)処理の状態までしか
|
||||
データを復元できないことです。最後の同期以降に追加されたデータや、故障したディスク上で行われた
|
||||
変更はすべて失われます。
|
||||
.PP
|
||||
一方で、新しく追加されたファイルは、既に存在するファイルの復旧を妨げません。
|
||||
新しく追加されたファイルが故障したディスク上にある場合にのみ、それらのファイルが失われます。
|
||||
そのため、SnapRAIDは主にデータの変更がほとんどない環境に適しています。
|
||||
.PP
|
||||
最後の同期時にすでに存在していたデータについて、復元の信頼性は \`snapshot\`(スナップショット)
|
||||
オプションが使用されているかどうかによって異なります。
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
スナップショットサポートがある場合(Btrfs、ZFS、Bcachefs、およびNTFSで利用可能):
|
||||
SnapRAIDはデータディスクの凍結されたリファレンスを自動的に維持できます。
|
||||
これにより、同期中または同期後にライブファイルシステム上のファイルを変更または削除した場合でも、
|
||||
復元プロセスの整合性と信頼性が保たれます。
|
||||
.PD
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
スナップショットサポートがない場合:
|
||||
\`sync\` 後にファイルを削除または変更すると、他の故障したディスクの完全な復元が妨げられる
|
||||
可能性があります。これは、変更されたファイルが故障したディスク上にない場合でも、
|
||||
パリティが変更後のファイルと一致しなくなるために発生します。一方で、新しく追加されたファイルが
|
||||
すでに存在するファイルの復元を妨げることはありません。
|
||||
.PD
|
||||
.PP
|
||||
その他のSnapRAIDの制限は次のとおりです。
|
||||
.PD 0
|
||||
|
|
@ -145,7 +159,7 @@ SnapRAIDは**限られた数のディスク障害**からのみデータを復
|
|||
**ファイル名、タイムスタンプ、シンボリックリンク、およびハードリンク**のみが保存されます。
|
||||
アクセス許可、所有権、および拡張属性は保存されません。
|
||||
.PD
|
||||
.SH GETTING STARTED
|
||||
.SH はじめに (GETTING STARTED)
|
||||
SnapRAIDを使用するには、まずディスクアレイ内の1つのディスクを \`parity\` 情報専用に
|
||||
選択する必要があります。パリティ用に1つのディスクを使用すると、RAID5と同様に、単一のディスク障害から
|
||||
復旧できます。
|
||||
|
|
@ -283,7 +297,7 @@ Ctrl+Cを押すことでいつでも停止でき、次回の実行時には中
|
|||
.PP
|
||||
これで、アレイを自由に使い始め、定期的に \`sync\` コマンドを実行してパリティ情報を
|
||||
更新できます。
|
||||
.SS Scrubbing
|
||||
.SS スクラブ (Scrubbing)
|
||||
データとパリティのエラーを定期的にチェックするには、\`scrub\` コマンドを
|
||||
実行できます。
|
||||
.PP
|
||||
|
|
@ -341,10 +355,10 @@ snapraid \-p bad scrub
|
|||
未同期のアレイで \`scrub\` を実行すると、削除または変更されたファイルによって
|
||||
引き起こされたエラーが報告される場合があります。これらのエラーは \`scrub\` の
|
||||
出力で報告されますが、関連するブロックは不良としてマークされません。
|
||||
.SS Pooling
|
||||
.SS プーリング (Pooling)
|
||||
注: ここで説明するプーリング機能は、**mergerfs** ツールに取って代わられました。
|
||||
mergerfs は、SnapRAIDコミュニティのLinuxユーザーに推奨されるオプションです。
|
||||
Mergefs は、複数のドライブを単一の統合されたマウントポイントにプールするための、
|
||||
Mergerfs は、複数のドライブを単一の統合されたマウントポイントにプールするための、
|
||||
より柔軟で効率的な方法を提供し、シンボリックリンクに頼ることなくアレイ全体の
|
||||
ファイルにシームレスにアクセスできます。これは、パリティ保護のためにSnapRAIDと
|
||||
うまく統合されており、OpenMediaVault (OMV) やカスタムNAS構成などのセットアップで
|
||||
|
|
@ -489,7 +503,7 @@ fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Undeleting
|
||||
.SS 削除取り消し (Undeleting)
|
||||
SnapRAIDはRAIDシステムよりもバックアッププログラムのように機能し、
|
||||
\-f, \-\-filter オプションを使用してファイルを以前の状態に復元または削除解除するために
|
||||
使用できます。
|
||||
|
|
@ -525,7 +539,7 @@ snapraid fix \-m
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Recovering
|
||||
.SS 回復 (Recovering)
|
||||
最悪の事態が発生し、1台以上のディスクを失いました!
|
||||
.PP
|
||||
**パニックにならないでください!** 復旧できます!
|
||||
|
|
@ -623,22 +637,22 @@ snapraid sync
|
|||
.RE
|
||||
.PP
|
||||
すべてが復旧されていれば、このコマンドは即座に完了します。
|
||||
.SH COMMANDS
|
||||
SnapRAIDは、次のことを可能にするいくつかの簡単なコマンドを提供します。
|
||||
.SH コマンド (COMMANDS)
|
||||
SnapRAIDは、以下の操作を行ういくつかのシンプルなコマンドを提供します。
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
アレイの状態の概要を出力 \-> \`status\`
|
||||
アレイの状態を表示する \-> \`status\`
|
||||
.IP \(bu
|
||||
ディスクの制御 \-> \`smart\`、\`probe\`、\`up\`、\`down\`
|
||||
ディスクを制御する \-> \`smart\`、\`probe\`、\`up\`、\`down\`
|
||||
.IP \(bu
|
||||
バックアップ/スナップショットの作成 \-> \`sync\`
|
||||
バックアップ/復元ポイントを作成する \-> \`sync\`
|
||||
.IP \(bu
|
||||
データの定期的なチェック \-> \`scrub\`
|
||||
データを定期的にチェックする \-> \`scrub\`
|
||||
.IP \(bu
|
||||
最後のバックアップ/スナップショットの復元 \-> \`fix\`。
|
||||
最後のバックアップ/復元ポイントを復元する \-> \`fix\`
|
||||
.PD
|
||||
.PP
|
||||
コマンドは**小文字**で記述する必要があります。
|
||||
コマンドは小文字で入力する必要があります。
|
||||
.SS status
|
||||
ディスクアレイの状態の概要を出力します。
|
||||
.PP
|
||||
|
|
@ -858,14 +872,14 @@ full \- すべてをスクラブします。
|
|||
\`parity\` ファイルは**変更されません**。
|
||||
アレイ内のファイルは**変更されません**。
|
||||
.SS fix
|
||||
すべてのファイルとパリティデータを修正します。
|
||||
すべてのファイルとパリティデータを修復(復元)します。
|
||||
.PP
|
||||
すべてのファイルとパリティデータは、最後の \`sync\` で保存されたスナップショット状態と
|
||||
比較されます。
|
||||
違いが見つかった場合、保存されたスナップショットに**元に戻されます**。
|
||||
すべてのファイルとパリティデータが、最後の \`sync\` で保存された状態と比較されます。
|
||||
差異が見つかった場合、保存されていた状態に巻き戻されます。
|
||||
.PP
|
||||
**警告!** \`fix\` コマンドは、エラーと意図的な変更を区別しません。
|
||||
ファイルの_状態を_最後の \`sync\` に**無条件に元に戻します**。
|
||||
警告!
|
||||
\`fix\` コマンドは、エラーと意図的な変更を区別しません。
|
||||
ファイルの変更状態を無条件で最後の \`sync\` の状態に戻します。
|
||||
.PP
|
||||
他のオプションが指定されていない場合、アレイ全体が処理されます。
|
||||
フィルタオプションを使用して、操作するファイルまたはディスクのサブセットを
|
||||
|
|
@ -984,7 +998,7 @@ SnapRAIDが移動およびコピーされたファイルを認識する能力が
|
|||
使用できます。
|
||||
再配置プロセス中、これらのファイルはパリティによって保護されないことに
|
||||
注意してください。
|
||||
.SH OPTIONS
|
||||
.SH オプション (OPTIONS)
|
||||
SnapRAIDには、次のオプションがあります。
|
||||
.TP
|
||||
.B \-c, \-\-conf CONFIG
|
||||
|
|
@ -1087,7 +1101,7 @@ DAYS は、ブロックがスクラブされるための最小経過日数であ
|
|||
1秒あたりのバイト数です。K、M、Gなどの乗数を指定できます
|
||||
(例:\-\-bw\-limit 1G)。
|
||||
.TP
|
||||
.B \-t, \-\-tail サイズ
|
||||
.B \-t, \-\-tail SIZE
|
||||
ファイルリストを、パリティディスクの指定された末尾サイズ以下を
|
||||
使用しているものに制限します。
|
||||
K、M、G、T などの倍数を使用できます(例:\-\-tail 1G)。
|
||||
|
|
@ -1172,7 +1186,7 @@ SnapRAIDが一部のディスクがUUIDを変更したことを検出した場
|
|||
お勧めします。
|
||||
\`sync\` 操作中にデータ保護はありません。
|
||||
.TP
|
||||
.B \-W, \-\-force\-realloc\-tail サイズ
|
||||
.B \-W, \-\-force\-realloc\-tail SIZE
|
||||
\-R, \-\-force\-realloc と同様に動作しますが、各パリティファイルの
|
||||
指定された末尾部分(最後の「サイズ」バイト)に制限されます。
|
||||
現在その末尾セクションに保存されているファイルフラグメント/ブロックの
|
||||
|
|
@ -1249,7 +1263,7 @@ locate \-t, \-\-tail を使用して、影響を受けるファイルを事前
|
|||
.TP
|
||||
.B \-V, \-\-version
|
||||
プログラムのバージョンを出力します。
|
||||
.SH CONFIGURATION
|
||||
.SH 設定 (CONFIGURATION)
|
||||
SnapRAIDは、ディスクアレイの場所とパリティ情報の保存場所を知るために、構成ファイルを
|
||||
必要とします。
|
||||
.PP
|
||||
|
|
@ -1348,6 +1362,27 @@ NAME を固定したままにしておけば、必要に応じてマウントポ
|
|||
.PP
|
||||
これらのディスクは常に回転していることが期待されるため、\`up\` およ
|
||||
び \`down\` コマンドの影響を受けないことに注意してください。
|
||||
.SS snapshot
|
||||
\`sync\`、\`scrub\`、\`check\`、および \`fix\` コマンドでファイルシステムスナップショットの
|
||||
使用を有効にします。
|
||||
.PP
|
||||
有効にすると、SnapRAIDは \`sync\` の開始時にデータの読み取り専用スナップショットを作成します。
|
||||
これにより、ファイルの整合性を保った特定の時点のビューが確保され、ファイルの同時変更によって
|
||||
発生するエラーを防ぎます。
|
||||
.PP
|
||||
これにより復元が大幅に向上します。ライブファイルシステムからファイルが削除されても、
|
||||
スナップショット内に保存され続けます。これにより、そのブロックのパリティが「破損」するのを防ぎ、
|
||||
別のディスクが故障した場合でもデータを正常に復元できるようになります。
|
||||
.PP
|
||||
このオプションは、LinuxのBtrfs、Bcachefs、ZFS、およびWindowsのNTFSでフォーマットされた
|
||||
データディスクにのみ適用されます。
|
||||
パリティディスク、または他のファイルシステムを使用しているデータディスクは、常にファイルシステムの
|
||||
ライブバージョンを使用します。
|
||||
.PP
|
||||
スナップショットの作成と削除には管理者権限が必要です。
|
||||
このオプションが有効な場合は、SnapRAIDが必要な権限(例:sudo)で実行されていることを確認してください。
|
||||
.PP
|
||||
スナップショットのライフサイクルの詳細な説明については、SNAPSHOTSのセクションを参照してください。
|
||||
.SS nohidden
|
||||
すべての隠しファイルとディレクトリを除外します。
|
||||
Unixでは、隠しファイルは \`.\` で始まるファイルです。
|
||||
|
|
@ -1421,31 +1456,31 @@ mkfs.ext4 \-m 0 \-T largefile4 DEVICE
|
|||
経験則として、SnapRAIDは通常、アレイ内のデータ16 TBごとに1 GiBのRAMを必要とします。
|
||||
.PP
|
||||
具体的には、データのハッシュを保存するために、SnapRAIDは
|
||||
約 $TS \\cdot (1 + HS) / BS$ バイトのRAMを必要とします。
|
||||
約 TS*(1+HS)/BS バイトのRAMを必要とします。
|
||||
ここで、TSはディスクアレイの合計サイズ(バイト)、BSはブロックサイズ(バイト)、HSはハッシュサイズ(バイト)です。
|
||||
.PP
|
||||
たとえば、4 TBのディスク8台、ブロックサイズ256 KiB(1 KiB = 1024バイト)、
|
||||
ハッシュサイズ16の場合:
|
||||
.PP
|
||||
RAM = $(8 \\cdot 4 \\cdot 10^{12}) \\cdot (1 + 16) / (256 \\cdot 2^{10}) = 1.93 \\text{ GiB}$
|
||||
RAM = (8 * 4 * 10^12) * (1+16) / (256 * 2^10) = 1.93 GiB
|
||||
.PD 0
|
||||
.PD
|
||||
.PP
|
||||
ハッシュサイズを8に切り替えると:
|
||||
.PP
|
||||
RAM = $(8 \\cdot 4 \\cdot 10^{12}) \\cdot (1 + 8) / (256 \\cdot 2^{10}) = 1.02 \\text{ GiB}$
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (256 * 2^10) = 1.02 GiB
|
||||
.PD 0
|
||||
.PD
|
||||
.PP
|
||||
ブロックサイズを512に切り替えると:
|
||||
.PP
|
||||
RAM = $(8 \\cdot 4 \\cdot 10^{12}) \\cdot (1 + 16) / (512 \\cdot 2^{10}) = 0.96 \\text{ GiB}$
|
||||
RAM = (8 * 4 * 10^12) * (1+16) / (512 * 2^10) = 0.96 GiB
|
||||
.PD 0
|
||||
.PD
|
||||
.PP
|
||||
ハッシュサイズを8、ブロックサイズを512の両方に切り替えると:
|
||||
.PP
|
||||
RAM = $(8 \\cdot 4 \\cdot 10^{12}) \\cdot (1 + 8) / (512 \\cdot 2^{10}) = 0.51 \\text{ GiB}$
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0.51 GiB
|
||||
.PD 0
|
||||
.PD
|
||||
.SS autosave SIZE_IN_GIGABYTES
|
||||
|
|
@ -1511,6 +1546,9 @@ PARITY はパリティ名のいずれかです:\`parity\`、\`2\-parity\`、\`
|
|||
RAIDコントローラーの場合、デバイスは固定されている可能性が高いため、
|
||||
\`%s\` を使用する必要はないかもしれません。
|
||||
.PP
|
||||
デフォルトの \`\-a\` オプションを置き換えるために、\`[info: ...]\` タグを使用して
|
||||
カスタム情報オプション文字列を指定することもできます。
|
||||
.PP
|
||||
使用可能なオプションについては、smartmontoolsのドキュメントを参照してください。
|
||||
.PP
|
||||
.RS 4
|
||||
|
|
@ -1526,6 +1564,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices
|
|||
例:
|
||||
.PP
|
||||
.RS 4
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl parity \-d sat %s
|
||||
.PD 0
|
||||
.PD
|
||||
|
|
@ -1540,10 +1582,19 @@ PARITY はパリティ名のいずれかです:\`parity\`、\`2\-parity\`、\`
|
|||
\`4\-parity\`、\`5\-parity\`、\`6\-parity\`、または \`z\-parity\`。
|
||||
特殊な値 \`*\` は、すべてのディスクで属性を無視するために使用できます。
|
||||
.PP
|
||||
例として、すべてのディスクで \`Current Pending Sector Count\` 属性を無視するには:
|
||||
複数の属性をスペースで区切って指定できます。
|
||||
各属性は1から255までの数値、または大文字と小文字を区别しない名前
|
||||
(例: \`Current_Pending_Sector\`)として指定できます。
|
||||
.PP
|
||||
例として、すべてのディスクで \`Current Pending Sector Count\` と
|
||||
\`Reallocated Sectors Count\` 属性を番号または名前で無視するには:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore * 197
|
||||
smartignore * 197 5
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
|
|
@ -1551,11 +1602,11 @@ smartignore * 197
|
|||
最初のパリティディスクでのみ無視するには:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore parity 197
|
||||
smartignore parity 197 5
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Examples
|
||||
.SS 例 (Examples)
|
||||
Unixの一般的な構成の例は次のとおりです。
|
||||
.PP
|
||||
.RS 4
|
||||
|
|
@ -1591,7 +1642,7 @@ exclude /tmp/
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1647,7 +1698,7 @@ exclude \\System Volume Information
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1663,7 +1714,105 @@ smartctl 2\-parity \-d areca,2/1 /dev/arcmsr0
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH PATTERN
|
||||
.SH スナップショット (SNAPSHOTS)
|
||||
設定でスナップショットオプションが有効になっている場合、SnapRAIDは
|
||||
ファイルシステムのスナップショット機能を利用して、アトミックで一貫性のある操作を保証します。
|
||||
.PP
|
||||
スナップショットの管理は完全に自動かつ透過的です。
|
||||
バックグラウンドで完全に処理されるスナップショットによる追加の保護を受けながら、
|
||||
これまでとまったく同じようにSnapRAIDを使用し続けることができます。
|
||||
.PP
|
||||
これには主に2つのメリットがあります。
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I 整合性
|
||||
長時間かかるsyncやscrubの実行中にライブファイルシステム上でファイルが変更されても、
|
||||
SnapRAIDは凍結された時点のイメージを参照するため、パリティの不一致や処理の中断は発生しません。
|
||||
.HP 4
|
||||
.I 復元
|
||||
ライブファイルシステムからファイルが更新または削除されても、スナップショット内に保存され続けます。
|
||||
次のsyncが実行される前にディスク故障が発生した場合、SnapRAIDはスナップショットに保存されている
|
||||
データを使用して、故障したディスクを再構築します。
|
||||
.PD
|
||||
.PP
|
||||
.RS 4
|
||||
.PD 0
|
||||
アクティブなsync処理中にディスクが故障した場合、SnapRAIDは前のパリティ計算の
|
||||
スナップショットと現在のスナップショットの両方から自動的に読み取ることも可能です。
|
||||
これにより、同期の間にブロックが変更または削除されていた場合でも、パリティ方程式を解くために
|
||||
必要な正確なデータブロックへのアクセスが提供され、完全な復元の可能性が最大化されます。
|
||||
.PD
|
||||
.PP
|
||||
.PD 0
|
||||
スナップショットがない場合、正常なディスク上の更新または削除されたファイルはデータブロックの欠損を
|
||||
招き、他の故障したディスクを修復するために必要となるブロックが失われる可能性があります。
|
||||
.PD
|
||||
.RE
|
||||
.RE
|
||||
.PP
|
||||
スナップショットはデータディスクに対してのみ、かつ基礎となるファイルシステムがその機能をサポートして
|
||||
いる場合にのみ作成されます。パリティディスクは常にライブファイルシステムを使用します。
|
||||
.PP
|
||||
現在、これはLinuxのBtrfs、Bcachefs、ZFS、およびWindowsのNTFSでサポートされています。
|
||||
.PP
|
||||
異なるファイルシステムを持つデータディスクを混在させることができます。スナップショットをサポートして
|
||||
いるディスクのみがそれを利用し、他のディスクはライブファイルシステム上で直接動作し続けます。
|
||||
.PP
|
||||
スナップショットの作成と削除には管理者権限が必要です。
|
||||
スナップショットが有効な場合は、SnapRAIDが必要な権限(例:sudo)で実行されていることを確認してください。
|
||||
.SS スナップショット使用時のコマンドの挙動 (Command Behavior with Snapshots)
|
||||
\`sync\` と \`scrub\` コマンドは、すべてのデータ操作が一貫した凍結状態に対して行われることを
|
||||
保証するために、いずれもスナップショット上でのみ動作します。これらのスナップショットを利用することで、
|
||||
SnapRAIDはライブファイルシステム上での同時ファイル変更によってトリガーされるパリティの不一致を防ぎます。
|
||||
\`sync\` の実行中、コマンドはプロセスの開始時に作成された新しいスナップショットを使用して、パリティ計算の
|
||||
ための現在の状態をキャプチャします。
|
||||
対照的に、\`scrub\` コマンドは、既存のパリティと一致する信頼できる参照ポイントを維持するために、
|
||||
最も直近の同期中に作成された最後のスナップショットを利用します。
|
||||
.PP
|
||||
\`check\` および \`fix\` コマンドの場合、最後のスナップショットの使用は、
|
||||
\-d, \-\-filter\-disk オプションを使用して特定のディスクがターゲットに指定されているかどうかによって異なります。
|
||||
.TP
|
||||
.B \-d を介して明示的に選択されたディスク(操作の「ターゲット」)は、常にライブファイルシステムを使用します。
|
||||
\`fix\` の場合、これによりアクティブな交換ディスクにデータを復元できます。
|
||||
\`check\` の場合、同じ条件下で \`fix\` 操作をシミュレートできます。
|
||||
.PP
|
||||
他のすべてのデータディスク(「参照」ディスク)は、それぞれのスナップショットを介してアクセスされます。
|
||||
これにより、復旧の進行中に正常なディスク上のファイルを変更している場合でも、SnapRAIDは
|
||||
パリティ方程式を解くための安定した凍結された参照を持つことができます。
|
||||
.TP
|
||||
.B \-d オプションが指定されていない場合、SnapRAIDは操作がアレイ全体に適用されると想定します。
|
||||
この場合、\`check\` と \`fix\` はライブファイルシステムのみを排他的に使用します。
|
||||
.PP
|
||||
他のすべてのコマンドは、ライブファイルシステム上でのみ動作します。
|
||||
.SH スナップショットのライフサイクル (SNAPSHOTS LIFECYCLE)
|
||||
SnapRAIDは、各データサブボリュームのルートにある隠しディレクトリ内で、
|
||||
\`stable\`(安定)と \`pending\`(保留)という2つの特定のスナップショットを管理します。
|
||||
Btrfs、Bcachefs、およびNTFSでは \`.snapraid/\` ディレクトリが使用され、
|
||||
ZFSでは標準の \`.zfs/snapshot/\` が使用されます。
|
||||
.PP
|
||||
\`stable\` スナップショットは、最後に正常に完了した \`sync\` の状態を表し、
|
||||
現在のパリティの計算に使用された正確なデータを含んでいます。これは、
|
||||
\`scrub\`、\`check\`、および \`fix\` コマンドの主要なデータソースとして機能します。
|
||||
.PP
|
||||
\`pending\` スナップショットは、パリティ計算のための凍結された状態を提供するために、
|
||||
\`sync\` の開始時に作成される一時的なイメージです。
|
||||
操作が正常に完了すると、以前の \`stable\` スナップショットが削除され、
|
||||
\`pending\` スナップショットが新しい安定した参照として昇格します。
|
||||
.PP
|
||||
\`sync\` が中断された場合、\`pending\` スナップショットは保持されます。
|
||||
パリティが部分的にしか同期されていない場合でも、.content ファイルに記録されたファイルシステム状態と
|
||||
一致するため、その後の \`scrub\`、\`check\`、および \`fix\` コマンドはこの保留中のスナップショットを使用します。
|
||||
.PP
|
||||
\`sync\` が中断された場合、\`check\` および \`fix\` コマンドは \`stable\` スナップショットからも
|
||||
読み取りを行い、同期中に更新または削除されたファイルからデータブロックを取得します。
|
||||
これは、.content ファイルが同期プロセス全体を通じて、変更または削除されたすべてのファイルの
|
||||
メタデータを保持しているために可能です。
|
||||
この履歴情報は、syncが正常に終了し、.content ファイルの最終バージョンが保存されたときにのみクリアされます。
|
||||
.PP
|
||||
中断後に \`sync\` が再開されると、既存の保留中(pending)のスナップショットは削除され、
|
||||
ライブファイルシステムの現在の状態をキャプチャするために新しいスナップショットが作成されます。
|
||||
.SH パターン (PATTERN)
|
||||
パターンは、含めるファイルまたは除外するファイルをフィルタリングするための柔軟な方法を
|
||||
提供します。グロブ文字を使用することで、すべてのパスを手動でリストすることなく、
|
||||
特定のファイル名やディレクトリ構造全体に一致するルールを定義できます。
|
||||
|
|
@ -1839,9 +1988,9 @@ snapraid \-f \[dq]*.mp3\[dq] check
|
|||
.PP
|
||||
Unixでは、コマンドラインでグロブ文字を使用する場合、シェルがそれらを展開するのを
|
||||
防ぐために引用符で囲む必要があります。
|
||||
.SH IGNORE FILE
|
||||
.SH 除外ファイル (IGNORE FILE)
|
||||
設定ファイルのグローバルルールに加えて、アレイ内の任意のディレクトリに
|
||||
.snapraidignore ファイルを配置して、分散型の除外ルールを定義できます。
|
||||
\`.snapraidignore\` ファイルを配置して、分散型の除外ルールを定義できます。
|
||||
.PP
|
||||
\`.snapraidignore\` で定義されたルールは、設定ファイルのルールの後に
|
||||
適用されます。これは、それらがより高い優先度を持ち、グローバル設定で
|
||||
|
|
@ -1898,15 +2047,18 @@ build/
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH CONTENT
|
||||
.SH コンテンツ (CONTENT)
|
||||
SnapRAIDは、ファイルの一覧とチェックサムをコンテンツファイルに保存します。
|
||||
.PP
|
||||
これはバイナリファイルであり、ディスクアレイに存在するすべてのファイルと、
|
||||
それらの整合性を検証するためのすべてのチェックサムを一覧表示します。
|
||||
.PP
|
||||
このファイルは \`sync\` および \`scrub\` コマンドによって読み書きされ、
|
||||
\`fix\`、\`check\`、および \`status\` コマンドによって読み取られます。
|
||||
.SH PARITY
|
||||
コンテンツファイルは \`sync\`、\`scrub\`、\`touch\`、および \`rehash\`
|
||||
コマンドによって読み書きされます。\`status\`、\`diff\`、\`check\`、
|
||||
\`fix\`、\`list\`、\`dup\`、\`locate\`、および \`pool\` コマンドによって読み取られ、
|
||||
\`smart\`、\`probe\`、\`up\`、\`down\`、および \`devices\` コマンドによって
|
||||
完全に無視されます。
|
||||
.SH パリティ (PARITY)
|
||||
SnapRAIDは、アレイのパリティ情報をパリティファイルに保存します。
|
||||
.PP
|
||||
これらはバイナリファイルであり、\`content\` ファイルで定義されたすべてのブロックの
|
||||
|
|
@ -1914,7 +2066,7 @@ SnapRAIDは、アレイのパリティ情報をパリティファイルに保存
|
|||
.PP
|
||||
これらのファイルは \`sync\` および \`fix\` コマンドによって読み書きされ、
|
||||
\`scrub\` および \`check\` コマンドによって**読み取られるだけ**です。
|
||||
.SH ENCODING
|
||||
.SH エンコーディング (ENCODING)
|
||||
UnixのSnapRAIDは、エンコーディングを無視します。ファイルシステムで使用されている
|
||||
のと同じエンコーディングでファイル名を読み取り、保存します。
|
||||
.PP
|
||||
|
|
@ -1922,10 +2074,28 @@ Windowsでは、ファイルシステムから読み取られたすべての名
|
|||
処理されます。
|
||||
.PP
|
||||
ファイル名を正しく出力するには、\`chcp 65001\` コマンドでWindowsコンソールをUTF\-8モードに設定し、
|
||||
コンソールフォントとして \`Lucida Console\` などのTrueTypeフォントを**使用する**必要があります。
|
||||
コンソールフォントとして \`Lucida Console\` などのTrueTypeフォントを使用する必要があります。
|
||||
これは出力されるファイル名にのみ影響します。コンソール出力をファイルにリダイレクトする場合、
|
||||
結果のファイルは常にUTF\-8形式になります。
|
||||
.SH COPYRIGHT
|
||||
This file is Copyright (C) 2025 Andrea Mazzoleni
|
||||
.SH SEE ALSO
|
||||
snapraid_log(1), snapraidd(1)
|
||||
.SH 終了コード (EXIT CODE)
|
||||
SnapRAIDは以下のエラーコードで終了します:
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I 0
|
||||
すべて正常。
|
||||
.HP 4
|
||||
.I 1
|
||||
コマンドでエラーが発生しました。
|
||||
.HP 4
|
||||
.I 2
|
||||
\`diff\` コマンドはすべて正常であると判定しましたが、 \`sync\` が必要です。
|
||||
.PD
|
||||
.RE
|
||||
.SH 翻訳 (TRANSLATION)
|
||||
この文書は英語版マニュアルの自動翻訳です。
|
||||
正確な記述については英語版マニュアルを参照してください。
|
||||
.SH 著作権 (COPYRIGHT)
|
||||
This file is Copyright (C) 2026 Andrea Mazzoleni
|
||||
.SH 関連項目 (SEE ALSO)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
Name{number}
|
||||
snapraid - Disk Array用 SnapRAID バックアップ
|
||||
|
||||
Synopsis
|
||||
概要 (Synopsis)
|
||||
:snapraid [-c, --conf CONFIG]
|
||||
: [-f, --filter PATTERN] [-d, --filter-disk NAME]
|
||||
: [-m, --filter-missing] [-e, --filter-error]
|
||||
|
|
@ -23,7 +23,7 @@ Synopsis
|
|||
|
||||
:snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
Description
|
||||
説明 (Description)
|
||||
SnapRAIDは、ディスクアレイ用のバックアッププログラムで、最大6台のディスク障害が発生した場合の
|
||||
データ復旧のためにパリティ情報を保存します。
|
||||
|
||||
|
|
@ -47,19 +47,29 @@ Description
|
|||
|
||||
:https://www.snapraid.it/
|
||||
|
||||
Limitations
|
||||
制限事項 (Limitations)
|
||||
SnapRAIDはRAIDとバックアッププログラムのハイブリッドであり、両方の利点を組み合わせることを
|
||||
目指しています。ただし、使用する前に考慮すべきいくつかの制限があります。
|
||||
目指しています。ただし、使用する前に考慮すべきいくつかの制限事項があります。
|
||||
|
||||
主な制限は、ディスクが故障し、最近 `sync` を実行していない場合、完全に復旧できない
|
||||
可能性があることです。
|
||||
より具体的には、最後の `sync` 操作以降に変更または削除されたファイルのサイズまでのデータが
|
||||
復旧できない可能性があります。
|
||||
これは、変更または削除されたファイルが故障したディスク上にない場合でも発生します。
|
||||
このため、SnapRAIDは**めったに変更されない**データに適しています。
|
||||
主な制限事項は、ディスクが故障した場合、最後の `sync`(同期)処理の状態までしか
|
||||
データを復元できないことです。最後の同期以降に追加されたデータや、故障したディスク上で行われた
|
||||
変更はすべて失われます。
|
||||
|
||||
一方で、新しく追加されたファイルは、既に存在するファイルの復旧を妨げません。
|
||||
新しく追加されたファイルが故障したディスク上にある場合にのみ、それらのファイルが失われます。
|
||||
そのため、SnapRAIDは主にデータの変更がほとんどない環境に適しています。
|
||||
|
||||
最後の同期時にすでに存在していたデータについて、復元の信頼性は `snapshot`(スナップショット)
|
||||
オプションが使用されているかどうかによって異なります。
|
||||
|
||||
* スナップショットサポートがある場合(Btrfs、ZFS、Bcachefs、およびNTFSで利用可能):
|
||||
SnapRAIDはデータディスクの凍結されたリファレンスを自動的に維持できます。
|
||||
これにより、同期中または同期後にライブファイルシステム上のファイルを変更または削除した場合でも、
|
||||
復元プロセスの整合性と信頼性が保たれます。
|
||||
|
||||
* スナップショットサポートがない場合:
|
||||
`sync` 後にファイルを削除または変更すると、他の故障したディスクの完全な復元が妨げられる
|
||||
可能性があります。これは、変更されたファイルが故障したディスク上にない場合でも、
|
||||
パリティが変更後のファイルと一致しなくなるために発生します。一方で、新しく追加されたファイルが
|
||||
すでに存在するファイルの復元を妨げることはありません。
|
||||
|
||||
その他のSnapRAIDの制限は次のとおりです。
|
||||
|
||||
|
|
@ -74,7 +84,7 @@ Limitations
|
|||
* **ファイル名、タイムスタンプ、シンボリックリンク、およびハードリンク**のみが保存されます。
|
||||
アクセス許可、所有権、および拡張属性は保存されません。
|
||||
|
||||
Getting Started
|
||||
はじめに (Getting Started)
|
||||
SnapRAIDを使用するには、まずディスクアレイ内の1つのディスクを `parity` 情報専用に
|
||||
選択する必要があります。パリティ用に1つのディスクを使用すると、RAID5と同様に、単一のディスク障害から
|
||||
復旧できます。
|
||||
|
|
@ -148,7 +158,7 @@ Getting Started
|
|||
これで、アレイを自由に使い始め、定期的に `sync` コマンドを実行してパリティ情報を
|
||||
更新できます。
|
||||
|
||||
Scrubbing
|
||||
スクラブ (Scrubbing)
|
||||
データとパリティのエラーを定期的にチェックするには、`scrub` コマンドを
|
||||
実行できます。
|
||||
|
||||
|
|
@ -187,10 +197,10 @@ Getting Started
|
|||
引き起こされたエラーが報告される場合があります。これらのエラーは `scrub` の
|
||||
出力で報告されますが、関連するブロックは不良としてマークされません。
|
||||
|
||||
Pooling
|
||||
プーリング (Pooling)
|
||||
注: ここで説明するプーリング機能は、**mergerfs** ツールに取って代わられました。
|
||||
mergerfs は、SnapRAIDコミュニティのLinuxユーザーに推奨されるオプションです。
|
||||
Mergefs は、複数のドライブを単一の統合されたマウントポイントにプールするための、
|
||||
Mergerfs は、複数のドライブを単一の統合されたマウントポイントにプールするための、
|
||||
より柔軟で効率的な方法を提供し、シンボリックリンクに頼ることなくアレイ全体の
|
||||
ファイルにシームレスにアクセスできます。これは、パリティ保護のためにSnapRAIDと
|
||||
うまく統合されており、OpenMediaVault (OMV) やカスタムNAS構成などのセットアップで
|
||||
|
|
@ -259,7 +269,7 @@ Getting Started
|
|||
|
||||
:fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
||||
|
||||
Undeleting
|
||||
削除取り消し (Undeleting)
|
||||
SnapRAIDはRAIDシステムよりもバックアッププログラムのように機能し、
|
||||
-f, --filter オプションを使用してファイルを以前の状態に復元または削除解除するために
|
||||
使用できます。
|
||||
|
|
@ -280,7 +290,7 @@ Getting Started
|
|||
|
||||
:snapraid fix -m
|
||||
|
||||
Recovering
|
||||
回復 (Recovering)
|
||||
最悪の事態が発生し、1台以上のディスクを失いました!
|
||||
|
||||
**パニックにならないでください!** 復旧できます!
|
||||
|
|
@ -363,16 +373,16 @@ Getting Started
|
|||
|
||||
すべてが復旧されていれば、このコマンドは即座に完了します。
|
||||
|
||||
Commands
|
||||
SnapRAIDは、次のことを可能にするいくつかの簡単なコマンドを提供します。
|
||||
コマンド (Commands)
|
||||
SnapRAIDは、以下の操作を行ういくつかのシンプルなコマンドを提供します。
|
||||
|
||||
* アレイの状態の概要を出力 -> `status`
|
||||
* ディスクの制御 -> `smart`、`probe`、`up`、`down`
|
||||
* バックアップ/スナップショットの作成 -> `sync`
|
||||
* データの定期的なチェック -> `scrub`
|
||||
* 最後のバックアップ/スナップショットの復元 -> `fix`。
|
||||
* アレイの状態を表示する -> `status`
|
||||
* ディスクを制御する -> `smart`、`probe`、`up`、`down`
|
||||
* バックアップ/復元ポイントを作成する -> `sync`
|
||||
* データを定期的にチェックする -> `scrub`
|
||||
* 最後のバックアップ/復元ポイントを復元する -> `fix`
|
||||
|
||||
コマンドは**小文字**で記述する必要があります。
|
||||
コマンドは小文字で入力する必要があります。
|
||||
|
||||
status
|
||||
ディスクアレイの状態の概要を出力します。
|
||||
|
|
@ -567,14 +577,14 @@ Commands
|
|||
アレイ内のファイルは**変更されません**。
|
||||
|
||||
fix
|
||||
すべてのファイルとパリティデータを修正します。
|
||||
すべてのファイルとパリティデータを修復(復元)します。
|
||||
|
||||
すべてのファイルとパリティデータは、最後の `sync` で保存されたスナップショット状態と
|
||||
比較されます。
|
||||
違いが見つかった場合、保存されたスナップショットに**元に戻されます**。
|
||||
すべてのファイルとパリティデータが、最後の `sync` で保存された状態と比較されます。
|
||||
差異が見つかった場合、保存されていた状態に巻き戻されます。
|
||||
|
||||
**警告!** `fix` コマンドは、エラーと意図的な変更を区別しません。
|
||||
ファイルの_状態を_最後の `sync` に**無条件に元に戻します**。
|
||||
警告!
|
||||
`fix` コマンドは、エラーと意図的な変更を区別しません。
|
||||
ファイルの変更状態を無条件で最後の `sync` の状態に戻します。
|
||||
|
||||
他のオプションが指定されていない場合、アレイ全体が処理されます。
|
||||
フィルタオプションを使用して、操作するファイルまたはディスクのサブセットを
|
||||
|
|
@ -702,7 +712,7 @@ Commands
|
|||
再配置プロセス中、これらのファイルはパリティによって保護されないことに
|
||||
注意してください。
|
||||
|
||||
Options
|
||||
オプション (Options)
|
||||
SnapRAIDには、次のオプションがあります。
|
||||
|
||||
-c, --conf CONFIG
|
||||
|
|
@ -805,7 +815,7 @@ Options
|
|||
1秒あたりのバイト数です。K、M、Gなどの乗数を指定できます
|
||||
(例:--bw-limit 1G)。
|
||||
|
||||
-t, --tail サイズ
|
||||
-t, --tail SIZE
|
||||
ファイルリストを、パリティディスクの指定された末尾サイズ以下を
|
||||
使用しているものに制限します。
|
||||
K、M、G、T などの倍数を使用できます(例:--tail 1G)。
|
||||
|
|
@ -890,7 +900,7 @@ Options
|
|||
お勧めします。
|
||||
`sync` 操作中にデータ保護はありません。
|
||||
|
||||
-W, --force-realloc-tail サイズ
|
||||
-W, --force-realloc-tail SIZE
|
||||
-R, --force-realloc と同様に動作しますが、各パリティファイルの
|
||||
指定された末尾部分(最後の「サイズ」バイト)に制限されます。
|
||||
現在その末尾セクションに保存されているファイルフラグメント/ブロックの
|
||||
|
|
@ -968,7 +978,7 @@ Options
|
|||
-V, --version
|
||||
プログラムのバージョンを出力します。
|
||||
|
||||
Configuration
|
||||
設定 (Configuration)
|
||||
SnapRAIDは、ディスクアレイの場所とパリティ情報の保存場所を知るために、構成ファイルを
|
||||
必要とします。
|
||||
|
||||
|
|
@ -1068,6 +1078,28 @@ Configuration
|
|||
これらのディスクは常に回転していることが期待されるため、`up` およ
|
||||
び `down` コマンドの影響を受けないことに注意してください。
|
||||
|
||||
snapshot
|
||||
`sync`、`scrub`、`check`、および `fix` コマンドでファイルシステムスナップショットの
|
||||
使用を有効にします。
|
||||
|
||||
有効にすると、SnapRAIDは `sync` の開始時にデータの読み取り専用スナップショットを作成します。
|
||||
これにより、ファイルの整合性を保った特定の時点のビューが確保され、ファイルの同時変更によって
|
||||
発生するエラーを防ぎます。
|
||||
|
||||
これにより復元が大幅に向上します。ライブファイルシステムからファイルが削除されても、
|
||||
スナップショット内に保存され続けます。これにより、そのブロックのパリティが「破損」するのを防ぎ、
|
||||
別のディスクが故障した場合でもデータを正常に復元できるようになります。
|
||||
|
||||
このオプションは、LinuxのBtrfs、Bcachefs、ZFS、およびWindowsのNTFSでフォーマットされた
|
||||
データディスクにのみ適用されます。
|
||||
パリティディスク、または他のファイルシステムを使用しているデータディスクは、常にファイルシステムの
|
||||
ライブバージョンを使用します。
|
||||
|
||||
スナップショットの作成と削除には管理者権限が必要です。
|
||||
このオプションが有効な場合は、SnapRAIDが必要な権限(例:sudo)で実行されていることを確認してください。
|
||||
|
||||
スナップショットのライフサイクルの詳細な説明については、SNAPSHOTSのセクションを参照してください。
|
||||
|
||||
nohidden
|
||||
すべての隠しファイルとディレクトリを除外します。
|
||||
Unixでは、隠しファイルは `.` で始まるファイルです。
|
||||
|
|
@ -1140,25 +1172,25 @@ Configuration
|
|||
経験則として、SnapRAIDは通常、アレイ内のデータ16 TBごとに1 GiBのRAMを必要とします。
|
||||
|
||||
具体的には、データのハッシュを保存するために、SnapRAIDは
|
||||
約 $TS \cdot (1 + HS) / BS$ バイトのRAMを必要とします。
|
||||
約 TS*(1+HS)/BS バイトのRAMを必要とします。
|
||||
ここで、TSはディスクアレイの合計サイズ(バイト)、BSはブロックサイズ(バイト)、HSはハッシュサイズ(バイト)です。
|
||||
|
||||
たとえば、4 TBのディスク8台、ブロックサイズ256 KiB(1 KiB = 1024バイト)、
|
||||
ハッシュサイズ16の場合:
|
||||
|
||||
:RAM = $(8 \cdot 4 \cdot 10^{12}) \cdot (1 + 16) / (256 \cdot 2^{10}) = 1.93 \text{ GiB}$
|
||||
:RAM = (8 * 4 * 10^12) * (1+16) / (256 * 2^10) = 1.93 GiB
|
||||
|
||||
ハッシュサイズを8に切り替えると:
|
||||
|
||||
:RAM = $(8 \cdot 4 \cdot 10^{12}) \cdot (1 + 8) / (256 \cdot 2^{10}) = 1.02 \text{ GiB}$
|
||||
:RAM = (8 * 4 * 10^12) * (1+8) / (256 * 2^10) = 1.02 GiB
|
||||
|
||||
ブロックサイズを512に切り替えると:
|
||||
|
||||
:RAM = $(8 \cdot 4 \cdot 10^{12}) \cdot (1 + 16) / (512 \cdot 2^{10}) = 0.96 \text{ GiB}$
|
||||
:RAM = (8 * 4 * 10^12) * (1+16) / (512 * 2^10) = 0.96 GiB
|
||||
|
||||
ハッシュサイズを8、ブロックサイズを512の両方に切り替えると:
|
||||
|
||||
:RAM = $(8 \cdot 4 \cdot 10^{12}) \cdot (1 + 8) / (512 \cdot 2^{10}) = 0.51 \text{ GiB}$
|
||||
:RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0.51 GiB
|
||||
|
||||
autosave SIZE_IN_GIGABYTES
|
||||
処理された指定されたGB量後に、同期またはスクラビング時に状態を自動的に保存します。
|
||||
|
|
@ -1228,6 +1260,9 @@ Configuration
|
|||
RAIDコントローラーの場合、デバイスは固定されている可能性が高いため、
|
||||
`%s` を使用する必要はないかもしれません。
|
||||
|
||||
デフォルトの `-a` オプションを置き換えるために、`[info: ...]` タグを使用して
|
||||
カスタム情報オプション文字列を指定することもできます。
|
||||
|
||||
使用可能なオプションについては、smartmontoolsのドキュメントを参照してください。
|
||||
|
||||
:https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
|
|
@ -1235,6 +1270,7 @@ Configuration
|
|||
|
||||
例:
|
||||
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl parity -d sat %s
|
||||
|
||||
smartignore DISK/PARITY ATTR [ATTR...]
|
||||
|
|
@ -1247,15 +1283,21 @@ Configuration
|
|||
`4-parity`、`5-parity`、`6-parity`、または `z-parity`。
|
||||
特殊な値 `*` は、すべてのディスクで属性を無視するために使用できます。
|
||||
|
||||
例として、すべてのディスクで `Current Pending Sector Count` 属性を無視するには:
|
||||
複数の属性をスペースで区切って指定できます。
|
||||
各属性は1から255までの数値、または大文字と小文字を区别しない名前
|
||||
(例: `Current_Pending_Sector`)として指定できます。
|
||||
|
||||
:smartignore * 197
|
||||
例として、すべてのディスクで `Current Pending Sector Count` と
|
||||
`Reallocated Sectors Count` 属性を番号または名前で無視するには:
|
||||
|
||||
:smartignore * 197 5
|
||||
:smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
最初のパリティディスクでのみ無視するには:
|
||||
|
||||
:smartignore parity 197
|
||||
:smartignore parity 197 5
|
||||
|
||||
Examples
|
||||
例 (Examples)
|
||||
Unixの一般的な構成の例は次のとおりです。
|
||||
|
||||
:parity /mnt/diskp/snapraid.parity
|
||||
|
|
@ -1266,7 +1308,7 @@ Configuration
|
|||
:data d3 /mnt/disk3/
|
||||
:exclude /lost+found/
|
||||
:exclude /tmp/
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/sg0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1282,12 +1324,100 @@ Configuration
|
|||
:exclude Thumbs.db
|
||||
:exclude \$RECYCLE.BIN
|
||||
:exclude \System Volume Information
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
Pattern
|
||||
スナップショット (Snapshots)
|
||||
設定でスナップショットオプションが有効になっている場合、SnapRAIDは
|
||||
ファイルシステムのスナップショット機能を利用して、アトミックで一貫性のある操作を保証します。
|
||||
|
||||
スナップショットの管理は完全に自動かつ透過的です。
|
||||
バックグラウンドで完全に処理されるスナップショットによる追加の保護を受けながら、
|
||||
これまでとまったく同じようにSnapRAIDを使用し続けることができます。
|
||||
|
||||
これには主に2つのメリットがあります。
|
||||
|
||||
整合性 - 長時間かかるsyncやscrubの実行中にライブファイルシステム上でファイルが変更されても、
|
||||
SnapRAIDは凍結された時点のイメージを参照するため、パリティの不一致や処理の中断は発生しません。
|
||||
復元 - ライブファイルシステムからファイルが更新または削除されても、スナップショット内に保存され続けます。
|
||||
次のsyncが実行される前にディスク故障が発生した場合、SnapRAIDはスナップショットに保存されている
|
||||
データを使用して、故障したディスクを再構築します。
|
||||
|
||||
アクティブなsync処理中にディスクが故障した場合、SnapRAIDは前のパリティ計算の
|
||||
スナップショットと現在のスナップショットの両方から自動的に読み取ることも可能です。
|
||||
これにより、同期の間にブロックが変更または削除されていた場合でも、パリティ方程式を解くために
|
||||
必要な正確なデータブロックへのアクセスが提供され、完全な復元の可能性が最大化されます。
|
||||
|
||||
スナップショットがない場合、正常なディスク上の更新または削除されたファイルはデータブロックの欠損を
|
||||
招き、他の故障したディスクを修復するために必要となるブロックが失われる可能性があります。
|
||||
|
||||
スナップショットはデータディスクに対してのみ、かつ基礎となるファイルシステムがその機能をサポートして
|
||||
いる場合にのみ作成されます。パリティディスクは常にライブファイルシステムを使用します。
|
||||
|
||||
現在、これはLinuxのBtrfs、Bcachefs、ZFS、およびWindowsのNTFSでサポートされています。
|
||||
|
||||
異なるファイルシステムを持つデータディスクを混在させることができます。スナップショットをサポートして
|
||||
いるディスクのみがそれを利用し、他のディスクはライブファイルシステム上で直接動作し続けます。
|
||||
|
||||
スナップショットの作成と削除には管理者権限が必要です。
|
||||
スナップショットが有効な場合は、SnapRAIDが必要な権限(例:sudo)で実行されていることを確認してください。
|
||||
|
||||
スナップショット使用時のコマンドの挙動 (Command Behavior with Snapshots)
|
||||
`sync` と `scrub` コマンドは、すべてのデータ操作が一貫した凍結状態に対して行われることを
|
||||
保証するために、いずれもスナップショット上でのみ動作します。これらのスナップショットを利用することで、
|
||||
SnapRAIDはライブファイルシステム上での同時ファイル変更によってトリガーされるパリティの不一致を防ぎます。
|
||||
`sync` の実行中、コマンドはプロセスの開始時に作成された新しいスナップショットを使用して、パリティ計算の
|
||||
ための現在の状態をキャプチャします。
|
||||
対照的に、`scrub` コマンドは、既存のパリティと一致する信頼できる参照ポイントを維持するために、
|
||||
最も直近の同期中に作成された最後のスナップショットを利用します。
|
||||
|
||||
`check` および `fix` コマンドの場合、最後のスナップショットの使用は、
|
||||
-d, --filter-disk オプションを使用して特定のディスクがターゲットに指定されているかどうかによって異なります。
|
||||
|
||||
-d を介して明示的に選択されたディスク(操作の「ターゲット」)は、常にライブファイルシステムを使用します。
|
||||
`fix` の場合、これによりアクティブな交換ディスクにデータを復元できます。
|
||||
`check` の場合、同じ条件下で `fix` 操作をシミュレートできます。
|
||||
|
||||
他のすべてのデータディスク(「参照」ディスク)は、それぞれのスナップショットを介してアクセスされます。
|
||||
これにより、復旧の進行中に正常なディスク上のファイルを変更している場合でも、SnapRAIDは
|
||||
パリティ方程式を解くための安定した凍結された参照を持つことができます。
|
||||
|
||||
-d オプションが指定されていない場合、SnapRAIDは操作がアレイ全体に適用されると想定します。
|
||||
この場合、`check` と `fix` はライブファイルシステムのみを排他的に使用します。
|
||||
|
||||
他のすべてのコマンドは、ライブファイルシステム上でのみ動作します。
|
||||
|
||||
スナップショットのライフサイクル (Snapshots Lifecycle)
|
||||
SnapRAIDは、各データサブボリュームのルートにある隠しディレクトリ内で、
|
||||
`stable`(安定)と `pending`(保留)という2つの特定のスナップショットを管理します。
|
||||
Btrfs、Bcachefs、およびNTFSでは `.snapraid/` ディレクトリが使用され、
|
||||
ZFSでは標準の `.zfs/snapshot/` が使用されます。
|
||||
|
||||
`stable` スナップショットは、最後に正常に完了した `sync` の状態を表し、
|
||||
現在のパリティの計算に使用された正確なデータを含んでいます。これは、
|
||||
`scrub`、`check`、および `fix` コマンドの主要なデータソースとして機能します。
|
||||
|
||||
`pending` スナップショットは、パリティ計算のための凍結された状態を提供するために、
|
||||
`sync` の開始時に作成される一時的なイメージです。
|
||||
操作が正常に完了すると、以前の `stable` スナップショットが削除され、
|
||||
`pending` スナップショットが新しい安定した参照として昇格します。
|
||||
|
||||
`sync` が中断された場合、`pending` スナップショットは保持されます。
|
||||
パリティが部分的にしか同期されていない場合でも、.content ファイルに記録されたファイルシステム状態と
|
||||
一致するため、その後の `scrub`、`check`、および `fix` コマンドはこの保留中のスナップショットを使用します。
|
||||
|
||||
`sync` が中断された場合、`check` および `fix` コマンドは `stable` スナップショットからも
|
||||
読み取りを行い、同期中に更新または削除されたファイルからデータブロックを取得します。
|
||||
これは、.content ファイルが同期プロセス全体を通じて、変更または削除されたすべてのファイルの
|
||||
メタデータを保持しているために可能です。
|
||||
この履歴情報は、syncが正常に終了し、.content ファイルの最終バージョンが保存されたときにのみクリアされます。
|
||||
|
||||
中断後に `sync` が再開されると、既存の保留中(pending)のスナップショットは削除され、
|
||||
ライブファイルシステムの現在の状態をキャプチャするために新しいスナップショットが作成されます。
|
||||
|
||||
パターン (Pattern)
|
||||
パターンは、含めるファイルまたは除外するファイルをフィルタリングするための柔軟な方法を
|
||||
提供します。グロブ文字を使用することで、すべてのパスを手動でリストすることなく、
|
||||
特定のファイル名やディレクトリ構造全体に一致するルールを定義できます。
|
||||
|
|
@ -1397,9 +1527,9 @@ Pattern
|
|||
Unixでは、コマンドラインでグロブ文字を使用する場合、シェルがそれらを展開するのを
|
||||
防ぐために引用符で囲む必要があります。
|
||||
|
||||
Ignore File
|
||||
除外ファイル (Ignore File)
|
||||
設定ファイルのグローバルルールに加えて、アレイ内の任意のディレクトリに
|
||||
.snapraidignore ファイルを配置して、分散型の除外ルールを定義できます。
|
||||
`.snapraidignore` ファイルを配置して、分散型の除外ルールを定義できます。
|
||||
|
||||
`.snapraidignore` で定義されたルールは、設定ファイルのルールの後に
|
||||
適用されます。これは、それらがより高い優先度を持ち、グローバル設定で
|
||||
|
|
@ -1438,16 +1568,19 @@ Ignore File
|
|||
:# projects/ またはそのサブフォルダ内のすべての .tmp ファイルを除外
|
||||
:*.tmp
|
||||
|
||||
Content
|
||||
コンテンツ (Content)
|
||||
SnapRAIDは、ファイルの一覧とチェックサムをコンテンツファイルに保存します。
|
||||
|
||||
これはバイナリファイルであり、ディスクアレイに存在するすべてのファイルと、
|
||||
それらの整合性を検証するためのすべてのチェックサムを一覧表示します。
|
||||
|
||||
このファイルは `sync` および `scrub` コマンドによって読み書きされ、
|
||||
`fix`、`check`、および `status` コマンドによって読み取られます。
|
||||
コンテンツファイルは `sync`、`scrub`、`touch`、および `rehash`
|
||||
コマンドによって読み書きされます。`status`、`diff`、`check`、
|
||||
`fix`、`list`、`dup`、`locate`、および `pool` コマンドによって読み取られ、
|
||||
`smart`、`probe`、`up`、`down`、および `devices` コマンドによって
|
||||
完全に無視されます。
|
||||
|
||||
Parity
|
||||
パリティ (Parity)
|
||||
SnapRAIDは、アレイのパリティ情報をパリティファイルに保存します。
|
||||
|
||||
これらはバイナリファイルであり、`content` ファイルで定義されたすべてのブロックの
|
||||
|
|
@ -1456,7 +1589,7 @@ Parity
|
|||
これらのファイルは `sync` および `fix` コマンドによって読み書きされ、
|
||||
`scrub` および `check` コマンドによって**読み取られるだけ**です。
|
||||
|
||||
Encoding
|
||||
エンコーディング (Encoding)
|
||||
UnixのSnapRAIDは、エンコーディングを無視します。ファイルシステムで使用されている
|
||||
のと同じエンコーディングでファイル名を読み取り、保存します。
|
||||
|
||||
|
|
@ -1464,12 +1597,23 @@ Encoding
|
|||
処理されます。
|
||||
|
||||
ファイル名を正しく出力するには、`chcp 65001` コマンドでWindowsコンソールをUTF-8モードに設定し、
|
||||
コンソールフォントとして `Lucida Console` などのTrueTypeフォントを**使用する**必要があります。
|
||||
コンソールフォントとして `Lucida Console` などのTrueTypeフォントを使用する必要があります。
|
||||
これは出力されるファイル名にのみ影響します。コンソール出力をファイルにリダイレクトする場合、
|
||||
結果のファイルは常にUTF-8形式になります。
|
||||
|
||||
Copyright
|
||||
This file is Copyright (C) 2025 Andrea Mazzoleni
|
||||
終了コード (Exit Code)
|
||||
SnapRAIDは以下のエラーコードで終了します:
|
||||
|
||||
See Also
|
||||
snapraid_log(1), snapraidd(1)
|
||||
0 - すべて正常。
|
||||
1 - コマンドでエラーが発生しました。
|
||||
2 - `diff` コマンドはすべて正常であると判定しましたが、 `sync` が必要です。
|
||||
|
||||
翻訳 (Translation)
|
||||
この文書は英語版マニュアルの自動翻訳です。
|
||||
正確な記述については英語版マニュアルを参照してください。
|
||||
|
||||
著作権 (Copyright)
|
||||
This file is Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
関連項目 (See Also)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
===========================
|
||||
|
||||
|
||||
1 SYNOPSIS
|
||||
==========
|
||||
1 概要 (SYNOPSIS)
|
||||
===============
|
||||
|
||||
snapraid [-c, --conf CONFIG]
|
||||
[-f, --filter PATTERN] [-d, --filter-disk NAME]
|
||||
|
|
@ -28,8 +28,8 @@ snapraid [-c, --conf CONFIG]
|
|||
snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
|
||||
2 DESCRIPTION
|
||||
=============
|
||||
2 説明 (DESCRIPTION)
|
||||
==================
|
||||
|
||||
SnapRAIDは、ディスクアレイ用のバックアッププログラムで、最大6台のディスク障害が発生した場合の
|
||||
データ復旧のためにパリティ情報を保存します。
|
||||
|
|
@ -55,21 +55,31 @@ SnapRAIDにはいくつかの機能があります。
|
|||
https://www.snapraid.it/
|
||||
|
||||
|
||||
3 LIMITATIONS
|
||||
=============
|
||||
3 制限事項 (LIMITATIONS)
|
||||
====================
|
||||
|
||||
SnapRAIDはRAIDとバックアッププログラムのハイブリッドであり、両方の利点を組み合わせることを
|
||||
目指しています。ただし、使用する前に考慮すべきいくつかの制限があります。
|
||||
目指しています。ただし、使用する前に考慮すべきいくつかの制限事項があります。
|
||||
|
||||
主な制限は、ディスクが故障し、最近 `sync` を実行していない場合、完全に復旧できない
|
||||
可能性があることです。
|
||||
より具体的には、最後の `sync` 操作以降に変更または削除されたファイルのサイズまでのデータが
|
||||
復旧できない可能性があります。
|
||||
これは、変更または削除されたファイルが故障したディスク上にない場合でも発生します。
|
||||
このため、SnapRAIDは**めったに変更されない**データに適しています。
|
||||
主な制限事項は、ディスクが故障した場合、最後の `sync`(同期)処理の状態までしか
|
||||
データを復元できないことです。最後の同期以降に追加されたデータや、故障したディスク上で行われた
|
||||
変更はすべて失われます。
|
||||
|
||||
一方で、新しく追加されたファイルは、既に存在するファイルの復旧を妨げません。
|
||||
新しく追加されたファイルが故障したディスク上にある場合にのみ、それらのファイルが失われます。
|
||||
そのため、SnapRAIDは主にデータの変更がほとんどない環境に適しています。
|
||||
|
||||
最後の同期時にすでに存在していたデータについて、復元の信頼性は `snapshot`(スナップショット)
|
||||
オプションが使用されているかどうかによって異なります。
|
||||
|
||||
* スナップショットサポートがある場合(Btrfs、ZFS、Bcachefs、およびNTFSで利用可能):
|
||||
SnapRAIDはデータディスクの凍結されたリファレンスを自動的に維持できます。
|
||||
これにより、同期中または同期後にライブファイルシステム上のファイルを変更または削除した場合でも、
|
||||
復元プロセスの整合性と信頼性が保たれます。
|
||||
|
||||
* スナップショットサポートがない場合:
|
||||
`sync` 後にファイルを削除または変更すると、他の故障したディスクの完全な復元が妨げられる
|
||||
可能性があります。これは、変更されたファイルが故障したディスク上にない場合でも、
|
||||
パリティが変更後のファイルと一致しなくなるために発生します。一方で、新しく追加されたファイルが
|
||||
すでに存在するファイルの復元を妨げることはありません。
|
||||
|
||||
その他のSnapRAIDの制限は次のとおりです。
|
||||
|
||||
|
|
@ -85,8 +95,8 @@ SnapRAIDはRAIDとバックアッププログラムのハイブリッドであ
|
|||
アクセス許可、所有権、および拡張属性は保存されません。
|
||||
|
||||
|
||||
4 GETTING STARTED
|
||||
=================
|
||||
4 はじめに (GETTING STARTED)
|
||||
========================
|
||||
|
||||
SnapRAIDを使用するには、まずディスクアレイ内の1つのディスクを `parity` 情報専用に
|
||||
選択する必要があります。パリティ用に1つのディスクを使用すると、RAID5と同様に、単一のディスク障害から
|
||||
|
|
@ -161,8 +171,8 @@ Ctrl+Cを押すことでいつでも停止でき、次回の実行時には中
|
|||
これで、アレイを自由に使い始め、定期的に `sync` コマンドを実行してパリティ情報を
|
||||
更新できます。
|
||||
|
||||
4.1 Scrubbing
|
||||
-------------
|
||||
4.1 スクラブ (Scrubbing)
|
||||
--------------------
|
||||
|
||||
データとパリティのエラーを定期的にチェックするには、`scrub` コマンドを
|
||||
実行できます。
|
||||
|
|
@ -202,12 +212,12 @@ Ctrl+Cを押すことでいつでも停止でき、次回の実行時には中
|
|||
引き起こされたエラーが報告される場合があります。これらのエラーは `scrub` の
|
||||
出力で報告されますが、関連するブロックは不良としてマークされません。
|
||||
|
||||
4.2 Pooling
|
||||
-----------
|
||||
4.2 プーリング (Pooling)
|
||||
-------------------
|
||||
|
||||
注: ここで説明するプーリング機能は、**mergerfs** ツールに取って代わられました。
|
||||
mergerfs は、SnapRAIDコミュニティのLinuxユーザーに推奨されるオプションです。
|
||||
Mergefs は、複数のドライブを単一の統合されたマウントポイントにプールするための、
|
||||
Mergerfs は、複数のドライブを単一の統合されたマウントポイントにプールするための、
|
||||
より柔軟で効率的な方法を提供し、シンボリックリンクに頼ることなくアレイ全体の
|
||||
ファイルにシームレスにアクセスできます。これは、パリティ保護のためにSnapRAIDと
|
||||
うまく統合されており、OpenMediaVault (OMV) やカスタムNAS構成などのセットアップで
|
||||
|
|
@ -276,8 +286,8 @@ Windowsでは、ネットワーク経由でシンボリックリンクを共有
|
|||
|
||||
fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
||||
|
||||
4.3 Undeleting
|
||||
--------------
|
||||
4.3 削除取り消し (Undeleting)
|
||||
-----------------------
|
||||
|
||||
SnapRAIDはRAIDシステムよりもバックアッププログラムのように機能し、
|
||||
-f, --filter オプションを使用してファイルを以前の状態に復元または削除解除するために
|
||||
|
|
@ -299,8 +309,8 @@ SnapRAIDはRAIDシステムよりもバックアッププログラムのよう
|
|||
|
||||
snapraid fix -m
|
||||
|
||||
4.4 Recovering
|
||||
--------------
|
||||
4.4 回復 (Recovering)
|
||||
-------------------
|
||||
|
||||
最悪の事態が発生し、1台以上のディスクを失いました!
|
||||
|
||||
|
|
@ -385,18 +395,18 @@ SnapRAIDの構成ファイルを変更して、故障したディスクの `data
|
|||
すべてが復旧されていれば、このコマンドは即座に完了します。
|
||||
|
||||
|
||||
5 COMMANDS
|
||||
==========
|
||||
5 コマンド (COMMANDS)
|
||||
=================
|
||||
|
||||
SnapRAIDは、次のことを可能にするいくつかの簡単なコマンドを提供します。
|
||||
SnapRAIDは、以下の操作を行ういくつかのシンプルなコマンドを提供します。
|
||||
|
||||
* アレイの状態の概要を出力 -> `status`
|
||||
* ディスクの制御 -> `smart`、`probe`、`up`、`down`
|
||||
* バックアップ/スナップショットの作成 -> `sync`
|
||||
* データの定期的なチェック -> `scrub`
|
||||
* 最後のバックアップ/スナップショットの復元 -> `fix`。
|
||||
* アレイの状態を表示する -> `status`
|
||||
* ディスクを制御する -> `smart`、`probe`、`up`、`down`
|
||||
* バックアップ/復元ポイントを作成する -> `sync`
|
||||
* データを定期的にチェックする -> `scrub`
|
||||
* 最後のバックアップ/復元ポイントを復元する -> `fix`
|
||||
|
||||
コマンドは**小文字**で記述する必要があります。
|
||||
コマンドは小文字で入力する必要があります。
|
||||
|
||||
5.1 status
|
||||
----------
|
||||
|
|
@ -609,14 +619,14 @@ full - すべてをスクラブします。
|
|||
5.9 fix
|
||||
-------
|
||||
|
||||
すべてのファイルとパリティデータを修正します。
|
||||
すべてのファイルとパリティデータを修復(復元)します。
|
||||
|
||||
すべてのファイルとパリティデータは、最後の `sync` で保存されたスナップショット状態と
|
||||
比較されます。
|
||||
違いが見つかった場合、保存されたスナップショットに**元に戻されます**。
|
||||
すべてのファイルとパリティデータが、最後の `sync` で保存された状態と比較されます。
|
||||
差異が見つかった場合、保存されていた状態に巻き戻されます。
|
||||
|
||||
**警告!** `fix` コマンドは、エラーと意図的な変更を区別しません。
|
||||
ファイルの_状態を_最後の `sync` に**無条件に元に戻します**。
|
||||
警告!
|
||||
`fix` コマンドは、エラーと意図的な変更を区別しません。
|
||||
ファイルの変更状態を無条件で最後の `sync` の状態に戻します。
|
||||
|
||||
他のオプションが指定されていない場合、アレイ全体が処理されます。
|
||||
フィルタオプションを使用して、操作するファイルまたはディスクのサブセットを
|
||||
|
|
@ -761,8 +771,8 @@ SnapRAIDが移動およびコピーされたファイルを認識する能力が
|
|||
注意してください。
|
||||
|
||||
|
||||
6 OPTIONS
|
||||
=========
|
||||
6 オプション (OPTIONS)
|
||||
=================
|
||||
|
||||
SnapRAIDには、次のオプションがあります。
|
||||
|
||||
|
|
@ -866,7 +876,7 @@ SnapRAIDには、次のオプションがあります。
|
|||
1秒あたりのバイト数です。K、M、Gなどの乗数を指定できます
|
||||
(例:--bw-limit 1G)。
|
||||
|
||||
-t, --tail サイズ
|
||||
-t, --tail SIZE
|
||||
ファイルリストを、パリティディスクの指定された末尾サイズ以下を
|
||||
使用しているものに制限します。
|
||||
K、M、G、T などの倍数を使用できます(例:--tail 1G)。
|
||||
|
|
@ -951,7 +961,7 @@ SnapRAIDには、次のオプションがあります。
|
|||
お勧めします。
|
||||
`sync` 操作中にデータ保護はありません。
|
||||
|
||||
-W, --force-realloc-tail サイズ
|
||||
-W, --force-realloc-tail SIZE
|
||||
-R, --force-realloc と同様に動作しますが、各パリティファイルの
|
||||
指定された末尾部分(最後の「サイズ」バイト)に制限されます。
|
||||
現在その末尾セクションに保存されているファイルフラグメント/ブロックの
|
||||
|
|
@ -1030,8 +1040,8 @@ SnapRAIDには、次のオプションがあります。
|
|||
プログラムのバージョンを出力します。
|
||||
|
||||
|
||||
7 CONFIGURATION
|
||||
===============
|
||||
7 設定 (CONFIGURATION)
|
||||
====================
|
||||
|
||||
SnapRAIDは、ディスクアレイの場所とパリティ情報の保存場所を知るために、構成ファイルを
|
||||
必要とします。
|
||||
|
|
@ -1144,14 +1154,38 @@ NAME を固定したままにしておけば、必要に応じてマウントポ
|
|||
これらのディスクは常に回転していることが期待されるため、`up` およ
|
||||
び `down` コマンドの影響を受けないことに注意してください。
|
||||
|
||||
7.7 nohidden
|
||||
7.7 snapshot
|
||||
------------
|
||||
|
||||
`sync`、`scrub`、`check`、および `fix` コマンドでファイルシステムスナップショットの
|
||||
使用を有効にします。
|
||||
|
||||
有効にすると、SnapRAIDは `sync` の開始時にデータの読み取り専用スナップショットを作成します。
|
||||
これにより、ファイルの整合性を保った特定の時点のビューが確保され、ファイルの同時変更によって
|
||||
発生するエラーを防ぎます。
|
||||
|
||||
これにより復元が大幅に向上します。ライブファイルシステムからファイルが削除されても、
|
||||
スナップショット内に保存され続けます。これにより、そのブロックのパリティが「破損」するのを防ぎ、
|
||||
別のディスクが故障した場合でもデータを正常に復元できるようになります。
|
||||
|
||||
このオプションは、LinuxのBtrfs、Bcachefs、ZFS、およびWindowsのNTFSでフォーマットされた
|
||||
データディスクにのみ適用されます。
|
||||
パリティディスク、または他のファイルシステムを使用しているデータディスクは、常にファイルシステムの
|
||||
ライブバージョンを使用します。
|
||||
|
||||
スナップショットの作成と削除には管理者権限が必要です。
|
||||
このオプションが有効な場合は、SnapRAIDが必要な権限(例:sudo)で実行されていることを確認してください。
|
||||
|
||||
スナップショットのライフサイクルの詳細な説明については、SNAPSHOTSのセクションを参照してください。
|
||||
|
||||
7.8 nohidden
|
||||
------------
|
||||
|
||||
すべての隠しファイルとディレクトリを除外します。
|
||||
Unixでは、隠しファイルは `.` で始まるファイルです。
|
||||
Windowsでは、隠し属性を持つファイルです。
|
||||
|
||||
7.8 exclude/include PATTERN
|
||||
7.9 exclude/include PATTERN
|
||||
---------------------------
|
||||
|
||||
syncプロセスで除外または含めるファイルまたはディレクトリのパターンを定義します。
|
||||
|
|
@ -1166,8 +1200,8 @@ syncプロセスで除外または含めるファイルまたはディレクト
|
|||
|
||||
このオプションは複数回使用できます。
|
||||
|
||||
7.9 blocksize SIZE_IN_KIBIBYTES
|
||||
-------------------------------
|
||||
7.10 blocksize SIZE_IN_KIBIBYTES
|
||||
--------------------------------
|
||||
|
||||
パリティの基本ブロックサイズをキビバイト単位で定義します。
|
||||
1キビバイトは1024バイトです。
|
||||
|
|
@ -1210,7 +1244,7 @@ Linuxでより大きなパリティパーティションを取得するトリッ
|
|||
これにより、約1.5%の追加スペース、4 TBディスクで約60 GBが得られ、
|
||||
浪費スペースなしで各データディスクで約460,000ファイルが可能になります。
|
||||
|
||||
7.10 hashsize SIZE_IN_BYTES
|
||||
7.11 hashsize SIZE_IN_BYTES
|
||||
---------------------------
|
||||
|
||||
保存されたブロックのハッシュサイズをバイト単位で定義します。
|
||||
|
|
@ -1224,34 +1258,34 @@ Linuxでより大きなパリティパーティションを取得するトリッ
|
|||
経験則として、SnapRAIDは通常、アレイ内のデータ16 TBごとに1 GiBのRAMを必要とします。
|
||||
|
||||
具体的には、データのハッシュを保存するために、SnapRAIDは
|
||||
約 $TS \cdot (1 + HS) / BS$ バイトのRAMを必要とします。
|
||||
約 TS*(1+HS)/BS バイトのRAMを必要とします。
|
||||
ここで、TSはディスクアレイの合計サイズ(バイト)、BSはブロックサイズ(バイト)、HSはハッシュサイズ(バイト)です。
|
||||
|
||||
たとえば、4 TBのディスク8台、ブロックサイズ256 KiB(1 KiB = 1024バイト)、
|
||||
ハッシュサイズ16の場合:
|
||||
|
||||
RAM = $(8 \cdot 4 \cdot 10^{12}) \cdot (1 + 16) / (256 \cdot 2^{10}) = 1.93 \text{ GiB}$
|
||||
RAM = (8 * 4 * 10^12) * (1+16) / (256 * 2^10) = 1.93 GiB
|
||||
|
||||
ハッシュサイズを8に切り替えると:
|
||||
|
||||
RAM = $(8 \cdot 4 \cdot 10^{12}) \cdot (1 + 8) / (256 \cdot 2^{10}) = 1.02 \text{ GiB}$
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (256 * 2^10) = 1.02 GiB
|
||||
|
||||
ブロックサイズを512に切り替えると:
|
||||
|
||||
RAM = $(8 \cdot 4 \cdot 10^{12}) \cdot (1 + 16) / (512 \cdot 2^{10}) = 0.96 \text{ GiB}$
|
||||
RAM = (8 * 4 * 10^12) * (1+16) / (512 * 2^10) = 0.96 GiB
|
||||
|
||||
ハッシュサイズを8、ブロックサイズを512の両方に切り替えると:
|
||||
|
||||
RAM = $(8 \cdot 4 \cdot 10^{12}) \cdot (1 + 8) / (512 \cdot 2^{10}) = 0.51 \text{ GiB}$
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0.51 GiB
|
||||
|
||||
7.11 autosave SIZE_IN_GIGABYTES
|
||||
7.12 autosave SIZE_IN_GIGABYTES
|
||||
-------------------------------
|
||||
|
||||
処理された指定されたGB量後に、同期またはスクラビング時に状態を自動的に保存します。
|
||||
このオプションは、マシンクラッシュやその他のイベントによって中断された場合に、
|
||||
長い `sync` コマンドを最初から再起動するのを避けるのに役立ちます。
|
||||
|
||||
7.12 temp_limit TEMPERATURE_CELSIUS
|
||||
7.13 temp_limit TEMPERATURE_CELSIUS
|
||||
-----------------------------------
|
||||
|
||||
許容される最大ディスク温度を摂氏で設定します。指定されている場合、
|
||||
|
|
@ -1279,13 +1313,13 @@ SnapRAIDの動作には影響しません。プログラムの動作は、実際
|
|||
通常、SnapRAIDは最も熱いディスクの温度のみを表示します。
|
||||
すべてのディスクの温度を表示するには、-A または --stats オプションを使用します。
|
||||
|
||||
7.13 temp_sleep TIME_IN_MINUTES
|
||||
7.14 temp_sleep TIME_IN_MINUTES
|
||||
-------------------------------
|
||||
|
||||
温度制限に達したときのスタンバイ時間(分単位)を設定します。この期間中、ディスクは
|
||||
スピンダウンしたままです。デフォルトは5分です。
|
||||
|
||||
7.14 pool DIR
|
||||
7.15 pool DIR
|
||||
-------------
|
||||
|
||||
`pool` コマンドを使用してディスクアレイの仮想ビューが作成されるプーリングディレクトリを
|
||||
|
|
@ -1293,7 +1327,7 @@ SnapRAIDの動作には影響しません。プログラムの動作は、実際
|
|||
|
||||
ディレクトリは既に存在している必要があります。
|
||||
|
||||
7.15 share UNC_DIR
|
||||
7.16 share UNC_DIR
|
||||
------------------
|
||||
|
||||
ディスクにリモートでアクセスするために必要なWindows UNCパスを定義します。
|
||||
|
|
@ -1308,7 +1342,7 @@ SnapRAIDの動作には影響しません。プログラムの動作は、実際
|
|||
|
||||
このオプションはWindowsでのみ必要です。
|
||||
|
||||
7.16 smartctl DISK/PARITY OPTIONS...
|
||||
7.17 smartctl DISK/PARITY OPTIONS...
|
||||
------------------------------------
|
||||
|
||||
各ディスクのSMART属性を取得するためのカスタムsmartctlオプションを定義します。
|
||||
|
|
@ -1324,6 +1358,9 @@ PARITY はパリティ名のいずれかです:`parity`、`2-parity`、`3-pari
|
|||
RAIDコントローラーの場合、デバイスは固定されている可能性が高いため、
|
||||
`%s` を使用する必要はないかもしれません。
|
||||
|
||||
デフォルトの `-a` オプションを置き換えるために、`[info: ...]` タグを使用して
|
||||
カスタム情報オプション文字列を指定することもできます。
|
||||
|
||||
使用可能なオプションについては、smartmontoolsのドキュメントを参照してください。
|
||||
|
||||
https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
|
|
@ -1331,9 +1368,10 @@ RAIDコントローラーの場合、デバイスは固定されている可能
|
|||
|
||||
例:
|
||||
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl parity -d sat %s
|
||||
|
||||
7.17 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
7.18 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
-------------------------------------------
|
||||
|
||||
ディスク障害の確率を計算するときに、指定されたSMART属性を無視します。
|
||||
|
|
@ -1345,16 +1383,22 @@ PARITY はパリティ名のいずれかです:`parity`、`2-parity`、`3-pari
|
|||
`4-parity`、`5-parity`、`6-parity`、または `z-parity`。
|
||||
特殊な値 `*` は、すべてのディスクで属性を無視するために使用できます。
|
||||
|
||||
例として、すべてのディスクで `Current Pending Sector Count` 属性を無視するには:
|
||||
複数の属性をスペースで区切って指定できます。
|
||||
各属性は1から255までの数値、または大文字と小文字を区别しない名前
|
||||
(例: `Current_Pending_Sector`)として指定できます。
|
||||
|
||||
smartignore * 197
|
||||
例として、すべてのディスクで `Current Pending Sector Count` と
|
||||
`Reallocated Sectors Count` 属性を番号または名前で無視するには:
|
||||
|
||||
smartignore * 197 5
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
最初のパリティディスクでのみ無視するには:
|
||||
|
||||
smartignore parity 197
|
||||
smartignore parity 197 5
|
||||
|
||||
7.18 Examples
|
||||
-------------
|
||||
7.19 例 (Examples)
|
||||
-----------------
|
||||
|
||||
Unixの一般的な構成の例は次のとおりです。
|
||||
|
||||
|
|
@ -1366,7 +1410,7 @@ Unixの一般的な構成の例は次のとおりです。
|
|||
data d3 /mnt/disk3/
|
||||
exclude /lost+found/
|
||||
exclude /tmp/
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/sg0
|
||||
smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1382,14 +1426,110 @@ Windowsの一般的な構成の例は次のとおりです。
|
|||
exclude Thumbs.db
|
||||
exclude \$RECYCLE.BIN
|
||||
exclude \System Volume Information
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
|
||||
8 PATTERN
|
||||
=========
|
||||
8 スナップショット (SNAPSHOTS)
|
||||
======================
|
||||
|
||||
設定でスナップショットオプションが有効になっている場合、SnapRAIDは
|
||||
ファイルシステムのスナップショット機能を利用して、アトミックで一貫性のある操作を保証します。
|
||||
|
||||
スナップショットの管理は完全に自動かつ透過的です。
|
||||
バックグラウンドで完全に処理されるスナップショットによる追加の保護を受けながら、
|
||||
これまでとまったく同じようにSnapRAIDを使用し続けることができます。
|
||||
|
||||
これには主に2つのメリットがあります。
|
||||
|
||||
整合性 - 長時間かかるsyncやscrubの実行中にライブファイルシステム上でファイルが変更されても、
|
||||
SnapRAIDは凍結された時点のイメージを参照するため、パリティの不一致や処理の中断は発生しません。
|
||||
復元 - ライブファイルシステムからファイルが更新または削除されても、スナップショット内に保存され続けます。
|
||||
次のsyncが実行される前にディスク故障が発生した場合、SnapRAIDはスナップショットに保存されている
|
||||
データを使用して、故障したディスクを再構築します。
|
||||
|
||||
アクティブなsync処理中にディスクが故障した場合、SnapRAIDは前のパリティ計算の
|
||||
スナップショットと現在のスナップショットの両方から自動的に読み取ることも可能です。
|
||||
これにより、同期の間にブロックが変更または削除されていた場合でも、パリティ方程式を解くために
|
||||
必要な正確なデータブロックへのアクセスが提供され、完全な復元の可能性が最大化されます。
|
||||
|
||||
スナップショットがない場合、正常なディスク上の更新または削除されたファイルはデータブロックの欠損を
|
||||
招き、他の故障したディスクを修復するために必要となるブロックが失われる可能性があります。
|
||||
|
||||
スナップショットはデータディスクに対してのみ、かつ基礎となるファイルシステムがその機能をサポートして
|
||||
いる場合にのみ作成されます。パリティディスクは常にライブファイルシステムを使用します。
|
||||
|
||||
現在、これはLinuxのBtrfs、Bcachefs、ZFS、およびWindowsのNTFSでサポートされています。
|
||||
|
||||
異なるファイルシステムを持つデータディスクを混在させることができます。スナップショットをサポートして
|
||||
いるディスクのみがそれを利用し、他のディスクはライブファイルシステム上で直接動作し続けます。
|
||||
|
||||
スナップショットの作成と削除には管理者権限が必要です。
|
||||
スナップショットが有効な場合は、SnapRAIDが必要な権限(例:sudo)で実行されていることを確認してください。
|
||||
|
||||
8.1 スナップショット使用時のコマンドの挙動 (Command Behavior with Snapshots)
|
||||
---------------------------------------------------------
|
||||
|
||||
`sync` と `scrub` コマンドは、すべてのデータ操作が一貫した凍結状態に対して行われることを
|
||||
保証するために、いずれもスナップショット上でのみ動作します。これらのスナップショットを利用することで、
|
||||
SnapRAIDはライブファイルシステム上での同時ファイル変更によってトリガーされるパリティの不一致を防ぎます。
|
||||
`sync` の実行中、コマンドはプロセスの開始時に作成された新しいスナップショットを使用して、パリティ計算の
|
||||
ための現在の状態をキャプチャします。
|
||||
対照的に、`scrub` コマンドは、既存のパリティと一致する信頼できる参照ポイントを維持するために、
|
||||
最も直近の同期中に作成された最後のスナップショットを利用します。
|
||||
|
||||
`check` および `fix` コマンドの場合、最後のスナップショットの使用は、
|
||||
-d, --filter-disk オプションを使用して特定のディスクがターゲットに指定されているかどうかによって異なります。
|
||||
|
||||
-d を介して明示的に選択されたディスク(操作の「ターゲット」)は、常にライブファイルシステムを使用します。
|
||||
`fix` の場合、これによりアクティブな交換ディスクにデータを復元できます。
|
||||
`check` の場合、同じ条件下で `fix` 操作をシミュレートできます。
|
||||
|
||||
他のすべてのデータディスク(「参照」ディスク)は、それぞれのスナップショットを介してアクセスされます。
|
||||
これにより、復旧の進行中に正常なディスク上のファイルを変更している場合でも、SnapRAIDは
|
||||
パリティ方程式を解くための安定した凍結された参照を持つことができます。
|
||||
|
||||
-d オプションが指定されていない場合、SnapRAIDは操作がアレイ全体に適用されると想定します。
|
||||
この場合、`check` と `fix` はライブファイルシステムのみを排他的に使用します。
|
||||
|
||||
他のすべてのコマンドは、ライブファイルシステム上でのみ動作します。
|
||||
|
||||
|
||||
9 スナップショットのライフサイクル (SNAPSHOTS LIFECYCLE)
|
||||
========================================
|
||||
|
||||
SnapRAIDは、各データサブボリュームのルートにある隠しディレクトリ内で、
|
||||
`stable`(安定)と `pending`(保留)という2つの特定のスナップショットを管理します。
|
||||
Btrfs、Bcachefs、およびNTFSでは `.snapraid/` ディレクトリが使用され、
|
||||
ZFSでは標準の `.zfs/snapshot/` が使用されます。
|
||||
|
||||
`stable` スナップショットは、最後に正常に完了した `sync` の状態を表し、
|
||||
現在のパリティの計算に使用された正確なデータを含んでいます。これは、
|
||||
`scrub`、`check`、および `fix` コマンドの主要なデータソースとして機能します。
|
||||
|
||||
`pending` スナップショットは、パリティ計算のための凍結された状態を提供するために、
|
||||
`sync` の開始時に作成される一時的なイメージです。
|
||||
操作が正常に完了すると、以前の `stable` スナップショットが削除され、
|
||||
`pending` スナップショットが新しい安定した参照として昇格します。
|
||||
|
||||
`sync` が中断された場合、`pending` スナップショットは保持されます。
|
||||
パリティが部分的にしか同期されていない場合でも、.content ファイルに記録されたファイルシステム状態と
|
||||
一致するため、その後の `scrub`、`check`、および `fix` コマンドはこの保留中のスナップショットを使用します。
|
||||
|
||||
`sync` が中断された場合、`check` および `fix` コマンドは `stable` スナップショットからも
|
||||
読み取りを行い、同期中に更新または削除されたファイルからデータブロックを取得します。
|
||||
これは、.content ファイルが同期プロセス全体を通じて、変更または削除されたすべてのファイルの
|
||||
メタデータを保持しているために可能です。
|
||||
この履歴情報は、syncが正常に終了し、.content ファイルの最終バージョンが保存されたときにのみクリアされます。
|
||||
|
||||
中断後に `sync` が再開されると、既存の保留中(pending)のスナップショットは削除され、
|
||||
ライブファイルシステムの現在の状態をキャプチャするために新しいスナップショットが作成されます。
|
||||
|
||||
|
||||
10 パターン (PATTERN)
|
||||
=================
|
||||
|
||||
パターンは、含めるファイルまたは除外するファイルをフィルタリングするための柔軟な方法を
|
||||
提供します。グロブ文字を使用することで、すべてのパスを手動でリストすることなく、
|
||||
|
|
@ -1501,11 +1641,11 @@ Unixでは、コマンドラインでグロブ文字を使用する場合、シ
|
|||
防ぐために引用符で囲む必要があります。
|
||||
|
||||
|
||||
9 IGNORE FILE
|
||||
=============
|
||||
11 除外ファイル (IGNORE FILE)
|
||||
=======================
|
||||
|
||||
設定ファイルのグローバルルールに加えて、アレイ内の任意のディレクトリに
|
||||
.snapraidignore ファイルを配置して、分散型の除外ルールを定義できます。
|
||||
`.snapraidignore` ファイルを配置して、分散型の除外ルールを定義できます。
|
||||
|
||||
`.snapraidignore` で定義されたルールは、設定ファイルのルールの後に
|
||||
適用されます。これは、それらがより高い優先度を持ち、グローバル設定で
|
||||
|
|
@ -1545,20 +1685,23 @@ Unixでは、コマンドラインでグロブ文字を使用する場合、シ
|
|||
*.tmp
|
||||
|
||||
|
||||
10 CONTENT
|
||||
==========
|
||||
12 コンテンツ (CONTENT)
|
||||
==================
|
||||
|
||||
SnapRAIDは、ファイルの一覧とチェックサムをコンテンツファイルに保存します。
|
||||
|
||||
これはバイナリファイルであり、ディスクアレイに存在するすべてのファイルと、
|
||||
それらの整合性を検証するためのすべてのチェックサムを一覧表示します。
|
||||
|
||||
このファイルは `sync` および `scrub` コマンドによって読み書きされ、
|
||||
`fix`、`check`、および `status` コマンドによって読み取られます。
|
||||
コンテンツファイルは `sync`、`scrub`、`touch`、および `rehash`
|
||||
コマンドによって読み書きされます。`status`、`diff`、`check`、
|
||||
`fix`、`list`、`dup`、`locate`、および `pool` コマンドによって読み取られ、
|
||||
`smart`、`probe`、`up`、`down`、および `devices` コマンドによって
|
||||
完全に無視されます。
|
||||
|
||||
|
||||
11 PARITY
|
||||
=========
|
||||
13 パリティ (PARITY)
|
||||
================
|
||||
|
||||
SnapRAIDは、アレイのパリティ情報をパリティファイルに保存します。
|
||||
|
||||
|
|
@ -1569,8 +1712,8 @@ SnapRAIDは、アレイのパリティ情報をパリティファイルに保存
|
|||
`scrub` および `check` コマンドによって**読み取られるだけ**です。
|
||||
|
||||
|
||||
12 ENCODING
|
||||
===========
|
||||
14 エンコーディング (ENCODING)
|
||||
======================
|
||||
|
||||
UnixのSnapRAIDは、エンコーディングを無視します。ファイルシステムで使用されている
|
||||
のと同じエンコーディングでファイル名を読み取り、保存します。
|
||||
|
|
@ -1579,18 +1722,35 @@ Windowsでは、ファイルシステムから読み取られたすべての名
|
|||
処理されます。
|
||||
|
||||
ファイル名を正しく出力するには、`chcp 65001` コマンドでWindowsコンソールをUTF-8モードに設定し、
|
||||
コンソールフォントとして `Lucida Console` などのTrueTypeフォントを**使用する**必要があります。
|
||||
コンソールフォントとして `Lucida Console` などのTrueTypeフォントを使用する必要があります。
|
||||
これは出力されるファイル名にのみ影響します。コンソール出力をファイルにリダイレクトする場合、
|
||||
結果のファイルは常にUTF-8形式になります。
|
||||
|
||||
|
||||
13 COPYRIGHT
|
||||
============
|
||||
15 終了コード (EXIT CODE)
|
||||
====================
|
||||
|
||||
This file is Copyright (C) 2025 Andrea Mazzoleni
|
||||
SnapRAIDは以下のエラーコードで終了します:
|
||||
|
||||
0 - すべて正常。
|
||||
1 - コマンドでエラーが発生しました。
|
||||
2 - `diff` コマンドはすべて正常であると判定しましたが、 `sync` が必要です。
|
||||
|
||||
|
||||
14 SEE ALSO
|
||||
===========
|
||||
16 翻訳 (TRANSLATION)
|
||||
===================
|
||||
|
||||
snapraid_log(1), snapraidd(1)
|
||||
この文書は英語版マニュアルの自動翻訳です。
|
||||
正確な記述については英語版マニュアルを参照してください。
|
||||
|
||||
|
||||
17 著作権 (COPYRIGHT)
|
||||
==================
|
||||
|
||||
This file is Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
|
||||
18 関連項目 (SEE ALSO)
|
||||
==================
|
||||
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
.TH "디스크 어레이를 위한 SnapRAID 백업" 1
|
||||
.SH NAME
|
||||
snapraid \- 디스크 어레이를 위한 SnapRAID 백업
|
||||
.SH SYNOPSIS
|
||||
.SH 개요 (SYNOPSIS)
|
||||
snapraid [\-c, \-\-conf CONFIG]
|
||||
.PD 0
|
||||
.PP
|
||||
|
|
@ -77,7 +77,7 @@ snapraid [\-c, \-\-conf CONFIG]
|
|||
snapraid [\-V, \-\-version] [\-H, \-\-help] [\-C, \-\-gen\-conf CONTENT]
|
||||
.PD 0
|
||||
.PD
|
||||
.SH DESCRIPTION
|
||||
.SH 설명 (DESCRIPTION)
|
||||
SnapRAID는 디스크 어레이를 위해 설계된 백업 프로그램으로,
|
||||
최대 6개의 디스크 오류가 발생해도 데이터를 복구하기 위한
|
||||
패리티 정보를 저장합니다.
|
||||
|
|
@ -89,7 +89,7 @@ SnapRAID는 디스크 어레이를 위해 설계된 백업 프로그램으로,
|
|||
파일을 다시 포맷할 필요 없이 이미 파일로 채워진 디스크를
|
||||
활용할 수 있으며, 평소처럼 액세스할 수 있습니다.
|
||||
.IP \(bu
|
||||
데이터 무결성을 보장하고 무단 손상을 방지하기 위해 모든 데이터가
|
||||
데이터 무결성을 보장하고 조용한 데이터 손상을 방지하기 위해 모든 데이터가
|
||||
해시됩니다.
|
||||
.IP \(bu
|
||||
실패한 디스크의 수가 패리티 수를 초과하는 경우, 데이터 손실은
|
||||
|
|
@ -116,20 +116,33 @@ https://www.snapraid.it/
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH LIMITATIONS
|
||||
SnapRAID는 RAID와 백업 프로그램의 하이브리드로, 두 가지의 장점을
|
||||
결합하는 것을 목표로 합니다. 하지만, 사용 전에 고려해야 할 몇 가지
|
||||
제한 사항이 있습니다.
|
||||
.SH 제한 사항 (LIMITATIONS)
|
||||
SnapRAID는 RAID와 백업 프로그램의 하이브리드로, 두 가지의 장점을 결합하는 것을
|
||||
목표로 합니다. 그러나 사용하기 전에 고려해야 할 몇 가지 제한 사항이 있습니다.
|
||||
.PP
|
||||
주요 제한 사항은 디스크가 실패하고 최근에 동기화(sync)하지 않은 경우,
|
||||
완전히 복구하지 못할 수 있다는 것입니다.
|
||||
더 구체적으로, 마지막 동기화 작업 이후 변경되거나 삭제된 파일의
|
||||
크기만큼 복구가 불가능할 수 있습니다.
|
||||
이는 변경되거나 삭제된 파일이 실패한 디스크에 있지 않더라도 발생합니다.
|
||||
이것이 SnapRAID가 **거의 변경되지 않는 데이터**에 더 적합한 이유입니다.
|
||||
가장 큰 제한 사항은 디스크가 고장 날 경우, 마지막 \`sync\`(동기화) 작업의 상태까지만
|
||||
데이터를 복구할 수 있다는 점입니다. 마지막 동기화 이후에 추가되거나 수정된 데이터 중
|
||||
고장 난 디스크에 위치한 데이터는 모두 손실됩니다.
|
||||
.PP
|
||||
반면에, 새로 추가된 파일은 이미 존재하는 파일의 복구를 방해하지 않습니다.
|
||||
새로 추가된 파일이 실패한 디스크에 있는 경우에만 해당 파일을 잃게 됩니다.
|
||||
따라서 SnapRAID는 주로 데이터 변경이 거의 없는 환경에 적합합니다.
|
||||
.PP
|
||||
마지막 동기화 시점에 이미 존재했던 데이터의 경우, 복구 신뢰성은 \`snapshot\`(스냅샷)
|
||||
옵션의 사용 여부에 따라 달라집니다.
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
스냅샷 지원이 있는 경우 (Btrfs, ZFS, Bcachefs 및 NTFS에서 사용 가능):
|
||||
SnapRAID는 데이터 디스크의 동결된 참조를 자동으로 유지할 수 있습니다.
|
||||
이를 통해 동기화 중이나 동기화 후에 라이브 파일시스템의 파일을 수정하거나 삭제하더라도
|
||||
복구 프로세스가 일관되고 신뢰할 수 있게 유지됩니다.
|
||||
.PD
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
스냅샷 지원이 없는 경우:
|
||||
\`sync\` 후에 파일을 삭제하거나 변경하면 다른 고장 난 디스크의 완전한 복구가 방해받을 수
|
||||
있습니다. 이는 수정된 파일이 고장 난 디스크에 없더라도 패리티가 수정된 파일과
|
||||
더 이상 일치하지 않기 때문에 발생합니다. 반면에 새로 추가된 파일은 이미 존재하는
|
||||
파일의 복구를 방해하지 않습니다.
|
||||
.PD
|
||||
.PP
|
||||
기타 SnapRAID 제한 사항은 다음과 같습니다:
|
||||
.PD 0
|
||||
|
|
@ -150,7 +163,7 @@ SnapRAID는 제한된 수의 디스크 오류에서만 데이터를 복구할
|
|||
파일 이름, 타임스탬프, 심볼릭 링크, 하드 링크만 저장됩니다.
|
||||
권한, 소유권, 확장 속성은 저장되지 않습니다.
|
||||
.PD
|
||||
.SH GETTING STARTED
|
||||
.SH 시작하기 (GETTING STARTED)
|
||||
SnapRAID를 사용하려면, 먼저 디스크 어레이에서 하나의 디스크를
|
||||
\`parity\`(패리티) 정보 전용으로 선택해야 합니다. 하나의 패리티 디스크로
|
||||
RAID5와 유사하게 단일 디스크 오류로부터 복구할 수 있습니다.
|
||||
|
|
@ -290,11 +303,11 @@ snapraid sync
|
|||
Ctrl+C를 눌러 언제든지 중지할 수 있으며, 다음 실행 시 중단된
|
||||
곳에서 재개됩니다.
|
||||
.PP
|
||||
이 명령이 완료되면 데이터는 **SAFE**합니다.
|
||||
이 명령이 완료되면 데이터는 안전합니다.
|
||||
.PP
|
||||
이제 어레이를 원하는 대로 사용하고 주기적으로 \`sync\` 명령을
|
||||
실행하여 패리티 정보를 업데이트할 수 있습니다.
|
||||
.SS Scrubbing
|
||||
.SS 스크러빙 (Scrubbing)
|
||||
주기적으로 데이터 및 패리티의 오류를 확인하려면 \`scrub\` 명령을
|
||||
실행할 수 있습니다.
|
||||
.PP
|
||||
|
|
@ -320,7 +333,7 @@ snapraid \-p 5 \-o 20 scrub
|
|||
.PD
|
||||
.RE
|
||||
.PP
|
||||
이 프로세스 중에 무단 또는 입출력 오류가 발견되면, 해당 블록은
|
||||
이 프로세스 중에 조용한 오류 또는 입출력 오류가 발견되면, 해당 블록은
|
||||
\`content\` 파일에 bad로 표시되며 \`status\` 명령에 나열됩니다.
|
||||
.PP
|
||||
.RS 4
|
||||
|
|
@ -351,7 +364,7 @@ snapraid \-p bad scrub
|
|||
동기화되지 않은 어레이에서 \`scrub\`을 실행하면 제거되거나 수정된 파일로
|
||||
인한 오류가 보고될 수 있습니다. 이러한 오류는 \`scrub\` 출력에는
|
||||
보고되지만, 관련 블록은 bad로 표시되지 않습니다.
|
||||
.SS Pooling
|
||||
.SS 풀링 (Pooling)
|
||||
참고: 아래에 설명된 풀링(pooling) 기능은 **mergerfs** 도구로 대체되었으며,
|
||||
이는 SnapRAID 커뮤니티에서 Linux 사용자를 위한 권장 옵션입니다.
|
||||
Mergefs는 여러 드라이브를 단일 통합 마운트 지점으로 풀링하는 더 유연하고
|
||||
|
|
@ -499,7 +512,7 @@ fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Undeleting
|
||||
.SS 삭제 취소 (Undeleting)
|
||||
SnapRAID는 RAID 시스템보다는 백업 프로그램처럼 작동하며,
|
||||
\-f, \-\-filter 옵션을 사용하여 파일이나 디렉토리를 이전 상태로 복원하거나
|
||||
삭제 취소할 수 있습니다:
|
||||
|
|
@ -535,10 +548,10 @@ snapraid fix \-m
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Recovering
|
||||
.SS 복구 (Recovering)
|
||||
최악의 상황이 발생하여 하나 이상의 디스크를 잃었습니다!
|
||||
.PP
|
||||
**패닉하지 마십시오!** 복구할 수 있습니다!
|
||||
**당황하지 마십시오!** 복구할 수 있습니다!
|
||||
.PP
|
||||
가장 먼저 해야 할 일은 디스크 어레이에 대한 추가 변경을 피하는 것입니다.
|
||||
모든 원격 연결과 SnapRAID 야간 동기화 또는 스크럽을 포함한 모든 예약된
|
||||
|
|
@ -636,27 +649,27 @@ snapraid sync
|
|||
.RE
|
||||
.PP
|
||||
모든 것이 복구되면 이 명령은 즉시 완료됩니다.
|
||||
.SH COMMANDS
|
||||
SnapRAID는 다음을 허용하는 몇 가지 간단한 명령을 제공합니다:
|
||||
.SH 명령어 (COMMANDS)
|
||||
SnapRAID는 다음과 같은 작업을 수행할 수 있는 몇 가지 간단한 명령어를 제공합니다.
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
어레이의 상태 출력 \-> \`status\`
|
||||
.IP \(bu
|
||||
디스크 제어 \-> \`smart\`, \`probe\`, \`up\`, \`down\`
|
||||
.IP \(bu
|
||||
백업/스냅샷 생성 \-> \`sync\`
|
||||
백업/복구 지점 생성 \-> \`sync\`
|
||||
.IP \(bu
|
||||
주기적으로 데이터 확인 \-> \`scrub\`
|
||||
주기적인 데이터 검사 \-> \`scrub\`
|
||||
.IP \(bu
|
||||
마지막 백업/스냅샷 복원 \-> \`fix\`.
|
||||
마지막 백업/복구 지점 복원 \-> \`fix\`
|
||||
.PD
|
||||
.PP
|
||||
명령은 소문자로 작성해야 합니다.
|
||||
명령어는 반드시 소문자로 작성해야 합니다.
|
||||
.SS status
|
||||
디스크 어레이의 상태 요약을 출력합니다.
|
||||
.PP
|
||||
패리티 단편화, 확인 없이 블록이 얼마나 오래되었는지, 그리고
|
||||
스크럽 중에 발생한 모든 기록된 무단 오류에 대한 정보를 포함합니다.
|
||||
스크럽 중에 발생한 모든 기록된 조용한 오류에 대한 정보를 포함합니다.
|
||||
.PP
|
||||
제시된 정보는 마지막으로 \`sync\`를 실행했을 때를 나타냅니다.
|
||||
나중에 수정된 내용은 고려되지 않습니다.
|
||||
|
|
@ -814,7 +827,7 @@ inode는 다르지만 디렉토리, 이름, 크기 및 타임스탬
|
|||
중지할 수 있습니다.
|
||||
다음 실행 시 \`sync\` 프로세스는 중단된 곳에서 재개됩니다.
|
||||
.PP
|
||||
이 프로세스 중에 무단 또는 입출력 오류가 발견되면,
|
||||
이 프로세스 중에 조용한 오류 또는 입출력 오류가 발견되면,
|
||||
해당 블록은 bad로 표시됩니다.
|
||||
.PP
|
||||
파일은 경로 및/또는 아이노드로 식별되며 크기와 타임스탬프로
|
||||
|
|
@ -829,7 +842,7 @@ inode는 다르지만 디렉토리, 이름, 크기 및 타임스탬
|
|||
\`content\` 및 \`parity\` 파일은 필요한 경우 수정됩니다.
|
||||
어레이의 파일은 수정되지 않습니다.
|
||||
.SS scrub
|
||||
어레이를 스크럽하여 데이터 및 패리티 디스크의 무단 또는 입출력 오류를
|
||||
어레이를 스크럽하여 데이터 및 패리티 디스크의 조용한 오류 또는 입출력 오류를
|
||||
확인합니다.
|
||||
.PP
|
||||
각 호출은 이전에 10일 이내에 스크럽된 데이터를 제외하고 어레이의
|
||||
|
|
@ -852,7 +865,7 @@ full \- 모든 것 스크럽.
|
|||
.PP
|
||||
스크럽 상태의 세부 정보를 얻으려면 \`status\` 명령을 사용하십시오.
|
||||
.PP
|
||||
발견된 모든 무단 또는 입출력 오류에 대해, 해당 블록은 \`content\` 파일에
|
||||
발견된 모든 조용한 오류 또는 입출력 오류에 대해, 해당 블록은 \`content\` 파일에
|
||||
bad로 표시됩니다.
|
||||
이러한 bad 블록은 \`status\`에 나열되며 \`fix \-e\`로 수정할 수 있습니다.
|
||||
수정 후, 다음 스크럽 시에 다시 확인되며, 수정된 것으로 발견되면 bad
|
||||
|
|
@ -860,7 +873,7 @@ bad로 표시됩니다.
|
|||
bad 블록만 스크럽하려면 \`scrub \-p bad\` 명령을 사용할 수 있습니다.
|
||||
.PP
|
||||
동기화되지 않은 데이터로 인한 보고된 오류를 피하기 위해 동기화된
|
||||
어레이에서만 \`scrub\`을 실행하는 것이 좋습니다. 이러한 오류는 무단
|
||||
어레이에서만 \`scrub\`을 실행하는 것이 좋습니다. 이러한 오류는 조용한
|
||||
오류가 아닌 것으로 인식되며, 블록은 bad로 표시되지 않지만,
|
||||
이러한 오류는 명령의 출력에 보고됩니다.
|
||||
.PP
|
||||
|
|
@ -869,14 +882,14 @@ bad 블록만 스크럽하려면 \`scrub \-p bad\` 명령을 사용할 수 있
|
|||
\`parity\` 파일은 수정되지 않습니다.
|
||||
어레이의 파일은 수정되지 않습니다.
|
||||
.SS fix
|
||||
모든 파일과 패리티 데이터를 수정합니다.
|
||||
모든 파일과 패리티 데이터를 복구(수정)합니다.
|
||||
.PP
|
||||
모든 파일과 패리티 데이터는 마지막 \`sync\`에 저장된 스냅샷
|
||||
상태와 비교됩니다.
|
||||
차이가 발견되면 저장된 스냅샷으로 되돌려집니다.
|
||||
모든 파일과 패리티 데이터는 마지막 \`sync\`에 저장된 상태와 비교됩니다.
|
||||
차이점이 발견되면 저장된 상태로 되돌립니다.
|
||||
.PP
|
||||
**경고!** \`fix\` 명령은 오류와 의도적인 수정 사이를 구별하지
|
||||
않습니다. 파일 상태를 무조건 마지막 \`sync\`로 되돌립니다.
|
||||
경고!
|
||||
\`fix\` 명령어는 오류와 의도적인 수정을 구별하지 않습니다.
|
||||
파일 상태를 조건 없이 마지막 \`sync\` 상태로 되돌립니다.
|
||||
.PP
|
||||
다른 옵션이 지정되지 않으면 전체 어레이가 처리됩니다.
|
||||
필터 옵션을 사용하여 처리할 파일 또는 디스크의 하위 집합을 선택하십시오.
|
||||
|
|
@ -997,7 +1010,7 @@ SnapRAID가 이동되거나 복사된 파일을 인식하는 능력을 향상시
|
|||
사용할 수 있습니다.
|
||||
재할당 과정 동안 해당 파일들은 패리티에 의해 보호되지 않으므로
|
||||
주의하십시오.
|
||||
.SH OPTIONS
|
||||
.SH 옵션 (OPTIONS)
|
||||
SnapRAID는 다음 옵션을 제공합니다:
|
||||
.TP
|
||||
.B \-c, \-\-conf CONFIG
|
||||
|
|
@ -1038,7 +1051,7 @@ Unix에서는 글로빙 문자가 사용되는 경우 따옴표로 묶어야 합
|
|||
.TP
|
||||
.B \-e, \-\-filter\-error
|
||||
\`check\` 및 \`fix\`에서 오류가 있는 파일을 처리합니다.
|
||||
\`status\`에 나열된 대로 \`sync\` 및 \`scrub\` 중에 무단 또는 입출력 오류가
|
||||
\`status\`에 나열된 대로 \`sync\` 및 \`scrub\` 중에 조용한 오류 또는 입출력 오류가
|
||||
표시된 블록을 가진 파일만 처리합니다.
|
||||
이 옵션은 \`check\` 및 \`fix\`에서만 사용할 수 있습니다.
|
||||
.TP
|
||||
|
|
@ -1052,7 +1065,7 @@ Unix에서는 글로빙 문자가 사용되는 경우 따옴표로 묶어야 합
|
|||
.TP
|
||||
.B \-o, \-\-older\-than DAYS
|
||||
\`scrub\`에서 처리할 어레이의 가장 오래된 부분을 선택합니다.
|
||||
DAYS는 블록이 스크럽되어야 하는 최소 일령(days)이며,
|
||||
DAYS는 블록이 스크럽되어야 하는 최소 경과 일수(days)이며,
|
||||
기본값은 10입니다.
|
||||
bad로 표시된 블록은 이 옵션에 관계없이 항상 스크럽됩니다.
|
||||
이 옵션은 \`scrub\`에서만 사용할 수 있습니다.
|
||||
|
|
@ -1072,7 +1085,7 @@ bad로 표시된 블록은 이 옵션에 관계없이 항상 스크럽됩니다.
|
|||
이 프로세스는 모든 디스크가 회전하고 CPU가 바쁜, 시스템이
|
||||
과부하 상태일 때 발생합니다.
|
||||
이는 기계의 극한 조건이며, 잠재된 하드웨어 문제가 있는 경우
|
||||
데이터가 아직 해시되지 않았기 때문에 무단 오류가 감지되지 않고
|
||||
데이터가 아직 해시되지 않았기 때문에 조용한 오류가 감지되지 않고
|
||||
지나갈 수 있습니다.
|
||||
이러한 위험을 피하려면, \`pre\-hash\` 모드를 활성화하여 모든 데이터를
|
||||
두 번 읽어 무결성을 보장할 수 있습니다.
|
||||
|
|
@ -1102,7 +1115,7 @@ bad로 표시된 블록은 이 옵션에 관계없이 항상 스크럽됩니다.
|
|||
초당 바이트 수입니다. K, M, 또는 G와 같은 승수(예: \-\-bw\-limit 1G)를
|
||||
지정할 수 있습니다.
|
||||
.TP
|
||||
.B \-t, \-\-tail 크기
|
||||
.B \-t, \-\-tail SIZE
|
||||
패리티 디스크의 지정된 꼬리 크기 이하를 사용하는 파일로
|
||||
목록을 제한합니다.
|
||||
K, M, G, T와 같은 배수를 사용할 수 있습니다 (예: \-\-tail 1G).
|
||||
|
|
@ -1174,7 +1187,7 @@ SnapRAID가 일부 디스크의 UUID가 변경되었음을 감지하면,
|
|||
동일한 속성을 가진 파일이 동일한 데이터를 가진 복사본이라고
|
||||
가정합니다.
|
||||
이는 한 디스크에서 다른 디스크로 복사되거나 이동된 파일을
|
||||
식별하고, 이미 계산된 해시 정보를 재사용하여 무단 오류를
|
||||
식별하고, 이미 계산된 해시 정보를 재사용하여 조용한 오류를
|
||||
감지하거나 누락된 파일을 복구할 수 있도록 합니다.
|
||||
일부 드문 경우에 이 동작은 오탐(false positives) 또는 많은
|
||||
해시 확인으로 인한 느린 프로세스를 초래할 수 있으며, 이 옵션을
|
||||
|
|
@ -1201,7 +1214,7 @@ content 파일에 있는 해시를 재사용하여 데이터를 검증하고
|
|||
강력히 권장됩니다.
|
||||
\`sync\` 작업 중에는 데이터 보호가 없습니다.
|
||||
.TP
|
||||
.B \-W, \-\-force\-realloc\-tail 크기
|
||||
.B \-W, \-\-force\-realloc\-tail SIZE
|
||||
\-R, \-\-force\-realloc과 같이 작동하지만, 각 패리티 파일의 지정된
|
||||
꼬리 부분(마지막 \'크기\' 바이트)으로 제한됩니다.
|
||||
현재 해당 꼬리 섹션에 저장된 모든 파일 조각/블록의 재할당(이동)을
|
||||
|
|
@ -1278,7 +1291,7 @@ locate \-t, \-\-tail을 사용하여 영향을 받는 파일을 사전에
|
|||
.TP
|
||||
.B \-V, \-\-version
|
||||
프로그램 버전을 출력합니다.
|
||||
.SH CONFIGURATION
|
||||
.SH 설정 (CONFIGURATION)
|
||||
SnapRAID는 디스크 어레이의 위치와 패리티 정보를 저장할 위치를
|
||||
알기 위해 설정 파일이 필요합니다.
|
||||
.PP
|
||||
|
|
@ -1296,8 +1309,8 @@ Windows에서는 \`snapraid.exe\`와 같은 디렉토리에 있는
|
|||
여러 파일을 지정할 수 있으며, 이들은 서로 다른 디스크에
|
||||
있어야 합니다.
|
||||
하나의 파일이 더 이상 커질 수 없을 때 다음 파일이 사용됩니다.
|
||||
총 사용 가능한 공간은 어레이에서 가장 큰 데이터 디스크보다
|
||||
적어도 커야 합니다.
|
||||
총 사용 가능한 공간은 어레이에서 가장 큰 데이터 디스크의 크기
|
||||
이상이어야 합니다.
|
||||
.PP
|
||||
나중에 추가 패리티 파일을 추가할 수 있지만, 순서를 바꾸거나
|
||||
제거할 수는 없습니다.
|
||||
|
|
@ -1385,6 +1398,27 @@ NAME을 고정된 상태로 유지하는 한, 필요에 따라 마운트 지점
|
|||
.PP
|
||||
이러한 디스크는 항상 회전할 것으로 예상되므로 \`up\` 및 \`down\` 명령의
|
||||
영향을 받지 않습니다.
|
||||
.SS snapshot
|
||||
\`sync\`, \`scrub\`, \`check\` 및 \`fix\` 명령어에 파일시스템 스냅샷 사용을
|
||||
활성화합니다.
|
||||
.PP
|
||||
활성화되면 SnapRAID는 \`sync\` 시작 시 데이터의 읽기 전용 스냅샷을 생성합니다.
|
||||
이는 파일의 일관된 특정 시점 뷰를 보장하여 동시 파일 수정으로 인해 발생하는
|
||||
오류를 방지합니다.
|
||||
.PP
|
||||
이는 복구 가능성을 크게 향상시킵니다. 라이브 파일시스템에서 파일이 삭제되더라도
|
||||
스냅샷에 그대로 보존됩니다. 이를 통해 해당 블록의 패리티가 \[dq]깨지는\[dq] 것을 방지하여,
|
||||
다른 디스크가 고장 나더라도 데이터를 성공적으로 복구할 수 있도록 보장합니다.
|
||||
.PP
|
||||
이 옵션은 Linux의 Btrfs, Bcachefs 또는 ZFS 파일시스템과 Windows의 NTFS로 포맷된
|
||||
데이터 디스크에만 독점적으로 적용됩니다.
|
||||
패리티 디스크나 다른 파일시스템을 사용하는 데이터 디스크는 항상 파일시스템의
|
||||
라이브 버전을 사용합니다.
|
||||
.PP
|
||||
스냅샷 생성 및 삭제에는 관리자 권한이 필요합니다.
|
||||
이 옵션이 활성화된 경우 SnapRAID가 필요한 권한(예: sudo)으로 실행되는지 확인하십시오.
|
||||
.PP
|
||||
스냅샷 수명 주기에 대한 자세한 설명은 SNAPSHOTS 섹션을 참조하십시오.
|
||||
.SS nohidden
|
||||
모든 숨겨진 파일 및 디렉토리를 제외합니다.
|
||||
Unix에서는 숨겨진 파일은 \'.\'으로 시작하는 파일입니다.
|
||||
|
|
@ -1507,11 +1541,11 @@ SnapRAID가 작동하는 동안 현재 디스크 온도가 표시됩니다.
|
|||
다시 일시 중지될 수 있습니다.
|
||||
.PP
|
||||
작동 중에 SnapRAID는 각 디스크의 가열 곡선을 분석하고 활동이 계속되면
|
||||
도달할 것으로 예상되는 장기 정상 온도를 추정합니다.
|
||||
도달할 것으로 예상되는 장기 평형 온도를 추정합니다.
|
||||
추정은 디스크 온도가 네 번 증가한 후에만 수행되어, 신뢰할 수 있는
|
||||
추세를 설정하기에 충분한 데이터 포인트가 확보되도록 합니다.
|
||||
이 예측된 정상 온도는 현재 값 옆에 괄호 안에 표시되며, 시스템의
|
||||
냉각이 적절한지 평가하는 데 도움이 됩니다. 이 추정 온도는 정보 제공
|
||||
이 예측된 평형 온도는 현재 값 옆에 괄호 안에 표시되며, 시스템의
|
||||
냉각이 적절한지 평가하는 데 도움이 됩니다. 이 추정 평형 온도는 정보 제공
|
||||
목적일 뿐이며 SnapRAID의 동작에는 영향을 미치지 않습니다.
|
||||
프로그램의 동작은 오로지 실제 측정된 디스크 온도에 기반합니다.
|
||||
.PP
|
||||
|
|
@ -1557,6 +1591,9 @@ PARITY는 \`parity\`, \`2\-parity\`, \`3\-parity\`, \`4\-parity\`, \`5\-parity\`
|
|||
RAID 컨트롤러의 경우 장치가 고정되어 있을 가능성이 높으므로
|
||||
\`%s\`를 사용할 필요가 없을 수 있습니다.
|
||||
.PP
|
||||
기본 \`\-a\` 옵션을 대체하기 위해 \`[info: ...]\` 태그를 사용하여
|
||||
사용자 정의 정보 옵션 문자열을 지정할 수도 있습니다.
|
||||
.PP
|
||||
가능한 옵션은 smartmontools 설명서를 참조하십시오:
|
||||
.PP
|
||||
.RS 4
|
||||
|
|
@ -1572,6 +1609,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices
|
|||
예:
|
||||
.PP
|
||||
.RS 4
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl parity \-d sat %s
|
||||
.PD 0
|
||||
.PD
|
||||
|
|
@ -1586,11 +1627,19 @@ PARITY는 \`parity\`, \`2\-parity\`, \`3\-parity\`, \`4\-parity\`, \`5\-parity\`
|
|||
\`6\-parity\`, 또는 \`z\-parity\` 중 하나의 패리티 이름입니다.
|
||||
특수 값 *는 모든 디스크에서 속성을 무시하는 데 사용될 수 있습니다.
|
||||
.PP
|
||||
예를 들어, 모든 디스크에서 \`Current Pending Sector Count\` 속성을
|
||||
무시하려면:
|
||||
여러 속성을 공백으로 구분하여 지정할 수 있습니다.
|
||||
각 속성은 1에서 255 사이의 숫자나 대소문자를 구분하지 않는 이름
|
||||
(예: \`Current_Pending_Sector\`)으로 지정할 수 있습니다.
|
||||
.PP
|
||||
예를 들어, 모든 디스크에서 \`Current Pending Sector Count\` 와
|
||||
\`Reallocated Sectors Count\` 속성을 번호나 이름으로 무시하려면:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore * 197
|
||||
smartignore * 197 5
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
|
|
@ -1598,7 +1647,7 @@ smartignore * 197
|
|||
첫 번째 패리티 디스크에서만 무시하려면:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore parity 197
|
||||
smartignore parity 197 5
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
|
|
@ -1638,7 +1687,7 @@ exclude /tmp/
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1694,7 +1743,7 @@ exclude \\System Volume Information
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1710,7 +1759,106 @@ smartctl 2\-parity \-d areca,2/1 /dev/arcmsr0
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH PATTERN
|
||||
.SH 스냅샷 (SNAPSHOTS)
|
||||
구성에서 스냅샷 옵션이 활성화된 경우, SnapRAID는 원자적이고
|
||||
일관된 작업을 보장하기 위해 파일시스템 스냅샷 기능을 이용합니다.
|
||||
.PP
|
||||
스냅샷 관리는 완전히 자동적이고 투명하게 이루어집니다.
|
||||
백그라운드에서 완전히 처리되는 스냅샷의 추가적인 보호와 함께,
|
||||
기존과 완전히 동일하게 SnapRAID를 계속 사용할 수 있습니다.
|
||||
.PP
|
||||
이것은 두 가지 주요 이점을 제공합니다.
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I 일관성
|
||||
장시간 실행되는 sync 또는 scrub 중에 라이브 파일시스템에서 수정된 파일은
|
||||
SnapRAID가 동결된 시점의 이미지를 보기 때문에 패리티 불일치나 작업 중단을
|
||||
유발하지 않습니다.
|
||||
.HP 4
|
||||
.I 복구
|
||||
라이브 파일시스템에서 파일이 업데이트되거나 삭제되더라도 스냅샷에 보존됩니다.
|
||||
다음 sync가 실행되기 전에 디스크 고장이 발생하면, SnapRAID는 스냅샷에 보존된
|
||||
데이터를 사용하여 고장 난 디스크를 재구성합니다.
|
||||
.PD
|
||||
.PP
|
||||
.RS 4
|
||||
.PD 0
|
||||
활성 sync 프로세스 중에 디스크 고장이 발생하는 경우,
|
||||
SnapRAID는 이전 패리티 계산의 스냅샷과 현재 스냅샷 모두에서 자동으로 읽을 수도 있습니다.
|
||||
이는 동기화 사이에 블록이 수정되거나 삭제되었더라도 패리티 방정식을 푸는 데
|
||||
필요한 정확한 데이터 블록에 대한 접근을 제공함으로써 완전한 복구 확률을 최대화합니다.
|
||||
.PD
|
||||
.PP
|
||||
.PD 0
|
||||
스냅샷이 없으면 정상 디스크에서 업데이트되거나 삭제된 파일로 인해 데이터 블록이 누락되며,
|
||||
이는 다른 고장 난 디스크를 복구하는 데 필요할 수 있습니다.
|
||||
.PD
|
||||
.RE
|
||||
.RE
|
||||
.PP
|
||||
스냅샷은 데이터 디스크에 대해서만 생성되며, 기본 파일시스템이 이 기능을 지원하는 경우에만
|
||||
생성됩니다. 패리티 디스크는 항상 라이브 파일시스템을 사용합니다.
|
||||
.PP
|
||||
현재 이는 Linux의 Btrfs, Bcachefs, ZFS 및 Windows의 NTFS에서 지원됩니다.
|
||||
.PP
|
||||
서로 다른 파일시스템을 가진 데이터 디스크를 혼합할 수 있습니다. 스냅샷을 지원하는 디스크만
|
||||
이를 활용하고, 다른 디스크는 라이브 파일시스템에서 직접 계속 작동합니다.
|
||||
.PP
|
||||
스냅샷 생성 및 삭제에는 관리자 권한이 필요합니다.
|
||||
스냅샷이 활성화된 경우 SnapRAID가 필요한 권한(예: sudo)으로 실행되는지 확인하십시오.
|
||||
.SS 스냅샷 사용 시 명령어 동작 (Command Behavior with Snapshots)
|
||||
\`sync\` 와 \`scrub\` 명령어는 모두 일관되고 동결된 상태에 대해 모든 데이터 작업이 수행되도록
|
||||
보장하기 위해 스냅샷에서만 독점적으로 작동합니다. 이러한 스냅샷을 이용함으로써 SnapRAID는
|
||||
라이브 파일시스템의 동시 파일 수정으로 인해 발생할 수 있는 패리티 불일치를 방지합니다.
|
||||
\`sync\` 중에 명령어는 프로세스 시작 시 생성된 새 스냅샷을 사용하여 패리티 계산을 위한
|
||||
현재 상태를 캡처합니다.
|
||||
반면에 \`scrub\` 명령어는 기존 패리티와 일치하는 신뢰할 수 있는 참조 지점을 유지하기 위해
|
||||
가장 최근 동기화 중에 생성된 마지막 스냅샷을 이용합니다.
|
||||
.PP
|
||||
\`check\` 및 \`fix\` 명령어의 경우, 마지막 스냅샷의 사용 여부는
|
||||
\-d, \-\-filter\-disk 옵션을 사용하여 특정 디스크를 대상으로 지정하는지 여부에 따라 달라집니다.
|
||||
.TP
|
||||
.B \-d를 통해 명시적으로 선택된 디스크(작업의 \[dq]대상\[dq])는 항상 라이브 파일시스템을 사용합니다.
|
||||
\`fix\` 의 경우 이를 통해 활성 교체 디스크에 데이터를 복원할 수 있습니다.
|
||||
\`check\` 의 경우 동일한 조건에서 \`fix\` 작업을 시뮬레이션할 수 있습니다.
|
||||
.PP
|
||||
다른 모든 데이터 디스크(\[dq]참조\[dq] 디스크)는 해당 스냅샷을 통해 액세스됩니다.
|
||||
이를 통해 복구가 진행되는 동안 정상 디스크의 파일을 수정하고 있더라도 SnapRAID가
|
||||
패리티 방정식을 풀기 위한 안정적이고 동결된 참조를 가질 수 있습니다.
|
||||
.TP
|
||||
.B \-d 옵션이 제공되지 않으면 SnapRAID는 작업이 전체 어레이에 적용된다고 가정하며, 이 경우
|
||||
\`check\` 와 \`fix\` 는 라이브 파일시스템만을 독점적으로 사용합니다.
|
||||
.PP
|
||||
다른 모든 명령어는 라이브 파일시스템에서만 독점적으로 작동합니다.
|
||||
.SH 스냅샷 수명 주기 (SNAPSHOTS LIFECYCLE)
|
||||
SnapRAID는 각 데이터 하위 볼륨의 루트에 있는 숨겨진 디렉터리 내에서
|
||||
\`stable\`(안정)과 \`pending\`(보류)이라는 두 가지 특정 스냅샷을 관리합니다.
|
||||
Btrfs, Bcachefs 및 NTFS에서는 \`.snapraid/\` 디렉터리가 사용되며,
|
||||
ZFS에서는 표준 \`.zfs/snapshot/\` 이 사용됩니다.
|
||||
.PP
|
||||
\`stable\` 스냅샷은 성공적으로 완료된 마지막 \`sync\` 상태를 나타내며,
|
||||
현재 패리티를 계산하는 데 사용된 정확한 데이터를 포함합니다. 이는
|
||||
\`scrub\`, \`check\` 및 \`fix\` 명령어의 기본 데이터 소스 역할을 합니다.
|
||||
.PP
|
||||
\`pending\` 스냅샷은 패리티 계산을 위한 동결된 상태를 제공하기 위해 \`sync\` 시작 시
|
||||
생성되는 임시 이미지입니다.
|
||||
작업이 성공적으로 완료되면 이전의 \`stable\` 스냅샷은 삭제되고, \`pending\` 스냅샷이
|
||||
새로운 안정적인 참조로 자리를 잡도록 승격됩니다.
|
||||
.PP
|
||||
\`sync\` 가 중단되면 \`pending\` 스냅샷은 보존됩니다.
|
||||
패리티가 부분적으로만 동기화되었더라도 .content 파일에 기록된 파일시스템 상태와 일치하므로
|
||||
이후의 \`scrub\`, \`check\` 및 \`fix\` 명령어는 이 보류 중인 스냅샷을 사용합니다.
|
||||
.PP
|
||||
\`sync\` 가 중단된 경우, \`check\` 및 \`fix\` 명령어는 \`stable\` 스냅샷에서도 읽어와
|
||||
동기화 중에 업데이트되거나 삭제된 파일에서 데이터 블록을 검색합니다.
|
||||
이는 동기화 프로세스 전반에 걸쳐 .content 파일이 수정되거나 삭제된 모든 파일의
|
||||
메타데이터를 유지하기 때문에 가능합니다.
|
||||
이 기록 정보는 동기화가 성공적으로 완료되고 .content 파일의 최종 버전이 저장되어야만 삭제됩니다.
|
||||
.PP
|
||||
중단 후 \`sync\` 가 재시작되면 기존의 보류 중인(pending) 스냅샷은 삭제되고,
|
||||
라이브 파일시스템의 현재 상태를 캡처하기 위해 새 스냅샷이 생성됩니다.
|
||||
.SH 패턴 (PATTERN)
|
||||
패턴은 포함하거나 제외할 파일을 필터링하는 유연한 방법을 제공합니다.
|
||||
글로빙(globbing) 문자를 사용하면 모든 경로를 일일이 나열하지 않고도
|
||||
특정 파일 이름이나 전체 디렉토리 구조와 일치하는 규칙을 정의할 수 있습니다.
|
||||
|
|
@ -1889,7 +2037,7 @@ snapraid \-f \[dq]*.mp3\[dq] check
|
|||
.PP
|
||||
Unix에서는 명령줄에서 글로빙 문자를 사용할 때 셸이 확장하는 것을
|
||||
방지하기 위해 따옴표로 묶어야 합니다.
|
||||
.SH IGNORE FILE
|
||||
.SH 제외 파일 (IGNORE FILE)
|
||||
설정 파일의 전역 규칙 외에도, 배열 내의 모든 디렉토리에 \`.snapraidignore\`
|
||||
파일을 배치하여 분산된 제외 규칙을 정의할 수 있습니다.
|
||||
.PP
|
||||
|
|
@ -1947,15 +2095,17 @@ build/
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH CONTENT
|
||||
.SH 콘텐츠 (CONTENT)
|
||||
SnapRAID는 content 파일에 파일 목록과 체크섬을 저장합니다.
|
||||
.PP
|
||||
이것은 디스크 어레이에 있는 모든 파일의 목록과 무결성을 확인하기 위한
|
||||
모든 체크섬을 나열하는 이진 파일입니다.
|
||||
.PP
|
||||
이 파일은 \`sync\` 및 \`scrub\` 명령에 의해 읽고 쓰여지며,
|
||||
\`fix\`, \`check\`, 및 \`status\` 명령에 의해 읽혀집니다.
|
||||
.SH PARITY
|
||||
content 파일은 \`sync\`, \`scrub\`, \`touch\` 및 \`rehash\` 명령에 의해
|
||||
읽고 쓰여집니다. 이것은 \`status\`, \`diff\`, \`check\`, \`fix\`, \`list\`,
|
||||
\`dup\`, \`locate\` 및 \`pool\` 명령에 의해 읽혀지며, \`smart\`, \`probe\`,
|
||||
\`up\`, \`down\` 및 \`devices\` 명령에 의해 완전히 무시됩니다.
|
||||
.SH 패리티 (PARITY)
|
||||
SnapRAID는 패리티 파일에 어레이의 패리티 정보를 저장합니다.
|
||||
.PP
|
||||
이들은 \`content\` 파일에 정의된 모든 블록의 계산된 패리티를 포함하는
|
||||
|
|
@ -1963,7 +2113,7 @@ SnapRAID는 패리티 파일에 어레이의 패리티 정보를 저장합니다
|
|||
.PP
|
||||
이 파일들은 \`sync\` 및 \`fix\` 명령에 의해 읽고 쓰여지며,
|
||||
\`scrub\` 및 \`check\` 명령에 의해서만 읽혀집니다.
|
||||
.SH ENCODING
|
||||
.SH 인코딩 (ENCODING)
|
||||
Unix의 SnapRAID는 인코딩을 무시합니다. 파일 시스템에서 사용되는
|
||||
것과 동일한 인코딩으로 파일 이름을 읽고 저장합니다.
|
||||
.PP
|
||||
|
|
@ -1975,7 +2125,25 @@ Windows 콘솔을 UTF\-8 모드로 설정하고 콘솔 글꼴로 \`Lucida Consol
|
|||
같은 TrueType 글꼴을 사용해야 합니다.
|
||||
이는 출력되는 파일 이름에만 영향을 미치며, 콘솔 출력을 파일로
|
||||
리디렉션하는 경우 결과 파일은 항상 UTF\-8 형식입니다.
|
||||
.SH COPYRIGHT
|
||||
This file is Copyright (C) 2025 Andrea Mazzoleni
|
||||
.SH SEE ALSO
|
||||
snapraid_log(1), snapraidd(1)
|
||||
.SH 종료 코드 (EXIT CODE)
|
||||
SnapRAID는 다음과 같은 오류 코드로 종료됩니다:
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I 0
|
||||
모두 정상.
|
||||
.HP 4
|
||||
.I 1
|
||||
명령 실행 중 오류가 발생했습니다.
|
||||
.HP 4
|
||||
.I 2
|
||||
\`diff\` 명령으로 모두 정상임을 확인했으나 \`sync\`가 필요합니다.
|
||||
.PD
|
||||
.RE
|
||||
.SH 번역 (TRANSLATION)
|
||||
이 문서는 영어 매뉴얼의 자동 번역본입니다.
|
||||
공식 버전은 영어 매뉴얼을 참조하십시오.
|
||||
.SH 저작권 (COPYRIGHT)
|
||||
This file is Copyright (C) 2026 Andrea Mazzoleni
|
||||
.SH 참고 (SEE ALSO)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
Name{number}
|
||||
snapraid - 디스크 어레이를 위한 SnapRAID 백업
|
||||
|
||||
Synopsis
|
||||
개요 (Synopsis)
|
||||
:snapraid [-c, --conf CONFIG]
|
||||
: [-f, --filter PATTERN] [-d, --filter-disk NAME]
|
||||
: [-m, --filter-missing] [-e, --filter-error]
|
||||
|
|
@ -23,7 +23,7 @@ Synopsis
|
|||
|
||||
:snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
Description
|
||||
설명 (Description)
|
||||
SnapRAID는 디스크 어레이를 위해 설계된 백업 프로그램으로,
|
||||
최대 6개의 디스크 오류가 발생해도 데이터를 복구하기 위한
|
||||
패리티 정보를 저장합니다.
|
||||
|
|
@ -33,7 +33,7 @@ Description
|
|||
|
||||
* 파일을 다시 포맷할 필요 없이 이미 파일로 채워진 디스크를
|
||||
활용할 수 있으며, 평소처럼 액세스할 수 있습니다.
|
||||
* 데이터 무결성을 보장하고 무단 손상을 방지하기 위해 모든 데이터가
|
||||
* 데이터 무결성을 보장하고 조용한 데이터 손상을 방지하기 위해 모든 데이터가
|
||||
해시됩니다.
|
||||
* 실패한 디스크의 수가 패리티 수를 초과하는 경우, 데이터 손실은
|
||||
영향을 받은 디스크로 제한되며, 다른 디스크의 데이터는
|
||||
|
|
@ -50,20 +50,29 @@ Description
|
|||
|
||||
:https://www.snapraid.it/
|
||||
|
||||
Limitations
|
||||
SnapRAID는 RAID와 백업 프로그램의 하이브리드로, 두 가지의 장점을
|
||||
결합하는 것을 목표로 합니다. 하지만, 사용 전에 고려해야 할 몇 가지
|
||||
제한 사항이 있습니다.
|
||||
제한 사항 (Limitations)
|
||||
SnapRAID는 RAID와 백업 프로그램의 하이브리드로, 두 가지의 장점을 결합하는 것을
|
||||
목표로 합니다. 그러나 사용하기 전에 고려해야 할 몇 가지 제한 사항이 있습니다.
|
||||
|
||||
주요 제한 사항은 디스크가 실패하고 최근에 동기화(sync)하지 않은 경우,
|
||||
완전히 복구하지 못할 수 있다는 것입니다.
|
||||
더 구체적으로, 마지막 동기화 작업 이후 변경되거나 삭제된 파일의
|
||||
크기만큼 복구가 불가능할 수 있습니다.
|
||||
이는 변경되거나 삭제된 파일이 실패한 디스크에 있지 않더라도 발생합니다.
|
||||
이것이 SnapRAID가 **거의 변경되지 않는 데이터**에 더 적합한 이유입니다.
|
||||
가장 큰 제한 사항은 디스크가 고장 날 경우, 마지막 `sync`(동기화) 작업의 상태까지만
|
||||
데이터를 복구할 수 있다는 점입니다. 마지막 동기화 이후에 추가되거나 수정된 데이터 중
|
||||
고장 난 디스크에 위치한 데이터는 모두 손실됩니다.
|
||||
|
||||
반면에, 새로 추가된 파일은 이미 존재하는 파일의 복구를 방해하지 않습니다.
|
||||
새로 추가된 파일이 실패한 디스크에 있는 경우에만 해당 파일을 잃게 됩니다.
|
||||
따라서 SnapRAID는 주로 데이터 변경이 거의 없는 환경에 적합합니다.
|
||||
|
||||
마지막 동기화 시점에 이미 존재했던 데이터의 경우, 복구 신뢰성은 `snapshot`(스냅샷)
|
||||
옵션의 사용 여부에 따라 달라집니다.
|
||||
|
||||
* 스냅샷 지원이 있는 경우 (Btrfs, ZFS, Bcachefs 및 NTFS에서 사용 가능):
|
||||
SnapRAID는 데이터 디스크의 동결된 참조를 자동으로 유지할 수 있습니다.
|
||||
이를 통해 동기화 중이나 동기화 후에 라이브 파일시스템의 파일을 수정하거나 삭제하더라도
|
||||
복구 프로세스가 일관되고 신뢰할 수 있게 유지됩니다.
|
||||
|
||||
* 스냅샷 지원이 없는 경우:
|
||||
`sync` 후에 파일을 삭제하거나 변경하면 다른 고장 난 디스크의 완전한 복구가 방해받을 수
|
||||
있습니다. 이는 수정된 파일이 고장 난 디스크에 없더라도 패리티가 수정된 파일과
|
||||
더 이상 일치하지 않기 때문에 발생합니다. 반면에 새로 추가된 파일은 이미 존재하는
|
||||
파일의 복구를 방해하지 않습니다.
|
||||
|
||||
기타 SnapRAID 제한 사항은 다음과 같습니다:
|
||||
|
||||
|
|
@ -79,7 +88,7 @@ Limitations
|
|||
* 파일 이름, 타임스탬프, 심볼릭 링크, 하드 링크만 저장됩니다.
|
||||
권한, 소유권, 확장 속성은 저장되지 않습니다.
|
||||
|
||||
Getting Started
|
||||
시작하기 (Getting Started)
|
||||
SnapRAID를 사용하려면, 먼저 디스크 어레이에서 하나의 디스크를
|
||||
`parity`(패리티) 정보 전용으로 선택해야 합니다. 하나의 패리티 디스크로
|
||||
RAID5와 유사하게 단일 디스크 오류로부터 복구할 수 있습니다.
|
||||
|
|
@ -154,12 +163,12 @@ Getting Started
|
|||
Ctrl+C를 눌러 언제든지 중지할 수 있으며, 다음 실행 시 중단된
|
||||
곳에서 재개됩니다.
|
||||
|
||||
이 명령이 완료되면 데이터는 **SAFE**합니다.
|
||||
이 명령이 완료되면 데이터는 안전합니다.
|
||||
|
||||
이제 어레이를 원하는 대로 사용하고 주기적으로 `sync` 명령을
|
||||
실행하여 패리티 정보를 업데이트할 수 있습니다.
|
||||
|
||||
Scrubbing
|
||||
스크러빙 (Scrubbing)
|
||||
주기적으로 데이터 및 패리티의 오류를 확인하려면 `scrub` 명령을
|
||||
실행할 수 있습니다.
|
||||
|
||||
|
|
@ -177,7 +186,7 @@ Getting Started
|
|||
|
||||
:snapraid -p 5 -o 20 scrub
|
||||
|
||||
이 프로세스 중에 무단 또는 입출력 오류가 발견되면, 해당 블록은
|
||||
이 프로세스 중에 조용한 오류 또는 입출력 오류가 발견되면, 해당 블록은
|
||||
`content` 파일에 bad로 표시되며 `status` 명령에 나열됩니다.
|
||||
|
||||
:snapraid status
|
||||
|
|
@ -197,7 +206,7 @@ Getting Started
|
|||
인한 오류가 보고될 수 있습니다. 이러한 오류는 `scrub` 출력에는
|
||||
보고되지만, 관련 블록은 bad로 표시되지 않습니다.
|
||||
|
||||
Pooling
|
||||
풀링 (Pooling)
|
||||
참고: 아래에 설명된 풀링(pooling) 기능은 **mergerfs** 도구로 대체되었으며,
|
||||
이는 SnapRAID 커뮤니티에서 Linux 사용자를 위한 권장 옵션입니다.
|
||||
Mergefs는 여러 드라이브를 단일 통합 마운트 지점으로 풀링하는 더 유연하고
|
||||
|
|
@ -269,7 +278,7 @@ Getting Started
|
|||
|
||||
:fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
||||
|
||||
Undeleting
|
||||
삭제 취소 (Undeleting)
|
||||
SnapRAID는 RAID 시스템보다는 백업 프로그램처럼 작동하며,
|
||||
-f, --filter 옵션을 사용하여 파일이나 디렉토리를 이전 상태로 복원하거나
|
||||
삭제 취소할 수 있습니다:
|
||||
|
|
@ -290,10 +299,10 @@ Getting Started
|
|||
|
||||
:snapraid fix -m
|
||||
|
||||
Recovering
|
||||
복구 (Recovering)
|
||||
최악의 상황이 발생하여 하나 이상의 디스크를 잃었습니다!
|
||||
|
||||
**패닉하지 마십시오!** 복구할 수 있습니다!
|
||||
**당황하지 마십시오!** 복구할 수 있습니다!
|
||||
|
||||
가장 먼저 해야 할 일은 디스크 어레이에 대한 추가 변경을 피하는 것입니다.
|
||||
모든 원격 연결과 SnapRAID 야간 동기화 또는 스크럽을 포함한 모든 예약된
|
||||
|
|
@ -376,22 +385,22 @@ Getting Started
|
|||
|
||||
모든 것이 복구되면 이 명령은 즉시 완료됩니다.
|
||||
|
||||
Commands
|
||||
SnapRAID는 다음을 허용하는 몇 가지 간단한 명령을 제공합니다:
|
||||
명령어 (Commands)
|
||||
SnapRAID는 다음과 같은 작업을 수행할 수 있는 몇 가지 간단한 명령어를 제공합니다.
|
||||
|
||||
* 어레이의 상태 출력 -> `status`
|
||||
* 디스크 제어 -> `smart`, `probe`, `up`, `down`
|
||||
* 백업/스냅샷 생성 -> `sync`
|
||||
* 주기적으로 데이터 확인 -> `scrub`
|
||||
* 마지막 백업/스냅샷 복원 -> `fix`.
|
||||
* 백업/복구 지점 생성 -> `sync`
|
||||
* 주기적인 데이터 검사 -> `scrub`
|
||||
* 마지막 백업/복구 지점 복원 -> `fix`
|
||||
|
||||
명령은 소문자로 작성해야 합니다.
|
||||
명령어는 반드시 소문자로 작성해야 합니다.
|
||||
|
||||
status
|
||||
디스크 어레이의 상태 요약을 출력합니다.
|
||||
|
||||
패리티 단편화, 확인 없이 블록이 얼마나 오래되었는지, 그리고
|
||||
스크럽 중에 발생한 모든 기록된 무단 오류에 대한 정보를 포함합니다.
|
||||
스크럽 중에 발생한 모든 기록된 조용한 오류에 대한 정보를 포함합니다.
|
||||
|
||||
제시된 정보는 마지막으로 `sync`를 실행했을 때를 나타냅니다.
|
||||
나중에 수정된 내용은 고려되지 않습니다.
|
||||
|
|
@ -521,7 +530,7 @@ Commands
|
|||
중지할 수 있습니다.
|
||||
다음 실행 시 `sync` 프로세스는 중단된 곳에서 재개됩니다.
|
||||
|
||||
이 프로세스 중에 무단 또는 입출력 오류가 발견되면,
|
||||
이 프로세스 중에 조용한 오류 또는 입출력 오류가 발견되면,
|
||||
해당 블록은 bad로 표시됩니다.
|
||||
|
||||
파일은 경로 및/또는 아이노드로 식별되며 크기와 타임스탬프로
|
||||
|
|
@ -537,7 +546,7 @@ Commands
|
|||
어레이의 파일은 수정되지 않습니다.
|
||||
|
||||
scrub
|
||||
어레이를 스크럽하여 데이터 및 패리티 디스크의 무단 또는 입출력 오류를
|
||||
어레이를 스크럽하여 데이터 및 패리티 디스크의 조용한 오류 또는 입출력 오류를
|
||||
확인합니다.
|
||||
|
||||
각 호출은 이전에 10일 이내에 스크럽된 데이터를 제외하고 어레이의
|
||||
|
|
@ -560,7 +569,7 @@ Commands
|
|||
|
||||
스크럽 상태의 세부 정보를 얻으려면 `status` 명령을 사용하십시오.
|
||||
|
||||
발견된 모든 무단 또는 입출력 오류에 대해, 해당 블록은 `content` 파일에
|
||||
발견된 모든 조용한 오류 또는 입출력 오류에 대해, 해당 블록은 `content` 파일에
|
||||
bad로 표시됩니다.
|
||||
이러한 bad 블록은 `status`에 나열되며 `fix -e`로 수정할 수 있습니다.
|
||||
수정 후, 다음 스크럽 시에 다시 확인되며, 수정된 것으로 발견되면 bad
|
||||
|
|
@ -568,7 +577,7 @@ Commands
|
|||
bad 블록만 스크럽하려면 `scrub -p bad` 명령을 사용할 수 있습니다.
|
||||
|
||||
동기화되지 않은 데이터로 인한 보고된 오류를 피하기 위해 동기화된
|
||||
어레이에서만 `scrub`을 실행하는 것이 좋습니다. 이러한 오류는 무단
|
||||
어레이에서만 `scrub`을 실행하는 것이 좋습니다. 이러한 오류는 조용한
|
||||
오류가 아닌 것으로 인식되며, 블록은 bad로 표시되지 않지만,
|
||||
이러한 오류는 명령의 출력에 보고됩니다.
|
||||
|
||||
|
|
@ -578,14 +587,14 @@ Commands
|
|||
어레이의 파일은 수정되지 않습니다.
|
||||
|
||||
fix
|
||||
모든 파일과 패리티 데이터를 수정합니다.
|
||||
모든 파일과 패리티 데이터를 복구(수정)합니다.
|
||||
|
||||
모든 파일과 패리티 데이터는 마지막 `sync`에 저장된 스냅샷
|
||||
상태와 비교됩니다.
|
||||
차이가 발견되면 저장된 스냅샷으로 되돌려집니다.
|
||||
모든 파일과 패리티 데이터는 마지막 `sync`에 저장된 상태와 비교됩니다.
|
||||
차이점이 발견되면 저장된 상태로 되돌립니다.
|
||||
|
||||
**경고!** `fix` 명령은 오류와 의도적인 수정 사이를 구별하지
|
||||
않습니다. 파일 상태를 무조건 마지막 `sync`로 되돌립니다.
|
||||
경고!
|
||||
`fix` 명령어는 오류와 의도적인 수정을 구별하지 않습니다.
|
||||
파일 상태를 조건 없이 마지막 `sync` 상태로 되돌립니다.
|
||||
|
||||
다른 옵션이 지정되지 않으면 전체 어레이가 처리됩니다.
|
||||
필터 옵션을 사용하여 처리할 파일 또는 디스크의 하위 집합을 선택하십시오.
|
||||
|
|
@ -715,7 +724,7 @@ Commands
|
|||
재할당 과정 동안 해당 파일들은 패리티에 의해 보호되지 않으므로
|
||||
주의하십시오.
|
||||
|
||||
Options
|
||||
옵션 (Options)
|
||||
SnapRAID는 다음 옵션을 제공합니다:
|
||||
|
||||
-c, --conf CONFIG
|
||||
|
|
@ -756,7 +765,7 @@ Options
|
|||
|
||||
-e, --filter-error
|
||||
`check` 및 `fix`에서 오류가 있는 파일을 처리합니다.
|
||||
`status`에 나열된 대로 `sync` 및 `scrub` 중에 무단 또는 입출력 오류가
|
||||
`status`에 나열된 대로 `sync` 및 `scrub` 중에 조용한 오류 또는 입출력 오류가
|
||||
표시된 블록을 가진 파일만 처리합니다.
|
||||
이 옵션은 `check` 및 `fix`에서만 사용할 수 있습니다.
|
||||
|
||||
|
|
@ -770,7 +779,7 @@ Options
|
|||
|
||||
-o, --older-than DAYS
|
||||
`scrub`에서 처리할 어레이의 가장 오래된 부분을 선택합니다.
|
||||
DAYS는 블록이 스크럽되어야 하는 최소 일령(days)이며,
|
||||
DAYS는 블록이 스크럽되어야 하는 최소 경과 일수(days)이며,
|
||||
기본값은 10입니다.
|
||||
bad로 표시된 블록은 이 옵션에 관계없이 항상 스크럽됩니다.
|
||||
이 옵션은 `scrub`에서만 사용할 수 있습니다.
|
||||
|
|
@ -790,7 +799,7 @@ Options
|
|||
이 프로세스는 모든 디스크가 회전하고 CPU가 바쁜, 시스템이
|
||||
과부하 상태일 때 발생합니다.
|
||||
이는 기계의 극한 조건이며, 잠재된 하드웨어 문제가 있는 경우
|
||||
데이터가 아직 해시되지 않았기 때문에 무단 오류가 감지되지 않고
|
||||
데이터가 아직 해시되지 않았기 때문에 조용한 오류가 감지되지 않고
|
||||
지나갈 수 있습니다.
|
||||
이러한 위험을 피하려면, `pre-hash` 모드를 활성화하여 모든 데이터를
|
||||
두 번 읽어 무결성을 보장할 수 있습니다.
|
||||
|
|
@ -820,7 +829,7 @@ Options
|
|||
초당 바이트 수입니다. K, M, 또는 G와 같은 승수(예: --bw-limit 1G)를
|
||||
지정할 수 있습니다.
|
||||
|
||||
-t, --tail 크기
|
||||
-t, --tail SIZE
|
||||
패리티 디스크의 지정된 꼬리 크기 이하를 사용하는 파일로
|
||||
목록을 제한합니다.
|
||||
K, M, G, T와 같은 배수를 사용할 수 있습니다 (예: --tail 1G).
|
||||
|
|
@ -892,7 +901,7 @@ Options
|
|||
동일한 속성을 가진 파일이 동일한 데이터를 가진 복사본이라고
|
||||
가정합니다.
|
||||
이는 한 디스크에서 다른 디스크로 복사되거나 이동된 파일을
|
||||
식별하고, 이미 계산된 해시 정보를 재사용하여 무단 오류를
|
||||
식별하고, 이미 계산된 해시 정보를 재사용하여 조용한 오류를
|
||||
감지하거나 누락된 파일을 복구할 수 있도록 합니다.
|
||||
일부 드문 경우에 이 동작은 오탐(false positives) 또는 많은
|
||||
해시 확인으로 인한 느린 프로세스를 초래할 수 있으며, 이 옵션을
|
||||
|
|
@ -919,7 +928,7 @@ Options
|
|||
강력히 권장됩니다.
|
||||
`sync` 작업 중에는 데이터 보호가 없습니다.
|
||||
|
||||
-W, --force-realloc-tail 크기
|
||||
-W, --force-realloc-tail SIZE
|
||||
-R, --force-realloc과 같이 작동하지만, 각 패리티 파일의 지정된
|
||||
꼬리 부분(마지막 '크기' 바이트)으로 제한됩니다.
|
||||
현재 해당 꼬리 섹션에 저장된 모든 파일 조각/블록의 재할당(이동)을
|
||||
|
|
@ -997,7 +1006,7 @@ Options
|
|||
-V, --version
|
||||
프로그램 버전을 출력합니다.
|
||||
|
||||
Configuration
|
||||
설정 (Configuration)
|
||||
SnapRAID는 디스크 어레이의 위치와 패리티 정보를 저장할 위치를
|
||||
알기 위해 설정 파일이 필요합니다.
|
||||
|
||||
|
|
@ -1016,8 +1025,8 @@ Configuration
|
|||
여러 파일을 지정할 수 있으며, 이들은 서로 다른 디스크에
|
||||
있어야 합니다.
|
||||
하나의 파일이 더 이상 커질 수 없을 때 다음 파일이 사용됩니다.
|
||||
총 사용 가능한 공간은 어레이에서 가장 큰 데이터 디스크보다
|
||||
적어도 커야 합니다.
|
||||
총 사용 가능한 공간은 어레이에서 가장 큰 데이터 디스크의 크기
|
||||
이상이어야 합니다.
|
||||
|
||||
나중에 추가 패리티 파일을 추가할 수 있지만, 순서를 바꾸거나
|
||||
제거할 수는 없습니다.
|
||||
|
|
@ -1105,6 +1114,28 @@ Configuration
|
|||
이러한 디스크는 항상 회전할 것으로 예상되므로 `up` 및 `down` 명령의
|
||||
영향을 받지 않습니다.
|
||||
|
||||
snapshot
|
||||
`sync`, `scrub`, `check` 및 `fix` 명령어에 파일시스템 스냅샷 사용을
|
||||
활성화합니다.
|
||||
|
||||
활성화되면 SnapRAID는 `sync` 시작 시 데이터의 읽기 전용 스냅샷을 생성합니다.
|
||||
이는 파일의 일관된 특정 시점 뷰를 보장하여 동시 파일 수정으로 인해 발생하는
|
||||
오류를 방지합니다.
|
||||
|
||||
이는 복구 가능성을 크게 향상시킵니다. 라이브 파일시스템에서 파일이 삭제되더라도
|
||||
스냅샷에 그대로 보존됩니다. 이를 통해 해당 블록의 패리티가 "깨지는" 것을 방지하여,
|
||||
다른 디스크가 고장 나더라도 데이터를 성공적으로 복구할 수 있도록 보장합니다.
|
||||
|
||||
이 옵션은 Linux의 Btrfs, Bcachefs 또는 ZFS 파일시스템과 Windows의 NTFS로 포맷된
|
||||
데이터 디스크에만 독점적으로 적용됩니다.
|
||||
패리티 디스크나 다른 파일시스템을 사용하는 데이터 디스크는 항상 파일시스템의
|
||||
라이브 버전을 사용합니다.
|
||||
|
||||
스냅샷 생성 및 삭제에는 관리자 권한이 필요합니다.
|
||||
이 옵션이 활성화된 경우 SnapRAID가 필요한 권한(예: sudo)으로 실행되는지 확인하십시오.
|
||||
|
||||
스냅샷 수명 주기에 대한 자세한 설명은 SNAPSHOTS 섹션을 참조하십시오.
|
||||
|
||||
nohidden
|
||||
모든 숨겨진 파일 및 디렉토리를 제외합니다.
|
||||
Unix에서는 숨겨진 파일은 '.'으로 시작하는 파일입니다.
|
||||
|
|
@ -1220,11 +1251,11 @@ Configuration
|
|||
다시 일시 중지될 수 있습니다.
|
||||
|
||||
작동 중에 SnapRAID는 각 디스크의 가열 곡선을 분석하고 활동이 계속되면
|
||||
도달할 것으로 예상되는 장기 정상 온도를 추정합니다.
|
||||
도달할 것으로 예상되는 장기 평형 온도를 추정합니다.
|
||||
추정은 디스크 온도가 네 번 증가한 후에만 수행되어, 신뢰할 수 있는
|
||||
추세를 설정하기에 충분한 데이터 포인트가 확보되도록 합니다.
|
||||
이 예측된 정상 온도는 현재 값 옆에 괄호 안에 표시되며, 시스템의
|
||||
냉각이 적절한지 평가하는 데 도움이 됩니다. 이 추정 온도는 정보 제공
|
||||
이 예측된 평형 온도는 현재 값 옆에 괄호 안에 표시되며, 시스템의
|
||||
냉각이 적절한지 평가하는 데 도움이 됩니다. 이 추정 평형 온도는 정보 제공
|
||||
목적일 뿐이며 SnapRAID의 동작에는 영향을 미치지 않습니다.
|
||||
프로그램의 동작은 오로지 실제 측정된 디스크 온도에 기반합니다.
|
||||
|
||||
|
|
@ -1274,6 +1305,9 @@ Configuration
|
|||
RAID 컨트롤러의 경우 장치가 고정되어 있을 가능성이 높으므로
|
||||
`%s`를 사용할 필요가 없을 수 있습니다.
|
||||
|
||||
기본 `-a` 옵션을 대체하기 위해 `[info: ...]` 태그를 사용하여
|
||||
사용자 정의 정보 옵션 문자열을 지정할 수도 있습니다.
|
||||
|
||||
가능한 옵션은 smartmontools 설명서를 참조하십시오:
|
||||
|
||||
:https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
|
|
@ -1281,6 +1315,7 @@ Configuration
|
|||
|
||||
예:
|
||||
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl parity -d sat %s
|
||||
|
||||
smartignore DISK/PARITY ATTR [ATTR...]
|
||||
|
|
@ -1293,14 +1328,19 @@ Configuration
|
|||
`6-parity`, 또는 `z-parity` 중 하나의 패리티 이름입니다.
|
||||
특수 값 *는 모든 디스크에서 속성을 무시하는 데 사용될 수 있습니다.
|
||||
|
||||
예를 들어, 모든 디스크에서 `Current Pending Sector Count` 속성을
|
||||
무시하려면:
|
||||
여러 속성을 공백으로 구분하여 지정할 수 있습니다.
|
||||
각 속성은 1에서 255 사이의 숫자나 대소문자를 구분하지 않는 이름
|
||||
(예: `Current_Pending_Sector`)으로 지정할 수 있습니다.
|
||||
|
||||
:smartignore * 197
|
||||
예를 들어, 모든 디스크에서 `Current Pending Sector Count` 와
|
||||
`Reallocated Sectors Count` 속성을 번호나 이름으로 무시하려면:
|
||||
|
||||
:smartignore * 197 5
|
||||
:smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
첫 번째 패리티 디스크에서만 무시하려면:
|
||||
|
||||
:smartignore parity 197
|
||||
:smartignore parity 197 5
|
||||
|
||||
Examples
|
||||
Unix의 일반적인 설정 예는 다음과 같습니다:
|
||||
|
|
@ -1313,7 +1353,7 @@ Configuration
|
|||
:data d3 /mnt/disk3/
|
||||
:exclude /lost+found/
|
||||
:exclude /tmp/
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/sg0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1329,12 +1369,101 @@ Configuration
|
|||
:exclude Thumbs.db
|
||||
:exclude \$RECYCLE.BIN
|
||||
:exclude \System Volume Information
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
Pattern
|
||||
스냅샷 (Snapshots)
|
||||
구성에서 스냅샷 옵션이 활성화된 경우, SnapRAID는 원자적이고
|
||||
일관된 작업을 보장하기 위해 파일시스템 스냅샷 기능을 이용합니다.
|
||||
|
||||
스냅샷 관리는 완전히 자동적이고 투명하게 이루어집니다.
|
||||
백그라운드에서 완전히 처리되는 스냅샷의 추가적인 보호와 함께,
|
||||
기존과 완전히 동일하게 SnapRAID를 계속 사용할 수 있습니다.
|
||||
|
||||
이것은 두 가지 주요 이점을 제공합니다.
|
||||
|
||||
일관성 - 장시간 실행되는 sync 또는 scrub 중에 라이브 파일시스템에서 수정된 파일은
|
||||
SnapRAID가 동결된 시점의 이미지를 보기 때문에 패리티 불일치나 작업 중단을
|
||||
유발하지 않습니다.
|
||||
복구 - 라이브 파일시스템에서 파일이 업데이트되거나 삭제되더라도 스냅샷에 보존됩니다.
|
||||
다음 sync가 실행되기 전에 디스크 고장이 발생하면, SnapRAID는 스냅샷에 보존된
|
||||
데이터를 사용하여 고장 난 디스크를 재구성합니다.
|
||||
|
||||
활성 sync 프로세스 중에 디스크 고장이 발생하는 경우,
|
||||
SnapRAID는 이전 패리티 계산의 스냅샷과 현재 스냅샷 모두에서 자동으로 읽을 수도 있습니다.
|
||||
이는 동기화 사이에 블록이 수정되거나 삭제되었더라도 패리티 방정식을 푸는 데
|
||||
필요한 정확한 데이터 블록에 대한 접근을 제공함으로써 완전한 복구 확률을 최대화합니다.
|
||||
|
||||
스냅샷이 없으면 정상 디스크에서 업데이트되거나 삭제된 파일로 인해 데이터 블록이 누락되며,
|
||||
이는 다른 고장 난 디스크를 복구하는 데 필요할 수 있습니다.
|
||||
|
||||
스냅샷은 데이터 디스크에 대해서만 생성되며, 기본 파일시스템이 이 기능을 지원하는 경우에만
|
||||
생성됩니다. 패리티 디스크는 항상 라이브 파일시스템을 사용합니다.
|
||||
|
||||
현재 이는 Linux의 Btrfs, Bcachefs, ZFS 및 Windows의 NTFS에서 지원됩니다.
|
||||
|
||||
서로 다른 파일시스템을 가진 데이터 디스크를 혼합할 수 있습니다. 스냅샷을 지원하는 디스크만
|
||||
이를 활용하고, 다른 디스크는 라이브 파일시스템에서 직접 계속 작동합니다.
|
||||
|
||||
스냅샷 생성 및 삭제에는 관리자 권한이 필요합니다.
|
||||
스냅샷이 활성화된 경우 SnapRAID가 필요한 권한(예: sudo)으로 실행되는지 확인하십시오.
|
||||
|
||||
스냅샷 사용 시 명령어 동작 (Command Behavior with Snapshots)
|
||||
`sync` 와 `scrub` 명령어는 모두 일관되고 동결된 상태에 대해 모든 데이터 작업이 수행되도록
|
||||
보장하기 위해 스냅샷에서만 독점적으로 작동합니다. 이러한 스냅샷을 이용함으로써 SnapRAID는
|
||||
라이브 파일시스템의 동시 파일 수정으로 인해 발생할 수 있는 패리티 불일치를 방지합니다.
|
||||
`sync` 중에 명령어는 프로세스 시작 시 생성된 새 스냅샷을 사용하여 패리티 계산을 위한
|
||||
현재 상태를 캡처합니다.
|
||||
반면에 `scrub` 명령어는 기존 패리티와 일치하는 신뢰할 수 있는 참조 지점을 유지하기 위해
|
||||
가장 최근 동기화 중에 생성된 마지막 스냅샷을 이용합니다.
|
||||
|
||||
`check` 및 `fix` 명령어의 경우, 마지막 스냅샷의 사용 여부는
|
||||
-d, --filter-disk 옵션을 사용하여 특정 디스크를 대상으로 지정하는지 여부에 따라 달라집니다.
|
||||
|
||||
-d를 통해 명시적으로 선택된 디스크(작업의 "대상")는 항상 라이브 파일시스템을 사용합니다.
|
||||
`fix` 의 경우 이를 통해 활성 교체 디스크에 데이터를 복원할 수 있습니다.
|
||||
`check` 의 경우 동일한 조건에서 `fix` 작업을 시뮬레이션할 수 있습니다.
|
||||
|
||||
다른 모든 데이터 디스크("참조" 디스크)는 해당 스냅샷을 통해 액세스됩니다.
|
||||
이를 통해 복구가 진행되는 동안 정상 디스크의 파일을 수정하고 있더라도 SnapRAID가
|
||||
패리티 방정식을 풀기 위한 안정적이고 동결된 참조를 가질 수 있습니다.
|
||||
|
||||
-d 옵션이 제공되지 않으면 SnapRAID는 작업이 전체 어레이에 적용된다고 가정하며, 이 경우
|
||||
`check` 와 `fix` 는 라이브 파일시스템만을 독점적으로 사용합니다.
|
||||
|
||||
다른 모든 명령어는 라이브 파일시스템에서만 독점적으로 작동합니다.
|
||||
|
||||
스냅샷 수명 주기 (Snapshots Lifecycle)
|
||||
SnapRAID는 각 데이터 하위 볼륨의 루트에 있는 숨겨진 디렉터리 내에서
|
||||
`stable`(안정)과 `pending`(보류)이라는 두 가지 특정 스냅샷을 관리합니다.
|
||||
Btrfs, Bcachefs 및 NTFS에서는 `.snapraid/` 디렉터리가 사용되며,
|
||||
ZFS에서는 표준 `.zfs/snapshot/` 이 사용됩니다.
|
||||
|
||||
`stable` 스냅샷은 성공적으로 완료된 마지막 `sync` 상태를 나타내며,
|
||||
현재 패리티를 계산하는 데 사용된 정확한 데이터를 포함합니다. 이는
|
||||
`scrub`, `check` 및 `fix` 명령어의 기본 데이터 소스 역할을 합니다.
|
||||
|
||||
`pending` 스냅샷은 패리티 계산을 위한 동결된 상태를 제공하기 위해 `sync` 시작 시
|
||||
생성되는 임시 이미지입니다.
|
||||
작업이 성공적으로 완료되면 이전의 `stable` 스냅샷은 삭제되고, `pending` 스냅샷이
|
||||
새로운 안정적인 참조로 자리를 잡도록 승격됩니다.
|
||||
|
||||
`sync` 가 중단되면 `pending` 스냅샷은 보존됩니다.
|
||||
패리티가 부분적으로만 동기화되었더라도 .content 파일에 기록된 파일시스템 상태와 일치하므로
|
||||
이후의 `scrub`, `check` 및 `fix` 명령어는 이 보류 중인 스냅샷을 사용합니다.
|
||||
|
||||
`sync` 가 중단된 경우, `check` 및 `fix` 명령어는 `stable` 스냅샷에서도 읽어와
|
||||
동기화 중에 업데이트되거나 삭제된 파일에서 데이터 블록을 검색합니다.
|
||||
이는 동기화 프로세스 전반에 걸쳐 .content 파일이 수정되거나 삭제된 모든 파일의
|
||||
메타데이터를 유지하기 때문에 가능합니다.
|
||||
이 기록 정보는 동기화가 성공적으로 완료되고 .content 파일의 최종 버전이 저장되어야만 삭제됩니다.
|
||||
|
||||
중단 후 `sync` 가 재시작되면 기존의 보류 중인(pending) 스냅샷은 삭제되고,
|
||||
라이브 파일시스템의 현재 상태를 캡처하기 위해 새 스냅샷이 생성됩니다.
|
||||
|
||||
패턴 (Pattern)
|
||||
패턴은 포함하거나 제외할 파일을 필터링하는 유연한 방법을 제공합니다.
|
||||
글로빙(globbing) 문자를 사용하면 모든 경로를 일일이 나열하지 않고도
|
||||
특정 파일 이름이나 전체 디렉토리 구조와 일치하는 규칙을 정의할 수 있습니다.
|
||||
|
|
@ -1447,7 +1576,7 @@ Pattern
|
|||
Unix에서는 명령줄에서 글로빙 문자를 사용할 때 셸이 확장하는 것을
|
||||
방지하기 위해 따옴표로 묶어야 합니다.
|
||||
|
||||
Ignore File
|
||||
제외 파일 (Ignore File)
|
||||
설정 파일의 전역 규칙 외에도, 배열 내의 모든 디렉토리에 `.snapraidignore`
|
||||
파일을 배치하여 분산된 제외 규칙을 정의할 수 있습니다.
|
||||
|
||||
|
|
@ -1487,16 +1616,18 @@ Ignore File
|
|||
:# projects/ 또는 그 하위 폴더의 모든 .tmp 파일 제외
|
||||
:*.tmp
|
||||
|
||||
Content
|
||||
콘텐츠 (Content)
|
||||
SnapRAID는 content 파일에 파일 목록과 체크섬을 저장합니다.
|
||||
|
||||
이것은 디스크 어레이에 있는 모든 파일의 목록과 무결성을 확인하기 위한
|
||||
모든 체크섬을 나열하는 이진 파일입니다.
|
||||
|
||||
이 파일은 `sync` 및 `scrub` 명령에 의해 읽고 쓰여지며,
|
||||
`fix`, `check`, 및 `status` 명령에 의해 읽혀집니다.
|
||||
content 파일은 `sync`, `scrub`, `touch` 및 `rehash` 명령에 의해
|
||||
읽고 쓰여집니다. 이것은 `status`, `diff`, `check`, `fix`, `list`,
|
||||
`dup`, `locate` 및 `pool` 명령에 의해 읽혀지며, `smart`, `probe`,
|
||||
`up`, `down` 및 `devices` 명령에 의해 완전히 무시됩니다.
|
||||
|
||||
Parity
|
||||
패리티 (Parity)
|
||||
SnapRAID는 패리티 파일에 어레이의 패리티 정보를 저장합니다.
|
||||
|
||||
이들은 `content` 파일에 정의된 모든 블록의 계산된 패리티를 포함하는
|
||||
|
|
@ -1505,7 +1636,7 @@ Parity
|
|||
이 파일들은 `sync` 및 `fix` 명령에 의해 읽고 쓰여지며,
|
||||
`scrub` 및 `check` 명령에 의해서만 읽혀집니다.
|
||||
|
||||
Encoding
|
||||
인코딩 (Encoding)
|
||||
Unix의 SnapRAID는 인코딩을 무시합니다. 파일 시스템에서 사용되는
|
||||
것과 동일한 인코딩으로 파일 이름을 읽고 저장합니다.
|
||||
|
||||
|
|
@ -1518,8 +1649,19 @@ Encoding
|
|||
이는 출력되는 파일 이름에만 영향을 미치며, 콘솔 출력을 파일로
|
||||
리디렉션하는 경우 결과 파일은 항상 UTF-8 형식입니다.
|
||||
|
||||
Copyright
|
||||
This file is Copyright (C) 2025 Andrea Mazzoleni
|
||||
종료 코드 (Exit Code)
|
||||
SnapRAID는 다음과 같은 오류 코드로 종료됩니다:
|
||||
|
||||
See Also
|
||||
snapraid_log(1), snapraidd(1)
|
||||
0 - 모두 정상.
|
||||
1 - 명령 실행 중 오류가 발생했습니다.
|
||||
2 - `diff` 명령으로 모두 정상임을 확인했으나 `sync`가 필요합니다.
|
||||
|
||||
번역 (Translation)
|
||||
이 문서는 영어 매뉴얼의 자동 번역본입니다.
|
||||
공식 버전은 영어 매뉴얼을 참조하십시오.
|
||||
|
||||
저작권 (Copyright)
|
||||
This file is Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
참고 (See Also)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
=======================
|
||||
|
||||
|
||||
1 SYNOPSIS
|
||||
==========
|
||||
1 개요 (SYNOPSIS)
|
||||
===============
|
||||
|
||||
snapraid [-c, --conf CONFIG]
|
||||
[-f, --filter PATTERN] [-d, --filter-disk NAME]
|
||||
|
|
@ -28,8 +28,8 @@ snapraid [-c, --conf CONFIG]
|
|||
snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
|
||||
2 DESCRIPTION
|
||||
=============
|
||||
2 설명 (DESCRIPTION)
|
||||
==================
|
||||
|
||||
SnapRAID는 디스크 어레이를 위해 설계된 백업 프로그램으로,
|
||||
최대 6개의 디스크 오류가 발생해도 데이터를 복구하기 위한
|
||||
|
|
@ -40,7 +40,7 @@ SnapRAID는 디스크 어레이를 위해 설계된 백업 프로그램으로,
|
|||
|
||||
* 파일을 다시 포맷할 필요 없이 이미 파일로 채워진 디스크를
|
||||
활용할 수 있으며, 평소처럼 액세스할 수 있습니다.
|
||||
* 데이터 무결성을 보장하고 무단 손상을 방지하기 위해 모든 데이터가
|
||||
* 데이터 무결성을 보장하고 조용한 데이터 손상을 방지하기 위해 모든 데이터가
|
||||
해시됩니다.
|
||||
* 실패한 디스크의 수가 패리티 수를 초과하는 경우, 데이터 손실은
|
||||
영향을 받은 디스크로 제한되며, 다른 디스크의 데이터는
|
||||
|
|
@ -58,22 +58,31 @@ SnapRAID는 디스크 어레이를 위해 설계된 백업 프로그램으로,
|
|||
https://www.snapraid.it/
|
||||
|
||||
|
||||
3 LIMITATIONS
|
||||
=============
|
||||
3 제한 사항 (LIMITATIONS)
|
||||
=====================
|
||||
|
||||
SnapRAID는 RAID와 백업 프로그램의 하이브리드로, 두 가지의 장점을
|
||||
결합하는 것을 목표로 합니다. 하지만, 사용 전에 고려해야 할 몇 가지
|
||||
제한 사항이 있습니다.
|
||||
SnapRAID는 RAID와 백업 프로그램의 하이브리드로, 두 가지의 장점을 결합하는 것을
|
||||
목표로 합니다. 그러나 사용하기 전에 고려해야 할 몇 가지 제한 사항이 있습니다.
|
||||
|
||||
주요 제한 사항은 디스크가 실패하고 최근에 동기화(sync)하지 않은 경우,
|
||||
완전히 복구하지 못할 수 있다는 것입니다.
|
||||
더 구체적으로, 마지막 동기화 작업 이후 변경되거나 삭제된 파일의
|
||||
크기만큼 복구가 불가능할 수 있습니다.
|
||||
이는 변경되거나 삭제된 파일이 실패한 디스크에 있지 않더라도 발생합니다.
|
||||
이것이 SnapRAID가 **거의 변경되지 않는 데이터**에 더 적합한 이유입니다.
|
||||
가장 큰 제한 사항은 디스크가 고장 날 경우, 마지막 `sync`(동기화) 작업의 상태까지만
|
||||
데이터를 복구할 수 있다는 점입니다. 마지막 동기화 이후에 추가되거나 수정된 데이터 중
|
||||
고장 난 디스크에 위치한 데이터는 모두 손실됩니다.
|
||||
|
||||
반면에, 새로 추가된 파일은 이미 존재하는 파일의 복구를 방해하지 않습니다.
|
||||
새로 추가된 파일이 실패한 디스크에 있는 경우에만 해당 파일을 잃게 됩니다.
|
||||
따라서 SnapRAID는 주로 데이터 변경이 거의 없는 환경에 적합합니다.
|
||||
|
||||
마지막 동기화 시점에 이미 존재했던 데이터의 경우, 복구 신뢰성은 `snapshot`(스냅샷)
|
||||
옵션의 사용 여부에 따라 달라집니다.
|
||||
|
||||
* 스냅샷 지원이 있는 경우 (Btrfs, ZFS, Bcachefs 및 NTFS에서 사용 가능):
|
||||
SnapRAID는 데이터 디스크의 동결된 참조를 자동으로 유지할 수 있습니다.
|
||||
이를 통해 동기화 중이나 동기화 후에 라이브 파일시스템의 파일을 수정하거나 삭제하더라도
|
||||
복구 프로세스가 일관되고 신뢰할 수 있게 유지됩니다.
|
||||
|
||||
* 스냅샷 지원이 없는 경우:
|
||||
`sync` 후에 파일을 삭제하거나 변경하면 다른 고장 난 디스크의 완전한 복구가 방해받을 수
|
||||
있습니다. 이는 수정된 파일이 고장 난 디스크에 없더라도 패리티가 수정된 파일과
|
||||
더 이상 일치하지 않기 때문에 발생합니다. 반면에 새로 추가된 파일은 이미 존재하는
|
||||
파일의 복구를 방해하지 않습니다.
|
||||
|
||||
기타 SnapRAID 제한 사항은 다음과 같습니다:
|
||||
|
||||
|
|
@ -90,8 +99,8 @@ SnapRAID는 RAID와 백업 프로그램의 하이브리드로, 두 가지의 장
|
|||
권한, 소유권, 확장 속성은 저장되지 않습니다.
|
||||
|
||||
|
||||
4 GETTING STARTED
|
||||
=================
|
||||
4 시작하기 (GETTING STARTED)
|
||||
========================
|
||||
|
||||
SnapRAID를 사용하려면, 먼저 디스크 어레이에서 하나의 디스크를
|
||||
`parity`(패리티) 정보 전용으로 선택해야 합니다. 하나의 패리티 디스크로
|
||||
|
|
@ -167,13 +176,13 @@ Windows 경로 형식을 사용해야 합니다.
|
|||
Ctrl+C를 눌러 언제든지 중지할 수 있으며, 다음 실행 시 중단된
|
||||
곳에서 재개됩니다.
|
||||
|
||||
이 명령이 완료되면 데이터는 **SAFE**합니다.
|
||||
이 명령이 완료되면 데이터는 안전합니다.
|
||||
|
||||
이제 어레이를 원하는 대로 사용하고 주기적으로 `sync` 명령을
|
||||
실행하여 패리티 정보를 업데이트할 수 있습니다.
|
||||
|
||||
4.1 Scrubbing
|
||||
-------------
|
||||
4.1 스크러빙 (Scrubbing)
|
||||
--------------------
|
||||
|
||||
주기적으로 데이터 및 패리티의 오류를 확인하려면 `scrub` 명령을
|
||||
실행할 수 있습니다.
|
||||
|
|
@ -192,7 +201,7 @@ Ctrl+C를 눌러 언제든지 중지할 수 있으며, 다음 실행 시 중단
|
|||
|
||||
snapraid -p 5 -o 20 scrub
|
||||
|
||||
이 프로세스 중에 무단 또는 입출력 오류가 발견되면, 해당 블록은
|
||||
이 프로세스 중에 조용한 오류 또는 입출력 오류가 발견되면, 해당 블록은
|
||||
`content` 파일에 bad로 표시되며 `status` 명령에 나열됩니다.
|
||||
|
||||
snapraid status
|
||||
|
|
@ -212,8 +221,8 @@ Ctrl+C를 눌러 언제든지 중지할 수 있으며, 다음 실행 시 중단
|
|||
인한 오류가 보고될 수 있습니다. 이러한 오류는 `scrub` 출력에는
|
||||
보고되지만, 관련 블록은 bad로 표시되지 않습니다.
|
||||
|
||||
4.2 Pooling
|
||||
-----------
|
||||
4.2 풀링 (Pooling)
|
||||
----------------
|
||||
|
||||
참고: 아래에 설명된 풀링(pooling) 기능은 **mergerfs** 도구로 대체되었으며,
|
||||
이는 SnapRAID 커뮤니티에서 Linux 사용자를 위한 권장 옵션입니다.
|
||||
|
|
@ -286,8 +295,8 @@ Windows에서 네트워크를 통해 심볼릭 링크를 공유하려면 클라
|
|||
|
||||
fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
||||
|
||||
4.3 Undeleting
|
||||
--------------
|
||||
4.3 삭제 취소 (Undeleting)
|
||||
----------------------
|
||||
|
||||
SnapRAID는 RAID 시스템보다는 백업 프로그램처럼 작동하며,
|
||||
-f, --filter 옵션을 사용하여 파일이나 디렉토리를 이전 상태로 복원하거나
|
||||
|
|
@ -309,12 +318,12 @@ SnapRAID는 RAID 시스템보다는 백업 프로그램처럼 작동하며,
|
|||
|
||||
snapraid fix -m
|
||||
|
||||
4.4 Recovering
|
||||
--------------
|
||||
4.4 복구 (Recovering)
|
||||
-------------------
|
||||
|
||||
최악의 상황이 발생하여 하나 이상의 디스크를 잃었습니다!
|
||||
|
||||
**패닉하지 마십시오!** 복구할 수 있습니다!
|
||||
**당황하지 마십시오!** 복구할 수 있습니다!
|
||||
|
||||
가장 먼저 해야 할 일은 디스크 어레이에 대한 추가 변경을 피하는 것입니다.
|
||||
모든 원격 연결과 SnapRAID 야간 동기화 또는 스크럽을 포함한 모든 예약된
|
||||
|
|
@ -398,18 +407,18 @@ fix.log 파일을 저장할 몇 기가바이트의 여유 공간이 있는지
|
|||
모든 것이 복구되면 이 명령은 즉시 완료됩니다.
|
||||
|
||||
|
||||
5 COMMANDS
|
||||
==========
|
||||
5 명령어 (COMMANDS)
|
||||
================
|
||||
|
||||
SnapRAID는 다음을 허용하는 몇 가지 간단한 명령을 제공합니다:
|
||||
SnapRAID는 다음과 같은 작업을 수행할 수 있는 몇 가지 간단한 명령어를 제공합니다.
|
||||
|
||||
* 어레이의 상태 출력 -> `status`
|
||||
* 디스크 제어 -> `smart`, `probe`, `up`, `down`
|
||||
* 백업/스냅샷 생성 -> `sync`
|
||||
* 주기적으로 데이터 확인 -> `scrub`
|
||||
* 마지막 백업/스냅샷 복원 -> `fix`.
|
||||
* 백업/복구 지점 생성 -> `sync`
|
||||
* 주기적인 데이터 검사 -> `scrub`
|
||||
* 마지막 백업/복구 지점 복원 -> `fix`
|
||||
|
||||
명령은 소문자로 작성해야 합니다.
|
||||
명령어는 반드시 소문자로 작성해야 합니다.
|
||||
|
||||
5.1 status
|
||||
----------
|
||||
|
|
@ -417,7 +426,7 @@ SnapRAID는 다음을 허용하는 몇 가지 간단한 명령을 제공합니
|
|||
디스크 어레이의 상태 요약을 출력합니다.
|
||||
|
||||
패리티 단편화, 확인 없이 블록이 얼마나 오래되었는지, 그리고
|
||||
스크럽 중에 발생한 모든 기록된 무단 오류에 대한 정보를 포함합니다.
|
||||
스크럽 중에 발생한 모든 기록된 조용한 오류에 대한 정보를 포함합니다.
|
||||
|
||||
제시된 정보는 마지막으로 `sync`를 실행했을 때를 나타냅니다.
|
||||
나중에 수정된 내용은 고려되지 않습니다.
|
||||
|
|
@ -559,7 +568,7 @@ SMART가 디스크가 실패하고 있다고 보고하면, 해당 디스크에
|
|||
중지할 수 있습니다.
|
||||
다음 실행 시 `sync` 프로세스는 중단된 곳에서 재개됩니다.
|
||||
|
||||
이 프로세스 중에 무단 또는 입출력 오류가 발견되면,
|
||||
이 프로세스 중에 조용한 오류 또는 입출력 오류가 발견되면,
|
||||
해당 블록은 bad로 표시됩니다.
|
||||
|
||||
파일은 경로 및/또는 아이노드로 식별되며 크기와 타임스탬프로
|
||||
|
|
@ -577,7 +586,7 @@ SMART가 디스크가 실패하고 있다고 보고하면, 해당 디스크에
|
|||
5.8 scrub
|
||||
---------
|
||||
|
||||
어레이를 스크럽하여 데이터 및 패리티 디스크의 무단 또는 입출력 오류를
|
||||
어레이를 스크럽하여 데이터 및 패리티 디스크의 조용한 오류 또는 입출력 오류를
|
||||
확인합니다.
|
||||
|
||||
각 호출은 이전에 10일 이내에 스크럽된 데이터를 제외하고 어레이의
|
||||
|
|
@ -600,7 +609,7 @@ full - 모든 것 스크럽.
|
|||
|
||||
스크럽 상태의 세부 정보를 얻으려면 `status` 명령을 사용하십시오.
|
||||
|
||||
발견된 모든 무단 또는 입출력 오류에 대해, 해당 블록은 `content` 파일에
|
||||
발견된 모든 조용한 오류 또는 입출력 오류에 대해, 해당 블록은 `content` 파일에
|
||||
bad로 표시됩니다.
|
||||
이러한 bad 블록은 `status`에 나열되며 `fix -e`로 수정할 수 있습니다.
|
||||
수정 후, 다음 스크럽 시에 다시 확인되며, 수정된 것으로 발견되면 bad
|
||||
|
|
@ -608,7 +617,7 @@ bad로 표시됩니다.
|
|||
bad 블록만 스크럽하려면 `scrub -p bad` 명령을 사용할 수 있습니다.
|
||||
|
||||
동기화되지 않은 데이터로 인한 보고된 오류를 피하기 위해 동기화된
|
||||
어레이에서만 `scrub`을 실행하는 것이 좋습니다. 이러한 오류는 무단
|
||||
어레이에서만 `scrub`을 실행하는 것이 좋습니다. 이러한 오류는 조용한
|
||||
오류가 아닌 것으로 인식되며, 블록은 bad로 표시되지 않지만,
|
||||
이러한 오류는 명령의 출력에 보고됩니다.
|
||||
|
||||
|
|
@ -620,14 +629,14 @@ bad 블록만 스크럽하려면 `scrub -p bad` 명령을 사용할 수 있습
|
|||
5.9 fix
|
||||
-------
|
||||
|
||||
모든 파일과 패리티 데이터를 수정합니다.
|
||||
모든 파일과 패리티 데이터를 복구(수정)합니다.
|
||||
|
||||
모든 파일과 패리티 데이터는 마지막 `sync`에 저장된 스냅샷
|
||||
상태와 비교됩니다.
|
||||
차이가 발견되면 저장된 스냅샷으로 되돌려집니다.
|
||||
모든 파일과 패리티 데이터는 마지막 `sync`에 저장된 상태와 비교됩니다.
|
||||
차이점이 발견되면 저장된 상태로 되돌립니다.
|
||||
|
||||
**경고!** `fix` 명령은 오류와 의도적인 수정 사이를 구별하지
|
||||
않습니다. 파일 상태를 무조건 마지막 `sync`로 되돌립니다.
|
||||
경고!
|
||||
`fix` 명령어는 오류와 의도적인 수정을 구별하지 않습니다.
|
||||
파일 상태를 조건 없이 마지막 `sync` 상태로 되돌립니다.
|
||||
|
||||
다른 옵션이 지정되지 않으면 전체 어레이가 처리됩니다.
|
||||
필터 옵션을 사용하여 처리할 파일 또는 디스크의 하위 집합을 선택하십시오.
|
||||
|
|
@ -774,8 +783,8 @@ SnapRAID가 이동되거나 복사된 파일을 인식하는 능력을 향상시
|
|||
주의하십시오.
|
||||
|
||||
|
||||
6 OPTIONS
|
||||
=========
|
||||
6 옵션 (OPTIONS)
|
||||
==============
|
||||
|
||||
SnapRAID는 다음 옵션을 제공합니다:
|
||||
|
||||
|
|
@ -817,7 +826,7 @@ SnapRAID는 다음 옵션을 제공합니다:
|
|||
|
||||
-e, --filter-error
|
||||
`check` 및 `fix`에서 오류가 있는 파일을 처리합니다.
|
||||
`status`에 나열된 대로 `sync` 및 `scrub` 중에 무단 또는 입출력 오류가
|
||||
`status`에 나열된 대로 `sync` 및 `scrub` 중에 조용한 오류 또는 입출력 오류가
|
||||
표시된 블록을 가진 파일만 처리합니다.
|
||||
이 옵션은 `check` 및 `fix`에서만 사용할 수 있습니다.
|
||||
|
||||
|
|
@ -831,7 +840,7 @@ SnapRAID는 다음 옵션을 제공합니다:
|
|||
|
||||
-o, --older-than DAYS
|
||||
`scrub`에서 처리할 어레이의 가장 오래된 부분을 선택합니다.
|
||||
DAYS는 블록이 스크럽되어야 하는 최소 일령(days)이며,
|
||||
DAYS는 블록이 스크럽되어야 하는 최소 경과 일수(days)이며,
|
||||
기본값은 10입니다.
|
||||
bad로 표시된 블록은 이 옵션에 관계없이 항상 스크럽됩니다.
|
||||
이 옵션은 `scrub`에서만 사용할 수 있습니다.
|
||||
|
|
@ -851,7 +860,7 @@ SnapRAID는 다음 옵션을 제공합니다:
|
|||
이 프로세스는 모든 디스크가 회전하고 CPU가 바쁜, 시스템이
|
||||
과부하 상태일 때 발생합니다.
|
||||
이는 기계의 극한 조건이며, 잠재된 하드웨어 문제가 있는 경우
|
||||
데이터가 아직 해시되지 않았기 때문에 무단 오류가 감지되지 않고
|
||||
데이터가 아직 해시되지 않았기 때문에 조용한 오류가 감지되지 않고
|
||||
지나갈 수 있습니다.
|
||||
이러한 위험을 피하려면, `pre-hash` 모드를 활성화하여 모든 데이터를
|
||||
두 번 읽어 무결성을 보장할 수 있습니다.
|
||||
|
|
@ -881,7 +890,7 @@ SnapRAID는 다음 옵션을 제공합니다:
|
|||
초당 바이트 수입니다. K, M, 또는 G와 같은 승수(예: --bw-limit 1G)를
|
||||
지정할 수 있습니다.
|
||||
|
||||
-t, --tail 크기
|
||||
-t, --tail SIZE
|
||||
패리티 디스크의 지정된 꼬리 크기 이하를 사용하는 파일로
|
||||
목록을 제한합니다.
|
||||
K, M, G, T와 같은 배수를 사용할 수 있습니다 (예: --tail 1G).
|
||||
|
|
@ -953,7 +962,7 @@ SnapRAID는 다음 옵션을 제공합니다:
|
|||
동일한 속성을 가진 파일이 동일한 데이터를 가진 복사본이라고
|
||||
가정합니다.
|
||||
이는 한 디스크에서 다른 디스크로 복사되거나 이동된 파일을
|
||||
식별하고, 이미 계산된 해시 정보를 재사용하여 무단 오류를
|
||||
식별하고, 이미 계산된 해시 정보를 재사용하여 조용한 오류를
|
||||
감지하거나 누락된 파일을 복구할 수 있도록 합니다.
|
||||
일부 드문 경우에 이 동작은 오탐(false positives) 또는 많은
|
||||
해시 확인으로 인한 느린 프로세스를 초래할 수 있으며, 이 옵션을
|
||||
|
|
@ -980,7 +989,7 @@ SnapRAID는 다음 옵션을 제공합니다:
|
|||
강력히 권장됩니다.
|
||||
`sync` 작업 중에는 데이터 보호가 없습니다.
|
||||
|
||||
-W, --force-realloc-tail 크기
|
||||
-W, --force-realloc-tail SIZE
|
||||
-R, --force-realloc과 같이 작동하지만, 각 패리티 파일의 지정된
|
||||
꼬리 부분(마지막 '크기' 바이트)으로 제한됩니다.
|
||||
현재 해당 꼬리 섹션에 저장된 모든 파일 조각/블록의 재할당(이동)을
|
||||
|
|
@ -1059,8 +1068,8 @@ SnapRAID는 다음 옵션을 제공합니다:
|
|||
프로그램 버전을 출력합니다.
|
||||
|
||||
|
||||
7 CONFIGURATION
|
||||
===============
|
||||
7 설정 (CONFIGURATION)
|
||||
====================
|
||||
|
||||
SnapRAID는 디스크 어레이의 위치와 패리티 정보를 저장할 위치를
|
||||
알기 위해 설정 파일이 필요합니다.
|
||||
|
|
@ -1082,8 +1091,8 @@ Windows에서는 `snapraid.exe`와 같은 디렉토리에 있는
|
|||
여러 파일을 지정할 수 있으며, 이들은 서로 다른 디스크에
|
||||
있어야 합니다.
|
||||
하나의 파일이 더 이상 커질 수 없을 때 다음 파일이 사용됩니다.
|
||||
총 사용 가능한 공간은 어레이에서 가장 큰 데이터 디스크보다
|
||||
적어도 커야 합니다.
|
||||
총 사용 가능한 공간은 어레이에서 가장 큰 데이터 디스크의 크기
|
||||
이상이어야 합니다.
|
||||
|
||||
나중에 추가 패리티 파일을 추가할 수 있지만, 순서를 바꾸거나
|
||||
제거할 수는 없습니다.
|
||||
|
|
@ -1181,14 +1190,38 @@ NAME을 고정된 상태로 유지하는 한, 필요에 따라 마운트 지점
|
|||
이러한 디스크는 항상 회전할 것으로 예상되므로 `up` 및 `down` 명령의
|
||||
영향을 받지 않습니다.
|
||||
|
||||
7.7 nohidden
|
||||
7.7 snapshot
|
||||
------------
|
||||
|
||||
`sync`, `scrub`, `check` 및 `fix` 명령어에 파일시스템 스냅샷 사용을
|
||||
활성화합니다.
|
||||
|
||||
활성화되면 SnapRAID는 `sync` 시작 시 데이터의 읽기 전용 스냅샷을 생성합니다.
|
||||
이는 파일의 일관된 특정 시점 뷰를 보장하여 동시 파일 수정으로 인해 발생하는
|
||||
오류를 방지합니다.
|
||||
|
||||
이는 복구 가능성을 크게 향상시킵니다. 라이브 파일시스템에서 파일이 삭제되더라도
|
||||
스냅샷에 그대로 보존됩니다. 이를 통해 해당 블록의 패리티가 "깨지는" 것을 방지하여,
|
||||
다른 디스크가 고장 나더라도 데이터를 성공적으로 복구할 수 있도록 보장합니다.
|
||||
|
||||
이 옵션은 Linux의 Btrfs, Bcachefs 또는 ZFS 파일시스템과 Windows의 NTFS로 포맷된
|
||||
데이터 디스크에만 독점적으로 적용됩니다.
|
||||
패리티 디스크나 다른 파일시스템을 사용하는 데이터 디스크는 항상 파일시스템의
|
||||
라이브 버전을 사용합니다.
|
||||
|
||||
스냅샷 생성 및 삭제에는 관리자 권한이 필요합니다.
|
||||
이 옵션이 활성화된 경우 SnapRAID가 필요한 권한(예: sudo)으로 실행되는지 확인하십시오.
|
||||
|
||||
스냅샷 수명 주기에 대한 자세한 설명은 SNAPSHOTS 섹션을 참조하십시오.
|
||||
|
||||
7.8 nohidden
|
||||
------------
|
||||
|
||||
모든 숨겨진 파일 및 디렉토리를 제외합니다.
|
||||
Unix에서는 숨겨진 파일은 '.'으로 시작하는 파일입니다.
|
||||
Windows에서는 숨김 속성을 가진 파일입니다.
|
||||
|
||||
7.8 exclude/include PATTERN
|
||||
7.9 exclude/include PATTERN
|
||||
---------------------------
|
||||
|
||||
sync 프로세스에서 제외하거나 포함할 파일 또는 디렉토리 패턴을
|
||||
|
|
@ -1204,8 +1237,8 @@ sync 프로세스에서 제외하거나 포함할 파일 또는 디렉토리 패
|
|||
|
||||
이 옵션은 여러 번 사용될 수 있습니다.
|
||||
|
||||
7.9 blocksize SIZE_IN_KIBIBYTES
|
||||
-------------------------------
|
||||
7.10 blocksize SIZE_IN_KIBIBYTES
|
||||
--------------------------------
|
||||
|
||||
패리티의 기본 블록 크기를 키비바이트(kibibyte) 단위로 정의합니다.
|
||||
1키비바이트는 1024바이트입니다.
|
||||
|
|
@ -1252,7 +1285,7 @@ Linux에서 더 큰 패리티 파티션을 얻는 트릭은 다음 명령으로
|
|||
낭비되는 공간 없이 각 데이터 디스크에 약 460,000개의 파일을
|
||||
허용합니다.
|
||||
|
||||
7.10 hashsize SIZE_IN_BYTES
|
||||
7.11 hashsize SIZE_IN_BYTES
|
||||
---------------------------
|
||||
|
||||
저장된 블록의 해시 크기를 바이트 단위로 정의합니다.
|
||||
|
|
@ -1289,14 +1322,14 @@ RAM = (8 * 4 * 10^12) * (1+16) / (512 * 2^10) = 0.96 GiB
|
|||
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0.51 GiB
|
||||
|
||||
7.11 autosave SIZE_IN_GIGABYTES
|
||||
7.12 autosave SIZE_IN_GIGABYTES
|
||||
-------------------------------
|
||||
|
||||
지정된 GB 양이 처리된 후 동기화 또는 스크럽 시 상태를 자동으로 저장합니다.
|
||||
이 옵션은 기계 충돌 또는 기타 이벤트로 인해 중단된 경우 긴 `sync`
|
||||
명령을 처음부터 다시 시작하는 것을 방지하는 데 유용합니다.
|
||||
|
||||
7.12 temp_limit TEMPERATURE_CELSIUS
|
||||
7.13 temp_limit TEMPERATURE_CELSIUS
|
||||
-----------------------------------
|
||||
|
||||
허용되는 최대 디스크 온도를 섭씨로 설정합니다. 지정되면 SnapRAID는
|
||||
|
|
@ -1308,11 +1341,11 @@ SnapRAID가 작동하는 동안 현재 디스크 온도가 표시됩니다.
|
|||
다시 일시 중지될 수 있습니다.
|
||||
|
||||
작동 중에 SnapRAID는 각 디스크의 가열 곡선을 분석하고 활동이 계속되면
|
||||
도달할 것으로 예상되는 장기 정상 온도를 추정합니다.
|
||||
도달할 것으로 예상되는 장기 평형 온도를 추정합니다.
|
||||
추정은 디스크 온도가 네 번 증가한 후에만 수행되어, 신뢰할 수 있는
|
||||
추세를 설정하기에 충분한 데이터 포인트가 확보되도록 합니다.
|
||||
이 예측된 정상 온도는 현재 값 옆에 괄호 안에 표시되며, 시스템의
|
||||
냉각이 적절한지 평가하는 데 도움이 됩니다. 이 추정 온도는 정보 제공
|
||||
이 예측된 평형 온도는 현재 값 옆에 괄호 안에 표시되며, 시스템의
|
||||
냉각이 적절한지 평가하는 데 도움이 됩니다. 이 추정 평형 온도는 정보 제공
|
||||
목적일 뿐이며 SnapRAID의 동작에는 영향을 미치지 않습니다.
|
||||
프로그램의 동작은 오로지 실제 측정된 디스크 온도에 기반합니다.
|
||||
|
||||
|
|
@ -1324,13 +1357,13 @@ SnapRAID가 작동하는 동안 현재 디스크 온도가 표시됩니다.
|
|||
일반적으로 SnapRAID는 가장 뜨거운 디스크의 온도만 표시합니다.
|
||||
모든 디스크의 온도를 표시하려면 -A 또는 --stats 옵션을 사용하십시오.
|
||||
|
||||
7.13 temp_sleep TIME_IN_MINUTES
|
||||
7.14 temp_sleep TIME_IN_MINUTES
|
||||
-------------------------------
|
||||
|
||||
온도 제한에 도달했을 때의 대기 시간(분)을 설정합니다. 이 기간 동안
|
||||
디스크는 회전 중지 상태를 유지합니다. 기본값은 5분입니다.
|
||||
|
||||
7.14 pool DIR
|
||||
7.15 pool DIR
|
||||
-------------
|
||||
|
||||
`pool` 명령을 사용하여 디스크 어레이의 가상 뷰가 생성되는 풀링
|
||||
|
|
@ -1338,7 +1371,7 @@ SnapRAID가 작동하는 동안 현재 디스크 온도가 표시됩니다.
|
|||
|
||||
디렉토리는 이미 존재해야 합니다.
|
||||
|
||||
7.15 share UNC_DIR
|
||||
7.16 share UNC_DIR
|
||||
------------------
|
||||
|
||||
디스크에 원격으로 액세스하는 데 필요한 Windows UNC 경로를 정의합니다.
|
||||
|
|
@ -1354,7 +1387,7 @@ SnapRAID가 작동하는 동안 현재 디스크 온도가 표시됩니다.
|
|||
|
||||
이 옵션은 Windows에만 필요합니다.
|
||||
|
||||
7.16 smartctl DISK/PARITY OPTIONS...
|
||||
7.17 smartctl DISK/PARITY OPTIONS...
|
||||
------------------------------------
|
||||
|
||||
각 디스크에 대한 SMART 속성을 얻기 위한 사용자 정의 smartctl 옵션을
|
||||
|
|
@ -1370,6 +1403,9 @@ PARITY는 `parity`, `2-parity`, `3-parity`, `4-parity`, `5-parity`,
|
|||
RAID 컨트롤러의 경우 장치가 고정되어 있을 가능성이 높으므로
|
||||
`%s`를 사용할 필요가 없을 수 있습니다.
|
||||
|
||||
기본 `-a` 옵션을 대체하기 위해 `[info: ...]` 태그를 사용하여
|
||||
사용자 정의 정보 옵션 문자열을 지정할 수도 있습니다.
|
||||
|
||||
가능한 옵션은 smartmontools 설명서를 참조하십시오:
|
||||
|
||||
https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
|
|
@ -1377,9 +1413,10 @@ RAID 컨트롤러의 경우 장치가 고정되어 있을 가능성이 높으므
|
|||
|
||||
예:
|
||||
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl parity -d sat %s
|
||||
|
||||
7.17 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
7.18 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
-------------------------------------------
|
||||
|
||||
디스크 실패 확률을 계산할 때 지정된 SMART 속성을 무시합니다.
|
||||
|
|
@ -1391,16 +1428,21 @@ PARITY는 `parity`, `2-parity`, `3-parity`, `4-parity`, `5-parity`,
|
|||
`6-parity`, 또는 `z-parity` 중 하나의 패리티 이름입니다.
|
||||
특수 값 *는 모든 디스크에서 속성을 무시하는 데 사용될 수 있습니다.
|
||||
|
||||
예를 들어, 모든 디스크에서 `Current Pending Sector Count` 속성을
|
||||
무시하려면:
|
||||
여러 속성을 공백으로 구분하여 지정할 수 있습니다.
|
||||
각 속성은 1에서 255 사이의 숫자나 대소문자를 구분하지 않는 이름
|
||||
(예: `Current_Pending_Sector`)으로 지정할 수 있습니다.
|
||||
|
||||
smartignore * 197
|
||||
예를 들어, 모든 디스크에서 `Current Pending Sector Count` 와
|
||||
`Reallocated Sectors Count` 속성을 번호나 이름으로 무시하려면:
|
||||
|
||||
smartignore * 197 5
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
첫 번째 패리티 디스크에서만 무시하려면:
|
||||
|
||||
smartignore parity 197
|
||||
smartignore parity 197 5
|
||||
|
||||
7.18 Examples
|
||||
7.19 Examples
|
||||
-------------
|
||||
|
||||
Unix의 일반적인 설정 예는 다음과 같습니다:
|
||||
|
|
@ -1413,7 +1455,7 @@ Unix의 일반적인 설정 예는 다음과 같습니다:
|
|||
data d3 /mnt/disk3/
|
||||
exclude /lost+found/
|
||||
exclude /tmp/
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/sg0
|
||||
smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1429,14 +1471,111 @@ Windows의 일반적인 설정 예는 다음과 같습니다:
|
|||
exclude Thumbs.db
|
||||
exclude \$RECYCLE.BIN
|
||||
exclude \System Volume Information
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
|
||||
8 PATTERN
|
||||
=========
|
||||
8 스냅샷 (SNAPSHOTS)
|
||||
=================
|
||||
|
||||
구성에서 스냅샷 옵션이 활성화된 경우, SnapRAID는 원자적이고
|
||||
일관된 작업을 보장하기 위해 파일시스템 스냅샷 기능을 이용합니다.
|
||||
|
||||
스냅샷 관리는 완전히 자동적이고 투명하게 이루어집니다.
|
||||
백그라운드에서 완전히 처리되는 스냅샷의 추가적인 보호와 함께,
|
||||
기존과 완전히 동일하게 SnapRAID를 계속 사용할 수 있습니다.
|
||||
|
||||
이것은 두 가지 주요 이점을 제공합니다.
|
||||
|
||||
일관성 - 장시간 실행되는 sync 또는 scrub 중에 라이브 파일시스템에서 수정된 파일은
|
||||
SnapRAID가 동결된 시점의 이미지를 보기 때문에 패리티 불일치나 작업 중단을
|
||||
유발하지 않습니다.
|
||||
복구 - 라이브 파일시스템에서 파일이 업데이트되거나 삭제되더라도 스냅샷에 보존됩니다.
|
||||
다음 sync가 실행되기 전에 디스크 고장이 발생하면, SnapRAID는 스냅샷에 보존된
|
||||
데이터를 사용하여 고장 난 디스크를 재구성합니다.
|
||||
|
||||
활성 sync 프로세스 중에 디스크 고장이 발생하는 경우,
|
||||
SnapRAID는 이전 패리티 계산의 스냅샷과 현재 스냅샷 모두에서 자동으로 읽을 수도 있습니다.
|
||||
이는 동기화 사이에 블록이 수정되거나 삭제되었더라도 패리티 방정식을 푸는 데
|
||||
필요한 정확한 데이터 블록에 대한 접근을 제공함으로써 완전한 복구 확률을 최대화합니다.
|
||||
|
||||
스냅샷이 없으면 정상 디스크에서 업데이트되거나 삭제된 파일로 인해 데이터 블록이 누락되며,
|
||||
이는 다른 고장 난 디스크를 복구하는 데 필요할 수 있습니다.
|
||||
|
||||
스냅샷은 데이터 디스크에 대해서만 생성되며, 기본 파일시스템이 이 기능을 지원하는 경우에만
|
||||
생성됩니다. 패리티 디스크는 항상 라이브 파일시스템을 사용합니다.
|
||||
|
||||
현재 이는 Linux의 Btrfs, Bcachefs, ZFS 및 Windows의 NTFS에서 지원됩니다.
|
||||
|
||||
서로 다른 파일시스템을 가진 데이터 디스크를 혼합할 수 있습니다. 스냅샷을 지원하는 디스크만
|
||||
이를 활용하고, 다른 디스크는 라이브 파일시스템에서 직접 계속 작동합니다.
|
||||
|
||||
스냅샷 생성 및 삭제에는 관리자 권한이 필요합니다.
|
||||
스냅샷이 활성화된 경우 SnapRAID가 필요한 권한(예: sudo)으로 실행되는지 확인하십시오.
|
||||
|
||||
8.1 스냅샷 사용 시 명령어 동작 (Command Behavior with Snapshots)
|
||||
-----------------------------------------------------
|
||||
|
||||
`sync` 와 `scrub` 명령어는 모두 일관되고 동결된 상태에 대해 모든 데이터 작업이 수행되도록
|
||||
보장하기 위해 스냅샷에서만 독점적으로 작동합니다. 이러한 스냅샷을 이용함으로써 SnapRAID는
|
||||
라이브 파일시스템의 동시 파일 수정으로 인해 발생할 수 있는 패리티 불일치를 방지합니다.
|
||||
`sync` 중에 명령어는 프로세스 시작 시 생성된 새 스냅샷을 사용하여 패리티 계산을 위한
|
||||
현재 상태를 캡처합니다.
|
||||
반면에 `scrub` 명령어는 기존 패리티와 일치하는 신뢰할 수 있는 참조 지점을 유지하기 위해
|
||||
가장 최근 동기화 중에 생성된 마지막 스냅샷을 이용합니다.
|
||||
|
||||
`check` 및 `fix` 명령어의 경우, 마지막 스냅샷의 사용 여부는
|
||||
-d, --filter-disk 옵션을 사용하여 특정 디스크를 대상으로 지정하는지 여부에 따라 달라집니다.
|
||||
|
||||
-d를 통해 명시적으로 선택된 디스크(작업의 "대상")는 항상 라이브 파일시스템을 사용합니다.
|
||||
`fix` 의 경우 이를 통해 활성 교체 디스크에 데이터를 복원할 수 있습니다.
|
||||
`check` 의 경우 동일한 조건에서 `fix` 작업을 시뮬레이션할 수 있습니다.
|
||||
|
||||
다른 모든 데이터 디스크("참조" 디스크)는 해당 스냅샷을 통해 액세스됩니다.
|
||||
이를 통해 복구가 진행되는 동안 정상 디스크의 파일을 수정하고 있더라도 SnapRAID가
|
||||
패리티 방정식을 풀기 위한 안정적이고 동결된 참조를 가질 수 있습니다.
|
||||
|
||||
-d 옵션이 제공되지 않으면 SnapRAID는 작업이 전체 어레이에 적용된다고 가정하며, 이 경우
|
||||
`check` 와 `fix` 는 라이브 파일시스템만을 독점적으로 사용합니다.
|
||||
|
||||
다른 모든 명령어는 라이브 파일시스템에서만 독점적으로 작동합니다.
|
||||
|
||||
|
||||
9 스냅샷 수명 주기 (SNAPSHOTS LIFECYCLE)
|
||||
=================================
|
||||
|
||||
SnapRAID는 각 데이터 하위 볼륨의 루트에 있는 숨겨진 디렉터리 내에서
|
||||
`stable`(안정)과 `pending`(보류)이라는 두 가지 특정 스냅샷을 관리합니다.
|
||||
Btrfs, Bcachefs 및 NTFS에서는 `.snapraid/` 디렉터리가 사용되며,
|
||||
ZFS에서는 표준 `.zfs/snapshot/` 이 사용됩니다.
|
||||
|
||||
`stable` 스냅샷은 성공적으로 완료된 마지막 `sync` 상태를 나타내며,
|
||||
현재 패리티를 계산하는 데 사용된 정확한 데이터를 포함합니다. 이는
|
||||
`scrub`, `check` 및 `fix` 명령어의 기본 데이터 소스 역할을 합니다.
|
||||
|
||||
`pending` 스냅샷은 패리티 계산을 위한 동결된 상태를 제공하기 위해 `sync` 시작 시
|
||||
생성되는 임시 이미지입니다.
|
||||
작업이 성공적으로 완료되면 이전의 `stable` 스냅샷은 삭제되고, `pending` 스냅샷이
|
||||
새로운 안정적인 참조로 자리를 잡도록 승격됩니다.
|
||||
|
||||
`sync` 가 중단되면 `pending` 스냅샷은 보존됩니다.
|
||||
패리티가 부분적으로만 동기화되었더라도 .content 파일에 기록된 파일시스템 상태와 일치하므로
|
||||
이후의 `scrub`, `check` 및 `fix` 명령어는 이 보류 중인 스냅샷을 사용합니다.
|
||||
|
||||
`sync` 가 중단된 경우, `check` 및 `fix` 명령어는 `stable` 스냅샷에서도 읽어와
|
||||
동기화 중에 업데이트되거나 삭제된 파일에서 데이터 블록을 검색합니다.
|
||||
이는 동기화 프로세스 전반에 걸쳐 .content 파일이 수정되거나 삭제된 모든 파일의
|
||||
메타데이터를 유지하기 때문에 가능합니다.
|
||||
이 기록 정보는 동기화가 성공적으로 완료되고 .content 파일의 최종 버전이 저장되어야만 삭제됩니다.
|
||||
|
||||
중단 후 `sync` 가 재시작되면 기존의 보류 중인(pending) 스냅샷은 삭제되고,
|
||||
라이브 파일시스템의 현재 상태를 캡처하기 위해 새 스냅샷이 생성됩니다.
|
||||
|
||||
|
||||
10 패턴 (PATTERN)
|
||||
===============
|
||||
|
||||
패턴은 포함하거나 제외할 파일을 필터링하는 유연한 방법을 제공합니다.
|
||||
글로빙(globbing) 문자를 사용하면 모든 경로를 일일이 나열하지 않고도
|
||||
|
|
@ -1551,8 +1690,8 @@ Unix에서는 명령줄에서 글로빙 문자를 사용할 때 셸이 확장하
|
|||
방지하기 위해 따옴표로 묶어야 합니다.
|
||||
|
||||
|
||||
9 IGNORE FILE
|
||||
=============
|
||||
11 제외 파일 (IGNORE FILE)
|
||||
======================
|
||||
|
||||
설정 파일의 전역 규칙 외에도, 배열 내의 모든 디렉토리에 `.snapraidignore`
|
||||
파일을 배치하여 분산된 제외 규칙을 정의할 수 있습니다.
|
||||
|
|
@ -1594,20 +1733,22 @@ Unix에서는 명령줄에서 글로빙 문자를 사용할 때 셸이 확장하
|
|||
*.tmp
|
||||
|
||||
|
||||
10 CONTENT
|
||||
==========
|
||||
12 콘텐츠 (CONTENT)
|
||||
================
|
||||
|
||||
SnapRAID는 content 파일에 파일 목록과 체크섬을 저장합니다.
|
||||
|
||||
이것은 디스크 어레이에 있는 모든 파일의 목록과 무결성을 확인하기 위한
|
||||
모든 체크섬을 나열하는 이진 파일입니다.
|
||||
|
||||
이 파일은 `sync` 및 `scrub` 명령에 의해 읽고 쓰여지며,
|
||||
`fix`, `check`, 및 `status` 명령에 의해 읽혀집니다.
|
||||
content 파일은 `sync`, `scrub`, `touch` 및 `rehash` 명령에 의해
|
||||
읽고 쓰여집니다. 이것은 `status`, `diff`, `check`, `fix`, `list`,
|
||||
`dup`, `locate` 및 `pool` 명령에 의해 읽혀지며, `smart`, `probe`,
|
||||
`up`, `down` 및 `devices` 명령에 의해 완전히 무시됩니다.
|
||||
|
||||
|
||||
11 PARITY
|
||||
=========
|
||||
13 패리티 (PARITY)
|
||||
===============
|
||||
|
||||
SnapRAID는 패리티 파일에 어레이의 패리티 정보를 저장합니다.
|
||||
|
||||
|
|
@ -1618,8 +1759,8 @@ SnapRAID는 패리티 파일에 어레이의 패리티 정보를 저장합니다
|
|||
`scrub` 및 `check` 명령에 의해서만 읽혀집니다.
|
||||
|
||||
|
||||
12 ENCODING
|
||||
===========
|
||||
14 인코딩 (ENCODING)
|
||||
=================
|
||||
|
||||
Unix의 SnapRAID는 인코딩을 무시합니다. 파일 시스템에서 사용되는
|
||||
것과 동일한 인코딩으로 파일 이름을 읽고 저장합니다.
|
||||
|
|
@ -1634,13 +1775,30 @@ Windows 콘솔을 UTF-8 모드로 설정하고 콘솔 글꼴로 `Lucida Console`
|
|||
리디렉션하는 경우 결과 파일은 항상 UTF-8 형식입니다.
|
||||
|
||||
|
||||
13 COPYRIGHT
|
||||
============
|
||||
15 종료 코드 (EXIT CODE)
|
||||
====================
|
||||
|
||||
This file is Copyright (C) 2025 Andrea Mazzoleni
|
||||
SnapRAID는 다음과 같은 오류 코드로 종료됩니다:
|
||||
|
||||
0 - 모두 정상.
|
||||
1 - 명령 실행 중 오류가 발생했습니다.
|
||||
2 - `diff` 명령으로 모두 정상임을 확인했으나 `sync`가 필요합니다.
|
||||
|
||||
|
||||
14 SEE ALSO
|
||||
===========
|
||||
16 번역 (TRANSLATION)
|
||||
===================
|
||||
|
||||
snapraid_log(1), snapraidd(1)
|
||||
이 문서는 영어 매뉴얼의 자동 번역본입니다.
|
||||
공식 버전은 영어 매뉴얼을 참조하십시오.
|
||||
|
||||
|
||||
17 저작권 (COPYRIGHT)
|
||||
==================
|
||||
|
||||
This file is Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
|
||||
18 참고 (SEE ALSO)
|
||||
================
|
||||
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
.TH "Kopia zapasowa SnapRAID dla macierzy dyskowych" 1
|
||||
.TH "Program do tworzenia kopii zapasowych SnapRAID dla macierzy dyskowych" 1
|
||||
.SH NAME
|
||||
snapraid \- Kopia zapasowa SnapRAID dla macierzy dyskowych
|
||||
.SH SYNOPSIS
|
||||
snapraid \- Program do tworzenia kopii zapasowych SnapRAID dla macierzy dyskowych
|
||||
.SH SKłADNIA (SYNOPSIS)
|
||||
snapraid [\-c, \-\-conf CONFIG]
|
||||
.PD 0
|
||||
.PP
|
||||
|
|
@ -77,7 +77,7 @@ snapraid [\-c, \-\-conf CONFIG]
|
|||
snapraid [\-V, \-\-version] [\-H, \-\-help] [\-C, \-\-gen\-conf CONTENT]
|
||||
.PD 0
|
||||
.PD
|
||||
.SH DESCRIPTION
|
||||
.SH OPIS (DESCRIPTION)
|
||||
SnapRAID to program do tworzenia kopii zapasowych przeznaczony
|
||||
dla macierzy dyskowych, przechowujący informacje parzystości
|
||||
do odzyskiwania danych w przypadku awarii do sześciu dysków.
|
||||
|
|
@ -116,22 +116,34 @@ https://www.snapraid.it/
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH LIMITATIONS
|
||||
SnapRAID to hybryda programu RAID i programu do tworzenia kopii zapasowych,
|
||||
której celem jest połączenie najlepszych zalet obu. Ma jednak pewne
|
||||
ograniczenia, które należy wziąć pod uwagę przed jego użyciem.
|
||||
.SH OGRANICZENIA (LIMITATIONS)
|
||||
SnapRAID jest hybrydą pomiędzy RAID a programem do tworzenia kopii zapasowych, mającą na celu połączenie
|
||||
najlepszych zalet obu tych rozwiązań. Posiada jednak pewne ograniczenia, które należy
|
||||
wziąć pod uwagę przed jego użyciem.
|
||||
.PP
|
||||
Głównym ograniczeniem jest to, że jeśli dysk ulegnie awarii, a Ty nie wykonałeś
|
||||
niedawno synchronizacji, możesz nie być w stanie w pełni odzyskać danych.
|
||||
Dokładniej, możesz nie być w stanie odzyskać danych o wielkości
|
||||
zmienionych lub usuniętych plików od czasu ostatniej operacji synchronizacji.
|
||||
Dzieje się tak, nawet jeśli zmienione lub usunięte pliki nie znajdują się na
|
||||
uszkodzonym dysku. Dlatego SnapRAID jest lepiej dostosowany do
|
||||
danych, które rzadko się zmieniają.
|
||||
Głównym ograniczeniem jest to, że w przypadku awarii dysku można odzyskać dane tylko do
|
||||
stanu z momentu ostatniej operacji \`sync\` (synchronizacji). Wszelkie dane dodane lub modyfikacje dokonane
|
||||
od ostatniej synchronizacji, które znajdują się na uszkodzonym dysku, zostaną utracone.
|
||||
.PP
|
||||
Z drugiej strony, nowo dodane pliki nie uniemożliwiają odzyskania już
|
||||
istniejących plików. Stracisz tylko ostatnio dodane pliki, jeśli
|
||||
znajdują się one na uszkodzonym dysku.
|
||||
W związku z tym SnapRAID nadaje się głównie do danych, które rzadko się zmieniają.
|
||||
.PP
|
||||
W przypadku danych, które już istniały podczas ostatniej synchronizacji, niezawodność odzyskiwania zależy
|
||||
od tego, czy użyto opcji \`snapshot\` (migawki):
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Z obsługą migawek (dostępną w systemach plików Btrfs, ZFS, Bcachefs i NTFS),
|
||||
SnapRAID może automatycznie utrzymywać zamrożony stan dysków z danymi.
|
||||
Zapewnia to, że nawet jeśli zmodyfikujesz lub usuniesz pliki w aktywnym systemie plików
|
||||
w trakcie lub po synchronizacji, proces odzyskiwania pozostanie spójny i niezawodny.
|
||||
.PD
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Bez obsługi migawek, usunięcie lub zmiana plików po operacji \`sync\`
|
||||
może uniemożliwić pełne odzyskanie danych z innych uszkodzonych dysków. Dzieje się tak,
|
||||
ponieważ parzystość nie odpowiada już zmodyfikowanym plikom, nawet jeśli
|
||||
pliki te nie znajdują się na uszkodzonym dysku. Z drugiej strony, nowo dodane
|
||||
pliki nie uniemożliwiają odzyskania już istniejących plików.
|
||||
.PD
|
||||
.PP
|
||||
Inne ograniczenia SnapRAID to:
|
||||
.PD 0
|
||||
|
|
@ -151,9 +163,9 @@ awarii całej macierzy dysków.
|
|||
.IP \(bu
|
||||
Zapisywane są tylko nazwy plików, znaczniki czasu, dowiązania symboliczne
|
||||
i dowiązania twarde.
|
||||
Uprawnienia, właścicielstwo i rozszerzone atrybuty nie są zapisywane.
|
||||
Uprawnienia, właściciel (własność) i rozszerzone atrybuty nie są zapisywane.
|
||||
.PD
|
||||
.SH GETTING STARTED
|
||||
.SH PIERWSZE KROKI (GETTING STARTED)
|
||||
Aby użyć SnapRAID, musisz najpierw wybrać jeden dysk w swojej macierzy
|
||||
dysków, który zostanie przeznaczony na informacje o \`parzystości\`. Z jednym dyskiem
|
||||
na parzystość będziesz w stanie odzyskać dane po awarii pojedynczego dysku,
|
||||
|
|
@ -300,7 +312,7 @@ Kiedy to polecenie się zakończy, Twoje dane są BEZPIECZNE.
|
|||
.PP
|
||||
Teraz możesz zacząć używać swojej macierzy, jak chcesz, i okresowo
|
||||
aktualizować informacje o parzystości, uruchamiając polecenie \`sync\`.
|
||||
.SS Scrubbing
|
||||
.SS Scrubbing (Scrubbing)
|
||||
Aby okresowo sprawdzać dane i parzystość pod kątem błędów, możesz
|
||||
uruchomić polecenie \`scrub\`.
|
||||
.PP
|
||||
|
|
@ -357,10 +369,10 @@ snapraid \-p bad scrub
|
|||
Uruchomienie \`scrub\` na niezsynchronizowanej macierzy może zgłosić błędy
|
||||
spowodowane usuniętymi lub zmodyfikowanymi plikami. Błędy te są zgłaszane
|
||||
w wyniku \`scrub\`, ale powiązane bloki nie są oznaczane jako złe.
|
||||
.SS Pooling
|
||||
.SS Łączenie w pulę (Pooling)
|
||||
Uwaga: Funkcja łączenia w pulę opisana poniżej została zastąpiona przez
|
||||
narzędzie mergerfs, które jest obecnie zalecaną opcją dla użytkowników Linuksa
|
||||
w społeczności SnapRAID. Mergefs zapewnia bardziej elastyczny i wydajny
|
||||
w społeczności SnapRAID. Mergerfs zapewnia bardziej elastyczny i wydajny
|
||||
sposób łączenia wielu dysków w jeden ujednolicony punkt montowania,
|
||||
umożliwiając bezproblemowy dostęp do plików w całej macierzy bez polegania
|
||||
na dowiązaniach symbolicznych. Dobrze integruje się z SnapRAID w celu ochrony
|
||||
|
|
@ -505,7 +517,7 @@ fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Undeleting
|
||||
.SS Cofanie usuwania (Undeleting)
|
||||
SnapRAID działa bardziej jak program do tworzenia kopii zapasowych niż system RAID
|
||||
i może być użyty do przywrócenia lub odzyskania usuniętych plików do ich poprzedniego
|
||||
stanu za pomocą opcji \-f, \-\-filter:
|
||||
|
|
@ -541,7 +553,7 @@ snapraid fix \-m
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Recovering
|
||||
.SS Odzyskiwanie (Recovering)
|
||||
Najgorsze się wydarzyło i straciłeś jeden lub więcej dysków!
|
||||
.PP
|
||||
NIE PANIKUJ! Będziesz w stanie je odzyskać!
|
||||
|
|
@ -602,7 +614,7 @@ Teraz odzyskałeś wszystko, co jest możliwe do odzyskania. Jeśli niektóre pl
|
|||
są częściowo lub całkowicie nie do odzyskania, zostaną one przemianowane
|
||||
poprzez dodanie rozszerzenia \`.unrecoverable\`.
|
||||
.PP
|
||||
Szczegółową listę wszystkich nie do odzyskania bloków znajdziesz w pliku fix.log,
|
||||
Szczegółową listę wszystkich bloków nie do odzyskania znajdziesz w pliku fix.log,
|
||||
sprawdzając wszystkie linie zaczynające się od \`unrecoverable:\`.
|
||||
.PP
|
||||
Jeśli nie jesteś zadowolony z odzyskiwania, możesz spróbować ponownie
|
||||
|
|
@ -643,22 +655,22 @@ snapraid sync
|
|||
.RE
|
||||
.PP
|
||||
Jeśli wszystko zostanie odzyskane, to polecenie jest natychmiastowe.
|
||||
.SH COMMANDS
|
||||
.SH POLECENIA (COMMANDS)
|
||||
SnapRAID udostępnia kilka prostych poleceń, które pozwalają na:
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Wyświetlenie statusu macierzy \-> \`status\`
|
||||
Wyświetlenie stanu macierzy \-> \`status\`
|
||||
.IP \(bu
|
||||
Kontrolę dysków \-> \`smart\`, \`probe\`, \`up\`, \`down\`
|
||||
Kontrola dysków \-> \`smart\`, \`probe\`, \`up\`, \`down\`
|
||||
.IP \(bu
|
||||
Wykonanie kopii zapasowej/migawki \-> \`sync\`
|
||||
Utworzenie punktu kopii zapasowej/przywracania \-> \`sync\`
|
||||
.IP \(bu
|
||||
Okresowe sprawdzanie danych \-> \`scrub\`
|
||||
.IP \(bu
|
||||
Przywrócenie ostatniej kopii zapasowej/migawki \-> \`fix\`.
|
||||
Przywrócenie ostatniego punktu kopii zapasowej/przywracania \-> \`fix\`.
|
||||
.PD
|
||||
.PP
|
||||
Polecenia muszą być zapisane małymi literami.
|
||||
Polecenia muszą być wpisywane małymi literami.
|
||||
.SS status
|
||||
Wyświetla podsumowanie stanu macierzy dysków.
|
||||
.PP
|
||||
|
|
@ -805,11 +817,11 @@ Są one identyfikowane przez posiadanie tej samej nazwy, rozmiaru
|
|||
i znacznika czasu.
|
||||
Jeśli podsekundowy znacznik czasu wynosi zero, pełna ścieżka
|
||||
musi być zgodna, aby plik został zidentyfikowany.
|
||||
W przeciwieństwie do plików \'moved\' na tym samym dysku, pliki
|
||||
relokowane mają inny i\-węzeł.
|
||||
W przeciwieństwie do plików przeniesionych (\'moved\') na tym samym dysku, pliki
|
||||
relokowane mają inny inode.
|
||||
.HP 4
|
||||
.I restored
|
||||
Pliki o innym i\-węźle, ale pasującym katalogu,
|
||||
Pliki o innym inode, ale pasującym katalogu,
|
||||
nazwie, rozmiarze i znaczniku czasu.
|
||||
Są to zazwyczaj pliki przywrócone po ich usunięciu.
|
||||
.PD
|
||||
|
|
@ -876,7 +888,7 @@ Aby sprawdzić tylko złe bloki, możesz użyć polecenia \`scrub \-p bad\`.
|
|||
.PP
|
||||
Zaleca się uruchamianie \`scrub\` tylko na zsynchronizowanej macierzy, aby uniknąć
|
||||
zgłaszania błędów spowodowanych przez niezsynchronizowane dane. Błędy te są rozpoznawane
|
||||
jako nie będące cichymi błędami, a bloki nie są oznaczane jako złe,
|
||||
jako niebędące cichymi błędami, a bloki nie są oznaczane jako złe,
|
||||
ale takie błędy są zgłaszane w wyniku polecenia.
|
||||
.PP
|
||||
Plik \`content\` jest modyfikowany w celu zaktualizowania czasu ostatniego sprawdzenia
|
||||
|
|
@ -884,15 +896,14 @@ dla każdego bloku i oznaczenia złych bloków.
|
|||
Pliki \`parity\` NIE są modyfikowane.
|
||||
Pliki w macierzy NIE są modyfikowane.
|
||||
.SS fix
|
||||
Naprawia wszystkie pliki i dane parzystości.
|
||||
Naprawia wszystkie pliki oraz dane parzystości.
|
||||
.PP
|
||||
Wszystkie pliki i dane parzystości są porównywane ze stanem migawki
|
||||
zapisanym w ostatniej \`sync\`.
|
||||
Jeśli zostanie znaleziona różnica, jest ona przywracana do zapisanego stanu migawki.
|
||||
Wszystkie pliki i dane parzystości są porównywane ze stanem zapisanym podczas
|
||||
ostatniej operacji \`sync\`. W przypadku znalezienia różnicy, następuje przywrócenie stanu zapisanego.
|
||||
.PP
|
||||
OSTRZEŻENIE! Polecenie \`fix\` nie rozróżnia błędów od
|
||||
celowych modyfikacji. Bezwarunkowo przywraca stan pliku
|
||||
do ostatniej \`sync\`.
|
||||
UWAGA!
|
||||
Polecenie \`fix\` nie odróżnia błędów od celowych modyfikacji.
|
||||
Bezwzględnie przywraca stan plików do momentu ostatniej operacji \`sync\`.
|
||||
.PP
|
||||
Jeśli nie określono żadnej innej opcji, przetwarzana jest cała macierz.
|
||||
Użyj opcji filtra, aby wybrać podzbiór plików lub dysków do operacji.
|
||||
|
|
@ -1020,7 +1031,7 @@ Jeśli chcesz dokonać realokacji tych plików, możesz użyć opcji
|
|||
\-W, \-\-force\-realloc\-tail.
|
||||
Pamiętaj, że takie pliki nie będą chronione przez parzystość podczas procesu
|
||||
realokacji.
|
||||
.SH OPTIONS
|
||||
.SH OPCJE (OPTIONS)
|
||||
SnapRAID udostępnia następujące opcje:
|
||||
.TP
|
||||
.B \-c, \-\-conf CONFIG
|
||||
|
|
@ -1131,9 +1142,9 @@ Stosuje globalne ograniczenie przepustowości dla wszystkich dysków. RATE to
|
|||
liczba bajtów na sekundę. Możesz określić mnożnik,
|
||||
taki jak K, M lub G (np. \-\-bw\-limit 1G).
|
||||
.TP
|
||||
.B \-t, \-\-tail ROZMIAR
|
||||
Ogranicza listę plików do tych, które nie używają więcej niż określony
|
||||
końcowy rozmiar dysków parzystości.
|
||||
.B \-t, \-\-tail SIZE
|
||||
Ogranicza listę plików do tych, które nie wykraczają poza określoną
|
||||
sekcję końcową (ogon) plików parzystości.
|
||||
Możesz użyć mnożników takich jak K, M, G lub T (np. \-\-tail 1G).
|
||||
Opcja ta jest ważna tylko wtedy, gdy jest używana wraz z poleceniem
|
||||
\`locate\`.
|
||||
|
|
@ -1231,9 +1242,9 @@ OSTRZEŻENIE! Ta opcja jest tylko dla ekspertów i jest wysoce
|
|||
zalecane, aby jej nie używać.
|
||||
NIE MASZ ochrony danych podczas operacji \`sync\`.
|
||||
.TP
|
||||
.B \-W, \-\-force\-realloc\-tail ROZMIAR
|
||||
.B \-W, \-\-force\-realloc\-tail SIZE
|
||||
Działa jak \-R, \-\-force\-realloc, ale ogranicza się do określonej części
|
||||
końcowej (ostatnie ROZMIAR bajtów) każdego pliku parzystości.
|
||||
końcowej (ostatnie SIZE bajtów) każdego pliku parzystości.
|
||||
Wymusza realokację (przeniesienie) wszelkich fragmentów/bloków plików
|
||||
obecnie przechowywanych w tej sekcji końcowej, pozwalając na ich
|
||||
umieszczenie w dowolnym miejscu w pliku (plikach) parzystości, gdzie
|
||||
|
|
@ -1265,7 +1276,7 @@ w trybie dołączania. Wystąpienia \`%D\` i \`%T\` w nazwie są
|
|||
zastępowane datą i czasem w formacie RRRRMMDD i
|
||||
GGMMSS. W plikach wsadowych Windows musisz podwoić
|
||||
znak \`%\`, np. result\-%%D.log. Aby użyć \`>>\`, musisz
|
||||
ujęć nazwę w cudzysłów, np. \`\[dq]>>result.log\[dq]\`.
|
||||
ująć nazwę w cudzysłów, np. \`\[dq]>>result.log\[dq]\`.
|
||||
Aby wyprowadzić log do standardowego wyjścia lub standardowego błędu,
|
||||
możesz użyć odpowiednio \`\[dq]>&1\[dq]\` i \`\[dq]>&2\[dq]\`.
|
||||
Opisy tagów logu znajdziesz w pliku snapraid_log.txt lub na stronie podręcznika.
|
||||
|
|
@ -1317,7 +1328,7 @@ Wyświetla krótki ekran pomocy.
|
|||
.TP
|
||||
.B \-V, \-\-version
|
||||
Wyświetla wersję programu.
|
||||
.SH CONFIGURATION
|
||||
.SH KONFIGURACJA (CONFIGURATION)
|
||||
SnapRAID wymaga pliku konfiguracyjnego, aby wiedzieć, gdzie znajduje się Twoja macierz
|
||||
dysków i gdzie przechowywać informacje o parzystości.
|
||||
.PP
|
||||
|
|
@ -1426,6 +1437,29 @@ dysk rozruchowy.
|
|||
.PP
|
||||
Należy zauważyć, że polecenia \`up\` i \`down\` nie mają wpływu na takie
|
||||
dyski, ponieważ oczekuje się, że będą one zawsze w ruchu.
|
||||
.SS snapshot
|
||||
Włącza używanie migawek systemu plików dla poleceń \`sync\`, \`scrub\`,
|
||||
\`check\` oraz \`fix\`.
|
||||
.PP
|
||||
Po włączeniu, SnapRAID tworzy migawkę danych w trybie tylko do odczytu na
|
||||
początku operacji \'sync\'. Zapewnia to spójny obraz plików z danego momentu,
|
||||
zapobiegając błędom wywołanym przez jednoczesne modyfikacje plików.
|
||||
.PP
|
||||
To znacznie usprawnia odzyskiwanie danych: jeśli plik zostanie usunięty z aktywnego systemu
|
||||
plików, pozostaje zachowany w migawce. Zapobiega to sytuacji, w której parzystość staje się \[dq]uszkodzona\[dq]
|
||||
dla tego bloku, zapewniając możliwość pomyślnego odzyskania danych,
|
||||
jeśli ulegnie awarii inny dysk.
|
||||
.PP
|
||||
Opcja ta dotyczy wyłącznie dysków z danymi sformatowanych w systemach plików
|
||||
Btrfs, Bcachefs lub ZFS w systemie Linux oraz NTFS w systemie Windows.
|
||||
Dyski parzystości lub dyski z danymi korzystające z innych systemów plików będą zawsze używać
|
||||
aktywnej wersji systemu plików.
|
||||
.PP
|
||||
Tworzenie i usuwanie migawek wymaga uprawnień administratora.
|
||||
Upewnij się, że SnapRAID jest uruchamiany z wymaganymi uprawnieniami (np. sudo), gdy
|
||||
opcja ta jest włączona.
|
||||
.PP
|
||||
Szczegółowe wyjaśnienie cyklu życia migawek znajduje się w sekcji SNAPSHOTS.
|
||||
.SS nohidden
|
||||
Wyklucza wszystkie ukryte pliki i katalogi.
|
||||
W systemie Unix ukryte pliki to te zaczynające się od \`.\`.
|
||||
|
|
@ -1472,7 +1506,7 @@ zmarnujesz 12,8 GB parzystości, co może skutkować
|
|||
.PP
|
||||
Możesz sprawdzić ilość zmarnowanego miejsca na każdym dysku za pomocą \`status\`.
|
||||
Jest to ilość miejsca, którą musisz pozostawić wolną na dyskach danych
|
||||
lub użyć dla plików nie włączonych do macierzy.
|
||||
lub użyć dla plików niewłączonych do macierzy.
|
||||
Jeśli ta wartość jest ujemna, oznacza to, że jesteś blisko wypełnienia
|
||||
parzystości i reprezentuje to przestrzeń, którą nadal możesz zmarnować.
|
||||
.PP
|
||||
|
|
@ -1546,7 +1580,7 @@ Ustawia maksymalną dozwoloną temperaturę dysku w stopniach Celsjusza. Po okre
|
|||
SnapRAID okresowo sprawdza temperaturę wszystkich dysków za pomocą
|
||||
narzędzia smartctl. Aktualne temperatury dysków są wyświetlane podczas
|
||||
działania SnapRAID. Jeśli którykolwiek dysk przekroczy ten limit, wszystkie operacje
|
||||
zostają zatrzymane, a dyski są zatrzymywane (przechodzą w stan gotowości) na czas
|
||||
zostają zatrzymane, a dyski są wyłączane (przechodzą w stan czuwania / uśpienia) na czas
|
||||
zdefiniowany przez opcję \`temp_sleep\`. Po okresie uśpienia, operacje
|
||||
są wznawiane, potencjalnie ponownie zatrzymując się, jeśli limit temperatury
|
||||
zostanie ponownie osiągnięty.
|
||||
|
|
@ -1554,7 +1588,7 @@ zostanie ponownie osiągnięty.
|
|||
Podczas działania SnapRAID analizuje również krzywą nagrzewania każdego
|
||||
dysku i szacuje długoterminową stałą temperaturę, którą mają
|
||||
osiągnąć, jeśli aktywność będzie kontynuowana. Oszacowanie jest wykonywane tylko po
|
||||
czterokrotnym wzroście temperatury dysku, co zapewnia, że
|
||||
czterokrotnym zarejestrowaniu wzrostu temperatury dysku, co zapewnia, że
|
||||
dostępnych jest wystarczająco dużo punktów danych do ustalenia wiarygodnego trendu.
|
||||
Ta przewidywana stała temperatura jest pokazywana w nawiasach obok
|
||||
aktualnej wartości i pomaga ocenić, czy chłodzenie systemu jest
|
||||
|
|
@ -1570,7 +1604,7 @@ wykorzystuje najniższą temperaturę dysku zmierzoną na początku uruchomienia
|
|||
Normalnie SnapRAID pokazuje tylko temperaturę najgorętszego dysku.
|
||||
Aby wyświetlić temperaturę wszystkich dysków, użyj opcji \-A lub \-\-stats.
|
||||
.SS temp_sleep TIME_IN_MINUTES
|
||||
Ustawia czas gotowości, w minutach, po osiągnięciu limitu temperatury.
|
||||
Ustawia czas wstrzymania (czuwania), w minutach, po osiągnięciu limitu temperatury.
|
||||
W tym okresie dyski pozostają zatrzymane. Domyślnie jest to 5 minut.
|
||||
.SS pool DIR
|
||||
Definiuje katalog puli, w którym tworzony jest wirtualny widok macierzy
|
||||
|
|
@ -1604,6 +1638,9 @@ W określonych OPCJACH ciąg \`%s\` jest zastępowany
|
|||
nazwą urządzenia. W przypadku kontrolerów RAID, urządzenie jest
|
||||
prawdopodobnie stałe i może nie być konieczne użycie \`%s\`.
|
||||
.PP
|
||||
Możesz również określić niestandardowy ciąg opcji informacyjnych za pomocą
|
||||
znacznika \`[info: ...]\`, aby zastąpić domyślną opcję \`\-a\`.
|
||||
.PP
|
||||
Zapoznaj się z dokumentacją smartmontools, aby uzyskać możliwe opcje:
|
||||
.PP
|
||||
.RS 4
|
||||
|
|
@ -1619,6 +1656,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices
|
|||
Na przykład:
|
||||
.PP
|
||||
.RS 4
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl parity \-d sat %s
|
||||
.PD 0
|
||||
.PD
|
||||
|
|
@ -1633,19 +1674,27 @@ PARITY to jedna z nazw parzystości: \`parity\`, \`2\-parity\`, \`3\-parity\`,
|
|||
\`4\-parity\`, \`5\-parity\`, \`6\-parity\` lub \`z\-parity\`.
|
||||
Specjalna wartość * może być użyta do zignorowania atrybutu na wszystkich dyskach.
|
||||
.PP
|
||||
Na przykład, aby zignorować atrybut \`Current Pending Sector Count\` na
|
||||
wszystkich dyskach:
|
||||
Można określić wiele atrybutów oddzielonych spacjami.
|
||||
Każdy atrybut można określić jako liczbę od 1 do 255 lub jako nazwę
|
||||
niewrażliwą na wielkość liter (np. \`Current_Pending_Sector\`).
|
||||
.PP
|
||||
Na przykład, aby zignorować atrybuty \`Current Pending Sector Count\` i
|
||||
\`Reallocated Sectors Count\` na wszystkich dyskach za pomocą ich numeru lub nazwy:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore * 197
|
||||
smartignore * 197 5
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.PP
|
||||
Aby zignorować go tylko na pierwszym dysku parzystości:
|
||||
Aby zignorować je tylko na pierwszym dysku parzystości:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore parity 197
|
||||
smartignore parity 197 5
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
|
|
@ -1685,7 +1734,7 @@ exclude /tmp/
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1741,7 +1790,7 @@ exclude \\System Volume Information
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1757,7 +1806,129 @@ smartctl 2\-parity \-d areca,2/1 /dev/arcmsr0
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH PATTERN
|
||||
.SH MIGAWKI (SNAPSHOTS)
|
||||
Jeśli opcja snapshot jest włączona w konfiguracji, SnapRAID
|
||||
wykorzystuje funkcjonalność migawek systemu plików w celu zapewnienia operacji atomowych
|
||||
i spójnych.
|
||||
.PP
|
||||
Zarządzanie migawkami jest całkowicie automatyczne i przejrzyste.
|
||||
Możesz nadal używać SnapRAID dokładnie tak jak dotychczas, z dodatkową
|
||||
ochroną zapewnianą przez migawki, która jest realizowana w całości w
|
||||
tle.
|
||||
.PP
|
||||
Zapewnia to dwie główne korzyści:
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I Spójność
|
||||
Pliki zmodyfikowane w aktywnym systemie plików podczas długotrwałej
|
||||
operacji sync lub scrub nie spowodują niezgodności parzystości ani przerwania
|
||||
operacji, ponieważ SnapRAID widzi zamrożony obraz z danego momentu.
|
||||
.HP 4
|
||||
.I Odzyskiwanie
|
||||
Jeśli plik zostanie zaktualizowany lub usunięty z aktywnego systemu plików,
|
||||
pozostaje zachowany w migawce. Jeśli awaria dysku nastąpi
|
||||
przed uruchomieniem kolejnej operacji sync, SnapRAID użyje danych zachowanych
|
||||
w migawce do odbudowania uszkodzonego dysku.
|
||||
.PD
|
||||
.PP
|
||||
.RS 4
|
||||
.PD 0
|
||||
W przypadku awarii dysku podczas aktywnego procesu sync,
|
||||
SnapRAID jest również w stanie automatycznie czytać zarówno z migawki
|
||||
poprzedniego obliczenia parzystości, jak i z bieżącej.
|
||||
Maksymalizuje to prawdopodobieństwo pełnego odzyskania danych poprzez
|
||||
zapewnienie dostępu do dokładnych bloków danych wymaganych do rozwiązania
|
||||
równań parzystości, nawet jeśli bloki te zostały zmodyfikowane
|
||||
lub usunięte pomiędzy operacjami sync.
|
||||
.PD
|
||||
.PP
|
||||
.PD 0
|
||||
Bez migawek, zaktualizowany lub usunięty plik na sprawnym dysku
|
||||
skutkuje brakiem bloków danych, które mogą być wymagane do
|
||||
naprawy innych uszkodzonych dysków.
|
||||
.PD
|
||||
.RE
|
||||
.RE
|
||||
.PP
|
||||
Migawki są tworzone tylko dla dysków z danymi i tylko wtedy, gdy bazowy
|
||||
system plików obsługuje tę funkcjonalność. Dyski parzystości zawsze używają
|
||||
aktywnego systemu plików.
|
||||
.PP
|
||||
Obecnie jest to obsługiwane w systemach Btrfs, Bcachefs i ZFS w systemie Linux
|
||||
oraz NTFS w systemie Windows.
|
||||
.PP
|
||||
Można mieszać dyski z danymi o różnych systemach plików. Tylko te, które
|
||||
obsługują migawki, będą z nich korzystać, podczas gdy inne dyski będą nadal
|
||||
działać bezpośrednio na aktywnym systemie plików.
|
||||
.PP
|
||||
Tworzenie i usuwanie migawek wymaga uprawnień administratora.
|
||||
Upewnij się, że SnapRAID jest uruchamiany z wymaganymi uprawnieniami (np. sudo),
|
||||
gdy migawki są włączone.
|
||||
.SS Zachowanie poleceń przy użyciu migawek
|
||||
Polecenia \`sync\` oraz \`scrub\` działają wyłącznie na migawkach,
|
||||
aby zapewnić, że wszystkie operacje na danych są wykonywane na spójnym,
|
||||
zamrożonym stanie. Poprzez wykorzystanie tych migawek, SnapRAID zapobiega niezgodnościom
|
||||
parzystości, które w przeciwnym razie zostałyby wywołane przez jednoczesne modyfikacje plików w aktywnym systemie plików.
|
||||
Podczas operacji \`sync\` polecenie używa nowej migawki utworzonej na
|
||||
początku procesu, aby uchwycić bieżący stan do obliczenia parzystości.
|
||||
W przeciwieństwie do tego, polecenie \`scrub\` wykorzystuje ostatnią migawkę, tę
|
||||
utworzoną podczas najnowszej synchronizacji, aby utrzymać wiarygodny punkt odniesienia
|
||||
odpowiadający istniejącej parzystości.
|
||||
.PP
|
||||
W przypadku poleceń \`check\` oraz \`fix\`, użycie ostatniej migawki
|
||||
zależy od tego, czy konkretne dyski są wskazywane za pomocą opcji
|
||||
\-d, \-\-filter\-disk.
|
||||
.PP
|
||||
Dysk jawnie wybrany za pomocą opcji \-d (\[dq]cel\[dq] operacji)
|
||||
zawsze używa aktywnego systemu plików. Dla \`fix\` pozwala to na przywrócenie
|
||||
danych na aktywny dysk zamienny. Dla \`check\` pozwala to na symulację
|
||||
operacji \`fix\` w tych samych warunkach.
|
||||
.PP
|
||||
Wszystkie inne dyski z danymi (dyski \[dq]referencyjne\[dq]) będą dostępne za pośrednictwem
|
||||
swoich migawek. Zapewnia to, że nawet jeśli modyfikujesz pliki
|
||||
na sprawnych dyskach podczas trwania odzyskiwania danych, SnapRAID
|
||||
posiada stabilny, zamrożony punkt odniesienia do rozwiązania równań parzystości.
|
||||
.PP
|
||||
Jeśli nie podano opcji \-d, SnapRAID zakłada, że operacja dotyczy
|
||||
całej macierzy. W takim przypadku \`check\` oraz \`fix\` będą używać wyłącznie
|
||||
aktywnych systemów plików.
|
||||
.PP
|
||||
Wszystkie inne polecenia działają wyłącznie na aktywnym systemie plików.
|
||||
.SH CYKL żYCIA MIGAWEK (SNAPSHOTS LIFECYCLE)
|
||||
SnapRAID zarządza dwoma określonymi migawkami, \`stable\` (stabilną) oraz \`pending\` (oczekującą),
|
||||
w ukrytym katalogu w katalogu głównym każdego podwolumenu danych.
|
||||
W systemach Btrfs, Bcachefs i NTFS używany jest katalog \`.snapraid/\`,
|
||||
w systemie ZFS standardowy \`.zfs/snapshot/\`.
|
||||
.PP
|
||||
Migawka \`stable\` reprezentuje stan ostatniej
|
||||
pomyślnie zakończonej operacji \`sync\`, zawierając dokładne dane użyte do
|
||||
obliczenia bieżącej parzystości. Służy ona jako główne źródło danych
|
||||
dla poleceń \`scrub\`, \`check\` i \`fix\`.
|
||||
.PP
|
||||
Migawka \`pending\` to tymczasowy obraz tworzony na początku
|
||||
operacji \`sync\` w celu zapewnienia zamrożonego stanu do obliczenia parzystości.
|
||||
Po pomyślnym zakończeniu operacji poprzednia migawka \`stable\`
|
||||
jest usuwana, a migawka \`pending\` zostaje podniesiona do rangi
|
||||
nowej stabilnej referencji.
|
||||
.PP
|
||||
Jeśli operacja \`sync\` zostanie przerwana, migawka \`pending\` zostaje zachowana.
|
||||
Kolejne polecenia \`scrub\`, \`check\` i \`fix\` będą używać tej oczekującej migawki,
|
||||
ponieważ odpowiada ona stanowi systemu plików zapisanemu w pliku .content,
|
||||
nawet jeśli parzystość jest zsynchronizowana tylko częściowo.
|
||||
.PP
|
||||
W przypadku przerwania operacji \`sync\`, polecenia \`check\` i \`fix\`
|
||||
odczytują dane również z migawki \`stable\`, aby pobrać bloki danych
|
||||
z plików, które zostały zaktualizowane lub usunięte podczas synchronizacji.
|
||||
Jest to możliwe, ponieważ plik .content zachowuje metadane dla
|
||||
wszystkich zmodyfikowanych lub usuniętych plików przez cały proces sync.
|
||||
Te informacje historyczne są czyszczone dopiero po pomyślnym zakończeniu operacji sync
|
||||
i zapisaniu ostatecznej wersji pliku .content.
|
||||
.PP
|
||||
Jeśli operacja \`sync\` zostanie zrestartowana po przerwaniu, istniejąca
|
||||
oczekująca (pending) migawka jest usuwana, a tworzona jest nowa, aby
|
||||
uchwycić bieżący stan aktywnego systemu plików.
|
||||
.SH WZORCE (PATTERN)
|
||||
Wzorce zapewniają elastyczny sposób filtrowania plików do uwzględnienia lub
|
||||
wykluczenia. Używając znaków globbingowych, można zdefiniować reguły, które
|
||||
pasują do określonych nazw plików lub całych struktur katalogów bez
|
||||
|
|
@ -1823,7 +1994,7 @@ specjalne katalogi Windows są traktowane jako pliki, co oznacza, że aby je
|
|||
wykluczyć, musisz użyć reguły pliku, a nie katalogu.
|
||||
.PP
|
||||
Jeśli nazwa pliku zawiera znak \`*\`, \`?\`, \`[\`,
|
||||
lub \`]\`, musisz go uciec, aby uniknąć interpretacji jako
|
||||
lub \`]\`, musisz go zamaskować (poprzedzić znakiem ucieczki), aby uniknąć interpretacji jako
|
||||
znaku globbing. W systemie Unix znakiem ucieczki jest \`\\\`; w systemie Windows jest to \`^\`.
|
||||
Gdy wzorzec znajduje się w wierszu poleceń, musisz podwoić znak ucieczki,
|
||||
aby uniknąć interpretacji przez powłokę poleceń.
|
||||
|
|
@ -1939,7 +2110,7 @@ snapraid \-f \[dq]*.mp3\[dq] check
|
|||
.PP
|
||||
W systemie Unix, używając znaków globbing w wierszu poleceń, musisz
|
||||
je cytować, aby zapobiec ich rozszerzeniu przez powłokę.
|
||||
.SH IGNORE FILE
|
||||
.SH PLIK IGNOROWANIA (IGNORE FILE)
|
||||
Oprócz reguł globalnych w pliku konfiguracyjnym, możesz umieścić pliki
|
||||
\`.snapraidignore\` w dowolnym katalogu w macierzy, aby zdefiniować
|
||||
zdecentralizowane reguły wykluczania.
|
||||
|
|
@ -1999,15 +2170,18 @@ build/
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH CONTENT
|
||||
.SH ZAWARTOść (CONTENT)
|
||||
SnapRAID przechowuje listę i sumy kontrolne Twoich plików w pliku zawartości.
|
||||
.PP
|
||||
Jest to plik binarny, który zawiera listę wszystkich plików obecnych w Twojej macierzy dysków,
|
||||
wraz ze wszystkimi sumami kontrolnymi w celu weryfikacji ich integralności.
|
||||
.PP
|
||||
Ten plik jest odczytywany i zapisywany przez polecenia \`sync\` i \`scrub\`
|
||||
oraz odczytywany przez polecenia \`fix\`, \`check\` i \`status\`.
|
||||
.SH PARITY
|
||||
Plik zawartości jest odczytywany i zapisywany przez polecenia \`sync\`,
|
||||
\`scrub\`, \`touch\` i \`rehash\`. Jest odczytywany przez polecenia \`status\`,
|
||||
\`diff\`, \`check\`, \`fix\`, \`list\`, \`dup\`, \`locate\` i \`pool\`, oraz jest
|
||||
całkowicie ignorowany przez polecenia \`smart\`, \`probe\`, \`up\`, \`down\`
|
||||
i \`devices\`.
|
||||
.SH PARZYSTOść (PARITY)
|
||||
SnapRAID przechowuje informacje o parzystości Twojej macierzy w plikach
|
||||
parzystości.
|
||||
.PP
|
||||
|
|
@ -2016,7 +2190,7 @@ bloków zdefiniowanych w pliku \`content\`.
|
|||
.PP
|
||||
Pliki te są odczytywane i zapisywane przez polecenia \`sync\` i \`fix\`
|
||||
oraz tylko odczytywane przez polecenia \`scrub\` i \`check\`.
|
||||
.SH ENCODING
|
||||
.SH KODOWANIE (ENCODING)
|
||||
SnapRAID w systemie Unix ignoruje wszelkie kodowanie. Odczytuje i przechowuje
|
||||
nazwy plików z tym samym kodowaniem używanym przez system plików.
|
||||
.PP
|
||||
|
|
@ -2029,7 +2203,25 @@ czcionki TrueType, takiej jak \`Lucida Console\`, jako czcionki konsoli.
|
|||
Dotyczy to tylko drukowanych nazw plików; jeśli
|
||||
przekierujesz wyjście konsoli do pliku, wynikowy plik jest zawsze
|
||||
w formacie UTF\-8.
|
||||
.SH COPYRIGHT
|
||||
Ten plik jest chroniony prawem autorskim (C) 2025 Andrea Mazzoleni
|
||||
.SH SEE ALSO
|
||||
snapraid_log(1), snapraidd(1)
|
||||
.SH KOD WYJśCIA (EXIT CODE)
|
||||
SnapRAID kończy działanie z następującymi kodami błędów:
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I 0
|
||||
Wszystko w porządku.
|
||||
.HP 4
|
||||
.I 1
|
||||
Polecenie napotkało błędy.
|
||||
.HP 4
|
||||
.I 2
|
||||
Polecenie \`diff\` wykazało, że wszystko jest w porządku, ale wymagane jest \`sync\`.
|
||||
.PD
|
||||
.RE
|
||||
.SH TłUMACZENIE (TRANSLATION)
|
||||
Ten dokument jest automatycznym tłumaczeniem angielskiej instrukcji.
|
||||
Wersję oficjalną stanowi oryginalny podręcznik w języku angielskim.
|
||||
.SH PRAWA AUTORSKIE (COPYRIGHT)
|
||||
Ten plik jest chroniony prawem autorskim (C) 2026 Andrea Mazzoleni
|
||||
.SH ZOBACZ RóWNIEż (SEE ALSO)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
Name{number}
|
||||
snapraid - Kopia zapasowa SnapRAID dla macierzy dyskowych
|
||||
snapraid - Program do tworzenia kopii zapasowych SnapRAID dla macierzy dyskowych
|
||||
|
||||
Synopsis
|
||||
Składnia (Synopsis)
|
||||
:snapraid [-c, --conf CONFIG]
|
||||
: [-f, --filter PATTERN] [-d, --filter-disk NAME]
|
||||
: [-m, --filter-missing] [-e, --filter-error]
|
||||
|
|
@ -23,7 +23,7 @@ Synopsis
|
|||
|
||||
:snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
Description
|
||||
Opis (Description)
|
||||
SnapRAID to program do tworzenia kopii zapasowych przeznaczony
|
||||
dla macierzy dyskowych, przechowujący informacje parzystości
|
||||
do odzyskiwania danych w przypadku awarii do sześciu dysków.
|
||||
|
|
@ -50,22 +50,30 @@ Description
|
|||
|
||||
:https://www.snapraid.it/
|
||||
|
||||
Limitations
|
||||
SnapRAID to hybryda programu RAID i programu do tworzenia kopii zapasowych,
|
||||
której celem jest połączenie najlepszych zalet obu. Ma jednak pewne
|
||||
ograniczenia, które należy wziąć pod uwagę przed jego użyciem.
|
||||
Ograniczenia (Limitations)
|
||||
SnapRAID jest hybrydą pomiędzy RAID a programem do tworzenia kopii zapasowych, mającą na celu połączenie
|
||||
najlepszych zalet obu tych rozwiązań. Posiada jednak pewne ograniczenia, które należy
|
||||
wziąć pod uwagę przed jego użyciem.
|
||||
|
||||
Głównym ograniczeniem jest to, że jeśli dysk ulegnie awarii, a Ty nie wykonałeś
|
||||
niedawno synchronizacji, możesz nie być w stanie w pełni odzyskać danych.
|
||||
Dokładniej, możesz nie być w stanie odzyskać danych o wielkości
|
||||
zmienionych lub usuniętych plików od czasu ostatniej operacji synchronizacji.
|
||||
Dzieje się tak, nawet jeśli zmienione lub usunięte pliki nie znajdują się na
|
||||
uszkodzonym dysku. Dlatego SnapRAID jest lepiej dostosowany do
|
||||
danych, które rzadko się zmieniają.
|
||||
Głównym ograniczeniem jest to, że w przypadku awarii dysku można odzyskać dane tylko do
|
||||
stanu z momentu ostatniej operacji `sync` (synchronizacji). Wszelkie dane dodane lub modyfikacje dokonane
|
||||
od ostatniej synchronizacji, które znajdują się na uszkodzonym dysku, zostaną utracone.
|
||||
|
||||
Z drugiej strony, nowo dodane pliki nie uniemożliwiają odzyskania już
|
||||
istniejących plików. Stracisz tylko ostatnio dodane pliki, jeśli
|
||||
znajdują się one na uszkodzonym dysku.
|
||||
W związku z tym SnapRAID nadaje się głównie do danych, które rzadko się zmieniają.
|
||||
|
||||
W przypadku danych, które już istniały podczas ostatniej synchronizacji, niezawodność odzyskiwania zależy
|
||||
od tego, czy użyto opcji `snapshot` (migawki):
|
||||
|
||||
* Z obsługą migawek (dostępną w systemach plików Btrfs, ZFS, Bcachefs i NTFS),
|
||||
SnapRAID może automatycznie utrzymywać zamrożony stan dysków z danymi.
|
||||
Zapewnia to, że nawet jeśli zmodyfikujesz lub usuniesz pliki w aktywnym systemie plików
|
||||
w trakcie lub po synchronizacji, proces odzyskiwania pozostanie spójny i niezawodny.
|
||||
|
||||
* Bez obsługi migawek, usunięcie lub zmiana plików po operacji `sync`
|
||||
może uniemożliwić pełne odzyskanie danych z innych uszkodzonych dysków. Dzieje się tak,
|
||||
ponieważ parzystość nie odpowiada już zmodyfikowanym plikom, nawet jeśli
|
||||
pliki te nie znajdują się na uszkodzonym dysku. Z drugiej strony, nowo dodane
|
||||
pliki nie uniemożliwiają odzyskania już istniejących plików.
|
||||
|
||||
Inne ograniczenia SnapRAID to:
|
||||
|
||||
|
|
@ -80,9 +88,9 @@ Limitations
|
|||
awarii całej macierzy dysków.
|
||||
* Zapisywane są tylko nazwy plików, znaczniki czasu, dowiązania symboliczne
|
||||
i dowiązania twarde.
|
||||
Uprawnienia, właścicielstwo i rozszerzone atrybuty nie są zapisywane.
|
||||
Uprawnienia, właściciel (własność) i rozszerzone atrybuty nie są zapisywane.
|
||||
|
||||
Getting Started
|
||||
Pierwsze kroki (Getting Started)
|
||||
Aby użyć SnapRAID, musisz najpierw wybrać jeden dysk w swojej macierzy
|
||||
dysków, który zostanie przeznaczony na informacje o `parzystości`. Z jednym dyskiem
|
||||
na parzystość będziesz w stanie odzyskać dane po awarii pojedynczego dysku,
|
||||
|
|
@ -165,7 +173,7 @@ Getting Started
|
|||
Teraz możesz zacząć używać swojej macierzy, jak chcesz, i okresowo
|
||||
aktualizować informacje o parzystości, uruchamiając polecenie `sync`.
|
||||
|
||||
Scrubbing
|
||||
Scrubbing (Scrubbing)
|
||||
Aby okresowo sprawdzać dane i parzystość pod kątem błędów, możesz
|
||||
uruchomić polecenie `scrub`.
|
||||
|
||||
|
|
@ -203,10 +211,10 @@ Getting Started
|
|||
spowodowane usuniętymi lub zmodyfikowanymi plikami. Błędy te są zgłaszane
|
||||
w wyniku `scrub`, ale powiązane bloki nie są oznaczane jako złe.
|
||||
|
||||
Pooling
|
||||
Łączenie w pulę (Pooling)
|
||||
Uwaga: Funkcja łączenia w pulę opisana poniżej została zastąpiona przez
|
||||
narzędzie mergerfs, które jest obecnie zalecaną opcją dla użytkowników Linuksa
|
||||
w społeczności SnapRAID. Mergefs zapewnia bardziej elastyczny i wydajny
|
||||
w społeczności SnapRAID. Mergerfs zapewnia bardziej elastyczny i wydajny
|
||||
sposób łączenia wielu dysków w jeden ujednolicony punkt montowania,
|
||||
umożliwiając bezproblemowy dostęp do plików w całej macierzy bez polegania
|
||||
na dowiązaniach symbolicznych. Dobrze integruje się z SnapRAID w celu ochrony
|
||||
|
|
@ -275,7 +283,7 @@ Getting Started
|
|||
|
||||
:fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
||||
|
||||
Undeleting
|
||||
Cofanie usuwania (Undeleting)
|
||||
SnapRAID działa bardziej jak program do tworzenia kopii zapasowych niż system RAID
|
||||
i może być użyty do przywrócenia lub odzyskania usuniętych plików do ich poprzedniego
|
||||
stanu za pomocą opcji -f, --filter:
|
||||
|
|
@ -296,7 +304,7 @@ Getting Started
|
|||
|
||||
:snapraid fix -m
|
||||
|
||||
Recovering
|
||||
Odzyskiwanie (Recovering)
|
||||
Najgorsze się wydarzyło i straciłeś jeden lub więcej dysków!
|
||||
|
||||
NIE PANIKUJ! Będziesz w stanie je odzyskać!
|
||||
|
|
@ -347,7 +355,7 @@ Getting Started
|
|||
są częściowo lub całkowicie nie do odzyskania, zostaną one przemianowane
|
||||
poprzez dodanie rozszerzenia `.unrecoverable`.
|
||||
|
||||
Szczegółową listę wszystkich nie do odzyskania bloków znajdziesz w pliku fix.log,
|
||||
Szczegółową listę wszystkich bloków nie do odzyskania znajdziesz w pliku fix.log,
|
||||
sprawdzając wszystkie linie zaczynające się od `unrecoverable:`.
|
||||
|
||||
Jeśli nie jesteś zadowolony z odzyskiwania, możesz spróbować ponownie
|
||||
|
|
@ -383,16 +391,16 @@ Getting Started
|
|||
|
||||
Jeśli wszystko zostanie odzyskane, to polecenie jest natychmiastowe.
|
||||
|
||||
Commands
|
||||
Polecenia (Commands)
|
||||
SnapRAID udostępnia kilka prostych poleceń, które pozwalają na:
|
||||
|
||||
* Wyświetlenie statusu macierzy -> `status`
|
||||
* Kontrolę dysków -> `smart`, `probe`, `up`, `down`
|
||||
* Wykonanie kopii zapasowej/migawki -> `sync`
|
||||
* Wyświetlenie stanu macierzy -> `status`
|
||||
* Kontrola dysków -> `smart`, `probe`, `up`, `down`
|
||||
* Utworzenie punktu kopii zapasowej/przywracania -> `sync`
|
||||
* Okresowe sprawdzanie danych -> `scrub`
|
||||
* Przywrócenie ostatniej kopii zapasowej/migawki -> `fix`.
|
||||
* Przywrócenie ostatniego punktu kopii zapasowej/przywracania -> `fix`.
|
||||
|
||||
Polecenia muszą być zapisane małymi literami.
|
||||
Polecenia muszą być wpisywane małymi literami.
|
||||
|
||||
status
|
||||
Wyświetla podsumowanie stanu macierzy dysków.
|
||||
|
|
@ -515,9 +523,9 @@ Commands
|
|||
i znacznika czasu.
|
||||
Jeśli podsekundowy znacznik czasu wynosi zero, pełna ścieżka
|
||||
musi być zgodna, aby plik został zidentyfikowany.
|
||||
W przeciwieństwie do plików 'moved' na tym samym dysku, pliki
|
||||
relokowane mają inny i-węzeł.
|
||||
restored - Pliki o innym i-węźle, ale pasującym katalogu,
|
||||
W przeciwieństwie do plików przeniesionych ('moved') na tym samym dysku, pliki
|
||||
relokowane mają inny inode.
|
||||
restored - Pliki o innym inode, ale pasującym katalogu,
|
||||
nazwie, rozmiarze i znaczniku czasu.
|
||||
Są to zazwyczaj pliki przywrócone po ich usunięciu.
|
||||
|
||||
|
|
@ -584,7 +592,7 @@ Commands
|
|||
|
||||
Zaleca się uruchamianie `scrub` tylko na zsynchronizowanej macierzy, aby uniknąć
|
||||
zgłaszania błędów spowodowanych przez niezsynchronizowane dane. Błędy te są rozpoznawane
|
||||
jako nie będące cichymi błędami, a bloki nie są oznaczane jako złe,
|
||||
jako niebędące cichymi błędami, a bloki nie są oznaczane jako złe,
|
||||
ale takie błędy są zgłaszane w wyniku polecenia.
|
||||
|
||||
Plik `content` jest modyfikowany w celu zaktualizowania czasu ostatniego sprawdzenia
|
||||
|
|
@ -593,15 +601,14 @@ Commands
|
|||
Pliki w macierzy NIE są modyfikowane.
|
||||
|
||||
fix
|
||||
Naprawia wszystkie pliki i dane parzystości.
|
||||
Naprawia wszystkie pliki oraz dane parzystości.
|
||||
|
||||
Wszystkie pliki i dane parzystości są porównywane ze stanem migawki
|
||||
zapisanym w ostatniej `sync`.
|
||||
Jeśli zostanie znaleziona różnica, jest ona przywracana do zapisanego stanu migawki.
|
||||
Wszystkie pliki i dane parzystości są porównywane ze stanem zapisanym podczas
|
||||
ostatniej operacji `sync`. W przypadku znalezienia różnicy, następuje przywrócenie stanu zapisanego.
|
||||
|
||||
OSTRZEŻENIE! Polecenie `fix` nie rozróżnia błędów od
|
||||
celowych modyfikacji. Bezwarunkowo przywraca stan pliku
|
||||
do ostatniej `sync`.
|
||||
UWAGA!
|
||||
Polecenie `fix` nie odróżnia błędów od celowych modyfikacji.
|
||||
Bezwzględnie przywraca stan plików do momentu ostatniej operacji `sync`.
|
||||
|
||||
Jeśli nie określono żadnej innej opcji, przetwarzana jest cała macierz.
|
||||
Użyj opcji filtra, aby wybrać podzbiór plików lub dysków do operacji.
|
||||
|
|
@ -738,7 +745,7 @@ Commands
|
|||
Pamiętaj, że takie pliki nie będą chronione przez parzystość podczas procesu
|
||||
realokacji.
|
||||
|
||||
Options
|
||||
Opcje (Options)
|
||||
SnapRAID udostępnia następujące opcje:
|
||||
|
||||
-c, --conf CONFIG
|
||||
|
|
@ -849,9 +856,9 @@ Options
|
|||
liczba bajtów na sekundę. Możesz określić mnożnik,
|
||||
taki jak K, M lub G (np. --bw-limit 1G).
|
||||
|
||||
-t, --tail ROZMIAR
|
||||
Ogranicza listę plików do tych, które nie używają więcej niż określony
|
||||
końcowy rozmiar dysków parzystości.
|
||||
-t, --tail SIZE
|
||||
Ogranicza listę plików do tych, które nie wykraczają poza określoną
|
||||
sekcję końcową (ogon) plików parzystości.
|
||||
Możesz użyć mnożników takich jak K, M, G lub T (np. --tail 1G).
|
||||
Opcja ta jest ważna tylko wtedy, gdy jest używana wraz z poleceniem
|
||||
`locate`.
|
||||
|
|
@ -949,9 +956,9 @@ Options
|
|||
zalecane, aby jej nie używać.
|
||||
NIE MASZ ochrony danych podczas operacji `sync`.
|
||||
|
||||
-W, --force-realloc-tail ROZMIAR
|
||||
-W, --force-realloc-tail SIZE
|
||||
Działa jak -R, --force-realloc, ale ogranicza się do określonej części
|
||||
końcowej (ostatnie ROZMIAR bajtów) każdego pliku parzystości.
|
||||
końcowej (ostatnie SIZE bajtów) każdego pliku parzystości.
|
||||
Wymusza realokację (przeniesienie) wszelkich fragmentów/bloków plików
|
||||
obecnie przechowywanych w tej sekcji końcowej, pozwalając na ich
|
||||
umieszczenie w dowolnym miejscu w pliku (plikach) parzystości, gdzie
|
||||
|
|
@ -983,7 +990,7 @@ Options
|
|||
zastępowane datą i czasem w formacie RRRRMMDD i
|
||||
GGMMSS. W plikach wsadowych Windows musisz podwoić
|
||||
znak `%`, np. result-%%D.log. Aby użyć `>>`, musisz
|
||||
ujęć nazwę w cudzysłów, np. `">>result.log"`.
|
||||
ująć nazwę w cudzysłów, np. `">>result.log"`.
|
||||
Aby wyprowadzić log do standardowego wyjścia lub standardowego błędu,
|
||||
możesz użyć odpowiednio `">&1"` i `">&2"`.
|
||||
Opisy tagów logu znajdziesz w pliku snapraid_log.txt lub na stronie podręcznika.
|
||||
|
|
@ -1036,7 +1043,7 @@ Options
|
|||
-V, --version
|
||||
Wyświetla wersję programu.
|
||||
|
||||
Configuration
|
||||
Konfiguracja (Configuration)
|
||||
SnapRAID wymaga pliku konfiguracyjnego, aby wiedzieć, gdzie znajduje się Twoja macierz
|
||||
dysków i gdzie przechowywać informacje o parzystości.
|
||||
|
||||
|
|
@ -1146,6 +1153,30 @@ Configuration
|
|||
Należy zauważyć, że polecenia `up` i `down` nie mają wpływu na takie
|
||||
dyski, ponieważ oczekuje się, że będą one zawsze w ruchu.
|
||||
|
||||
snapshot
|
||||
Włącza używanie migawek systemu plików dla poleceń `sync`, `scrub`,
|
||||
`check` oraz `fix`.
|
||||
|
||||
Po włączeniu, SnapRAID tworzy migawkę danych w trybie tylko do odczytu na
|
||||
początku operacji 'sync'. Zapewnia to spójny obraz plików z danego momentu,
|
||||
zapobiegając błędom wywołanym przez jednoczesne modyfikacje plików.
|
||||
|
||||
To znacznie usprawnia odzyskiwanie danych: jeśli plik zostanie usunięty z aktywnego systemu
|
||||
plików, pozostaje zachowany w migawce. Zapobiega to sytuacji, w której parzystość staje się "uszkodzona"
|
||||
dla tego bloku, zapewniając możliwość pomyślnego odzyskania danych,
|
||||
jeśli ulegnie awarii inny dysk.
|
||||
|
||||
Opcja ta dotyczy wyłącznie dysków z danymi sformatowanych w systemach plików
|
||||
Btrfs, Bcachefs lub ZFS w systemie Linux oraz NTFS w systemie Windows.
|
||||
Dyski parzystości lub dyski z danymi korzystające z innych systemów plików będą zawsze używać
|
||||
aktywnej wersji systemu plików.
|
||||
|
||||
Tworzenie i usuwanie migawek wymaga uprawnień administratora.
|
||||
Upewnij się, że SnapRAID jest uruchamiany z wymaganymi uprawnieniami (np. sudo), gdy
|
||||
opcja ta jest włączona.
|
||||
|
||||
Szczegółowe wyjaśnienie cyklu życia migawek znajduje się w sekcji SNAPSHOTS.
|
||||
|
||||
nohidden
|
||||
Wyklucza wszystkie ukryte pliki i katalogi.
|
||||
W systemie Unix ukryte pliki to te zaczynające się od `.`.
|
||||
|
|
@ -1194,7 +1225,7 @@ Configuration
|
|||
|
||||
Możesz sprawdzić ilość zmarnowanego miejsca na każdym dysku za pomocą `status`.
|
||||
Jest to ilość miejsca, którą musisz pozostawić wolną na dyskach danych
|
||||
lub użyć dla plików nie włączonych do macierzy.
|
||||
lub użyć dla plików niewłączonych do macierzy.
|
||||
Jeśli ta wartość jest ujemna, oznacza to, że jesteś blisko wypełnienia
|
||||
parzystości i reprezentuje to przestrzeń, którą nadal możesz zmarnować.
|
||||
|
||||
|
|
@ -1259,7 +1290,7 @@ Configuration
|
|||
SnapRAID okresowo sprawdza temperaturę wszystkich dysków za pomocą
|
||||
narzędzia smartctl. Aktualne temperatury dysków są wyświetlane podczas
|
||||
działania SnapRAID. Jeśli którykolwiek dysk przekroczy ten limit, wszystkie operacje
|
||||
zostają zatrzymane, a dyski są zatrzymywane (przechodzą w stan gotowości) na czas
|
||||
zostają zatrzymane, a dyski są wyłączane (przechodzą w stan czuwania / uśpienia) na czas
|
||||
zdefiniowany przez opcję `temp_sleep`. Po okresie uśpienia, operacje
|
||||
są wznawiane, potencjalnie ponownie zatrzymując się, jeśli limit temperatury
|
||||
zostanie ponownie osiągnięty.
|
||||
|
|
@ -1267,7 +1298,7 @@ Configuration
|
|||
Podczas działania SnapRAID analizuje również krzywą nagrzewania każdego
|
||||
dysku i szacuje długoterminową stałą temperaturę, którą mają
|
||||
osiągnąć, jeśli aktywność będzie kontynuowana. Oszacowanie jest wykonywane tylko po
|
||||
czterokrotnym wzroście temperatury dysku, co zapewnia, że
|
||||
czterokrotnym zarejestrowaniu wzrostu temperatury dysku, co zapewnia, że
|
||||
dostępnych jest wystarczająco dużo punktów danych do ustalenia wiarygodnego trendu.
|
||||
Ta przewidywana stała temperatura jest pokazywana w nawiasach obok
|
||||
aktualnej wartości i pomaga ocenić, czy chłodzenie systemu jest
|
||||
|
|
@ -1284,7 +1315,7 @@ Configuration
|
|||
Aby wyświetlić temperaturę wszystkich dysków, użyj opcji -A lub --stats.
|
||||
|
||||
temp_sleep TIME_IN_MINUTES
|
||||
Ustawia czas gotowości, w minutach, po osiągnięciu limitu temperatury.
|
||||
Ustawia czas wstrzymania (czuwania), w minutach, po osiągnięciu limitu temperatury.
|
||||
W tym okresie dyski pozostają zatrzymane. Domyślnie jest to 5 minut.
|
||||
|
||||
pool DIR
|
||||
|
|
@ -1321,6 +1352,9 @@ Configuration
|
|||
nazwą urządzenia. W przypadku kontrolerów RAID, urządzenie jest
|
||||
prawdopodobnie stałe i może nie być konieczne użycie `%s`.
|
||||
|
||||
Możesz również określić niestandardowy ciąg opcji informacyjnych za pomocą
|
||||
znacznika `[info: ...]`, aby zastąpić domyślną opcję `-a`.
|
||||
|
||||
Zapoznaj się z dokumentacją smartmontools, aby uzyskać możliwe opcje:
|
||||
|
||||
:https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
|
|
@ -1328,6 +1362,7 @@ Configuration
|
|||
|
||||
Na przykład:
|
||||
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl parity -d sat %s
|
||||
|
||||
smartignore DISK/PARITY ATTR [ATTR...]
|
||||
|
|
@ -1340,14 +1375,19 @@ Configuration
|
|||
`4-parity`, `5-parity`, `6-parity` lub `z-parity`.
|
||||
Specjalna wartość * może być użyta do zignorowania atrybutu na wszystkich dyskach.
|
||||
|
||||
Na przykład, aby zignorować atrybut `Current Pending Sector Count` na
|
||||
wszystkich dyskach:
|
||||
Można określić wiele atrybutów oddzielonych spacjami.
|
||||
Każdy atrybut można określić jako liczbę od 1 do 255 lub jako nazwę
|
||||
niewrażliwą na wielkość liter (np. `Current_Pending_Sector`).
|
||||
|
||||
:smartignore * 197
|
||||
Na przykład, aby zignorować atrybuty `Current Pending Sector Count` i
|
||||
`Reallocated Sectors Count` na wszystkich dyskach za pomocą ich numeru lub nazwy:
|
||||
|
||||
Aby zignorować go tylko na pierwszym dysku parzystości:
|
||||
:smartignore * 197 5
|
||||
:smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
:smartignore parity 197
|
||||
Aby zignorować je tylko na pierwszym dysku parzystości:
|
||||
|
||||
:smartignore parity 197 5
|
||||
|
||||
Examples
|
||||
Przykład typowej konfiguracji dla systemu Unix:
|
||||
|
|
@ -1360,7 +1400,7 @@ Configuration
|
|||
:data d3 /mnt/disk3/
|
||||
:exclude /lost+found/
|
||||
:exclude /tmp/
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/sg0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1376,12 +1416,124 @@ Configuration
|
|||
:exclude Thumbs.db
|
||||
:exclude \$RECYCLE.BIN
|
||||
:exclude \System Volume Information
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
Pattern
|
||||
Migawki (Snapshots)
|
||||
Jeśli opcja snapshot jest włączona w konfiguracji, SnapRAID
|
||||
wykorzystuje funkcjonalność migawek systemu plików w celu zapewnienia operacji atomowych
|
||||
i spójnych.
|
||||
|
||||
Zarządzanie migawkami jest całkowicie automatyczne i przejrzyste.
|
||||
Możesz nadal używać SnapRAID dokładnie tak jak dotychczas, z dodatkową
|
||||
ochroną zapewnianą przez migawki, która jest realizowana w całości w
|
||||
tle.
|
||||
|
||||
Zapewnia to dwie główne korzyści:
|
||||
|
||||
Spójność - Pliki zmodyfikowane w aktywnym systemie plików podczas długotrwałej
|
||||
operacji sync lub scrub nie spowodują niezgodności parzystości ani przerwania
|
||||
operacji, ponieważ SnapRAID widzi zamrożony obraz z danego momentu.
|
||||
Odzyskiwanie - Jeśli plik zostanie zaktualizowany lub usunięty z aktywnego systemu plików,
|
||||
pozostaje zachowany w migawce. Jeśli awaria dysku nastąpi
|
||||
przed uruchomieniem kolejnej operacji sync, SnapRAID użyje danych zachowanych
|
||||
w migawce do odbudowania uszkodzonego dysku.
|
||||
|
||||
W przypadku awarii dysku podczas aktywnego procesu sync,
|
||||
SnapRAID jest również w stanie automatycznie czytać zarówno z migawki
|
||||
poprzedniego obliczenia parzystości, jak i z bieżącej.
|
||||
Maksymalizuje to prawdopodobieństwo pełnego odzyskania danych poprzez
|
||||
zapewnienie dostępu do dokładnych bloków danych wymaganych do rozwiązania
|
||||
równań parzystości, nawet jeśli bloki te zostały zmodyfikowane
|
||||
lub usunięte pomiędzy operacjami sync.
|
||||
|
||||
Bez migawek, zaktualizowany lub usunięty plik na sprawnym dysku
|
||||
skutkuje brakiem bloków danych, które mogą być wymagane do
|
||||
naprawy innych uszkodzonych dysków.
|
||||
|
||||
Migawki są tworzone tylko dla dysków z danymi i tylko wtedy, gdy bazowy
|
||||
system plików obsługuje tę funkcjonalność. Dyski parzystości zawsze używają
|
||||
aktywnego systemu plików.
|
||||
|
||||
Obecnie jest to obsługiwane w systemach Btrfs, Bcachefs i ZFS w systemie Linux
|
||||
oraz NTFS w systemie Windows.
|
||||
|
||||
Można mieszać dyski z danymi o różnych systemach plików. Tylko te, które
|
||||
obsługują migawki, będą z nich korzystać, podczas gdy inne dyski będą nadal
|
||||
działać bezpośrednio na aktywnym systemie plików.
|
||||
|
||||
Tworzenie i usuwanie migawek wymaga uprawnień administratora.
|
||||
Upewnij się, że SnapRAID jest uruchamiany z wymaganymi uprawnieniami (np. sudo),
|
||||
gdy migawki są włączone.
|
||||
|
||||
Zachowanie poleceń przy użyciu migawek
|
||||
Polecenia `sync` oraz `scrub` działają wyłącznie na migawkach,
|
||||
aby zapewnić, że wszystkie operacje na danych są wykonywane na spójnym,
|
||||
zamrożonym stanie. Poprzez wykorzystanie tych migawek, SnapRAID zapobiega niezgodnościom
|
||||
parzystości, które w przeciwnym razie zostałyby wywołane przez jednoczesne modyfikacje plików w aktywnym systemie plików.
|
||||
Podczas operacji `sync` polecenie używa nowej migawki utworzonej na
|
||||
początku procesu, aby uchwycić bieżący stan do obliczenia parzystości.
|
||||
W przeciwieństwie do tego, polecenie `scrub` wykorzystuje ostatnią migawkę, tę
|
||||
utworzoną podczas najnowszej synchronizacji, aby utrzymać wiarygodny punkt odniesienia
|
||||
odpowiadający istniejącej parzystości.
|
||||
|
||||
W przypadku poleceń `check` oraz `fix`, użycie ostatniej migawki
|
||||
zależy od tego, czy konkretne dyski są wskazywane za pomocą opcji
|
||||
-d, --filter-disk.
|
||||
|
||||
Dysk jawnie wybrany za pomocą opcji -d ("cel" operacji)
|
||||
zawsze używa aktywnego systemu plików. Dla `fix` pozwala to na przywrócenie
|
||||
danych na aktywny dysk zamienny. Dla `check` pozwala to na symulację
|
||||
operacji `fix` w tych samych warunkach.
|
||||
|
||||
Wszystkie inne dyski z danymi (dyski "referencyjne") będą dostępne za pośrednictwem
|
||||
swoich migawek. Zapewnia to, że nawet jeśli modyfikujesz pliki
|
||||
na sprawnych dyskach podczas trwania odzyskiwania danych, SnapRAID
|
||||
posiada stabilny, zamrożony punkt odniesienia do rozwiązania równań parzystości.
|
||||
|
||||
Jeśli nie podano opcji -d, SnapRAID zakłada, że operacja dotyczy
|
||||
całej macierzy. W takim przypadku `check` oraz `fix` będą używać wyłącznie
|
||||
aktywnych systemów plików.
|
||||
|
||||
Wszystkie inne polecenia działają wyłącznie na aktywnym systemie plików.
|
||||
|
||||
Cykl życia migawek (Snapshots Lifecycle)
|
||||
SnapRAID zarządza dwoma określonymi migawkami, `stable` (stabilną) oraz `pending` (oczekującą),
|
||||
w ukrytym katalogu w katalogu głównym każdego podwolumenu danych.
|
||||
W systemach Btrfs, Bcachefs i NTFS używany jest katalog `.snapraid/`,
|
||||
w systemie ZFS standardowy `.zfs/snapshot/`.
|
||||
|
||||
Migawka `stable` reprezentuje stan ostatniej
|
||||
pomyślnie zakończonej operacji `sync`, zawierając dokładne dane użyte do
|
||||
obliczenia bieżącej parzystości. Służy ona jako główne źródło danych
|
||||
dla poleceń `scrub`, `check` i `fix`.
|
||||
|
||||
Migawka `pending` to tymczasowy obraz tworzony na początku
|
||||
operacji `sync` w celu zapewnienia zamrożonego stanu do obliczenia parzystości.
|
||||
Po pomyślnym zakończeniu operacji poprzednia migawka `stable`
|
||||
jest usuwana, a migawka `pending` zostaje podniesiona do rangi
|
||||
nowej stabilnej referencji.
|
||||
|
||||
Jeśli operacja `sync` zostanie przerwana, migawka `pending` zostaje zachowana.
|
||||
Kolejne polecenia `scrub`, `check` i `fix` będą używać tej oczekującej migawki,
|
||||
ponieważ odpowiada ona stanowi systemu plików zapisanemu w pliku .content,
|
||||
nawet jeśli parzystość jest zsynchronizowana tylko częściowo.
|
||||
|
||||
W przypadku przerwania operacji `sync`, polecenia `check` i `fix`
|
||||
odczytują dane również z migawki `stable`, aby pobrać bloki danych
|
||||
z plików, które zostały zaktualizowane lub usunięte podczas synchronizacji.
|
||||
Jest to możliwe, ponieważ plik .content zachowuje metadane dla
|
||||
wszystkich zmodyfikowanych lub usuniętych plików przez cały proces sync.
|
||||
Te informacje historyczne są czyszczone dopiero po pomyślnym zakończeniu operacji sync
|
||||
i zapisaniu ostatecznej wersji pliku .content.
|
||||
|
||||
Jeśli operacja `sync` zostanie zrestartowana po przerwaniu, istniejąca
|
||||
oczekująca (pending) migawka jest usuwana, a tworzona jest nowa, aby
|
||||
uchwycić bieżący stan aktywnego systemu plików.
|
||||
|
||||
Wzorce (Pattern)
|
||||
Wzorce zapewniają elastyczny sposób filtrowania plików do uwzględnienia lub
|
||||
wykluczenia. Używając znaków globbingowych, można zdefiniować reguły, które
|
||||
pasują do określonych nazw plików lub całych struktur katalogów bez
|
||||
|
|
@ -1447,7 +1599,7 @@ Pattern
|
|||
wykluczyć, musisz użyć reguły pliku, a nie katalogu.
|
||||
|
||||
Jeśli nazwa pliku zawiera znak `*`, `?`, `[`,
|
||||
lub `]`, musisz go uciec, aby uniknąć interpretacji jako
|
||||
lub `]`, musisz go zamaskować (poprzedzić znakiem ucieczki), aby uniknąć interpretacji jako
|
||||
znaku globbing. W systemie Unix znakiem ucieczki jest `\`; w systemie Windows jest to `^`.
|
||||
Gdy wzorzec znajduje się w wierszu poleceń, musisz podwoić znak ucieczki,
|
||||
aby uniknąć interpretacji przez powłokę poleceń.
|
||||
|
|
@ -1497,7 +1649,7 @@ Pattern
|
|||
W systemie Unix, używając znaków globbing w wierszu poleceń, musisz
|
||||
je cytować, aby zapobiec ich rozszerzeniu przez powłokę.
|
||||
|
||||
Ignore File
|
||||
Plik ignorowania (Ignore File)
|
||||
Oprócz reguł globalnych w pliku konfiguracyjnym, możesz umieścić pliki
|
||||
`.snapraidignore` w dowolnym katalogu w macierzy, aby zdefiniować
|
||||
zdecentralizowane reguły wykluczania.
|
||||
|
|
@ -1539,16 +1691,19 @@ Ignore File
|
|||
:# Wyklucza każdy plik .tmp wewnątrz projects/ lub jego podfolderach
|
||||
:*.tmp
|
||||
|
||||
Content
|
||||
Zawartość (Content)
|
||||
SnapRAID przechowuje listę i sumy kontrolne Twoich plików w pliku zawartości.
|
||||
|
||||
Jest to plik binarny, który zawiera listę wszystkich plików obecnych w Twojej macierzy dysków,
|
||||
wraz ze wszystkimi sumami kontrolnymi w celu weryfikacji ich integralności.
|
||||
|
||||
Ten plik jest odczytywany i zapisywany przez polecenia `sync` i `scrub`
|
||||
oraz odczytywany przez polecenia `fix`, `check` i `status`.
|
||||
Plik zawartości jest odczytywany i zapisywany przez polecenia `sync`,
|
||||
`scrub`, `touch` i `rehash`. Jest odczytywany przez polecenia `status`,
|
||||
`diff`, `check`, `fix`, `list`, `dup`, `locate` i `pool`, oraz jest
|
||||
całkowicie ignorowany przez polecenia `smart`, `probe`, `up`, `down`
|
||||
i `devices`.
|
||||
|
||||
Parity
|
||||
Parzystość (Parity)
|
||||
SnapRAID przechowuje informacje o parzystości Twojej macierzy w plikach
|
||||
parzystości.
|
||||
|
||||
|
|
@ -1558,7 +1713,7 @@ Parity
|
|||
Pliki te są odczytywane i zapisywane przez polecenia `sync` i `fix`
|
||||
oraz tylko odczytywane przez polecenia `scrub` i `check`.
|
||||
|
||||
Encoding
|
||||
Kodowanie (Encoding)
|
||||
SnapRAID w systemie Unix ignoruje wszelkie kodowanie. Odczytuje i przechowuje
|
||||
nazwy plików z tym samym kodowaniem używanym przez system plików.
|
||||
|
||||
|
|
@ -1572,8 +1727,19 @@ Encoding
|
|||
przekierujesz wyjście konsoli do pliku, wynikowy plik jest zawsze
|
||||
w formacie UTF-8.
|
||||
|
||||
Copyright
|
||||
Ten plik jest chroniony prawem autorskim (C) 2025 Andrea Mazzoleni
|
||||
Kod wyjścia (Exit Code)
|
||||
SnapRAID kończy działanie z następującymi kodami błędów:
|
||||
|
||||
See Also
|
||||
snapraid_log(1), snapraidd(1)
|
||||
0 - Wszystko w porządku.
|
||||
1 - Polecenie napotkało błędy.
|
||||
2 - Polecenie `diff` wykazało, że wszystko jest w porządku, ale wymagane jest `sync`.
|
||||
|
||||
Tłumaczenie (Translation)
|
||||
Ten dokument jest automatycznym tłumaczeniem angielskiej instrukcji.
|
||||
Wersję oficjalną stanowi oryginalny podręcznik w języku angielskim.
|
||||
|
||||
Prawa autorskie (Copyright)
|
||||
Ten plik jest chroniony prawem autorskim (C) 2026 Andrea Mazzoleni
|
||||
|
||||
Zobacz również (See Also)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
==============================================
|
||||
Kopia zapasowa SnapRAID dla macierzy dyskowych
|
||||
==============================================
|
||||
=====================================================================
|
||||
Program do tworzenia kopii zapasowych SnapRAID dla macierzy dyskowych
|
||||
=====================================================================
|
||||
|
||||
|
||||
1 SYNOPSIS
|
||||
==========
|
||||
1 SKłADNIA (SYNOPSIS)
|
||||
=====================
|
||||
|
||||
snapraid [-c, --conf CONFIG]
|
||||
[-f, --filter PATTERN] [-d, --filter-disk NAME]
|
||||
|
|
@ -28,8 +28,8 @@ snapraid [-c, --conf CONFIG]
|
|||
snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
|
||||
2 DESCRIPTION
|
||||
=============
|
||||
2 OPIS (DESCRIPTION)
|
||||
====================
|
||||
|
||||
SnapRAID to program do tworzenia kopii zapasowych przeznaczony
|
||||
dla macierzy dyskowych, przechowujący informacje parzystości
|
||||
|
|
@ -58,24 +58,32 @@ Więcej informacji można znaleźć na oficjalnej stronie SnapRAID:
|
|||
https://www.snapraid.it/
|
||||
|
||||
|
||||
3 LIMITATIONS
|
||||
=============
|
||||
3 OGRANICZENIA (LIMITATIONS)
|
||||
============================
|
||||
|
||||
SnapRAID to hybryda programu RAID i programu do tworzenia kopii zapasowych,
|
||||
której celem jest połączenie najlepszych zalet obu. Ma jednak pewne
|
||||
ograniczenia, które należy wziąć pod uwagę przed jego użyciem.
|
||||
SnapRAID jest hybrydą pomiędzy RAID a programem do tworzenia kopii zapasowych, mającą na celu połączenie
|
||||
najlepszych zalet obu tych rozwiązań. Posiada jednak pewne ograniczenia, które należy
|
||||
wziąć pod uwagę przed jego użyciem.
|
||||
|
||||
Głównym ograniczeniem jest to, że jeśli dysk ulegnie awarii, a Ty nie wykonałeś
|
||||
niedawno synchronizacji, możesz nie być w stanie w pełni odzyskać danych.
|
||||
Dokładniej, możesz nie być w stanie odzyskać danych o wielkości
|
||||
zmienionych lub usuniętych plików od czasu ostatniej operacji synchronizacji.
|
||||
Dzieje się tak, nawet jeśli zmienione lub usunięte pliki nie znajdują się na
|
||||
uszkodzonym dysku. Dlatego SnapRAID jest lepiej dostosowany do
|
||||
danych, które rzadko się zmieniają.
|
||||
Głównym ograniczeniem jest to, że w przypadku awarii dysku można odzyskać dane tylko do
|
||||
stanu z momentu ostatniej operacji `sync` (synchronizacji). Wszelkie dane dodane lub modyfikacje dokonane
|
||||
od ostatniej synchronizacji, które znajdują się na uszkodzonym dysku, zostaną utracone.
|
||||
|
||||
Z drugiej strony, nowo dodane pliki nie uniemożliwiają odzyskania już
|
||||
istniejących plików. Stracisz tylko ostatnio dodane pliki, jeśli
|
||||
znajdują się one na uszkodzonym dysku.
|
||||
W związku z tym SnapRAID nadaje się głównie do danych, które rzadko się zmieniają.
|
||||
|
||||
W przypadku danych, które już istniały podczas ostatniej synchronizacji, niezawodność odzyskiwania zależy
|
||||
od tego, czy użyto opcji `snapshot` (migawki):
|
||||
|
||||
* Z obsługą migawek (dostępną w systemach plików Btrfs, ZFS, Bcachefs i NTFS),
|
||||
SnapRAID może automatycznie utrzymywać zamrożony stan dysków z danymi.
|
||||
Zapewnia to, że nawet jeśli zmodyfikujesz lub usuniesz pliki w aktywnym systemie plików
|
||||
w trakcie lub po synchronizacji, proces odzyskiwania pozostanie spójny i niezawodny.
|
||||
|
||||
* Bez obsługi migawek, usunięcie lub zmiana plików po operacji `sync`
|
||||
może uniemożliwić pełne odzyskanie danych z innych uszkodzonych dysków. Dzieje się tak,
|
||||
ponieważ parzystość nie odpowiada już zmodyfikowanym plikom, nawet jeśli
|
||||
pliki te nie znajdują się na uszkodzonym dysku. Z drugiej strony, nowo dodane
|
||||
pliki nie uniemożliwiają odzyskania już istniejących plików.
|
||||
|
||||
Inne ograniczenia SnapRAID to:
|
||||
|
||||
|
|
@ -90,11 +98,11 @@ Inne ograniczenia SnapRAID to:
|
|||
awarii całej macierzy dysków.
|
||||
* Zapisywane są tylko nazwy plików, znaczniki czasu, dowiązania symboliczne
|
||||
i dowiązania twarde.
|
||||
Uprawnienia, właścicielstwo i rozszerzone atrybuty nie są zapisywane.
|
||||
Uprawnienia, właściciel (własność) i rozszerzone atrybuty nie są zapisywane.
|
||||
|
||||
|
||||
4 GETTING STARTED
|
||||
=================
|
||||
4 PIERWSZE KROKI (GETTING STARTED)
|
||||
==================================
|
||||
|
||||
Aby użyć SnapRAID, musisz najpierw wybrać jeden dysk w swojej macierzy
|
||||
dysków, który zostanie przeznaczony na informacje o `parzystości`. Z jednym dyskiem
|
||||
|
|
@ -178,8 +186,8 @@ Kiedy to polecenie się zakończy, Twoje dane są BEZPIECZNE.
|
|||
Teraz możesz zacząć używać swojej macierzy, jak chcesz, i okresowo
|
||||
aktualizować informacje o parzystości, uruchamiając polecenie `sync`.
|
||||
|
||||
4.1 Scrubbing
|
||||
-------------
|
||||
4.1 Scrubbing (Scrubbing)
|
||||
-------------------------
|
||||
|
||||
Aby okresowo sprawdzać dane i parzystość pod kątem błędów, możesz
|
||||
uruchomić polecenie `scrub`.
|
||||
|
|
@ -218,12 +226,12 @@ Uruchomienie `scrub` na niezsynchronizowanej macierzy może zgłosić błędy
|
|||
spowodowane usuniętymi lub zmodyfikowanymi plikami. Błędy te są zgłaszane
|
||||
w wyniku `scrub`, ale powiązane bloki nie są oznaczane jako złe.
|
||||
|
||||
4.2 Pooling
|
||||
-----------
|
||||
4.2 Łączenie w pulę (Pooling)
|
||||
-----------------------------
|
||||
|
||||
Uwaga: Funkcja łączenia w pulę opisana poniżej została zastąpiona przez
|
||||
narzędzie mergerfs, które jest obecnie zalecaną opcją dla użytkowników Linuksa
|
||||
w społeczności SnapRAID. Mergefs zapewnia bardziej elastyczny i wydajny
|
||||
w społeczności SnapRAID. Mergerfs zapewnia bardziej elastyczny i wydajny
|
||||
sposób łączenia wielu dysków w jeden ujednolicony punkt montowania,
|
||||
umożliwiając bezproblemowy dostęp do plików w całej macierzy bez polegania
|
||||
na dowiązaniach symbolicznych. Dobrze integruje się z SnapRAID w celu ochrony
|
||||
|
|
@ -292,8 +300,8 @@ do zdalnych dowiązań symbolicznych za pomocą polecenia:
|
|||
|
||||
fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
||||
|
||||
4.3 Undeleting
|
||||
--------------
|
||||
4.3 Cofanie usuwania (Undeleting)
|
||||
---------------------------------
|
||||
|
||||
SnapRAID działa bardziej jak program do tworzenia kopii zapasowych niż system RAID
|
||||
i może być użyty do przywrócenia lub odzyskania usuniętych plików do ich poprzedniego
|
||||
|
|
@ -315,8 +323,8 @@ Lub aby odzyskać wszystkie usunięte pliki na wszystkich dyskach za pomocą:
|
|||
|
||||
snapraid fix -m
|
||||
|
||||
4.4 Recovering
|
||||
--------------
|
||||
4.4 Odzyskiwanie (Recovering)
|
||||
-----------------------------
|
||||
|
||||
Najgorsze się wydarzyło i straciłeś jeden lub więcej dysków!
|
||||
|
||||
|
|
@ -368,7 +376,7 @@ Teraz odzyskałeś wszystko, co jest możliwe do odzyskania. Jeśli niektóre pl
|
|||
są częściowo lub całkowicie nie do odzyskania, zostaną one przemianowane
|
||||
poprzez dodanie rozszerzenia `.unrecoverable`.
|
||||
|
||||
Szczegółową listę wszystkich nie do odzyskania bloków znajdziesz w pliku fix.log,
|
||||
Szczegółową listę wszystkich bloków nie do odzyskania znajdziesz w pliku fix.log,
|
||||
sprawdzając wszystkie linie zaczynające się od `unrecoverable:`.
|
||||
|
||||
Jeśli nie jesteś zadowolony z odzyskiwania, możesz spróbować ponownie
|
||||
|
|
@ -405,18 +413,18 @@ Uruchom polecenie `sync`, aby ponownie zsynchronizować macierz z nowym dyskiem.
|
|||
Jeśli wszystko zostanie odzyskane, to polecenie jest natychmiastowe.
|
||||
|
||||
|
||||
5 COMMANDS
|
||||
==========
|
||||
5 POLECENIA (COMMANDS)
|
||||
======================
|
||||
|
||||
SnapRAID udostępnia kilka prostych poleceń, które pozwalają na:
|
||||
|
||||
* Wyświetlenie statusu macierzy -> `status`
|
||||
* Kontrolę dysków -> `smart`, `probe`, `up`, `down`
|
||||
* Wykonanie kopii zapasowej/migawki -> `sync`
|
||||
* Wyświetlenie stanu macierzy -> `status`
|
||||
* Kontrola dysków -> `smart`, `probe`, `up`, `down`
|
||||
* Utworzenie punktu kopii zapasowej/przywracania -> `sync`
|
||||
* Okresowe sprawdzanie danych -> `scrub`
|
||||
* Przywrócenie ostatniej kopii zapasowej/migawki -> `fix`.
|
||||
* Przywrócenie ostatniego punktu kopii zapasowej/przywracania -> `fix`.
|
||||
|
||||
Polecenia muszą być zapisane małymi literami.
|
||||
Polecenia muszą być wpisywane małymi literami.
|
||||
|
||||
5.1 status
|
||||
----------
|
||||
|
|
@ -551,9 +559,9 @@ podsumowanie zmian, pogrupowane według:
|
|||
i znacznika czasu.
|
||||
Jeśli podsekundowy znacznik czasu wynosi zero, pełna ścieżka
|
||||
musi być zgodna, aby plik został zidentyfikowany.
|
||||
W przeciwieństwie do plików 'moved' na tym samym dysku, pliki
|
||||
relokowane mają inny i-węzeł.
|
||||
restored - Pliki o innym i-węźle, ale pasującym katalogu,
|
||||
W przeciwieństwie do plików przeniesionych ('moved') na tym samym dysku, pliki
|
||||
relokowane mają inny inode.
|
||||
restored - Pliki o innym inode, ale pasującym katalogu,
|
||||
nazwie, rozmiarze i znaczniku czasu.
|
||||
Są to zazwyczaj pliki przywrócone po ich usunięciu.
|
||||
|
||||
|
|
@ -624,7 +632,7 @@ Aby sprawdzić tylko złe bloki, możesz użyć polecenia `scrub -p bad`.
|
|||
|
||||
Zaleca się uruchamianie `scrub` tylko na zsynchronizowanej macierzy, aby uniknąć
|
||||
zgłaszania błędów spowodowanych przez niezsynchronizowane dane. Błędy te są rozpoznawane
|
||||
jako nie będące cichymi błędami, a bloki nie są oznaczane jako złe,
|
||||
jako niebędące cichymi błędami, a bloki nie są oznaczane jako złe,
|
||||
ale takie błędy są zgłaszane w wyniku polecenia.
|
||||
|
||||
Plik `content` jest modyfikowany w celu zaktualizowania czasu ostatniego sprawdzenia
|
||||
|
|
@ -635,15 +643,14 @@ Pliki w macierzy NIE są modyfikowane.
|
|||
5.9 fix
|
||||
-------
|
||||
|
||||
Naprawia wszystkie pliki i dane parzystości.
|
||||
Naprawia wszystkie pliki oraz dane parzystości.
|
||||
|
||||
Wszystkie pliki i dane parzystości są porównywane ze stanem migawki
|
||||
zapisanym w ostatniej `sync`.
|
||||
Jeśli zostanie znaleziona różnica, jest ona przywracana do zapisanego stanu migawki.
|
||||
Wszystkie pliki i dane parzystości są porównywane ze stanem zapisanym podczas
|
||||
ostatniej operacji `sync`. W przypadku znalezienia różnicy, następuje przywrócenie stanu zapisanego.
|
||||
|
||||
OSTRZEŻENIE! Polecenie `fix` nie rozróżnia błędów od
|
||||
celowych modyfikacji. Bezwarunkowo przywraca stan pliku
|
||||
do ostatniej `sync`.
|
||||
UWAGA!
|
||||
Polecenie `fix` nie odróżnia błędów od celowych modyfikacji.
|
||||
Bezwzględnie przywraca stan plików do momentu ostatniej operacji `sync`.
|
||||
|
||||
Jeśli nie określono żadnej innej opcji, przetwarzana jest cała macierz.
|
||||
Użyj opcji filtra, aby wybrać podzbiór plików lub dysków do operacji.
|
||||
|
|
@ -797,8 +804,8 @@ Pamiętaj, że takie pliki nie będą chronione przez parzystość podczas proce
|
|||
realokacji.
|
||||
|
||||
|
||||
6 OPTIONS
|
||||
=========
|
||||
6 OPCJE (OPTIONS)
|
||||
=================
|
||||
|
||||
SnapRAID udostępnia następujące opcje:
|
||||
|
||||
|
|
@ -910,9 +917,9 @@ SnapRAID udostępnia następujące opcje:
|
|||
liczba bajtów na sekundę. Możesz określić mnożnik,
|
||||
taki jak K, M lub G (np. --bw-limit 1G).
|
||||
|
||||
-t, --tail ROZMIAR
|
||||
Ogranicza listę plików do tych, które nie używają więcej niż określony
|
||||
końcowy rozmiar dysków parzystości.
|
||||
-t, --tail SIZE
|
||||
Ogranicza listę plików do tych, które nie wykraczają poza określoną
|
||||
sekcję końcową (ogon) plików parzystości.
|
||||
Możesz użyć mnożników takich jak K, M, G lub T (np. --tail 1G).
|
||||
Opcja ta jest ważna tylko wtedy, gdy jest używana wraz z poleceniem
|
||||
`locate`.
|
||||
|
|
@ -1010,9 +1017,9 @@ SnapRAID udostępnia następujące opcje:
|
|||
zalecane, aby jej nie używać.
|
||||
NIE MASZ ochrony danych podczas operacji `sync`.
|
||||
|
||||
-W, --force-realloc-tail ROZMIAR
|
||||
-W, --force-realloc-tail SIZE
|
||||
Działa jak -R, --force-realloc, ale ogranicza się do określonej części
|
||||
końcowej (ostatnie ROZMIAR bajtów) każdego pliku parzystości.
|
||||
końcowej (ostatnie SIZE bajtów) każdego pliku parzystości.
|
||||
Wymusza realokację (przeniesienie) wszelkich fragmentów/bloków plików
|
||||
obecnie przechowywanych w tej sekcji końcowej, pozwalając na ich
|
||||
umieszczenie w dowolnym miejscu w pliku (plikach) parzystości, gdzie
|
||||
|
|
@ -1044,7 +1051,7 @@ SnapRAID udostępnia następujące opcje:
|
|||
zastępowane datą i czasem w formacie RRRRMMDD i
|
||||
GGMMSS. W plikach wsadowych Windows musisz podwoić
|
||||
znak `%`, np. result-%%D.log. Aby użyć `>>`, musisz
|
||||
ujęć nazwę w cudzysłów, np. `">>result.log"`.
|
||||
ująć nazwę w cudzysłów, np. `">>result.log"`.
|
||||
Aby wyprowadzić log do standardowego wyjścia lub standardowego błędu,
|
||||
możesz użyć odpowiednio `">&1"` i `">&2"`.
|
||||
Opisy tagów logu znajdziesz w pliku snapraid_log.txt lub na stronie podręcznika.
|
||||
|
|
@ -1098,8 +1105,8 @@ SnapRAID udostępnia następujące opcje:
|
|||
Wyświetla wersję programu.
|
||||
|
||||
|
||||
7 CONFIGURATION
|
||||
===============
|
||||
7 KONFIGURACJA (CONFIGURATION)
|
||||
==============================
|
||||
|
||||
SnapRAID wymaga pliku konfiguracyjnego, aby wiedzieć, gdzie znajduje się Twoja macierz
|
||||
dysków i gdzie przechowywać informacje o parzystości.
|
||||
|
|
@ -1222,14 +1229,40 @@ dysk rozruchowy.
|
|||
Należy zauważyć, że polecenia `up` i `down` nie mają wpływu na takie
|
||||
dyski, ponieważ oczekuje się, że będą one zawsze w ruchu.
|
||||
|
||||
7.7 nohidden
|
||||
7.7 snapshot
|
||||
------------
|
||||
|
||||
Włącza używanie migawek systemu plików dla poleceń `sync`, `scrub`,
|
||||
`check` oraz `fix`.
|
||||
|
||||
Po włączeniu, SnapRAID tworzy migawkę danych w trybie tylko do odczytu na
|
||||
początku operacji 'sync'. Zapewnia to spójny obraz plików z danego momentu,
|
||||
zapobiegając błędom wywołanym przez jednoczesne modyfikacje plików.
|
||||
|
||||
To znacznie usprawnia odzyskiwanie danych: jeśli plik zostanie usunięty z aktywnego systemu
|
||||
plików, pozostaje zachowany w migawce. Zapobiega to sytuacji, w której parzystość staje się "uszkodzona"
|
||||
dla tego bloku, zapewniając możliwość pomyślnego odzyskania danych,
|
||||
jeśli ulegnie awarii inny dysk.
|
||||
|
||||
Opcja ta dotyczy wyłącznie dysków z danymi sformatowanych w systemach plików
|
||||
Btrfs, Bcachefs lub ZFS w systemie Linux oraz NTFS w systemie Windows.
|
||||
Dyski parzystości lub dyski z danymi korzystające z innych systemów plików będą zawsze używać
|
||||
aktywnej wersji systemu plików.
|
||||
|
||||
Tworzenie i usuwanie migawek wymaga uprawnień administratora.
|
||||
Upewnij się, że SnapRAID jest uruchamiany z wymaganymi uprawnieniami (np. sudo), gdy
|
||||
opcja ta jest włączona.
|
||||
|
||||
Szczegółowe wyjaśnienie cyklu życia migawek znajduje się w sekcji SNAPSHOTS.
|
||||
|
||||
7.8 nohidden
|
||||
------------
|
||||
|
||||
Wyklucza wszystkie ukryte pliki i katalogi.
|
||||
W systemie Unix ukryte pliki to te zaczynające się od `.`.
|
||||
W systemie Windows są to te z atrybutem ukrycia.
|
||||
|
||||
7.8 exclude/include PATTERN
|
||||
7.9 exclude/include PATTERN
|
||||
---------------------------
|
||||
|
||||
Definiuje wzorce plików lub katalogów do wykluczenia lub włączenia
|
||||
|
|
@ -1246,8 +1279,8 @@ wzorców.
|
|||
|
||||
Ta opcja może być używana wielokrotnie.
|
||||
|
||||
7.9 blocksize SIZE_IN_KIBIBYTES
|
||||
-------------------------------
|
||||
7.10 blocksize SIZE_IN_KIBIBYTES
|
||||
--------------------------------
|
||||
|
||||
Definiuje podstawowy rozmiar bloku w kibibajtach dla parzystości.
|
||||
Jeden kibibajt to 1024 bajty.
|
||||
|
|
@ -1276,7 +1309,7 @@ zmarnujesz 12,8 GB parzystości, co może skutkować
|
|||
|
||||
Możesz sprawdzić ilość zmarnowanego miejsca na każdym dysku za pomocą `status`.
|
||||
Jest to ilość miejsca, którą musisz pozostawić wolną na dyskach danych
|
||||
lub użyć dla plików nie włączonych do macierzy.
|
||||
lub użyć dla plików niewłączonych do macierzy.
|
||||
Jeśli ta wartość jest ujemna, oznacza to, że jesteś blisko wypełnienia
|
||||
parzystości i reprezentuje to przestrzeń, którą nadal możesz zmarnować.
|
||||
|
||||
|
|
@ -1294,7 +1327,7 @@ Daje to około 1,5% dodatkowego miejsca, około 60 GB dla
|
|||
dysku 4 TB, co pozwala na około 460 000 plików na każdym dysku danych bez
|
||||
marnowania miejsca.
|
||||
|
||||
7.10 hashsize SIZE_IN_BYTES
|
||||
7.11 hashsize SIZE_IN_BYTES
|
||||
---------------------------
|
||||
|
||||
Definiuje rozmiar hasza w bajtach dla zapisanych bloków.
|
||||
|
|
@ -1332,7 +1365,7 @@ Przełączając się zarówno na rozmiar hasza 8, jak i rozmiar bloku 512, otrzy
|
|||
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0,51 GiB
|
||||
|
||||
7.11 autosave SIZE_IN_GIGABYTES
|
||||
7.12 autosave SIZE_IN_GIGABYTES
|
||||
-------------------------------
|
||||
|
||||
Automatycznie zapisuje stan podczas synchronizacji lub sprawdzania po przetworzeniu
|
||||
|
|
@ -1340,14 +1373,14 @@ określonej ilości GB.
|
|||
Ta opcja jest przydatna, aby uniknąć ponownego uruchamiania długich poleceń `sync`
|
||||
od zera, jeśli zostaną przerwane przez awarię maszyny lub inne zdarzenie.
|
||||
|
||||
7.12 temp_limit TEMPERATURE_CELSIUS
|
||||
7.13 temp_limit TEMPERATURE_CELSIUS
|
||||
-----------------------------------
|
||||
|
||||
Ustawia maksymalną dozwoloną temperaturę dysku w stopniach Celsjusza. Po określeniu,
|
||||
SnapRAID okresowo sprawdza temperaturę wszystkich dysków za pomocą
|
||||
narzędzia smartctl. Aktualne temperatury dysków są wyświetlane podczas
|
||||
działania SnapRAID. Jeśli którykolwiek dysk przekroczy ten limit, wszystkie operacje
|
||||
zostają zatrzymane, a dyski są zatrzymywane (przechodzą w stan gotowości) na czas
|
||||
zostają zatrzymane, a dyski są wyłączane (przechodzą w stan czuwania / uśpienia) na czas
|
||||
zdefiniowany przez opcję `temp_sleep`. Po okresie uśpienia, operacje
|
||||
są wznawiane, potencjalnie ponownie zatrzymując się, jeśli limit temperatury
|
||||
zostanie ponownie osiągnięty.
|
||||
|
|
@ -1355,7 +1388,7 @@ zostanie ponownie osiągnięty.
|
|||
Podczas działania SnapRAID analizuje również krzywą nagrzewania każdego
|
||||
dysku i szacuje długoterminową stałą temperaturę, którą mają
|
||||
osiągnąć, jeśli aktywność będzie kontynuowana. Oszacowanie jest wykonywane tylko po
|
||||
czterokrotnym wzroście temperatury dysku, co zapewnia, że
|
||||
czterokrotnym zarejestrowaniu wzrostu temperatury dysku, co zapewnia, że
|
||||
dostępnych jest wystarczająco dużo punktów danych do ustalenia wiarygodnego trendu.
|
||||
Ta przewidywana stała temperatura jest pokazywana w nawiasach obok
|
||||
aktualnej wartości i pomaga ocenić, czy chłodzenie systemu jest
|
||||
|
|
@ -1371,13 +1404,13 @@ wykorzystuje najniższą temperaturę dysku zmierzoną na początku uruchomienia
|
|||
Normalnie SnapRAID pokazuje tylko temperaturę najgorętszego dysku.
|
||||
Aby wyświetlić temperaturę wszystkich dysków, użyj opcji -A lub --stats.
|
||||
|
||||
7.13 temp_sleep TIME_IN_MINUTES
|
||||
7.14 temp_sleep TIME_IN_MINUTES
|
||||
-------------------------------
|
||||
|
||||
Ustawia czas gotowości, w minutach, po osiągnięciu limitu temperatury.
|
||||
Ustawia czas wstrzymania (czuwania), w minutach, po osiągnięciu limitu temperatury.
|
||||
W tym okresie dyski pozostają zatrzymane. Domyślnie jest to 5 minut.
|
||||
|
||||
7.14 pool DIR
|
||||
7.15 pool DIR
|
||||
-------------
|
||||
|
||||
Definiuje katalog puli, w którym tworzony jest wirtualny widok macierzy
|
||||
|
|
@ -1385,7 +1418,7 @@ dysków za pomocą polecenia `pool`.
|
|||
|
||||
Katalog musi już istnieć.
|
||||
|
||||
7.15 share UNC_DIR
|
||||
7.16 share UNC_DIR
|
||||
------------------
|
||||
|
||||
Definiuje ścieżkę UNC Windows wymaganą do zdalnego dostępu do dysków.
|
||||
|
|
@ -1401,7 +1434,7 @@ katalog i nazwę pliku.
|
|||
|
||||
Ta opcja jest wymagana tylko dla systemu Windows.
|
||||
|
||||
7.16 smartctl DISK/PARITY OPTIONS...
|
||||
7.17 smartctl DISK/PARITY OPTIONS...
|
||||
------------------------------------
|
||||
|
||||
Definiuje niestandardowe opcje smartctl do uzyskania atrybutów SMART dla
|
||||
|
|
@ -1417,6 +1450,9 @@ W określonych OPCJACH ciąg `%s` jest zastępowany
|
|||
nazwą urządzenia. W przypadku kontrolerów RAID, urządzenie jest
|
||||
prawdopodobnie stałe i może nie być konieczne użycie `%s`.
|
||||
|
||||
Możesz również określić niestandardowy ciąg opcji informacyjnych za pomocą
|
||||
znacznika `[info: ...]`, aby zastąpić domyślną opcję `-a`.
|
||||
|
||||
Zapoznaj się z dokumentacją smartmontools, aby uzyskać możliwe opcje:
|
||||
|
||||
https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
|
|
@ -1424,9 +1460,10 @@ Zapoznaj się z dokumentacją smartmontools, aby uzyskać możliwe opcje:
|
|||
|
||||
Na przykład:
|
||||
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl parity -d sat %s
|
||||
|
||||
7.17 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
7.18 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
-------------------------------------------
|
||||
|
||||
Ignoruje określony atrybut SMART podczas obliczania prawdopodobieństwa
|
||||
|
|
@ -1438,16 +1475,21 @@ PARITY to jedna z nazw parzystości: `parity`, `2-parity`, `3-parity`,
|
|||
`4-parity`, `5-parity`, `6-parity` lub `z-parity`.
|
||||
Specjalna wartość * może być użyta do zignorowania atrybutu na wszystkich dyskach.
|
||||
|
||||
Na przykład, aby zignorować atrybut `Current Pending Sector Count` na
|
||||
wszystkich dyskach:
|
||||
Można określić wiele atrybutów oddzielonych spacjami.
|
||||
Każdy atrybut można określić jako liczbę od 1 do 255 lub jako nazwę
|
||||
niewrażliwą na wielkość liter (np. `Current_Pending_Sector`).
|
||||
|
||||
smartignore * 197
|
||||
Na przykład, aby zignorować atrybuty `Current Pending Sector Count` i
|
||||
`Reallocated Sectors Count` na wszystkich dyskach za pomocą ich numeru lub nazwy:
|
||||
|
||||
Aby zignorować go tylko na pierwszym dysku parzystości:
|
||||
smartignore * 197 5
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
smartignore parity 197
|
||||
Aby zignorować je tylko na pierwszym dysku parzystości:
|
||||
|
||||
7.18 Examples
|
||||
smartignore parity 197 5
|
||||
|
||||
7.19 Examples
|
||||
-------------
|
||||
|
||||
Przykład typowej konfiguracji dla systemu Unix:
|
||||
|
|
@ -1460,7 +1502,7 @@ Przykład typowej konfiguracji dla systemu Unix:
|
|||
data d3 /mnt/disk3/
|
||||
exclude /lost+found/
|
||||
exclude /tmp/
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/sg0
|
||||
smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1476,14 +1518,134 @@ Przykład typowej konfiguracji dla systemu Windows:
|
|||
exclude Thumbs.db
|
||||
exclude \$RECYCLE.BIN
|
||||
exclude \System Volume Information
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
|
||||
8 PATTERN
|
||||
=========
|
||||
8 MIGAWKI (SNAPSHOTS)
|
||||
=====================
|
||||
|
||||
Jeśli opcja snapshot jest włączona w konfiguracji, SnapRAID
|
||||
wykorzystuje funkcjonalność migawek systemu plików w celu zapewnienia operacji atomowych
|
||||
i spójnych.
|
||||
|
||||
Zarządzanie migawkami jest całkowicie automatyczne i przejrzyste.
|
||||
Możesz nadal używać SnapRAID dokładnie tak jak dotychczas, z dodatkową
|
||||
ochroną zapewnianą przez migawki, która jest realizowana w całości w
|
||||
tle.
|
||||
|
||||
Zapewnia to dwie główne korzyści:
|
||||
|
||||
Spójność - Pliki zmodyfikowane w aktywnym systemie plików podczas długotrwałej
|
||||
operacji sync lub scrub nie spowodują niezgodności parzystości ani przerwania
|
||||
operacji, ponieważ SnapRAID widzi zamrożony obraz z danego momentu.
|
||||
Odzyskiwanie - Jeśli plik zostanie zaktualizowany lub usunięty z aktywnego systemu plików,
|
||||
pozostaje zachowany w migawce. Jeśli awaria dysku nastąpi
|
||||
przed uruchomieniem kolejnej operacji sync, SnapRAID użyje danych zachowanych
|
||||
w migawce do odbudowania uszkodzonego dysku.
|
||||
|
||||
W przypadku awarii dysku podczas aktywnego procesu sync,
|
||||
SnapRAID jest również w stanie automatycznie czytać zarówno z migawki
|
||||
poprzedniego obliczenia parzystości, jak i z bieżącej.
|
||||
Maksymalizuje to prawdopodobieństwo pełnego odzyskania danych poprzez
|
||||
zapewnienie dostępu do dokładnych bloków danych wymaganych do rozwiązania
|
||||
równań parzystości, nawet jeśli bloki te zostały zmodyfikowane
|
||||
lub usunięte pomiędzy operacjami sync.
|
||||
|
||||
Bez migawek, zaktualizowany lub usunięty plik na sprawnym dysku
|
||||
skutkuje brakiem bloków danych, które mogą być wymagane do
|
||||
naprawy innych uszkodzonych dysków.
|
||||
|
||||
Migawki są tworzone tylko dla dysków z danymi i tylko wtedy, gdy bazowy
|
||||
system plików obsługuje tę funkcjonalność. Dyski parzystości zawsze używają
|
||||
aktywnego systemu plików.
|
||||
|
||||
Obecnie jest to obsługiwane w systemach Btrfs, Bcachefs i ZFS w systemie Linux
|
||||
oraz NTFS w systemie Windows.
|
||||
|
||||
Można mieszać dyski z danymi o różnych systemach plików. Tylko te, które
|
||||
obsługują migawki, będą z nich korzystać, podczas gdy inne dyski będą nadal
|
||||
działać bezpośrednio na aktywnym systemie plików.
|
||||
|
||||
Tworzenie i usuwanie migawek wymaga uprawnień administratora.
|
||||
Upewnij się, że SnapRAID jest uruchamiany z wymaganymi uprawnieniami (np. sudo),
|
||||
gdy migawki są włączone.
|
||||
|
||||
8.1 Zachowanie poleceń przy użyciu migawek
|
||||
------------------------------------------
|
||||
|
||||
Polecenia `sync` oraz `scrub` działają wyłącznie na migawkach,
|
||||
aby zapewnić, że wszystkie operacje na danych są wykonywane na spójnym,
|
||||
zamrożonym stanie. Poprzez wykorzystanie tych migawek, SnapRAID zapobiega niezgodnościom
|
||||
parzystości, które w przeciwnym razie zostałyby wywołane przez jednoczesne modyfikacje plików w aktywnym systemie plików.
|
||||
Podczas operacji `sync` polecenie używa nowej migawki utworzonej na
|
||||
początku procesu, aby uchwycić bieżący stan do obliczenia parzystości.
|
||||
W przeciwieństwie do tego, polecenie `scrub` wykorzystuje ostatnią migawkę, tę
|
||||
utworzoną podczas najnowszej synchronizacji, aby utrzymać wiarygodny punkt odniesienia
|
||||
odpowiadający istniejącej parzystości.
|
||||
|
||||
W przypadku poleceń `check` oraz `fix`, użycie ostatniej migawki
|
||||
zależy od tego, czy konkretne dyski są wskazywane za pomocą opcji
|
||||
-d, --filter-disk.
|
||||
|
||||
Dysk jawnie wybrany za pomocą opcji -d ("cel" operacji)
|
||||
zawsze używa aktywnego systemu plików. Dla `fix` pozwala to na przywrócenie
|
||||
danych na aktywny dysk zamienny. Dla `check` pozwala to na symulację
|
||||
operacji `fix` w tych samych warunkach.
|
||||
|
||||
Wszystkie inne dyski z danymi (dyski "referencyjne") będą dostępne za pośrednictwem
|
||||
swoich migawek. Zapewnia to, że nawet jeśli modyfikujesz pliki
|
||||
na sprawnych dyskach podczas trwania odzyskiwania danych, SnapRAID
|
||||
posiada stabilny, zamrożony punkt odniesienia do rozwiązania równań parzystości.
|
||||
|
||||
Jeśli nie podano opcji -d, SnapRAID zakłada, że operacja dotyczy
|
||||
całej macierzy. W takim przypadku `check` oraz `fix` będą używać wyłącznie
|
||||
aktywnych systemów plików.
|
||||
|
||||
Wszystkie inne polecenia działają wyłącznie na aktywnym systemie plików.
|
||||
|
||||
|
||||
9 CYKL żYCIA MIGAWEK (SNAPSHOTS LIFECYCLE)
|
||||
==========================================
|
||||
|
||||
SnapRAID zarządza dwoma określonymi migawkami, `stable` (stabilną) oraz `pending` (oczekującą),
|
||||
w ukrytym katalogu w katalogu głównym każdego podwolumenu danych.
|
||||
W systemach Btrfs, Bcachefs i NTFS używany jest katalog `.snapraid/`,
|
||||
w systemie ZFS standardowy `.zfs/snapshot/`.
|
||||
|
||||
Migawka `stable` reprezentuje stan ostatniej
|
||||
pomyślnie zakończonej operacji `sync`, zawierając dokładne dane użyte do
|
||||
obliczenia bieżącej parzystości. Służy ona jako główne źródło danych
|
||||
dla poleceń `scrub`, `check` i `fix`.
|
||||
|
||||
Migawka `pending` to tymczasowy obraz tworzony na początku
|
||||
operacji `sync` w celu zapewnienia zamrożonego stanu do obliczenia parzystości.
|
||||
Po pomyślnym zakończeniu operacji poprzednia migawka `stable`
|
||||
jest usuwana, a migawka `pending` zostaje podniesiona do rangi
|
||||
nowej stabilnej referencji.
|
||||
|
||||
Jeśli operacja `sync` zostanie przerwana, migawka `pending` zostaje zachowana.
|
||||
Kolejne polecenia `scrub`, `check` i `fix` będą używać tej oczekującej migawki,
|
||||
ponieważ odpowiada ona stanowi systemu plików zapisanemu w pliku .content,
|
||||
nawet jeśli parzystość jest zsynchronizowana tylko częściowo.
|
||||
|
||||
W przypadku przerwania operacji `sync`, polecenia `check` i `fix`
|
||||
odczytują dane również z migawki `stable`, aby pobrać bloki danych
|
||||
z plików, które zostały zaktualizowane lub usunięte podczas synchronizacji.
|
||||
Jest to możliwe, ponieważ plik .content zachowuje metadane dla
|
||||
wszystkich zmodyfikowanych lub usuniętych plików przez cały proces sync.
|
||||
Te informacje historyczne są czyszczone dopiero po pomyślnym zakończeniu operacji sync
|
||||
i zapisaniu ostatecznej wersji pliku .content.
|
||||
|
||||
Jeśli operacja `sync` zostanie zrestartowana po przerwaniu, istniejąca
|
||||
oczekująca (pending) migawka jest usuwana, a tworzona jest nowa, aby
|
||||
uchwycić bieżący stan aktywnego systemu plików.
|
||||
|
||||
|
||||
10 WZORCE (PATTERN)
|
||||
===================
|
||||
|
||||
Wzorce zapewniają elastyczny sposób filtrowania plików do uwzględnienia lub
|
||||
wykluczenia. Używając znaków globbingowych, można zdefiniować reguły, które
|
||||
|
|
@ -1550,7 +1712,7 @@ specjalne katalogi Windows są traktowane jako pliki, co oznacza, że aby je
|
|||
wykluczyć, musisz użyć reguły pliku, a nie katalogu.
|
||||
|
||||
Jeśli nazwa pliku zawiera znak `*`, `?`, `[`,
|
||||
lub `]`, musisz go uciec, aby uniknąć interpretacji jako
|
||||
lub `]`, musisz go zamaskować (poprzedzić znakiem ucieczki), aby uniknąć interpretacji jako
|
||||
znaku globbing. W systemie Unix znakiem ucieczki jest `\`; w systemie Windows jest to `^`.
|
||||
Gdy wzorzec znajduje się w wierszu poleceń, musisz podwoić znak ucieczki,
|
||||
aby uniknąć interpretacji przez powłokę poleceń.
|
||||
|
|
@ -1601,8 +1763,8 @@ W systemie Unix, używając znaków globbing w wierszu poleceń, musisz
|
|||
je cytować, aby zapobiec ich rozszerzeniu przez powłokę.
|
||||
|
||||
|
||||
9 IGNORE FILE
|
||||
=============
|
||||
11 PLIK IGNOROWANIA (IGNORE FILE)
|
||||
=================================
|
||||
|
||||
Oprócz reguł globalnych w pliku konfiguracyjnym, możesz umieścić pliki
|
||||
`.snapraidignore` w dowolnym katalogu w macierzy, aby zdefiniować
|
||||
|
|
@ -1646,20 +1808,23 @@ Na przykład, jeśli masz `.snapraidignore` w `/mnt/disk1/projects/`:
|
|||
*.tmp
|
||||
|
||||
|
||||
10 CONTENT
|
||||
==========
|
||||
12 ZAWARTOść (CONTENT)
|
||||
======================
|
||||
|
||||
SnapRAID przechowuje listę i sumy kontrolne Twoich plików w pliku zawartości.
|
||||
|
||||
Jest to plik binarny, który zawiera listę wszystkich plików obecnych w Twojej macierzy dysków,
|
||||
wraz ze wszystkimi sumami kontrolnymi w celu weryfikacji ich integralności.
|
||||
|
||||
Ten plik jest odczytywany i zapisywany przez polecenia `sync` i `scrub`
|
||||
oraz odczytywany przez polecenia `fix`, `check` i `status`.
|
||||
Plik zawartości jest odczytywany i zapisywany przez polecenia `sync`,
|
||||
`scrub`, `touch` i `rehash`. Jest odczytywany przez polecenia `status`,
|
||||
`diff`, `check`, `fix`, `list`, `dup`, `locate` i `pool`, oraz jest
|
||||
całkowicie ignorowany przez polecenia `smart`, `probe`, `up`, `down`
|
||||
i `devices`.
|
||||
|
||||
|
||||
11 PARITY
|
||||
=========
|
||||
13 PARZYSTOść (PARITY)
|
||||
======================
|
||||
|
||||
SnapRAID przechowuje informacje o parzystości Twojej macierzy w plikach
|
||||
parzystości.
|
||||
|
|
@ -1671,8 +1836,8 @@ Pliki te są odczytywane i zapisywane przez polecenia `sync` i `fix`
|
|||
oraz tylko odczytywane przez polecenia `scrub` i `check`.
|
||||
|
||||
|
||||
12 ENCODING
|
||||
===========
|
||||
14 KODOWANIE (ENCODING)
|
||||
=======================
|
||||
|
||||
SnapRAID w systemie Unix ignoruje wszelkie kodowanie. Odczytuje i przechowuje
|
||||
nazwy plików z tym samym kodowaniem używanym przez system plików.
|
||||
|
|
@ -1688,13 +1853,30 @@ przekierujesz wyjście konsoli do pliku, wynikowy plik jest zawsze
|
|||
w formacie UTF-8.
|
||||
|
||||
|
||||
13 COPYRIGHT
|
||||
============
|
||||
15 KOD WYJśCIA (EXIT CODE)
|
||||
==========================
|
||||
|
||||
Ten plik jest chroniony prawem autorskim (C) 2025 Andrea Mazzoleni
|
||||
SnapRAID kończy działanie z następującymi kodami błędów:
|
||||
|
||||
0 - Wszystko w porządku.
|
||||
1 - Polecenie napotkało błędy.
|
||||
2 - Polecenie `diff` wykazało, że wszystko jest w porządku, ale wymagane jest `sync`.
|
||||
|
||||
|
||||
14 SEE ALSO
|
||||
===========
|
||||
16 TłUMACZENIE (TRANSLATION)
|
||||
============================
|
||||
|
||||
snapraid_log(1), snapraidd(1)
|
||||
Ten dokument jest automatycznym tłumaczeniem angielskiej instrukcji.
|
||||
Wersję oficjalną stanowi oryginalny podręcznik w języku angielskim.
|
||||
|
||||
|
||||
17 PRAWA AUTORSKIE (COPYRIGHT)
|
||||
==============================
|
||||
|
||||
Ten plik jest chroniony prawem autorskim (C) 2026 Andrea Mazzoleni
|
||||
|
||||
|
||||
18 ZOBACZ RóWNIEż (SEE ALSO)
|
||||
============================
|
||||
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
.TH "SnapRAID Backup para Arrays de Disco" 1
|
||||
.SH NAME
|
||||
snapraid \- SnapRAID Backup para Arrays de Disco
|
||||
.SH SINOPSE
|
||||
.SH SINOPSE (SYNOPSIS)
|
||||
snapraid [\-c, \-\-conf CONFIG]
|
||||
.PD 0
|
||||
.PP
|
||||
|
|
@ -77,7 +77,7 @@ snapraid [\-c, \-\-conf CONFIG]
|
|||
snapraid [\-V, \-\-version] [\-H, \-\-help] [\-C, \-\-gen\-conf CONTENT]
|
||||
.PD 0
|
||||
.PD
|
||||
.SH DESCRIçãO
|
||||
.SH DESCRIçãO (DESCRIPTION)
|
||||
SnapRAID é um programa de backup projetado para arrays de disco,
|
||||
armazenando informações de paridade para recuperação de dados no
|
||||
caso de até seis falhas de disco.
|
||||
|
|
@ -117,22 +117,34 @@ https://www.snapraid.it/
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH LIMITAçõES
|
||||
SnapRAID é um híbrido entre um programa RAID e um programa de backup,
|
||||
visando combinar os melhores benefícios de ambos. No entanto, ele tem
|
||||
algumas limitações que você deve considerar antes de usá\-lo.
|
||||
.SH LIMITAçõES (LIMITATIONS)
|
||||
O SnapRAID é um híbrido entre um RAID e um programa de backup, com o objetivo de combinar
|
||||
os melhores benefícios de ambos. No entanto, possui algumas limitações que deve
|
||||
considerar antes de o utilizar.
|
||||
.PP
|
||||
A principal limitação é que, se um disco falhar e você não tiver
|
||||
sincronizado recentemente, talvez não consiga recuperar totalmente.
|
||||
Mais especificamente, você pode não conseguir recuperar até o tamanho dos
|
||||
arquivos alterados ou excluídos desde a última operação de sincronização.
|
||||
Isso ocorre mesmo que os arquivos alterados ou excluídos não estejam no
|
||||
disco com falha. É por isso que o SnapRAID é mais adequado para
|
||||
dados que raramente mudam.
|
||||
A principal limitação é que, se um disco falhar, apenas poderá recuperar dados até ao
|
||||
estado da última operação de sincronização (\`sync\`). Quaisquer dados adicionados ou modificações feitas
|
||||
desde a última sincronização que estejam localizados no disco com falha serão perdidos.
|
||||
.PP
|
||||
Por outro lado, arquivos recém\-adicionados não impedem a recuperação de
|
||||
arquivos já existentes. Você perderá apenas os arquivos adicionados
|
||||
recentemente se estiverem no disco com falha.
|
||||
Consequentemente, o SnapRAID é adequado principalmente para dados que raramente mudam.
|
||||
.PP
|
||||
Para dados que já existiam na última sincronização, a fiabilidade da recuperação depende
|
||||
de a opção \`snapshot\` ser ou não utilizada:
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Com suporte a instantâneos (disponível em Btrfs, ZFS, Bcachefs e NTFS),
|
||||
o SnapRAID pode manter automaticamente uma referência congelada dos seus discos de dados.
|
||||
Isso garante que, mesmo que modifique ou exclua arquivos no seu sistema de arquivos ativo
|
||||
durante ou após uma sincronização, o processo de recuperação permanece consistente e confiável.
|
||||
.PD
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Sem suporte a instantâneos, excluir ou alterar arquivos após um \`sync\`
|
||||
pode impedir a recuperação total de outros discos com falha. Isso ocorre
|
||||
porque a paridade já não corresponde aos arquivos modificados, mesmo que
|
||||
esses arquivos não estejam no disco com falha. Por outro lado, arquivos adicionados recentemente
|
||||
não impedem a recuperação de arquivos já existentes.
|
||||
.PD
|
||||
.PP
|
||||
Outras limitações do SnapRAID são:
|
||||
.PD 0
|
||||
|
|
@ -153,7 +165,7 @@ de todo o array de discos.
|
|||
Apenas nomes de arquivos, carimbos de data/hora, symlinks e hardlinks
|
||||
são salvos. Permissões, propriedade e atributos estendidos não são salvos.
|
||||
.PD
|
||||
.SH PRIMEIROS PASSOS
|
||||
.SH PRIMEIROS PASSOS (GETTING STARTED)
|
||||
Para usar o SnapRAID, você precisa primeiro selecionar um disco em seu array
|
||||
de discos para dedicar às informações de \`parity\` (paridade). Com um
|
||||
disco para paridade, você poderá recuperar de uma única falha de disco,
|
||||
|
|
@ -300,7 +312,7 @@ Quando este comando for concluído, seus dados estarão SEGUROS.
|
|||
.PP
|
||||
Agora você pode começar a usar seu array como quiser e periodicamente
|
||||
atualizar as informações de paridade executando o comando \`sync\`.
|
||||
.SS Scrubbing
|
||||
.SS Scrubbing (Scrubbing)
|
||||
Para verificar periodicamente os dados e a paridade em busca de erros,
|
||||
você pode executar o comando \`scrub\`.
|
||||
.PP
|
||||
|
|
@ -358,10 +370,10 @@ snapraid \-p bad scrub
|
|||
Executar \`scrub\` em um array não sincronizado pode relatar erros causados por
|
||||
arquivos removidos ou modificados. Esses erros são relatados na saída de \`scrub\`,
|
||||
mas os blocos relacionados não são marcados como ruins.
|
||||
.SS Pooling
|
||||
.SS Pooling (Pooling)
|
||||
Nota: O recurso de pooling descrito abaixo foi substituído pela ferramenta
|
||||
mergerfs, que agora é a opção recomendada para usuários Linux na comunidade
|
||||
SnapRAID. Mergefs oferece uma maneira mais flexível e eficiente de agrupar
|
||||
SnapRAID. Mergerfs oferece uma maneira mais flexível e eficiente de agrupar
|
||||
várias unidades em um único ponto de montagem unificado, permitindo acesso
|
||||
perfeito a arquivos em todo o seu array sem depender de links simbólicos.
|
||||
Ele se integra bem ao SnapRAID para proteção de paridade e é comumente usado
|
||||
|
|
@ -545,7 +557,7 @@ snapraid fix \-m
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Recuperando
|
||||
.SS Recuperação (Recovering)
|
||||
O pior aconteceu e você perdeu um ou mais discos!
|
||||
.PP
|
||||
NÃO ENTRE EM PÂNICO! Você será capaz de recuperá\-los!
|
||||
|
|
@ -614,7 +626,7 @@ no arquivo fix.log, verificando todas as linhas que começam com \`unrecoverable
|
|||
Se você não estiver satisfeito com a recuperação, pode tentar novamente
|
||||
quantas vezes quiser.
|
||||
.PP
|
||||
Por exemplo, se você removeu arquivos do array após a última
|
||||
Por exemplo, se você removeu arquivos do array após o último
|
||||
\`sync\`, isso pode resultar em alguns arquivos não sendo recuperados.
|
||||
Neste caso, você pode tentar novamente o \`fix\` usando a opção \-i, \-\-import,
|
||||
especificando onde esses arquivos estão agora para incluí\-los novamente
|
||||
|
|
@ -650,19 +662,19 @@ snapraid sync
|
|||
.RE
|
||||
.PP
|
||||
Se tudo for recuperado, este comando é imediato.
|
||||
.SH COMANDOS
|
||||
SnapRAID fornece alguns comandos simples que permitem a você:
|
||||
.SH COMANDOS (COMMANDS)
|
||||
O SnapRAID fornece alguns comandos simples que lhe permitem:
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Imprimir o status do array \-> \`status\`
|
||||
Imprimir o estado do array \-> \`status\`
|
||||
.IP \(bu
|
||||
Controlar os discos \-> \`smart\`, \`probe\`, \`up\`, \`down\`
|
||||
.IP \(bu
|
||||
Fazer um backup/snapshot \-> \`sync\`
|
||||
Criar um ponto de backup/recuperação \-> \`sync\`
|
||||
.IP \(bu
|
||||
Verificar periodicamente os dados \-> \`scrub\`
|
||||
.IP \(bu
|
||||
Restaurar o último backup/snapshot \-> \`fix\`.
|
||||
Restaurar o último ponto de backup/recuperação \-> \`fix\`.
|
||||
.PD
|
||||
.PP
|
||||
Os comandos devem ser escritos em letras minúsculas.
|
||||
|
|
@ -816,7 +828,7 @@ carimbo de data/hora.
|
|||
Se o carimbo de data/hora de subsegundos for zero, o caminho
|
||||
completo deve corresponder para ser identificado.
|
||||
Ao contrário dos arquivos \'moved\' no mesmo disco, os arquivos
|
||||
realocados têm um inode diferente.
|
||||
relocados têm um inode diferente.
|
||||
.HP 4
|
||||
.I restored
|
||||
Arquivos com um inode diferente, mas com diretório,
|
||||
|
|
@ -825,7 +837,7 @@ Geralmente são arquivos restaurados após serem excluídos.
|
|||
.PD
|
||||
.RE
|
||||
.PP
|
||||
Se uma \`sync\` for necessária, o código de retorno do processo é 2,
|
||||
Se um \`sync\` for necessário, o código de retorno do processo é 2,
|
||||
em vez do padrão 0. O código de retorno 1 é usado para uma condição
|
||||
de erro genérica.
|
||||
.PP
|
||||
|
|
@ -901,13 +913,12 @@ Os arquivos no array NÃO são modificados.
|
|||
.SS fix
|
||||
Corrige todos os arquivos e os dados de paridade.
|
||||
.PP
|
||||
Todos os arquivos e dados de paridade são comparados com o estado de
|
||||
snapshot salvo na última \`sync\`.
|
||||
Se uma diferença for encontrada, ela é revertida para o snapshot armazenado.
|
||||
Todos os arquivos e dados de paridade são comparados com o estado salvo no
|
||||
último \`sync\`. Se for encontrada uma diferença, esta é revertida para o estado armazenado.
|
||||
.PP
|
||||
ATENÇÃO! O comando \`fix\` não diferencia entre erros e modificações
|
||||
intencionais. Ele reverte incondicionalmente o estado do arquivo
|
||||
para a última \`sync\`.
|
||||
AVISO!
|
||||
O comando \`fix\` não diferencia erros de modificações intencionais.
|
||||
Reverte incondicionalmente o estado do arquivo para o do último \`sync\`.
|
||||
.PP
|
||||
Se nenhuma outra opção for especificada, todo o array é processado.
|
||||
Use as opções de filtro para selecionar um subconjunto de arquivos ou
|
||||
|
|
@ -916,13 +927,13 @@ discos para operar.
|
|||
Para corrigir apenas os blocos marcados como ruins durante \`sync\` e \`scrub\`,
|
||||
use a opção \-e, \-\-filter\-error.
|
||||
Ao contrário de outras opções de filtro, esta aplica correções apenas a
|
||||
arquivos que não foram alterados desde a última \`sync\`.
|
||||
arquivos que não foram alterados desde o último \`sync\`.
|
||||
.PP
|
||||
O SnapRAID renomeia todos os arquivos que não podem ser corrigidos adicionando
|
||||
a extensão \`.unrecoverable\`.
|
||||
.PP
|
||||
Antes de corrigir, todo o array é escaneado para encontrar quaisquer
|
||||
arquivos movidos desde a última operação \`sync\`.
|
||||
arquivos movidos desde a última operação de \`sync\`.
|
||||
Esses arquivos são identificados por seu carimbo de data/hora, ignorando
|
||||
seu nome e diretório, e são usados no processo de recuperação, se
|
||||
necessário.
|
||||
|
|
@ -1038,7 +1049,7 @@ Se desejar realocar esses arquivos, você poderá usar a opção
|
|||
\-W, \-\-force\-realloc\-tail.
|
||||
Esteja ciente de que tais arquivos não estarão protegidos pela paridade durante
|
||||
o processo de realocação.
|
||||
.SH OPçõES
|
||||
.SH OPçõES (OPTIONS)
|
||||
SnapRAID fornece as seguintes opções:
|
||||
.TP
|
||||
.B \-c, \-\-conf CONFIG
|
||||
|
|
@ -1113,9 +1124,9 @@ esta opção pode acelerar significativamente o processo de verificação.
|
|||
Esta opção pode ser usada apenas com \`check\`.
|
||||
.TP
|
||||
.B \-h, \-\-pre\-hash
|
||||
Em \`sync\`, executa uma fase de hash preliminar de todos os novos dados
|
||||
Em \`sync\`, executa uma fase de hash prexcluir de todos os novos dados
|
||||
para verificação adicional antes do cálculo da paridade.
|
||||
Normalmente, em \`sync\`, nenhum hash preliminar é feito, e os novos
|
||||
Normalmente, em \`sync\`, nenhum hash prexcluir é feito, e os novos
|
||||
dados são hashados logo antes do cálculo da paridade, quando são lidos
|
||||
pela primeira vez.
|
||||
Este processo ocorre quando o sistema está sob
|
||||
|
|
@ -1152,7 +1163,7 @@ Aplica um limite de largura de banda global para todos os discos. A
|
|||
RATE é o número de bytes por segundo. Você pode especificar um
|
||||
multiplicador como K, M ou G (por exemplo, \-\-bw\-limit 1G).
|
||||
.TP
|
||||
.B \-t, \-\-tail TAMANHO
|
||||
.B \-t, \-\-tail SIZE
|
||||
Limita a listagem de arquivos àqueles que não usam mais do que o
|
||||
tamanho final especificado dos discos de paridade.
|
||||
Você pode usar multiplicadores como K, M, G ou T (ex: \-\-tail 1G).
|
||||
|
|
@ -1258,9 +1269,9 @@ ATENÇÃO! Esta opção é apenas para especialistas e é altamente
|
|||
recomendado não usá\-la.
|
||||
Você NÃO tem proteção de dados durante a operação \`sync\`.
|
||||
.TP
|
||||
.B \-W, \-\-force\-realloc\-tail TAMANHO
|
||||
.B \-W, \-\-force\-realloc\-tail SIZE
|
||||
Funciona como \-R, \-\-force\-realloc, mas limitado à parte final
|
||||
especificada (últimos TAMANHO bytes) de cada arquivo de paridade.
|
||||
especificada (últimos SIZE bytes) de cada arquivo de paridade.
|
||||
Força a realocação (movimentação) de quaisquer fragmentos/blocos de arquivos
|
||||
atualmente armazenados nessa seção final, permitindo que sejam colocados
|
||||
em qualquer lugar no(s) arquivo(s) de paridade onde houver espaço livre
|
||||
|
|
@ -1274,10 +1285,9 @@ Você pode usar multiplicadores como K, M, G ou T (ex:
|
|||
\-\-force\-realloc\-tail 1G).
|
||||
Você pode usar locate \-t, \-\-tail para saber antecipadamente os
|
||||
arquivos afetados.
|
||||
AVISO!
|
||||
Esta opção é apenas para especialistas e é altamente recomendado
|
||||
não utilizá\-la.
|
||||
Você NÃO terá proteção de datos durante a operação \`sync\` para os
|
||||
ATENÇÃO! Esta opção é apenas para especialistas e é altamente
|
||||
recomendado não usá\-la.
|
||||
Você NÃO tem proteção de dados durante a operação \`sync\` para os
|
||||
arquivos afetados.
|
||||
.TP
|
||||
.B \-l, \-\-log FILE
|
||||
|
|
@ -1346,7 +1356,7 @@ Imprime uma tela de ajuda curta.
|
|||
.TP
|
||||
.B \-V, \-\-version
|
||||
Imprime a versão do programa.
|
||||
.SH CONFIGURAçãO
|
||||
.SH CONFIGURAçãO (CONFIGURATION)
|
||||
SnapRAID requer um arquivo de configuração para saber onde seu array
|
||||
de discos está localizado e onde armazenar as informações de paridade.
|
||||
.PP
|
||||
|
|
@ -1450,12 +1460,36 @@ armazenado dos discos.
|
|||
Define o nome e o ponto de montagem de discos adicionais para
|
||||
monitorar com os comandos \`smart\` e \`probe\`.
|
||||
.PP
|
||||
Isso é útil para monitorar discos que não fazem parte da matriz,
|
||||
Isso é útil para monitorar discos que não fazem parte do array,
|
||||
mas que são necessários para o funcionamento do sistema, como o
|
||||
disco de inicialização.
|
||||
.PP
|
||||
Observe que tais discos não são afetados pelos comandos \`up\` e \`down\`
|
||||
porque se espera que estejam sempre girando.
|
||||
.SS snapshot
|
||||
Ativa o uso de instantâneos (snapshots) do sistema de arquivos para os comandos \`sync\`, \`scrub\`,
|
||||
\`check\` e \`fix\`.
|
||||
.PP
|
||||
Quando ativado, o SnapRAID cria um instantâneo de somente leitura dos seus dados no
|
||||
início de um \'sync\'. Isso garante uma visão consistente e num ponto específico no tempo dos seus
|
||||
arquivos, prevenindo erros causados por modificações concorrentes de arquivos.
|
||||
.PP
|
||||
Isso melhora significativamente a recuperação: se um arquivo for excluído do sistema de arquivos ativo,
|
||||
ele permanece preservado no instantâneo. Isso evita que a paridade fique \[dq]corrompida\[dq]
|
||||
para esse bloco, garantindo que ainda pode recuperar os dados com sucesso
|
||||
se outro disco falhar.
|
||||
.PP
|
||||
Esta opção aplica\-se exclusivamente a discos de dados formatados com os sistemas de
|
||||
arquivos Btrfs, Bcachefs ou ZFS em Linux e NTFS em Windows.
|
||||
Discos de paridade, ou discos de dados que utilizem outros sistemas de arquivos, usarão sempre
|
||||
a versão ativa do sistema de arquivos.
|
||||
.PP
|
||||
A criação e exclusão de instantâneos requerem privilégios administrativos.
|
||||
Garanta que o SnapRAID é executado com as permissões necessárias (ex: sudo) quando
|
||||
esta opção estiver ativada.
|
||||
.PP
|
||||
Consulte a seção SNAPSHOTS para uma explicação detalhada do ciclo de vida
|
||||
dos instantâneos.
|
||||
.SS nohidden
|
||||
Exclui todos os arquivos e diretórios ocultos.
|
||||
No Unix, arquivos ocultos são aqueles que começam com \`.\`.
|
||||
|
|
@ -1587,7 +1621,7 @@ temperatura for atingido mais uma vez.
|
|||
Durante a operação, o SnapRAID também analisa a curva de aquecimento de
|
||||
cada disco e estima a temperatura estável de longo prazo que eles
|
||||
devem atingir se a atividade continuar. A estimativa é realizada apenas
|
||||
depois que a temperatura do disco aumentou quatro vezes, garantindo
|
||||
depois que a temperatura do disco tiver subido quatro vezes, garantindo
|
||||
que pontos de dados suficientes estejam disponíveis para estabelecer uma
|
||||
tendência confiável.
|
||||
Esta temperatura estável prevista é mostrada entre parênteses ao lado
|
||||
|
|
@ -1641,6 +1675,9 @@ Nas OPTIONS especificadas, a string \`%s\` é substituída pelo
|
|||
nome do dispositivo. Para controladores RAID, o dispositivo é
|
||||
provavelmente fixo, e você pode não precisar usar \`%s\`.
|
||||
.PP
|
||||
Você também pode especificar uma string personalizada de opções de informação
|
||||
usando a tag \`[info: ...]\` para substituir a opção padrão \`\-a\`.
|
||||
.PP
|
||||
Consulte a documentação do smartmontools para possíveis opções:
|
||||
.PP
|
||||
.RS 4
|
||||
|
|
@ -1656,6 +1693,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices
|
|||
Por exemplo:
|
||||
.PP
|
||||
.RS 4
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl parity \-d sat %s
|
||||
.PD 0
|
||||
.PD
|
||||
|
|
@ -1670,19 +1711,27 @@ PARITY é um dos nomes de paridade: \`parity\`, \`2\-parity\`, \`3\-parity\`,
|
|||
\`4\-parity\`, \`5\-parity\`, \`6\-parity\` ou \`z\-parity\`.
|
||||
O valor especial * pode ser usado para ignorar o atributo em todos os discos.
|
||||
.PP
|
||||
Por exemplo, para ignorar o atributo \`Current Pending Sector Count\` em
|
||||
todos os discos:
|
||||
Múltiplos atributos podem ser especificados separados por espaços.
|
||||
Cada atributo pode ser especificado como um número de 1 a 255, ou como um
|
||||
nome insensível a maiúsculas/minúsculas (por exemplo, \`Current_Pending_Sector\`).
|
||||
.PP
|
||||
Por exemplo, para ignorar os atributos \`Current Pending Sector Count\` e
|
||||
\`Reallocated Sectors Count\` em todos os discos pelo seu número ou nome:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore * 197
|
||||
smartignore * 197 5
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.PP
|
||||
Para ignorá\-lo apenas no primeiro disco de paridade:
|
||||
Para ignorá\-los apenas no primeiro disco de paridade:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore parity 197
|
||||
smartignore parity 197 5
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
|
|
@ -1722,7 +1771,7 @@ exclude /tmp/
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1778,7 +1827,7 @@ exclude \\System Volume Information
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1794,6 +1843,128 @@ smartctl 2\-parity \-d areca,2/1 /dev/arcmsr0
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH INSTANTâNEOS (SNAPSHOTS)
|
||||
Se a opção de instantâneo estiver ativada na configuração, o SnapRAID
|
||||
utiliza a funcionalidade de instantâneos do sistema de arquivos para garantir operações atômicas
|
||||
e consistentes.
|
||||
.PP
|
||||
A gestão de instantâneos é completamente automática e transparente.
|
||||
Pode continuar a utilizar o SnapRAID exatamente como antes, com a
|
||||
proteção adicional fornecida por instantâneos geridos inteiramente em
|
||||
segundo plano.
|
||||
.PP
|
||||
Isso proporciona dois benefícios principais:
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I Consistência
|
||||
Arquivos modificados no sistema de arquivos ativo durante um sync ou scrub de
|
||||
longa duração não causarão divergências de paridade ou operações abortadas,
|
||||
pois o SnapRAID vê uma imagem congelada no tempo.
|
||||
.HP 4
|
||||
.I Recuperação
|
||||
Se um arquivo for atualizado ou excluído do sistema de arquivos ativo,
|
||||
ele permanece preservado no instantâneo. Se ocorrer uma falha de disco
|
||||
antes de o próximo sync ser executado, o SnapRAID utiliza os dados preservados
|
||||
no instantâneo para reconstruir o disco com falha.
|
||||
.PD
|
||||
.PP
|
||||
.RS 4
|
||||
.PD 0
|
||||
Em caso de falha de um disco durante um processo de sync ativo,
|
||||
o SnapRAID também é capaz de ler automaticamente tanto do instantâneo
|
||||
da computação de paridade anterior quanto da atual.
|
||||
Isso maximiza a probabilidade de uma recuperação completa ao
|
||||
fornecer acesso aos blocos de dados exatos necessários para resolver
|
||||
as equações de paridade, mesmo que esses blocos tenham sido modificados
|
||||
ou excluídos entre os syncs.
|
||||
.PD
|
||||
.PP
|
||||
.PD 0
|
||||
Sem instantâneos, um arquivo atualizado ou excluído num disco saudável
|
||||
resulta na falta de blocos de dados que podem ser necessários para
|
||||
reparar outros discos com falha.
|
||||
.PD
|
||||
.RE
|
||||
.RE
|
||||
.PP
|
||||
Os instantâneos são criados apenas para discos de dados e apenas se o sistema de arquivos
|
||||
subjacente suportar esta funcionalidade. Os discos de paridade usam sempre
|
||||
o sistema de arquivos ativo.
|
||||
.PP
|
||||
Atualmente, isso é suportado em Btrfs, Bcachefs e ZFS em Linux
|
||||
e em NTFS em Windows.
|
||||
.PP
|
||||
Pode misturar discos de dados com sistemas de arquivos diferentes. Apenas aqueles que
|
||||
suportam instantâneos os utilizarão, enquanto os outros discos continuarão
|
||||
a operar diretamente no sistema de arquivos ativo.
|
||||
.PP
|
||||
A criação e exclusão de instantâneos requerem privilégios administrativos.
|
||||
Garanta que o SnapRAID é executado com as permissões necessárias (ex: sudo)
|
||||
quando os instantâneos estão ativados.
|
||||
.SS Comportamento dos Comandos com Instantâneos
|
||||
Os comandos \`sync\` e \`scrub\` operam ambos exclusivamente em instantâneos
|
||||
para garantir que todas as operações de dados sejam realizadas contra um estado consistente
|
||||
e congelado. Ao utilizar esses instantâneos, o SnapRAID previne divergências de paridade
|
||||
que, de outra forma, seriam despoletadas por modificações concorrentes de arquivos no sistema de arquivos ativo.
|
||||
Durante um \`sync\`, o comando usa um novo instantâneo criado no
|
||||
início do processo para capturar o estado atual para a computação da paridade.
|
||||
Em contraste, o comando \`scrub\` utiliza o último instantâneo, aquele
|
||||
criado durante o sync mais recente, para manter um ponto de referência confiável
|
||||
que corresponda à paridade existente.
|
||||
.PP
|
||||
Para os comandos \`check\` e \`fix\`, o uso do último instantâneo
|
||||
depende de discos específicos serem ou não alvo da operação utilizando a opção
|
||||
\-d, \-\-filter\-disk.
|
||||
.PP
|
||||
Um disco explicitamente selecionado via \-d (o \[dq]alvo\[dq] da operação)
|
||||
usa sempre o sistema de arquivos ativo. Para \`fix\`, isso permite restaurar
|
||||
dados para a substituição do disco ativo. Para \`check\`, permite simular
|
||||
a operação \`fix\` sob as mesmas condições.
|
||||
.PP
|
||||
Todos os outros discos de dados (os discos de \[dq]referência\[dq]) serão acessados através dos
|
||||
seus instantâneos. Isso garante que, mesmo que esteja modificando arquivos
|
||||
nos seus discos saudáveis enquanto uma recuperação está em curso, o SnapRAID
|
||||
tem uma referência estável e congelada para resolver as equações de paridade.
|
||||
.PP
|
||||
Se nenhuma opção \-d for fornecida, o SnapRAID assume que a operação se aplica
|
||||
a todo o array, neste caso, \`check\` e \`fix\` usarão os sistemas
|
||||
de arquivos ativos exclusivamente.
|
||||
.PP
|
||||
Todos os outros comandos operam exclusivamente no sistema de arquivos ativo.
|
||||
.SH CICLO DE VIDA DOS INSTANTâNEOS (SNAPSHOTS LIFECYCLE)
|
||||
O SnapRAID gerencia dois instantâneos específicos, \`stable\` (estável) e \`pending\` (pendente),
|
||||
dentro de um diretório oculto na raiz de cada subvolume de dados.
|
||||
Em Btrfs, Bcachefs e NTFS é utilizado o diretório \`.snapraid/\`,
|
||||
em ZFS o padrão \`.zfs/snapshot/\`.
|
||||
.PP
|
||||
O instantâneo \`stable\` representa o estado do último
|
||||
\`sync\` concluído com sucesso, contendo os dados exatos utilizados para
|
||||
computar a paridade atual. Serve como a principal fonte de dados
|
||||
para os comandos \`scrub\`, \`check\` e \`fix\`.
|
||||
.PP
|
||||
O instantâneo \`pending\` é uma imagem temporária criada ao início
|
||||
de um \`sync\` para fornecer um estado congelado para a computação da paridade.
|
||||
Após a conclusão bem\-sucedida da operação, o instantâneo \`stable\` anterior
|
||||
é excluído, e o instantâneo \`pending\` é promovido para
|
||||
tomar o seu lugar como a nova referência estável.
|
||||
.PP
|
||||
Se um \`sync\` for interrompido, o instantâneo \`pending\` é preservado.
|
||||
Os comandos subsequentes \`scrub\`, \`check\` e \`fix\` utilizarão este
|
||||
instantâneo pendente, pois ele corresponde ao estado do sistema de arquivos registrado no
|
||||
arquivo .content, mesmo que a paridade esteja apenas parcialmente sincronizada.
|
||||
.PP
|
||||
No caso de uma interrupção do \`sync\`, os comandos \`check\` e \`fix\`
|
||||
também leem do instantâneo \`stable\` para recuperar blocos de dados
|
||||
de arquivos que foram atualizados ou excluídos durante o sync.
|
||||
Isso é possível porque o arquivo .content retém metadados para
|
||||
todos os arquivos modificados ou excluídos ao longo do processo de sync.
|
||||
Esta informação histórica só é limpa quando um sync termina
|
||||
com sucesso e a versão final do arquivo .content é salva.
|
||||
.PP
|
||||
Se um \`sync\` for reiniciado após uma interrupção, o instantâneo pending existente
|
||||
é excluído e um novo é criado para
|
||||
capturar o estado atual do sistema de arquivos ativo.
|
||||
.SH PADRãO (PATTERN)
|
||||
Os padrões fornecem uma maneira flexível de filtrar arquivos para inclusão ou
|
||||
exclusão. Ao usar caracteres de globbing, você pode definir regras que
|
||||
|
|
@ -1975,7 +2146,7 @@ snapraid \-f \[dq]*.mp3\[dq] check
|
|||
.RE
|
||||
.PP
|
||||
No Unix, ao usar caracteres globbing na linha de comando, você deve
|
||||
citá\-los para evitar que o shell os expanda.
|
||||
colocá\-los entre aspas para evitar que o shell os expanda.
|
||||
.SH IGNORAR ARQUIVOS (IGNORE FILE)
|
||||
Além das regras globais no arquivo de configuração, você pode colocar
|
||||
arquivos \`.snapraidignore\` em qualquer diretório dentro do array para definir
|
||||
|
|
@ -2042,8 +2213,10 @@ SnapRAID armazena a lista e os checksums de seus arquivos no arquivo content.
|
|||
É um arquivo binário que lista todos os arquivos presentes em seu array
|
||||
de discos, juntamente com todos os checksums para verificar sua integridade.
|
||||
.PP
|
||||
Este arquivo é lido e escrito pelos comandos \`sync\` e \`scrub\` e
|
||||
lido pelos comandos \`fix\`, \`check\` e \`status\`.
|
||||
O arquivo content é lido e escrito pelos comandos \`sync\`, \`scrub\`,
|
||||
\`touch\` e \`rehash\`. É lido pelos comandos \`status\`, \`diff\`, \`check\`,
|
||||
\`fix\`, \`list\`, \`dup\`, \`locate\` e \`pool\`, e é completamente ignorado
|
||||
pelos comandos \`smart\`, \`probe\`, \`up\`, \`down\` e \`devices\`.
|
||||
.SH PARIDADE (PARITY)
|
||||
SnapRAID armazena as informações de paridade do seu array nos arquivos parity.
|
||||
.PP
|
||||
|
|
@ -2065,7 +2238,25 @@ e usar uma fonte TrueType como \`Lucida Console\` como fonte do console.
|
|||
Isso afeta apenas os nomes de arquivo impressos; se você
|
||||
redirecionar a saída do console para um arquivo, o arquivo resultante
|
||||
estará sempre no formato UTF\-8.
|
||||
.SH CóDIGO DE SAíDA (EXIT CODE)
|
||||
O SnapRAID termina com os seguintes códigos de erro:
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I 0
|
||||
Tudo OK.
|
||||
.HP 4
|
||||
.I 1
|
||||
O comando encontrou alguns erros.
|
||||
.HP 4
|
||||
.I 2
|
||||
O comando \`diff\` determinou que tudo está OK, mas é necessário um \`sync\`.
|
||||
.PD
|
||||
.RE
|
||||
.SH TRADUçãO (TRANSLATION)
|
||||
Este documento é uma tradução automática do manual em inglês.
|
||||
Consulte o manual em inglês para a versão oficial.
|
||||
.SH DIREITOS AUTORAIS (COPYRIGHT)
|
||||
Este arquivo é Copyright (C) 2025 Andrea Mazzoleni
|
||||
Este arquivo é Copyright (C) 2026 Andrea Mazzoleni
|
||||
.SH VEJA TAMBéM (SEE ALSO)
|
||||
snapraid_log(1), snapraidd(1)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
Name{number}
|
||||
snapraid - SnapRAID Backup para Arrays de Disco
|
||||
|
||||
Sinopse
|
||||
Sinopse (Synopsis)
|
||||
:snapraid [-c, --conf CONFIG]
|
||||
: [-f, --filter PATTERN] [-d, --filter-disk NAME]
|
||||
: [-m, --filter-missing] [-e, --filter-error]
|
||||
|
|
@ -23,7 +23,7 @@ Sinopse
|
|||
|
||||
:snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
Descrição
|
||||
Descrição (Description)
|
||||
SnapRAID é um programa de backup projetado para arrays de disco,
|
||||
armazenando informações de paridade para recuperação de dados no
|
||||
caso de até seis falhas de disco.
|
||||
|
|
@ -51,22 +51,30 @@ Descrição
|
|||
|
||||
:https://www.snapraid.it/
|
||||
|
||||
Limitações
|
||||
SnapRAID é um híbrido entre um programa RAID e um programa de backup,
|
||||
visando combinar os melhores benefícios de ambos. No entanto, ele tem
|
||||
algumas limitações que você deve considerar antes de usá-lo.
|
||||
Limitações (Limitations)
|
||||
O SnapRAID é um híbrido entre um RAID e um programa de backup, com o objetivo de combinar
|
||||
os melhores benefícios de ambos. No entanto, possui algumas limitações que deve
|
||||
considerar antes de o utilizar.
|
||||
|
||||
A principal limitação é que, se um disco falhar e você não tiver
|
||||
sincronizado recentemente, talvez não consiga recuperar totalmente.
|
||||
Mais especificamente, você pode não conseguir recuperar até o tamanho dos
|
||||
arquivos alterados ou excluídos desde a última operação de sincronização.
|
||||
Isso ocorre mesmo que os arquivos alterados ou excluídos não estejam no
|
||||
disco com falha. É por isso que o SnapRAID é mais adequado para
|
||||
dados que raramente mudam.
|
||||
A principal limitação é que, se um disco falhar, apenas poderá recuperar dados até ao
|
||||
estado da última operação de sincronização (`sync`). Quaisquer dados adicionados ou modificações feitas
|
||||
desde a última sincronização que estejam localizados no disco com falha serão perdidos.
|
||||
|
||||
Por outro lado, arquivos recém-adicionados não impedem a recuperação de
|
||||
arquivos já existentes. Você perderá apenas os arquivos adicionados
|
||||
recentemente se estiverem no disco com falha.
|
||||
Consequentemente, o SnapRAID é adequado principalmente para dados que raramente mudam.
|
||||
|
||||
Para dados que já existiam na última sincronização, a fiabilidade da recuperação depende
|
||||
de a opção `snapshot` ser ou não utilizada:
|
||||
|
||||
* Com suporte a instantâneos (disponível em Btrfs, ZFS, Bcachefs e NTFS),
|
||||
o SnapRAID pode manter automaticamente uma referência congelada dos seus discos de dados.
|
||||
Isso garante que, mesmo que modifique ou exclua arquivos no seu sistema de arquivos ativo
|
||||
durante ou após uma sincronização, o processo de recuperação permanece consistente e confiável.
|
||||
|
||||
* Sem suporte a instantâneos, excluir ou alterar arquivos após um `sync`
|
||||
pode impedir a recuperação total de outros discos com falha. Isso ocorre
|
||||
porque a paridade já não corresponde aos arquivos modificados, mesmo que
|
||||
esses arquivos não estejam no disco com falha. Por outro lado, arquivos adicionados recentemente
|
||||
não impedem a recuperação de arquivos já existentes.
|
||||
|
||||
Outras limitações do SnapRAID são:
|
||||
|
||||
|
|
@ -82,7 +90,7 @@ Limitações
|
|||
* Apenas nomes de arquivos, carimbos de data/hora, symlinks e hardlinks
|
||||
são salvos. Permissões, propriedade e atributos estendidos não são salvos.
|
||||
|
||||
Primeiros Passos
|
||||
Primeiros Passos (Getting Started)
|
||||
Para usar o SnapRAID, você precisa primeiro selecionar um disco em seu array
|
||||
de discos para dedicar às informações de `parity` (paridade). Com um
|
||||
disco para paridade, você poderá recuperar de uma única falha de disco,
|
||||
|
|
@ -165,7 +173,7 @@ Primeiros Passos
|
|||
Agora você pode começar a usar seu array como quiser e periodicamente
|
||||
atualizar as informações de paridade executando o comando `sync`.
|
||||
|
||||
Scrubbing
|
||||
Scrubbing (Scrubbing)
|
||||
Para verificar periodicamente os dados e a paridade em busca de erros,
|
||||
você pode executar o comando `scrub`.
|
||||
|
||||
|
|
@ -204,10 +212,10 @@ Primeiros Passos
|
|||
arquivos removidos ou modificados. Esses erros são relatados na saída de `scrub`,
|
||||
mas os blocos relacionados não são marcados como ruins.
|
||||
|
||||
Pooling
|
||||
Pooling (Pooling)
|
||||
Nota: O recurso de pooling descrito abaixo foi substituído pela ferramenta
|
||||
mergerfs, que agora é a opção recomendada para usuários Linux na comunidade
|
||||
SnapRAID. Mergefs oferece uma maneira mais flexível e eficiente de agrupar
|
||||
SnapRAID. Mergerfs oferece uma maneira mais flexível e eficiente de agrupar
|
||||
várias unidades em um único ponto de montagem unificado, permitindo acesso
|
||||
perfeito a arquivos em todo o seu array sem depender de links simbólicos.
|
||||
Ele se integra bem ao SnapRAID para proteção de paridade e é comumente usado
|
||||
|
|
@ -300,7 +308,7 @@ Primeiros Passos
|
|||
|
||||
:snapraid fix -m
|
||||
|
||||
Recuperando
|
||||
Recuperação (Recovering)
|
||||
O pior aconteceu e você perdeu um ou mais discos!
|
||||
|
||||
NÃO ENTRE EM PÂNICO! Você será capaz de recuperá-los!
|
||||
|
|
@ -359,7 +367,7 @@ Primeiros Passos
|
|||
Se você não estiver satisfeito com a recuperação, pode tentar novamente
|
||||
quantas vezes quiser.
|
||||
|
||||
Por exemplo, se você removeu arquivos do array após a última
|
||||
Por exemplo, se você removeu arquivos do array após o último
|
||||
`sync`, isso pode resultar em alguns arquivos não sendo recuperados.
|
||||
Neste caso, você pode tentar novamente o `fix` usando a opção -i, --import,
|
||||
especificando onde esses arquivos estão agora para incluí-los novamente
|
||||
|
|
@ -390,14 +398,14 @@ Primeiros Passos
|
|||
|
||||
Se tudo for recuperado, este comando é imediato.
|
||||
|
||||
Comandos
|
||||
SnapRAID fornece alguns comandos simples que permitem a você:
|
||||
Comandos (Commands)
|
||||
O SnapRAID fornece alguns comandos simples que lhe permitem:
|
||||
|
||||
* Imprimir o status do array -> `status`
|
||||
* Imprimir o estado do array -> `status`
|
||||
* Controlar os discos -> `smart`, `probe`, `up`, `down`
|
||||
* Fazer um backup/snapshot -> `sync`
|
||||
* Criar um ponto de backup/recuperação -> `sync`
|
||||
* Verificar periodicamente os dados -> `scrub`
|
||||
* Restaurar o último backup/snapshot -> `fix`.
|
||||
* Restaurar o último ponto de backup/recuperação -> `fix`.
|
||||
|
||||
Os comandos devem ser escritos em letras minúsculas.
|
||||
|
||||
|
|
@ -526,12 +534,12 @@ Comandos
|
|||
Se o carimbo de data/hora de subsegundos for zero, o caminho
|
||||
completo deve corresponder para ser identificado.
|
||||
Ao contrário dos arquivos 'moved' no mesmo disco, os arquivos
|
||||
realocados têm um inode diferente.
|
||||
relocados têm um inode diferente.
|
||||
restored - Arquivos com um inode diferente, mas com diretório,
|
||||
nome, tamanho e carimbo de data/hora correspondentes.
|
||||
Geralmente são arquivos restaurados após serem excluídos.
|
||||
|
||||
Se uma `sync` for necessária, o código de retorno do processo é 2,
|
||||
Se um `sync` for necessário, o código de retorno do processo é 2,
|
||||
em vez do padrão 0. O código de retorno 1 é usado para uma condição
|
||||
de erro genérica.
|
||||
|
||||
|
|
@ -610,13 +618,12 @@ Comandos
|
|||
fix
|
||||
Corrige todos os arquivos e os dados de paridade.
|
||||
|
||||
Todos os arquivos e dados de paridade são comparados com o estado de
|
||||
snapshot salvo na última `sync`.
|
||||
Se uma diferença for encontrada, ela é revertida para o snapshot armazenado.
|
||||
Todos os arquivos e dados de paridade são comparados com o estado salvo no
|
||||
último `sync`. Se for encontrada uma diferença, esta é revertida para o estado armazenado.
|
||||
|
||||
ATENÇÃO! O comando `fix` não diferencia entre erros e modificações
|
||||
intencionais. Ele reverte incondicionalmente o estado do arquivo
|
||||
para a última `sync`.
|
||||
AVISO!
|
||||
O comando `fix` não diferencia erros de modificações intencionais.
|
||||
Reverte incondicionalmente o estado do arquivo para o do último `sync`.
|
||||
|
||||
Se nenhuma outra opção for especificada, todo o array é processado.
|
||||
Use as opções de filtro para selecionar um subconjunto de arquivos ou
|
||||
|
|
@ -625,13 +632,13 @@ Comandos
|
|||
Para corrigir apenas os blocos marcados como ruins durante `sync` e `scrub`,
|
||||
use a opção -e, --filter-error.
|
||||
Ao contrário de outras opções de filtro, esta aplica correções apenas a
|
||||
arquivos que não foram alterados desde a última `sync`.
|
||||
arquivos que não foram alterados desde o último `sync`.
|
||||
|
||||
O SnapRAID renomeia todos os arquivos que não podem ser corrigidos adicionando
|
||||
a extensão `.unrecoverable`.
|
||||
|
||||
Antes de corrigir, todo o array é escaneado para encontrar quaisquer
|
||||
arquivos movidos desde a última operação `sync`.
|
||||
arquivos movidos desde a última operação de `sync`.
|
||||
Esses arquivos são identificados por seu carimbo de data/hora, ignorando
|
||||
seu nome e diretório, e são usados no processo de recuperação, se
|
||||
necessário.
|
||||
|
|
@ -756,7 +763,7 @@ Comandos
|
|||
Esteja ciente de que tais arquivos não estarão protegidos pela paridade durante
|
||||
o processo de realocação.
|
||||
|
||||
Opções
|
||||
Opções (Options)
|
||||
SnapRAID fornece as seguintes opções:
|
||||
|
||||
-c, --conf CONFIG
|
||||
|
|
@ -831,9 +838,9 @@ Opções
|
|||
Esta opção pode ser usada apenas com `check`.
|
||||
|
||||
-h, --pre-hash
|
||||
Em `sync`, executa uma fase de hash preliminar de todos os novos dados
|
||||
Em `sync`, executa uma fase de hash prexcluir de todos os novos dados
|
||||
para verificação adicional antes do cálculo da paridade.
|
||||
Normalmente, em `sync`, nenhum hash preliminar é feito, e os novos
|
||||
Normalmente, em `sync`, nenhum hash prexcluir é feito, e os novos
|
||||
dados são hashados logo antes do cálculo da paridade, quando são lidos
|
||||
pela primeira vez.
|
||||
Este processo ocorre quando o sistema está sob
|
||||
|
|
@ -870,7 +877,7 @@ Opções
|
|||
RATE é o número de bytes por segundo. Você pode especificar um
|
||||
multiplicador como K, M ou G (por exemplo, --bw-limit 1G).
|
||||
|
||||
-t, --tail TAMANHO
|
||||
-t, --tail SIZE
|
||||
Limita a listagem de arquivos àqueles que não usam mais do que o
|
||||
tamanho final especificado dos discos de paridade.
|
||||
Você pode usar multiplicadores como K, M, G ou T (ex: --tail 1G).
|
||||
|
|
@ -976,9 +983,9 @@ Opções
|
|||
recomendado não usá-la.
|
||||
Você NÃO tem proteção de dados durante a operação `sync`.
|
||||
|
||||
-W, --force-realloc-tail TAMANHO
|
||||
-W, --force-realloc-tail SIZE
|
||||
Funciona como -R, --force-realloc, mas limitado à parte final
|
||||
especificada (últimos TAMANHO bytes) de cada arquivo de paridade.
|
||||
especificada (últimos SIZE bytes) de cada arquivo de paridade.
|
||||
Força a realocação (movimentação) de quaisquer fragmentos/blocos de arquivos
|
||||
atualmente armazenados nessa seção final, permitindo que sejam colocados
|
||||
em qualquer lugar no(s) arquivo(s) de paridade onde houver espaço livre
|
||||
|
|
@ -992,10 +999,9 @@ Opções
|
|||
--force-realloc-tail 1G).
|
||||
Você pode usar locate -t, --tail para saber antecipadamente os
|
||||
arquivos afetados.
|
||||
AVISO!
|
||||
Esta opção é apenas para especialistas e é altamente recomendado
|
||||
não utilizá-la.
|
||||
Você NÃO terá proteção de datos durante a operação `sync` para os
|
||||
ATENÇÃO! Esta opção é apenas para especialistas e é altamente
|
||||
recomendado não usá-la.
|
||||
Você NÃO tem proteção de dados durante a operação `sync` para os
|
||||
arquivos afetados.
|
||||
|
||||
-l, --log FILE
|
||||
|
|
@ -1065,7 +1071,7 @@ Opções
|
|||
-V, --version
|
||||
Imprime a versão do programa.
|
||||
|
||||
Configuração
|
||||
Configuração (Configuration)
|
||||
SnapRAID requer um arquivo de configuração para saber onde seu array
|
||||
de discos está localizado e onde armazenar as informações de paridade.
|
||||
|
||||
|
|
@ -1169,13 +1175,38 @@ Configuração
|
|||
Define o nome e o ponto de montagem de discos adicionais para
|
||||
monitorar com os comandos `smart` e `probe`.
|
||||
|
||||
Isso é útil para monitorar discos que não fazem parte da matriz,
|
||||
Isso é útil para monitorar discos que não fazem parte do array,
|
||||
mas que são necessários para o funcionamento do sistema, como o
|
||||
disco de inicialização.
|
||||
|
||||
Observe que tais discos não são afetados pelos comandos `up` e `down`
|
||||
porque se espera que estejam sempre girando.
|
||||
|
||||
snapshot
|
||||
Ativa o uso de instantâneos (snapshots) do sistema de arquivos para os comandos `sync`, `scrub`,
|
||||
`check` e `fix`.
|
||||
|
||||
Quando ativado, o SnapRAID cria um instantâneo de somente leitura dos seus dados no
|
||||
início de um 'sync'. Isso garante uma visão consistente e num ponto específico no tempo dos seus
|
||||
arquivos, prevenindo erros causados por modificações concorrentes de arquivos.
|
||||
|
||||
Isso melhora significativamente a recuperação: se um arquivo for excluído do sistema de arquivos ativo,
|
||||
ele permanece preservado no instantâneo. Isso evita que a paridade fique "corrompida"
|
||||
para esse bloco, garantindo que ainda pode recuperar os dados com sucesso
|
||||
se outro disco falhar.
|
||||
|
||||
Esta opção aplica-se exclusivamente a discos de dados formatados com os sistemas de
|
||||
arquivos Btrfs, Bcachefs ou ZFS em Linux e NTFS em Windows.
|
||||
Discos de paridade, ou discos de dados que utilizem outros sistemas de arquivos, usarão sempre
|
||||
a versão ativa do sistema de arquivos.
|
||||
|
||||
A criação e exclusão de instantâneos requerem privilégios administrativos.
|
||||
Garanta que o SnapRAID é executado com as permissões necessárias (ex: sudo) quando
|
||||
esta opção estiver ativada.
|
||||
|
||||
Consulte a seção SNAPSHOTS para uma explicação detalhada do ciclo de vida
|
||||
dos instantâneos.
|
||||
|
||||
nohidden
|
||||
Exclui todos os arquivos e diretórios ocultos.
|
||||
No Unix, arquivos ocultos são aqueles que começam com `.`.
|
||||
|
|
@ -1300,7 +1331,7 @@ Configuração
|
|||
Durante a operação, o SnapRAID também analisa a curva de aquecimento de
|
||||
cada disco e estima a temperatura estável de longo prazo que eles
|
||||
devem atingir se a atividade continuar. A estimativa é realizada apenas
|
||||
depois que a temperatura do disco aumentou quatro vezes, garantindo
|
||||
depois que a temperatura do disco tiver subido quatro vezes, garantindo
|
||||
que pontos de dados suficientes estejam disponíveis para estabelecer uma
|
||||
tendência confiável.
|
||||
Esta temperatura estável prevista é mostrada entre parênteses ao lado
|
||||
|
|
@ -1358,6 +1389,9 @@ Configuração
|
|||
nome do dispositivo. Para controladores RAID, o dispositivo é
|
||||
provavelmente fixo, e você pode não precisar usar `%s`.
|
||||
|
||||
Você também pode especificar uma string personalizada de opções de informação
|
||||
usando a tag `[info: ...]` para substituir a opção padrão `-a`.
|
||||
|
||||
Consulte a documentação do smartmontools para possíveis opções:
|
||||
|
||||
:https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
|
|
@ -1365,6 +1399,7 @@ Configuração
|
|||
|
||||
Por exemplo:
|
||||
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl parity -d sat %s
|
||||
|
||||
smartignore DISK/PARITY ATTR [ATTR...]
|
||||
|
|
@ -1377,14 +1412,19 @@ Configuração
|
|||
`4-parity`, `5-parity`, `6-parity` ou `z-parity`.
|
||||
O valor especial * pode ser usado para ignorar o atributo em todos os discos.
|
||||
|
||||
Por exemplo, para ignorar o atributo `Current Pending Sector Count` em
|
||||
todos os discos:
|
||||
Múltiplos atributos podem ser especificados separados por espaços.
|
||||
Cada atributo pode ser especificado como um número de 1 a 255, ou como um
|
||||
nome insensível a maiúsculas/minúsculas (por exemplo, `Current_Pending_Sector`).
|
||||
|
||||
:smartignore * 197
|
||||
Por exemplo, para ignorar os atributos `Current Pending Sector Count` e
|
||||
`Reallocated Sectors Count` em todos os discos pelo seu número ou nome:
|
||||
|
||||
Para ignorá-lo apenas no primeiro disco de paridade:
|
||||
:smartignore * 197 5
|
||||
:smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
:smartignore parity 197
|
||||
Para ignorá-los apenas no primeiro disco de paridade:
|
||||
|
||||
:smartignore parity 197 5
|
||||
|
||||
Exemplos
|
||||
Um exemplo de uma configuração típica para Unix é:
|
||||
|
|
@ -1397,7 +1437,7 @@ Configuração
|
|||
:data d3 /mnt/disk3/
|
||||
:exclude /lost+found/
|
||||
:exclude /tmp/
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/sg0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1413,11 +1453,123 @@ Configuração
|
|||
:exclude Thumbs.db
|
||||
:exclude \$RECYCLE.BIN
|
||||
:exclude \System Volume Information
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
Instantâneos (Snapshots)
|
||||
Se a opção de instantâneo estiver ativada na configuração, o SnapRAID
|
||||
utiliza a funcionalidade de instantâneos do sistema de arquivos para garantir operações atômicas
|
||||
e consistentes.
|
||||
|
||||
A gestão de instantâneos é completamente automática e transparente.
|
||||
Pode continuar a utilizar o SnapRAID exatamente como antes, com a
|
||||
proteção adicional fornecida por instantâneos geridos inteiramente em
|
||||
segundo plano.
|
||||
|
||||
Isso proporciona dois benefícios principais:
|
||||
|
||||
Consistência - Arquivos modificados no sistema de arquivos ativo durante um sync ou scrub de
|
||||
longa duração não causarão divergências de paridade ou operações abortadas,
|
||||
pois o SnapRAID vê uma imagem congelada no tempo.
|
||||
Recuperação - Se um arquivo for atualizado ou excluído do sistema de arquivos ativo,
|
||||
ele permanece preservado no instantâneo. Se ocorrer uma falha de disco
|
||||
antes de o próximo sync ser executado, o SnapRAID utiliza os dados preservados
|
||||
no instantâneo para reconstruir o disco com falha.
|
||||
|
||||
Em caso de falha de um disco durante um processo de sync ativo,
|
||||
o SnapRAID também é capaz de ler automaticamente tanto do instantâneo
|
||||
da computação de paridade anterior quanto da atual.
|
||||
Isso maximiza a probabilidade de uma recuperação completa ao
|
||||
fornecer acesso aos blocos de dados exatos necessários para resolver
|
||||
as equações de paridade, mesmo que esses blocos tenham sido modificados
|
||||
ou excluídos entre os syncs.
|
||||
|
||||
Sem instantâneos, um arquivo atualizado ou excluído num disco saudável
|
||||
resulta na falta de blocos de dados que podem ser necessários para
|
||||
reparar outros discos com falha.
|
||||
|
||||
Os instantâneos são criados apenas para discos de dados e apenas se o sistema de arquivos
|
||||
subjacente suportar esta funcionalidade. Os discos de paridade usam sempre
|
||||
o sistema de arquivos ativo.
|
||||
|
||||
Atualmente, isso é suportado em Btrfs, Bcachefs e ZFS em Linux
|
||||
e em NTFS em Windows.
|
||||
|
||||
Pode misturar discos de dados com sistemas de arquivos diferentes. Apenas aqueles que
|
||||
suportam instantâneos os utilizarão, enquanto os outros discos continuarão
|
||||
a operar diretamente no sistema de arquivos ativo.
|
||||
|
||||
A criação e exclusão de instantâneos requerem privilégios administrativos.
|
||||
Garanta que o SnapRAID é executado com as permissões necessárias (ex: sudo)
|
||||
quando os instantâneos estão ativados.
|
||||
|
||||
Comportamento dos Comandos com Instantâneos
|
||||
Os comandos `sync` e `scrub` operam ambos exclusivamente em instantâneos
|
||||
para garantir que todas as operações de dados sejam realizadas contra um estado consistente
|
||||
e congelado. Ao utilizar esses instantâneos, o SnapRAID previne divergências de paridade
|
||||
que, de outra forma, seriam despoletadas por modificações concorrentes de arquivos no sistema de arquivos ativo.
|
||||
Durante um `sync`, o comando usa um novo instantâneo criado no
|
||||
início do processo para capturar o estado atual para a computação da paridade.
|
||||
Em contraste, o comando `scrub` utiliza o último instantâneo, aquele
|
||||
criado durante o sync mais recente, para manter um ponto de referência confiável
|
||||
que corresponda à paridade existente.
|
||||
|
||||
Para os comandos `check` e `fix`, o uso do último instantâneo
|
||||
depende de discos específicos serem ou não alvo da operação utilizando a opção
|
||||
-d, --filter-disk.
|
||||
|
||||
Um disco explicitamente selecionado via -d (o "alvo" da operação)
|
||||
usa sempre o sistema de arquivos ativo. Para `fix`, isso permite restaurar
|
||||
dados para a substituição do disco ativo. Para `check`, permite simular
|
||||
a operação `fix` sob as mesmas condições.
|
||||
|
||||
Todos os outros discos de dados (os discos de "referência") serão acessados através dos
|
||||
seus instantâneos. Isso garante que, mesmo que esteja modificando arquivos
|
||||
nos seus discos saudáveis enquanto uma recuperação está em curso, o SnapRAID
|
||||
tem uma referência estável e congelada para resolver as equações de paridade.
|
||||
|
||||
Se nenhuma opção -d for fornecida, o SnapRAID assume que a operação se aplica
|
||||
a todo o array, neste caso, `check` e `fix` usarão os sistemas
|
||||
de arquivos ativos exclusivamente.
|
||||
|
||||
Todos os outros comandos operam exclusivamente no sistema de arquivos ativo.
|
||||
|
||||
Ciclo de Vida dos Instantâneos (Snapshots Lifecycle)
|
||||
O SnapRAID gerencia dois instantâneos específicos, `stable` (estável) e `pending` (pendente),
|
||||
dentro de um diretório oculto na raiz de cada subvolume de dados.
|
||||
Em Btrfs, Bcachefs e NTFS é utilizado o diretório `.snapraid/`,
|
||||
em ZFS o padrão `.zfs/snapshot/`.
|
||||
|
||||
O instantâneo `stable` representa o estado do último
|
||||
`sync` concluído com sucesso, contendo os dados exatos utilizados para
|
||||
computar a paridade atual. Serve como a principal fonte de dados
|
||||
para os comandos `scrub`, `check` e `fix`.
|
||||
|
||||
O instantâneo `pending` é uma imagem temporária criada ao início
|
||||
de um `sync` para fornecer um estado congelado para a computação da paridade.
|
||||
Após a conclusão bem-sucedida da operação, o instantâneo `stable` anterior
|
||||
é excluído, e o instantâneo `pending` é promovido para
|
||||
tomar o seu lugar como a nova referência estável.
|
||||
|
||||
Se um `sync` for interrompido, o instantâneo `pending` é preservado.
|
||||
Os comandos subsequentes `scrub`, `check` e `fix` utilizarão este
|
||||
instantâneo pendente, pois ele corresponde ao estado do sistema de arquivos registrado no
|
||||
arquivo .content, mesmo que a paridade esteja apenas parcialmente sincronizada.
|
||||
|
||||
No caso de uma interrupção do `sync`, os comandos `check` e `fix`
|
||||
também leem do instantâneo `stable` para recuperar blocos de dados
|
||||
de arquivos que foram atualizados ou excluídos durante o sync.
|
||||
Isso é possível porque o arquivo .content retém metadados para
|
||||
todos os arquivos modificados ou excluídos ao longo do processo de sync.
|
||||
Esta informação histórica só é limpa quando um sync termina
|
||||
com sucesso e a versão final do arquivo .content é salva.
|
||||
|
||||
Se um `sync` for reiniciado após uma interrupção, o instantâneo pending existente
|
||||
é excluído e um novo é criado para
|
||||
capturar o estado atual do sistema de arquivos ativo.
|
||||
|
||||
Padrão (Pattern)
|
||||
Os padrões fornecem uma maneira flexível de filtrar arquivos para inclusão ou
|
||||
exclusão. Ao usar caracteres de globbing, você pode definir regras que
|
||||
|
|
@ -1532,7 +1684,7 @@ Padrão (Pattern)
|
|||
:snapraid -f "*.mp3" check
|
||||
|
||||
No Unix, ao usar caracteres globbing na linha de comando, você deve
|
||||
citá-los para evitar que o shell os expanda.
|
||||
colocá-los entre aspas para evitar que o shell os expanda.
|
||||
|
||||
Ignorar Arquivos (Ignore File)
|
||||
Além das regras globais no arquivo de configuração, você pode colocar
|
||||
|
|
@ -1582,8 +1734,10 @@ Conteúdo (Content)
|
|||
É um arquivo binário que lista todos os arquivos presentes em seu array
|
||||
de discos, juntamente com todos os checksums para verificar sua integridade.
|
||||
|
||||
Este arquivo é lido e escrito pelos comandos `sync` e `scrub` e
|
||||
lido pelos comandos `fix`, `check` e `status`.
|
||||
O arquivo content é lido e escrito pelos comandos `sync`, `scrub`,
|
||||
`touch` e `rehash`. É lido pelos comandos `status`, `diff`, `check`,
|
||||
`fix`, `list`, `dup`, `locate` e `pool`, e é completamente ignorado
|
||||
pelos comandos `smart`, `probe`, `up`, `down` e `devices`.
|
||||
|
||||
Paridade (Parity)
|
||||
SnapRAID armazena as informações de paridade do seu array nos arquivos parity.
|
||||
|
|
@ -1608,8 +1762,19 @@ Codificação (Encoding)
|
|||
redirecionar a saída do console para um arquivo, o arquivo resultante
|
||||
estará sempre no formato UTF-8.
|
||||
|
||||
Código de Saída (Exit Code)
|
||||
O SnapRAID termina com os seguintes códigos de erro:
|
||||
|
||||
0 - Tudo OK.
|
||||
1 - O comando encontrou alguns erros.
|
||||
2 - O comando `diff` determinou que tudo está OK, mas é necessário um `sync`.
|
||||
|
||||
Tradução (Translation)
|
||||
Este documento é uma tradução automática do manual em inglês.
|
||||
Consulte o manual em inglês para a versão oficial.
|
||||
|
||||
Direitos Autorais (Copyright)
|
||||
Este arquivo é Copyright (C) 2025 Andrea Mazzoleni
|
||||
Este arquivo é Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
Veja Também (See Also)
|
||||
snapraid_log(1), snapraidd(1)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
====================================
|
||||
|
||||
|
||||
1 SINOPSE
|
||||
=========
|
||||
1 SINOPSE (SYNOPSIS)
|
||||
====================
|
||||
|
||||
snapraid [-c, --conf CONFIG]
|
||||
[-f, --filter PATTERN] [-d, --filter-disk NAME]
|
||||
|
|
@ -28,8 +28,8 @@ snapraid [-c, --conf CONFIG]
|
|||
snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
|
||||
2 DESCRIçãO
|
||||
===========
|
||||
2 DESCRIçãO (DESCRIPTION)
|
||||
=========================
|
||||
|
||||
SnapRAID é um programa de backup projetado para arrays de disco,
|
||||
armazenando informações de paridade para recuperação de dados no
|
||||
|
|
@ -59,24 +59,32 @@ Para mais informações, visite o site oficial do SnapRAID:
|
|||
https://www.snapraid.it/
|
||||
|
||||
|
||||
3 LIMITAçõES
|
||||
============
|
||||
3 LIMITAçõES (LIMITATIONS)
|
||||
==========================
|
||||
|
||||
SnapRAID é um híbrido entre um programa RAID e um programa de backup,
|
||||
visando combinar os melhores benefícios de ambos. No entanto, ele tem
|
||||
algumas limitações que você deve considerar antes de usá-lo.
|
||||
O SnapRAID é um híbrido entre um RAID e um programa de backup, com o objetivo de combinar
|
||||
os melhores benefícios de ambos. No entanto, possui algumas limitações que deve
|
||||
considerar antes de o utilizar.
|
||||
|
||||
A principal limitação é que, se um disco falhar e você não tiver
|
||||
sincronizado recentemente, talvez não consiga recuperar totalmente.
|
||||
Mais especificamente, você pode não conseguir recuperar até o tamanho dos
|
||||
arquivos alterados ou excluídos desde a última operação de sincronização.
|
||||
Isso ocorre mesmo que os arquivos alterados ou excluídos não estejam no
|
||||
disco com falha. É por isso que o SnapRAID é mais adequado para
|
||||
dados que raramente mudam.
|
||||
A principal limitação é que, se um disco falhar, apenas poderá recuperar dados até ao
|
||||
estado da última operação de sincronização (`sync`). Quaisquer dados adicionados ou modificações feitas
|
||||
desde a última sincronização que estejam localizados no disco com falha serão perdidos.
|
||||
|
||||
Por outro lado, arquivos recém-adicionados não impedem a recuperação de
|
||||
arquivos já existentes. Você perderá apenas os arquivos adicionados
|
||||
recentemente se estiverem no disco com falha.
|
||||
Consequentemente, o SnapRAID é adequado principalmente para dados que raramente mudam.
|
||||
|
||||
Para dados que já existiam na última sincronização, a fiabilidade da recuperação depende
|
||||
de a opção `snapshot` ser ou não utilizada:
|
||||
|
||||
* Com suporte a instantâneos (disponível em Btrfs, ZFS, Bcachefs e NTFS),
|
||||
o SnapRAID pode manter automaticamente uma referência congelada dos seus discos de dados.
|
||||
Isso garante que, mesmo que modifique ou exclua arquivos no seu sistema de arquivos ativo
|
||||
durante ou após uma sincronização, o processo de recuperação permanece consistente e confiável.
|
||||
|
||||
* Sem suporte a instantâneos, excluir ou alterar arquivos após um `sync`
|
||||
pode impedir a recuperação total de outros discos com falha. Isso ocorre
|
||||
porque a paridade já não corresponde aos arquivos modificados, mesmo que
|
||||
esses arquivos não estejam no disco com falha. Por outro lado, arquivos adicionados recentemente
|
||||
não impedem a recuperação de arquivos já existentes.
|
||||
|
||||
Outras limitações do SnapRAID são:
|
||||
|
||||
|
|
@ -93,8 +101,8 @@ Outras limitações do SnapRAID são:
|
|||
são salvos. Permissões, propriedade e atributos estendidos não são salvos.
|
||||
|
||||
|
||||
4 PRIMEIROS PASSOS
|
||||
==================
|
||||
4 PRIMEIROS PASSOS (GETTING STARTED)
|
||||
====================================
|
||||
|
||||
Para usar o SnapRAID, você precisa primeiro selecionar um disco em seu array
|
||||
de discos para dedicar às informações de `parity` (paridade). Com um
|
||||
|
|
@ -178,8 +186,8 @@ Quando este comando for concluído, seus dados estarão SEGUROS.
|
|||
Agora você pode começar a usar seu array como quiser e periodicamente
|
||||
atualizar as informações de paridade executando o comando `sync`.
|
||||
|
||||
4.1 Scrubbing
|
||||
-------------
|
||||
4.1 Scrubbing (Scrubbing)
|
||||
-------------------------
|
||||
|
||||
Para verificar periodicamente os dados e a paridade em busca de erros,
|
||||
você pode executar o comando `scrub`.
|
||||
|
|
@ -219,12 +227,12 @@ Executar `scrub` em um array não sincronizado pode relatar erros causados por
|
|||
arquivos removidos ou modificados. Esses erros são relatados na saída de `scrub`,
|
||||
mas os blocos relacionados não são marcados como ruins.
|
||||
|
||||
4.2 Pooling
|
||||
-----------
|
||||
4.2 Pooling (Pooling)
|
||||
---------------------
|
||||
|
||||
Nota: O recurso de pooling descrito abaixo foi substituído pela ferramenta
|
||||
mergerfs, que agora é a opção recomendada para usuários Linux na comunidade
|
||||
SnapRAID. Mergefs oferece uma maneira mais flexível e eficiente de agrupar
|
||||
SnapRAID. Mergerfs oferece uma maneira mais flexível e eficiente de agrupar
|
||||
várias unidades em um único ponto de montagem unificado, permitindo acesso
|
||||
perfeito a arquivos em todo o seu array sem depender de links simbólicos.
|
||||
Ele se integra bem ao SnapRAID para proteção de paridade e é comumente usado
|
||||
|
|
@ -319,8 +327,8 @@ Ou para recuperar todos os arquivos excluídos em todas as unidades com:
|
|||
|
||||
snapraid fix -m
|
||||
|
||||
4.4 Recuperando
|
||||
---------------
|
||||
4.4 Recuperação (Recovering)
|
||||
----------------------------
|
||||
|
||||
O pior aconteceu e você perdeu um ou mais discos!
|
||||
|
||||
|
|
@ -380,7 +388,7 @@ no arquivo fix.log, verificando todas as linhas que começam com `unrecoverable:
|
|||
Se você não estiver satisfeito com a recuperação, pode tentar novamente
|
||||
quantas vezes quiser.
|
||||
|
||||
Por exemplo, se você removeu arquivos do array após a última
|
||||
Por exemplo, se você removeu arquivos do array após o último
|
||||
`sync`, isso pode resultar em alguns arquivos não sendo recuperados.
|
||||
Neste caso, você pode tentar novamente o `fix` usando a opção -i, --import,
|
||||
especificando onde esses arquivos estão agora para incluí-los novamente
|
||||
|
|
@ -412,16 +420,16 @@ Execute o comando `sync` para ressincronizar o array com o novo disco.
|
|||
Se tudo for recuperado, este comando é imediato.
|
||||
|
||||
|
||||
5 COMANDOS
|
||||
==========
|
||||
5 COMANDOS (COMMANDS)
|
||||
=====================
|
||||
|
||||
SnapRAID fornece alguns comandos simples que permitem a você:
|
||||
O SnapRAID fornece alguns comandos simples que lhe permitem:
|
||||
|
||||
* Imprimir o status do array -> `status`
|
||||
* Imprimir o estado do array -> `status`
|
||||
* Controlar os discos -> `smart`, `probe`, `up`, `down`
|
||||
* Fazer um backup/snapshot -> `sync`
|
||||
* Criar um ponto de backup/recuperação -> `sync`
|
||||
* Verificar periodicamente os dados -> `scrub`
|
||||
* Restaurar o último backup/snapshot -> `fix`.
|
||||
* Restaurar o último ponto de backup/recuperação -> `fix`.
|
||||
|
||||
Os comandos devem ser escritos em letras minúsculas.
|
||||
|
||||
|
|
@ -562,12 +570,12 @@ apresentado, agrupado por:
|
|||
Se o carimbo de data/hora de subsegundos for zero, o caminho
|
||||
completo deve corresponder para ser identificado.
|
||||
Ao contrário dos arquivos 'moved' no mesmo disco, os arquivos
|
||||
realocados têm um inode diferente.
|
||||
relocados têm um inode diferente.
|
||||
restored - Arquivos com um inode diferente, mas com diretório,
|
||||
nome, tamanho e carimbo de data/hora correspondentes.
|
||||
Geralmente são arquivos restaurados após serem excluídos.
|
||||
|
||||
Se uma `sync` for necessária, o código de retorno do processo é 2,
|
||||
Se um `sync` for necessário, o código de retorno do processo é 2,
|
||||
em vez do padrão 0. O código de retorno 1 é usado para uma condição
|
||||
de erro genérica.
|
||||
|
||||
|
|
@ -652,13 +660,12 @@ Os arquivos no array NÃO são modificados.
|
|||
|
||||
Corrige todos os arquivos e os dados de paridade.
|
||||
|
||||
Todos os arquivos e dados de paridade são comparados com o estado de
|
||||
snapshot salvo na última `sync`.
|
||||
Se uma diferença for encontrada, ela é revertida para o snapshot armazenado.
|
||||
Todos os arquivos e dados de paridade são comparados com o estado salvo no
|
||||
último `sync`. Se for encontrada uma diferença, esta é revertida para o estado armazenado.
|
||||
|
||||
ATENÇÃO! O comando `fix` não diferencia entre erros e modificações
|
||||
intencionais. Ele reverte incondicionalmente o estado do arquivo
|
||||
para a última `sync`.
|
||||
AVISO!
|
||||
O comando `fix` não diferencia erros de modificações intencionais.
|
||||
Reverte incondicionalmente o estado do arquivo para o do último `sync`.
|
||||
|
||||
Se nenhuma outra opção for especificada, todo o array é processado.
|
||||
Use as opções de filtro para selecionar um subconjunto de arquivos ou
|
||||
|
|
@ -667,13 +674,13 @@ discos para operar.
|
|||
Para corrigir apenas os blocos marcados como ruins durante `sync` e `scrub`,
|
||||
use a opção -e, --filter-error.
|
||||
Ao contrário de outras opções de filtro, esta aplica correções apenas a
|
||||
arquivos que não foram alterados desde a última `sync`.
|
||||
arquivos que não foram alterados desde o último `sync`.
|
||||
|
||||
O SnapRAID renomeia todos os arquivos que não podem ser corrigidos adicionando
|
||||
a extensão `.unrecoverable`.
|
||||
|
||||
Antes de corrigir, todo o array é escaneado para encontrar quaisquer
|
||||
arquivos movidos desde a última operação `sync`.
|
||||
arquivos movidos desde a última operação de `sync`.
|
||||
Esses arquivos são identificados por seu carimbo de data/hora, ignorando
|
||||
seu nome e diretório, e são usados no processo de recuperação, se
|
||||
necessário.
|
||||
|
|
@ -815,8 +822,8 @@ Esteja ciente de que tais arquivos não estarão protegidos pela paridade durant
|
|||
o processo de realocação.
|
||||
|
||||
|
||||
6 OPçõES
|
||||
========
|
||||
6 OPçõES (OPTIONS)
|
||||
==================
|
||||
|
||||
SnapRAID fornece as seguintes opções:
|
||||
|
||||
|
|
@ -892,9 +899,9 @@ SnapRAID fornece as seguintes opções:
|
|||
Esta opção pode ser usada apenas com `check`.
|
||||
|
||||
-h, --pre-hash
|
||||
Em `sync`, executa uma fase de hash preliminar de todos os novos dados
|
||||
Em `sync`, executa uma fase de hash prexcluir de todos os novos dados
|
||||
para verificação adicional antes do cálculo da paridade.
|
||||
Normalmente, em `sync`, nenhum hash preliminar é feito, e os novos
|
||||
Normalmente, em `sync`, nenhum hash prexcluir é feito, e os novos
|
||||
dados são hashados logo antes do cálculo da paridade, quando são lidos
|
||||
pela primeira vez.
|
||||
Este processo ocorre quando o sistema está sob
|
||||
|
|
@ -931,7 +938,7 @@ SnapRAID fornece as seguintes opções:
|
|||
RATE é o número de bytes por segundo. Você pode especificar um
|
||||
multiplicador como K, M ou G (por exemplo, --bw-limit 1G).
|
||||
|
||||
-t, --tail TAMANHO
|
||||
-t, --tail SIZE
|
||||
Limita a listagem de arquivos àqueles que não usam mais do que o
|
||||
tamanho final especificado dos discos de paridade.
|
||||
Você pode usar multiplicadores como K, M, G ou T (ex: --tail 1G).
|
||||
|
|
@ -1037,9 +1044,9 @@ SnapRAID fornece as seguintes opções:
|
|||
recomendado não usá-la.
|
||||
Você NÃO tem proteção de dados durante a operação `sync`.
|
||||
|
||||
-W, --force-realloc-tail TAMANHO
|
||||
-W, --force-realloc-tail SIZE
|
||||
Funciona como -R, --force-realloc, mas limitado à parte final
|
||||
especificada (últimos TAMANHO bytes) de cada arquivo de paridade.
|
||||
especificada (últimos SIZE bytes) de cada arquivo de paridade.
|
||||
Força a realocação (movimentação) de quaisquer fragmentos/blocos de arquivos
|
||||
atualmente armazenados nessa seção final, permitindo que sejam colocados
|
||||
em qualquer lugar no(s) arquivo(s) de paridade onde houver espaço livre
|
||||
|
|
@ -1053,10 +1060,9 @@ SnapRAID fornece as seguintes opções:
|
|||
--force-realloc-tail 1G).
|
||||
Você pode usar locate -t, --tail para saber antecipadamente os
|
||||
arquivos afetados.
|
||||
AVISO!
|
||||
Esta opção é apenas para especialistas e é altamente recomendado
|
||||
não utilizá-la.
|
||||
Você NÃO terá proteção de datos durante a operação `sync` para os
|
||||
ATENÇÃO! Esta opção é apenas para especialistas e é altamente
|
||||
recomendado não usá-la.
|
||||
Você NÃO tem proteção de dados durante a operação `sync` para os
|
||||
arquivos afetados.
|
||||
|
||||
-l, --log FILE
|
||||
|
|
@ -1127,8 +1133,8 @@ SnapRAID fornece as seguintes opções:
|
|||
Imprime a versão do programa.
|
||||
|
||||
|
||||
7 CONFIGURAçãO
|
||||
==============
|
||||
7 CONFIGURAçãO (CONFIGURATION)
|
||||
==============================
|
||||
|
||||
SnapRAID requer um arquivo de configuração para saber onde seu array
|
||||
de discos está localizado e onde armazenar as informações de paridade.
|
||||
|
|
@ -1245,21 +1251,48 @@ armazenado dos discos.
|
|||
Define o nome e o ponto de montagem de discos adicionais para
|
||||
monitorar com os comandos `smart` e `probe`.
|
||||
|
||||
Isso é útil para monitorar discos que não fazem parte da matriz,
|
||||
Isso é útil para monitorar discos que não fazem parte do array,
|
||||
mas que são necessários para o funcionamento do sistema, como o
|
||||
disco de inicialização.
|
||||
|
||||
Observe que tais discos não são afetados pelos comandos `up` e `down`
|
||||
porque se espera que estejam sempre girando.
|
||||
|
||||
7.7 nohidden
|
||||
7.7 snapshot
|
||||
------------
|
||||
|
||||
Ativa o uso de instantâneos (snapshots) do sistema de arquivos para os comandos `sync`, `scrub`,
|
||||
`check` e `fix`.
|
||||
|
||||
Quando ativado, o SnapRAID cria um instantâneo de somente leitura dos seus dados no
|
||||
início de um 'sync'. Isso garante uma visão consistente e num ponto específico no tempo dos seus
|
||||
arquivos, prevenindo erros causados por modificações concorrentes de arquivos.
|
||||
|
||||
Isso melhora significativamente a recuperação: se um arquivo for excluído do sistema de arquivos ativo,
|
||||
ele permanece preservado no instantâneo. Isso evita que a paridade fique "corrompida"
|
||||
para esse bloco, garantindo que ainda pode recuperar os dados com sucesso
|
||||
se outro disco falhar.
|
||||
|
||||
Esta opção aplica-se exclusivamente a discos de dados formatados com os sistemas de
|
||||
arquivos Btrfs, Bcachefs ou ZFS em Linux e NTFS em Windows.
|
||||
Discos de paridade, ou discos de dados que utilizem outros sistemas de arquivos, usarão sempre
|
||||
a versão ativa do sistema de arquivos.
|
||||
|
||||
A criação e exclusão de instantâneos requerem privilégios administrativos.
|
||||
Garanta que o SnapRAID é executado com as permissões necessárias (ex: sudo) quando
|
||||
esta opção estiver ativada.
|
||||
|
||||
Consulte a seção SNAPSHOTS para uma explicação detalhada do ciclo de vida
|
||||
dos instantâneos.
|
||||
|
||||
7.8 nohidden
|
||||
------------
|
||||
|
||||
Exclui todos os arquivos e diretórios ocultos.
|
||||
No Unix, arquivos ocultos são aqueles que começam com `.`.
|
||||
No Windows, são aqueles com o atributo oculto.
|
||||
|
||||
7.8 exclude/include PATTERN
|
||||
7.9 exclude/include PATTERN
|
||||
---------------------------
|
||||
|
||||
Define os padrões de arquivo ou diretório a serem excluídos ou incluídos
|
||||
|
|
@ -1277,8 +1310,8 @@ especificações de padrão.
|
|||
|
||||
Esta opção pode ser usada várias vezes.
|
||||
|
||||
7.9 blocksize SIZE_IN_KIBIBYTES
|
||||
-------------------------------
|
||||
7.10 blocksize SIZE_IN_KIBIBYTES
|
||||
--------------------------------
|
||||
|
||||
Define o tamanho básico do bloco em kibibytes para a paridade.
|
||||
Um kibibyte é 1024 bytes.
|
||||
|
|
@ -1327,7 +1360,7 @@ Isso resulta em cerca de 1,5% de espaço extra, aproximadamente 60 GB para
|
|||
um disco de 4 TB, o que permite cerca de 460.000 arquivos em cada disco
|
||||
de dados sem qualquer espaço desperdiçado.
|
||||
|
||||
7.10 hashsize SIZE_IN_BYTES
|
||||
7.11 hashsize SIZE_IN_BYTES
|
||||
---------------------------
|
||||
|
||||
Define o tamanho do hash em bytes para os blocos salvos.
|
||||
|
|
@ -1365,7 +1398,7 @@ Mudando para um tamanho de hash de 8 e um tamanho de bloco de 512, você obtém:
|
|||
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0.51 GiB
|
||||
|
||||
7.11 autosave SIZE_IN_GIGABYTES
|
||||
7.12 autosave SIZE_IN_GIGABYTES
|
||||
-------------------------------
|
||||
|
||||
Salva automaticamente o estado ao sincronizar ou examinar após a
|
||||
|
|
@ -1373,7 +1406,7 @@ quantidade especificada de GB processados.
|
|||
Esta opção é útil para evitar reiniciar longos comandos `sync`
|
||||
do zero se interrompidos por uma falha de máquina ou qualquer outro evento.
|
||||
|
||||
7.12 temp_limit TEMPERATURE_CELSIUS
|
||||
7.13 temp_limit TEMPERATURE_CELSIUS
|
||||
-----------------------------------
|
||||
|
||||
Define a temperatura máxima permitida do disco em Celsius. Quando especificado,
|
||||
|
|
@ -1388,7 +1421,7 @@ temperatura for atingido mais uma vez.
|
|||
Durante a operação, o SnapRAID também analisa a curva de aquecimento de
|
||||
cada disco e estima a temperatura estável de longo prazo que eles
|
||||
devem atingir se a atividade continuar. A estimativa é realizada apenas
|
||||
depois que a temperatura do disco aumentou quatro vezes, garantindo
|
||||
depois que a temperatura do disco tiver subido quatro vezes, garantindo
|
||||
que pontos de dados suficientes estejam disponíveis para estabelecer uma
|
||||
tendência confiável.
|
||||
Esta temperatura estável prevista é mostrada entre parênteses ao lado
|
||||
|
|
@ -1406,14 +1439,14 @@ referência de fallback.
|
|||
Normalmente, o SnapRAID mostra apenas a temperatura do disco mais quente.
|
||||
Para exibir a temperatura de todos os discos, use a opção -A ou --stats.
|
||||
|
||||
7.13 temp_sleep TIME_IN_MINUTES
|
||||
7.14 temp_sleep TIME_IN_MINUTES
|
||||
-------------------------------
|
||||
|
||||
Define o tempo de espera (standby time), em minutos, quando o limite de
|
||||
temperatura é atingido. Durante este período, os discos permanecem
|
||||
desligados. O padrão é 5 minutos.
|
||||
|
||||
7.14 pool DIR
|
||||
7.15 pool DIR
|
||||
-------------
|
||||
|
||||
Define o diretório de pooling onde a visualização virtual do array
|
||||
|
|
@ -1421,7 +1454,7 @@ de discos é criada usando o comando `pool`.
|
|||
|
||||
O diretório já deve existir.
|
||||
|
||||
7.15 share UNC_DIR
|
||||
7.16 share UNC_DIR
|
||||
------------------
|
||||
|
||||
Define o caminho UNC do Windows necessário para acessar os discos remotamente.
|
||||
|
|
@ -1437,7 +1470,7 @@ e finalmente adicionando o diretório e nome do arquivo.
|
|||
|
||||
Esta opção é necessária apenas para Windows.
|
||||
|
||||
7.16 smartctl DISK/PARITY OPTIONS...
|
||||
7.17 smartctl DISK/PARITY OPTIONS...
|
||||
------------------------------------
|
||||
|
||||
Define opções smartctl personalizadas para obter os atributos SMART para
|
||||
|
|
@ -1454,6 +1487,9 @@ Nas OPTIONS especificadas, a string `%s` é substituída pelo
|
|||
nome do dispositivo. Para controladores RAID, o dispositivo é
|
||||
provavelmente fixo, e você pode não precisar usar `%s`.
|
||||
|
||||
Você também pode especificar uma string personalizada de opções de informação
|
||||
usando a tag `[info: ...]` para substituir a opção padrão `-a`.
|
||||
|
||||
Consulte a documentação do smartmontools para possíveis opções:
|
||||
|
||||
https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
|
|
@ -1461,9 +1497,10 @@ Consulte a documentação do smartmontools para possíveis opções:
|
|||
|
||||
Por exemplo:
|
||||
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl parity -d sat %s
|
||||
|
||||
7.17 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
7.18 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
-------------------------------------------
|
||||
|
||||
Ignora o atributo SMART especificado ao calcular a probabilidade
|
||||
|
|
@ -1475,16 +1512,21 @@ PARITY é um dos nomes de paridade: `parity`, `2-parity`, `3-parity`,
|
|||
`4-parity`, `5-parity`, `6-parity` ou `z-parity`.
|
||||
O valor especial * pode ser usado para ignorar o atributo em todos os discos.
|
||||
|
||||
Por exemplo, para ignorar o atributo `Current Pending Sector Count` em
|
||||
todos os discos:
|
||||
Múltiplos atributos podem ser especificados separados por espaços.
|
||||
Cada atributo pode ser especificado como um número de 1 a 255, ou como um
|
||||
nome insensível a maiúsculas/minúsculas (por exemplo, `Current_Pending_Sector`).
|
||||
|
||||
smartignore * 197
|
||||
Por exemplo, para ignorar os atributos `Current Pending Sector Count` e
|
||||
`Reallocated Sectors Count` em todos os discos pelo seu número ou nome:
|
||||
|
||||
Para ignorá-lo apenas no primeiro disco de paridade:
|
||||
smartignore * 197 5
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
smartignore parity 197
|
||||
Para ignorá-los apenas no primeiro disco de paridade:
|
||||
|
||||
7.18 Exemplos
|
||||
smartignore parity 197 5
|
||||
|
||||
7.19 Exemplos
|
||||
-------------
|
||||
|
||||
Um exemplo de uma configuração típica para Unix é:
|
||||
|
|
@ -1497,7 +1539,7 @@ Um exemplo de uma configuração típica para Unix é:
|
|||
data d3 /mnt/disk3/
|
||||
exclude /lost+found/
|
||||
exclude /tmp/
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/sg0
|
||||
smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1513,14 +1555,134 @@ Um exemplo de uma configuração típica para Windows é:
|
|||
exclude Thumbs.db
|
||||
exclude \$RECYCLE.BIN
|
||||
exclude \System Volume Information
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
|
||||
8 PADRãO (PATTERN)
|
||||
==================
|
||||
8 INSTANTâNEOS (SNAPSHOTS)
|
||||
==========================
|
||||
|
||||
Se a opção de instantâneo estiver ativada na configuração, o SnapRAID
|
||||
utiliza a funcionalidade de instantâneos do sistema de arquivos para garantir operações atômicas
|
||||
e consistentes.
|
||||
|
||||
A gestão de instantâneos é completamente automática e transparente.
|
||||
Pode continuar a utilizar o SnapRAID exatamente como antes, com a
|
||||
proteção adicional fornecida por instantâneos geridos inteiramente em
|
||||
segundo plano.
|
||||
|
||||
Isso proporciona dois benefícios principais:
|
||||
|
||||
Consistência - Arquivos modificados no sistema de arquivos ativo durante um sync ou scrub de
|
||||
longa duração não causarão divergências de paridade ou operações abortadas,
|
||||
pois o SnapRAID vê uma imagem congelada no tempo.
|
||||
Recuperação - Se um arquivo for atualizado ou excluído do sistema de arquivos ativo,
|
||||
ele permanece preservado no instantâneo. Se ocorrer uma falha de disco
|
||||
antes de o próximo sync ser executado, o SnapRAID utiliza os dados preservados
|
||||
no instantâneo para reconstruir o disco com falha.
|
||||
|
||||
Em caso de falha de um disco durante um processo de sync ativo,
|
||||
o SnapRAID também é capaz de ler automaticamente tanto do instantâneo
|
||||
da computação de paridade anterior quanto da atual.
|
||||
Isso maximiza a probabilidade de uma recuperação completa ao
|
||||
fornecer acesso aos blocos de dados exatos necessários para resolver
|
||||
as equações de paridade, mesmo que esses blocos tenham sido modificados
|
||||
ou excluídos entre os syncs.
|
||||
|
||||
Sem instantâneos, um arquivo atualizado ou excluído num disco saudável
|
||||
resulta na falta de blocos de dados que podem ser necessários para
|
||||
reparar outros discos com falha.
|
||||
|
||||
Os instantâneos são criados apenas para discos de dados e apenas se o sistema de arquivos
|
||||
subjacente suportar esta funcionalidade. Os discos de paridade usam sempre
|
||||
o sistema de arquivos ativo.
|
||||
|
||||
Atualmente, isso é suportado em Btrfs, Bcachefs e ZFS em Linux
|
||||
e em NTFS em Windows.
|
||||
|
||||
Pode misturar discos de dados com sistemas de arquivos diferentes. Apenas aqueles que
|
||||
suportam instantâneos os utilizarão, enquanto os outros discos continuarão
|
||||
a operar diretamente no sistema de arquivos ativo.
|
||||
|
||||
A criação e exclusão de instantâneos requerem privilégios administrativos.
|
||||
Garanta que o SnapRAID é executado com as permissões necessárias (ex: sudo)
|
||||
quando os instantâneos estão ativados.
|
||||
|
||||
8.1 Comportamento dos Comandos com Instantâneos
|
||||
-----------------------------------------------
|
||||
|
||||
Os comandos `sync` e `scrub` operam ambos exclusivamente em instantâneos
|
||||
para garantir que todas as operações de dados sejam realizadas contra um estado consistente
|
||||
e congelado. Ao utilizar esses instantâneos, o SnapRAID previne divergências de paridade
|
||||
que, de outra forma, seriam despoletadas por modificações concorrentes de arquivos no sistema de arquivos ativo.
|
||||
Durante um `sync`, o comando usa um novo instantâneo criado no
|
||||
início do processo para capturar o estado atual para a computação da paridade.
|
||||
Em contraste, o comando `scrub` utiliza o último instantâneo, aquele
|
||||
criado durante o sync mais recente, para manter um ponto de referência confiável
|
||||
que corresponda à paridade existente.
|
||||
|
||||
Para os comandos `check` e `fix`, o uso do último instantâneo
|
||||
depende de discos específicos serem ou não alvo da operação utilizando a opção
|
||||
-d, --filter-disk.
|
||||
|
||||
Um disco explicitamente selecionado via -d (o "alvo" da operação)
|
||||
usa sempre o sistema de arquivos ativo. Para `fix`, isso permite restaurar
|
||||
dados para a substituição do disco ativo. Para `check`, permite simular
|
||||
a operação `fix` sob as mesmas condições.
|
||||
|
||||
Todos os outros discos de dados (os discos de "referência") serão acessados através dos
|
||||
seus instantâneos. Isso garante que, mesmo que esteja modificando arquivos
|
||||
nos seus discos saudáveis enquanto uma recuperação está em curso, o SnapRAID
|
||||
tem uma referência estável e congelada para resolver as equações de paridade.
|
||||
|
||||
Se nenhuma opção -d for fornecida, o SnapRAID assume que a operação se aplica
|
||||
a todo o array, neste caso, `check` e `fix` usarão os sistemas
|
||||
de arquivos ativos exclusivamente.
|
||||
|
||||
Todos os outros comandos operam exclusivamente no sistema de arquivos ativo.
|
||||
|
||||
|
||||
9 CICLO DE VIDA DOS INSTANTâNEOS (SNAPSHOTS LIFECYCLE)
|
||||
======================================================
|
||||
|
||||
O SnapRAID gerencia dois instantâneos específicos, `stable` (estável) e `pending` (pendente),
|
||||
dentro de um diretório oculto na raiz de cada subvolume de dados.
|
||||
Em Btrfs, Bcachefs e NTFS é utilizado o diretório `.snapraid/`,
|
||||
em ZFS o padrão `.zfs/snapshot/`.
|
||||
|
||||
O instantâneo `stable` representa o estado do último
|
||||
`sync` concluído com sucesso, contendo os dados exatos utilizados para
|
||||
computar a paridade atual. Serve como a principal fonte de dados
|
||||
para os comandos `scrub`, `check` e `fix`.
|
||||
|
||||
O instantâneo `pending` é uma imagem temporária criada ao início
|
||||
de um `sync` para fornecer um estado congelado para a computação da paridade.
|
||||
Após a conclusão bem-sucedida da operação, o instantâneo `stable` anterior
|
||||
é excluído, e o instantâneo `pending` é promovido para
|
||||
tomar o seu lugar como a nova referência estável.
|
||||
|
||||
Se um `sync` for interrompido, o instantâneo `pending` é preservado.
|
||||
Os comandos subsequentes `scrub`, `check` e `fix` utilizarão este
|
||||
instantâneo pendente, pois ele corresponde ao estado do sistema de arquivos registrado no
|
||||
arquivo .content, mesmo que a paridade esteja apenas parcialmente sincronizada.
|
||||
|
||||
No caso de uma interrupção do `sync`, os comandos `check` e `fix`
|
||||
também leem do instantâneo `stable` para recuperar blocos de dados
|
||||
de arquivos que foram atualizados ou excluídos durante o sync.
|
||||
Isso é possível porque o arquivo .content retém metadados para
|
||||
todos os arquivos modificados ou excluídos ao longo do processo de sync.
|
||||
Esta informação histórica só é limpa quando um sync termina
|
||||
com sucesso e a versão final do arquivo .content é salva.
|
||||
|
||||
Se um `sync` for reiniciado após uma interrupção, o instantâneo pending existente
|
||||
é excluído e um novo é criado para
|
||||
capturar o estado atual do sistema de arquivos ativo.
|
||||
|
||||
|
||||
10 PADRãO (PATTERN)
|
||||
===================
|
||||
|
||||
Os padrões fornecem uma maneira flexível de filtrar arquivos para inclusão ou
|
||||
exclusão. Ao usar caracteres de globbing, você pode definir regras que
|
||||
|
|
@ -1635,11 +1797,11 @@ Por exemplo:
|
|||
snapraid -f "*.mp3" check
|
||||
|
||||
No Unix, ao usar caracteres globbing na linha de comando, você deve
|
||||
citá-los para evitar que o shell os expanda.
|
||||
colocá-los entre aspas para evitar que o shell os expanda.
|
||||
|
||||
|
||||
9 IGNORAR ARQUIVOS (IGNORE FILE)
|
||||
================================
|
||||
11 IGNORAR ARQUIVOS (IGNORE FILE)
|
||||
=================================
|
||||
|
||||
Além das regras globais no arquivo de configuração, você pode colocar
|
||||
arquivos `.snapraidignore` em qualquer diretório dentro do array para definir
|
||||
|
|
@ -1683,7 +1845,7 @@ Por exemplo, se você tiver um `.snapraidignore` em `/mnt/disk1/projects/`:
|
|||
*.tmp
|
||||
|
||||
|
||||
10 CONTEúDO (CONTENT)
|
||||
12 CONTEúDO (CONTENT)
|
||||
=====================
|
||||
|
||||
SnapRAID armazena a lista e os checksums de seus arquivos no arquivo content.
|
||||
|
|
@ -1691,11 +1853,13 @@ SnapRAID armazena a lista e os checksums de seus arquivos no arquivo content.
|
|||
É um arquivo binário que lista todos os arquivos presentes em seu array
|
||||
de discos, juntamente com todos os checksums para verificar sua integridade.
|
||||
|
||||
Este arquivo é lido e escrito pelos comandos `sync` e `scrub` e
|
||||
lido pelos comandos `fix`, `check` e `status`.
|
||||
O arquivo content é lido e escrito pelos comandos `sync`, `scrub`,
|
||||
`touch` e `rehash`. É lido pelos comandos `status`, `diff`, `check`,
|
||||
`fix`, `list`, `dup`, `locate` e `pool`, e é completamente ignorado
|
||||
pelos comandos `smart`, `probe`, `up`, `down` e `devices`.
|
||||
|
||||
|
||||
11 PARIDADE (PARITY)
|
||||
13 PARIDADE (PARITY)
|
||||
====================
|
||||
|
||||
SnapRAID armazena as informações de paridade do seu array nos arquivos parity.
|
||||
|
|
@ -1707,7 +1871,7 @@ Estes arquivos são lidos e escritos pelos comandos `sync` e `fix` e
|
|||
apenas lidos pelos comandos `scrub` e `check`.
|
||||
|
||||
|
||||
12 CODIFICAçãO (ENCODING)
|
||||
14 CODIFICAçãO (ENCODING)
|
||||
=========================
|
||||
|
||||
SnapRAID no Unix ignora qualquer codificação. Ele lê e armazena os
|
||||
|
|
@ -1724,13 +1888,30 @@ redirecionar a saída do console para um arquivo, o arquivo resultante
|
|||
estará sempre no formato UTF-8.
|
||||
|
||||
|
||||
13 DIREITOS AUTORAIS (COPYRIGHT)
|
||||
================================
|
||||
15 CóDIGO DE SAíDA (EXIT CODE)
|
||||
==============================
|
||||
|
||||
Este arquivo é Copyright (C) 2025 Andrea Mazzoleni
|
||||
O SnapRAID termina com os seguintes códigos de erro:
|
||||
|
||||
0 - Tudo OK.
|
||||
1 - O comando encontrou alguns erros.
|
||||
2 - O comando `diff` determinou que tudo está OK, mas é necessário um `sync`.
|
||||
|
||||
|
||||
14 VEJA TAMBéM (SEE ALSO)
|
||||
16 TRADUçãO (TRANSLATION)
|
||||
=========================
|
||||
|
||||
snapraid_log(1), snapraidd(1)
|
||||
Este documento é uma tradução automática do manual em inglês.
|
||||
Consulte o manual em inglês para a versão oficial.
|
||||
|
||||
|
||||
17 DIREITOS AUTORAIS (COPYRIGHT)
|
||||
================================
|
||||
|
||||
Este arquivo é Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
|
||||
18 VEJA TAMBéM (SEE ALSO)
|
||||
=========================
|
||||
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
.TH "SnapRAID Backup pentru Matrici de Discuri" 1
|
||||
.SH NAME
|
||||
snapraid \- SnapRAID Backup pentru Matrici de Discuri
|
||||
.SH SINTAXă
|
||||
.SH SINTAXă (SYNOPSIS)
|
||||
snapraid [\-c, \-\-conf CONFIG]
|
||||
.PD 0
|
||||
.PP
|
||||
|
|
@ -77,7 +77,7 @@ snapraid [\-c, \-\-conf CONFIG]
|
|||
snapraid [\-V, \-\-version] [\-H, \-\-help] [\-C, \-\-gen\-conf CONTENT]
|
||||
.PD 0
|
||||
.PD
|
||||
.SH DESCRIERE
|
||||
.SH DESCRIERE (DESCRIPTION)
|
||||
SnapRAID este un program de backup conceput pentru matrici de discuri, care stochează
|
||||
informații de paritate pentru recuperarea datelor în cazul a până la șase
|
||||
defecte de disc.
|
||||
|
|
@ -87,7 +87,7 @@ care se schimbă rar, SnapRAID oferă câteva caracteristici:
|
|||
.PD 0
|
||||
.IP \(bu
|
||||
Puteți utiliza discuri deja pline cu fișiere fără
|
||||
nevoia de a le reformat, accesându\-le ca de obicei.
|
||||
nevoia de a le reformata, accesându\-le ca de obicei.
|
||||
.IP \(bu
|
||||
Toate datele dvs. sunt hash\-uite pentru a asigura integritatea datelor și a preveni
|
||||
corupția silențioasă.
|
||||
|
|
@ -104,7 +104,7 @@ Discurile pot avea dimensiuni diferite.
|
|||
Puteți adăuga discuri în orice moment.
|
||||
.IP \(bu
|
||||
SnapRAID nu vă blochează datele; puteți înceta să\-l utilizați
|
||||
oricând fără a reforma sau muta date.
|
||||
oricând fără a reformata sau muta date.
|
||||
.IP \(bu
|
||||
Pentru a accesa un fișier, este necesar să se rotească doar un singur disc, economisind
|
||||
energie și reducând zgomotul.
|
||||
|
|
@ -117,22 +117,34 @@ https://www.snapraid.it/
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH LIMITăRI
|
||||
SnapRAID este un hibrid între un program RAID și unul de backup, care urmărește să combine
|
||||
cele mai bune beneficii ale ambelor. Cu toate acestea, are unele limitări pe care ar trebui
|
||||
.SH LIMITăRI (LIMITATIONS)
|
||||
SnapRAID este un hibrid între un RAID și un program de backup, având ca scop combinarea
|
||||
celor mai bune avantaje ale ambelor. Cu toate acestea, are unele limitări pe care ar trebui
|
||||
să le luați în considerare înainte de a\-l utiliza.
|
||||
.PP
|
||||
Principala limitare este că, dacă un disc se defectează și nu ați făcut recent o sincronizare,
|
||||
este posibil să nu puteți recupera complet.
|
||||
Mai exact, este posibil să nu puteți recupera până la dimensiunea
|
||||
fișierelor modificate sau șterse de la ultima operațiune de sincronizare.
|
||||
Acest lucru se întâmplă chiar dacă fișierele modificate sau șterse nu sunt pe
|
||||
discul defect. Acesta este motivul pentru care SnapRAID este mai potrivit pentru
|
||||
date care se schimbă rar.
|
||||
Principala limitare este că, dacă un disc se defectează, puteți recupera datele doar până la
|
||||
starea ultimei operațiuni de \`sync\`. Orice date adăugate sau modificări efectuate
|
||||
de la ultima sincronizare care se află pe discul defect vor fi pierdute.
|
||||
.PP
|
||||
Pe de altă parte, fișierele nou adăugate nu împiedică recuperarea fișierelor
|
||||
deja existente. Veți pierde doar fișierele adăugate recent dacă acestea
|
||||
se află pe discul defect.
|
||||
Prin urmare, SnapRAID este potrivit în principal pentru date care se modifică rar.
|
||||
.PP
|
||||
Pentru datele care existau deja la ultima sincronizare, fiabilitatea recuperării depinde
|
||||
de utilizarea sau nu a opțiunii \`snapshot\`:
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Cu suport pentru snapshot (disponibil pe Btrfs, ZFS, Bcachefs și NTFS),
|
||||
SnapRAID poate menține automat o referință înghețată a discurilor de date.
|
||||
Acest lucru asigură că, chiar dacă modificați sau ștergeți fișiere pe sistemul de fișiere live
|
||||
în timpul sau după un sync, procesul de recuperare rămâne consistent și de încredere.
|
||||
.PD
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Fără suport pentru snapshot, ștergerea sau modificarea fișierelor după un \`sync\`
|
||||
poate împiedica recuperarea completă a altor discuri defecte. Acest lucru se întâmplă
|
||||
deoarece paritatea nu mai corespunde cu fișierele modificate, chiar dacă
|
||||
acele fișiere nu se află pe discul defect. Pe de altă parte, fișierele nou adăugate
|
||||
nu împiedică recuperarea fișierelor deja existente.
|
||||
.PD
|
||||
.PP
|
||||
Alte limitări ale SnapRAID sunt:
|
||||
.PD 0
|
||||
|
|
@ -153,7 +165,7 @@ a întregii matrici de discuri.
|
|||
Sunt salvate doar numele fișierelor, mărcile temporale, symlink\-urile și hardlink\-urile.
|
||||
Permisiunile, proprietarul și atributele extinse nu sunt salvate.
|
||||
.PD
|
||||
.SH NOțIUNI DE BAZă
|
||||
.SH NOțIUNI DE BAZă (GETTING STARTED)
|
||||
Pentru a utiliza SnapRAID, trebuie mai întâi să selectați un disc în matricea dvs. de discuri
|
||||
pentru a\-l dedica informațiilor de \`paritate\`. Cu un singur disc pentru paritate, veți
|
||||
putea recupera dintr\-o singură defecțiune de disc, similar cu RAID5.
|
||||
|
|
@ -298,7 +310,7 @@ Când această comandă se finalizează, datele dvs. sunt ÎN SIGURANȚĂ.
|
|||
.PP
|
||||
Acum puteți începe să utilizați matricea după cum doriți și
|
||||
să actualizați periodic informațiile de paritate rulând comanda \`sync\`.
|
||||
.SS Scrubbing (Verificare)
|
||||
.SS Verificare (Scrubbing)
|
||||
Pentru a verifica periodic datele și paritatea pentru erori, puteți
|
||||
rula comanda \`scrub\`.
|
||||
.PP
|
||||
|
|
@ -355,10 +367,10 @@ snapraid \-p bad scrub
|
|||
Rularea \`scrub\` pe o matrice nesincronizată poate raporta erori cauzate de
|
||||
fișiere eliminate sau modificate. Aceste erori sunt raportate în ieșirea \`scrub\`,
|
||||
dar blocurile aferente nu sunt marcate ca defecte.
|
||||
.SS Pooling (Agregare)
|
||||
.SS Agregare (Pooling)
|
||||
Notă: Funcționalitatea de pooling descrisă mai jos a fost înlocuită de instrumentul
|
||||
mergerfs, care este acum opțiunea recomandată pentru utilizatorii Linux în
|
||||
comunitatea SnapRAID. Mergefs oferă o modalitate mai flexibilă și eficientă
|
||||
comunitatea SnapRAID. Mergerfs oferă o modalitate mai flexibilă și eficientă
|
||||
de a agrega mai multe discuri într\-un singur punct de montare unificat,
|
||||
permițând accesul neîntrerupt la fișiere pe toată matricea dvs. fără a se baza
|
||||
pe link\-uri simbolice. Se integrează bine cu SnapRAID pentru protecția parității
|
||||
|
|
@ -367,7 +379,7 @@ sau configurații NAS personalizate.
|
|||
.PP
|
||||
Pentru a avea toate fișierele din matricea dvs. afișate în același arbore de directoare,
|
||||
puteți activa funcționalitatea de \`pooling\`. Aceasta creează o vizualizare virtuală
|
||||
doar în citire a tuturor fișierelor din matricea dvs. folosind link\-uri simbolice.
|
||||
read\-only a tuturor fișierelor din matricea dvs. folosind link\-uri simbolice.
|
||||
.PP
|
||||
Puteți configura directorul de \`pooling\` în fișierul de configurare cu:
|
||||
.PP
|
||||
|
|
@ -502,7 +514,7 @@ fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Undeleting (Anulare Ștergere)
|
||||
.SS Anulare ștergere (Undeleting)
|
||||
SnapRAID funcționează mai mult ca un program de backup decât un sistem RAID și poate
|
||||
fi folosit pentru a restaura sau anula ștergerea fișierelor la starea lor anterioară utilizând
|
||||
opțiunea \-f, \-\-filter:
|
||||
|
|
@ -538,7 +550,7 @@ snapraid fix \-m
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Recuperare
|
||||
.SS Recuperare (Recovering)
|
||||
Cel mai rău s\-a întâmplat și ați pierdut unul sau mai multe discuri!
|
||||
.PP
|
||||
NU INTRAȚI ÎN PANICĂ! Veți putea să le recuperați!
|
||||
|
|
@ -556,7 +568,7 @@ Modificați fișierul de configurare SnapRAID pentru a face ca opțiunea \`data\
|
|||
a discului defect să indice o locație cu suficient spațiu gol
|
||||
pentru a recupera fișierele.
|
||||
.PP
|
||||
De exemplu, dacă discul \`d1\` a eșuat, schimbați de la:
|
||||
De exemplu, dacă discul \`d1\` s\-a defectat, schimbați de la:
|
||||
.PP
|
||||
.RS 4
|
||||
data d1 /mnt/disk1/
|
||||
|
|
@ -603,7 +615,7 @@ verificând toate liniile care încep cu \`unrecoverable:\`.
|
|||
Dacă nu sunteți mulțumit de recuperare, o puteți reîncerca de câte
|
||||
ori doriți.
|
||||
.PP
|
||||
De exemplu, dacă ați eliminat fișiere din matrice după ultima
|
||||
De exemplu, dacă ați eliminat fișiere din matrice după ultimul
|
||||
\`sync\`, acest lucru poate duce la nerecuperarea unor fișiere.
|
||||
În acest caz, puteți reîncerca \`fix\`\-ul utilizând opțiunea \-i, \-\-import,
|
||||
specificând unde se află acum aceste fișiere pentru a le include din nou în
|
||||
|
|
@ -639,19 +651,19 @@ snapraid sync
|
|||
.RE
|
||||
.PP
|
||||
Dacă totul este recuperat, această comandă este imediată.
|
||||
.SH COMENZI
|
||||
.SH COMENZI (COMMANDS)
|
||||
SnapRAID oferă câteva comenzi simple care vă permit să:
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Tipăriți starea matricei \-> \`status\`
|
||||
Afișați starea matricei \-> \`status\`
|
||||
.IP \(bu
|
||||
Controlați discurile \-> \`smart\`, \`probe\`, \`up\`, \`down\`
|
||||
.IP \(bu
|
||||
Faceți un backup/snapshot \-> \`sync\`
|
||||
Creați un punct de backup/recuperare \-> \`sync\`
|
||||
.IP \(bu
|
||||
Verificați periodic datele \-> \`scrub\`
|
||||
.IP \(bu
|
||||
Restaurați ultimul backup/snapshot \-> \`fix\`.
|
||||
Restaurați ultimul punct de backup/recuperare \-> \`fix\`.
|
||||
.PD
|
||||
.PP
|
||||
Comenzile trebuie scrise cu litere mici.
|
||||
|
|
@ -677,7 +689,7 @@ Nimic nu este modificat.
|
|||
Tipărește un raport SMART al tuturor discurilor din sistem.
|
||||
.PP
|
||||
Include o estimare a probabilității de eșec în anul următor,
|
||||
permițându\-vă să planificați înlocuiri de întreținere a discurilor care prezintă
|
||||
permițându\-vă să planificați înlocuiri de întreținere ale discurilor care prezintă
|
||||
atribute suspecte.
|
||||
.PP
|
||||
Această estimare a probabilității este obținută prin corelarea atributelor SMART
|
||||
|
|
@ -689,7 +701,7 @@ https://www.backblaze.com/hard\-drive\-test\-data.html
|
|||
.PD
|
||||
.RE
|
||||
.PP
|
||||
Dacă SMART raportează că un disc este pe cale să eșueze, \`FAIL\` sau \`PREFAIL\` este tipărit
|
||||
Dacă SMART raportează că un disc este pe cale să se defecteze, \`FAIL\` sau \`PREFAIL\` este tipărit
|
||||
pentru acel disc, iar SnapRAID returnează o eroare.
|
||||
În acest caz, înlocuirea imediată a discului este puternic recomandată.
|
||||
.PP
|
||||
|
|
@ -734,7 +746,7 @@ o comandă personalizată utilizând opțiunea \`smartctl\` în fișierul de con
|
|||
.PP
|
||||
Nimic nu este modificat.
|
||||
.SS up
|
||||
Pornirea tuturor discurilor din matrice.
|
||||
Pornește toate discurile din matrice.
|
||||
.PP
|
||||
Puteți porni doar discuri specifice utilizând opțiunea \-d, \-\-filter\-disk.
|
||||
.PP
|
||||
|
|
@ -743,7 +755,7 @@ Asigurați\-vă că sursa dvs. de alimentare o poate susține.
|
|||
.PP
|
||||
Nimic nu este modificat.
|
||||
.SS down
|
||||
Oprirea (spin down) tuturor discurilor din matrice.
|
||||
Oprește (spin down) toate discurile din matrice.
|
||||
.PP
|
||||
Această comandă utilizează instrumentul \`smartctl\` și este echivalentă cu rularea
|
||||
\`smartctl \-s standby,now\` pe toate dispozitivele.
|
||||
|
|
@ -756,7 +768,7 @@ atunci când apare o eroare.
|
|||
.PP
|
||||
Nimic nu este modificat.
|
||||
.SS diff
|
||||
Listează toate fișierele modificate de la ultima \`sync\` care trebuie
|
||||
Listează toate fișierele modificate de la ultimul \`sync\` care trebuie
|
||||
să li se recalculeze datele de paritate.
|
||||
.PP
|
||||
Această comandă nu verifică datele fișierului, ci doar marca temporală,
|
||||
|
|
@ -789,8 +801,8 @@ Sunt identificate având același nume, dimensiune, marcă temporală
|
|||
Fișiere copiate pe același disc sau pe un disc diferit
|
||||
unde fișierul original încă există.
|
||||
Acestea sunt identificate prin faptul că au același nume,
|
||||
dimensiune și amprentă temporală.
|
||||
Dacă amprenta temporală sub\-secundă este zero, calea completă
|
||||
dimensiune și marcă temporală.
|
||||
Dacă marca temporală sub\-secundă este zero, calea completă
|
||||
trebuie să se potrivească pentru a fi identificate, nu doar
|
||||
numele.
|
||||
.HP 4
|
||||
|
|
@ -798,20 +810,20 @@ numele.
|
|||
Fișiere mutate pe același disc sau pe un disc diferit
|
||||
unde originalul a dispărut.
|
||||
Acestea sunt identificate prin faptul că au același nume,
|
||||
dimensiune și amprentă temporală.
|
||||
Dacă amprenta temporală sub\-secundă este zero, calea completă
|
||||
dimensiune și marcă temporală.
|
||||
Dacă marca temporală sub\-secundă este zero, calea completă
|
||||
trebuie să se potrivească pentru a fi identificate.
|
||||
Spre deosebire de fișierele \'moved\' de pe același disc, fișierele
|
||||
relocate au un inod diferit.
|
||||
.HP 4
|
||||
.I restored
|
||||
Fișiere cu un inod diferit, dar care se potrivesc ca
|
||||
director, nume, dimensiune și amprentă temporală.
|
||||
director, nume, dimensiune și marcă temporală.
|
||||
Acestea sunt de obicei fișiere restaurate după ce au fost șterse.
|
||||
.PD
|
||||
.RE
|
||||
.PP
|
||||
Dacă este necesară o \`sync\`, codul de retur al procesului este 2, în loc de
|
||||
Dacă este necesară o sincronizare, codul de retur al procesului este 2, în loc de
|
||||
cel implicit 0. Codul de retur 1 este utilizat pentru o condiție de eroare generică.
|
||||
.PP
|
||||
Nimic nu este modificat.
|
||||
|
|
@ -882,13 +894,12 @@ Fișierele din matrice NU sunt modificate.
|
|||
.SS fix
|
||||
Repară toate fișierele și datele de paritate.
|
||||
.PP
|
||||
Toate fișierele și datele de paritate sunt comparate cu starea snapshot\-ului
|
||||
salvată la ultima \`sync\`.
|
||||
Dacă se găsește o diferență, este readusă la snapshot\-ul stocat.
|
||||
Toate fișierele și datele de paritate sunt comparate cu starea salvată în
|
||||
ultimul \`sync\`. Dacă se găsește o diferență, aceasta este readusă la starea stocată.
|
||||
.PP
|
||||
ATENȚIE! Comanda \`fix\` nu face diferența între erori și
|
||||
modificări intenționate. Ea revine necondiționat la starea fișierului
|
||||
de la ultima \`sync\`.
|
||||
AVERTISMENT!
|
||||
Comanda \`fix\` nu face diferența între erori și modificări intenționate.
|
||||
Ea revine necondiționat la starea fișierelor de la ultimul \`sync\`.
|
||||
.PP
|
||||
Dacă nu este specificată nicio altă opțiune, întreaga matrice este procesată.
|
||||
Utilizați opțiunile de filtrare pentru a selecta un subset de fișiere sau discuri de operat.
|
||||
|
|
@ -896,7 +907,7 @@ Utilizați opțiunile de filtrare pentru a selecta un subset de fișiere sau dis
|
|||
Pentru a repara doar blocurile marcate ca defecte în timpul \`sync\` și \`scrub\`,
|
||||
utilizați opțiunea \-e, \-\-filter\-error.
|
||||
Spre deosebire de alte opțiuni de filtrare, aceasta aplică reparații doar fișierelor care sunt
|
||||
neschimbate de la ultima \`sync\`.
|
||||
neschimbate de la ultimul \`sync\`.
|
||||
.PP
|
||||
SnapRAID redenumește toate fișierele care nu pot fi reparate adăugând extensia
|
||||
\`.unrecoverable\`.
|
||||
|
|
@ -932,7 +943,7 @@ Fișierele sunt identificate doar prin cale, nu prin inod.
|
|||
Nimic nu este modificat.
|
||||
.SS list
|
||||
Listează toate fișierele conținute în matrice la momentul
|
||||
ultimei \`sync\`.
|
||||
ultimului \`sync\`.
|
||||
.PP
|
||||
Cu \-v sau \-\-verbose, este afișat și timpul sub\-secundă.
|
||||
.PP
|
||||
|
|
@ -1011,12 +1022,11 @@ fragmente pe care le ocupă.
|
|||
.PP
|
||||
Puteți utiliza opțiunea \-t, \-\-tail pentru a restricționa operațiunea la fișierele
|
||||
care ocupă porțiunea finală specificată a parității.
|
||||
Dacă doriți să realocați aceste fișiere, puteți utiliza apoi opțiunea
|
||||
\-W, \-\-force\-realloc\-tail.
|
||||
.PP
|
||||
Rețineți că astfel de fișiere nu vor fi protejate de paritate în timpul procesului
|
||||
de realocare.
|
||||
.SH OPțIUNI
|
||||
Dacă doriți să realocați aceste fișiere, puteți utiliza apoi opțiunea
|
||||
\-W, \-\-force\-realloc\-tail. Rețineți că astfel de fișiere nu vor
|
||||
fi protejate de paritate în timpul procesului de realocare.
|
||||
.SH OPțIUNI (OPTIONS)
|
||||
SnapRAID oferă următoarele opțiuni:
|
||||
.TP
|
||||
.B \-c, \-\-conf CONFIG
|
||||
|
|
@ -1107,7 +1117,7 @@ Această opțiune poate fi utilizată doar cu \`sync\`.
|
|||
.TP
|
||||
.B \-i, \-\-import DIR
|
||||
Importă din directorul specificat orice fișiere șterse
|
||||
din matrice după ultima \`sync\`.
|
||||
din matrice după ultimul \`sync\`.
|
||||
Dacă mai aveți astfel de fișiere, ele pot fi utilizate de \`check\`
|
||||
și \`fix\` pentru a îmbunătăți procesul de recuperare.
|
||||
Fișierele sunt citite, inclusiv în subdirectoare, și sunt
|
||||
|
|
@ -1125,9 +1135,9 @@ chiar și atunci când o comandă eșuează.
|
|||
.B \-w, \-\-bw\-limit RATE
|
||||
Aplică o limită globală de lățime de bandă pentru toate discurile. RATE este
|
||||
numărul de octeți pe secundă. Puteți specifica un multiplicator
|
||||
cum ar fi K, M sau G (de exemplu, \-\-bw\-limit 1G).
|
||||
cum ar fi K, M, G sau T (de exemplu, \-\-bw\-limit 1G).
|
||||
.TP
|
||||
.B \-t, \-\-tail DIMENSIUNE
|
||||
.B \-t, \-\-tail SIZE
|
||||
Limitează listarea fișierelor la cele care nu utilizează mai mult de
|
||||
dimensiunea finală specificată a discurilor de paritate.
|
||||
Puteți utiliza multiplicatori precum K, M, G sau T (ex. \-\-tail 1G).
|
||||
|
|
@ -1170,11 +1180,7 @@ pe disc lipsesc sau au fost rescrise, se oprește din a continua
|
|||
dacă nu specificați această opțiune.
|
||||
Acest lucru vă permite să detectați cu ușurință când un sistem de fișiere de date nu este
|
||||
montat.
|
||||
Este permis, totuși, să aveți o singură schimbare de UUID cu
|
||||
paritate simplă și mai multe cu paritate multiplă, deoarece acesta este
|
||||
cazul normal la înlocuirea discurilor după o recuperare.
|
||||
Această opțiune poate fi utilizată doar cu \`sync\`, \`check\` sau
|
||||
\`fix\`.
|
||||
Această opțiune poate fi utilizată doar cu \`sync\`.
|
||||
.TP
|
||||
.B \-U, \-\-force\-uuid
|
||||
Forțează operațiunea nesigură de sincronizare, verificare și reparare
|
||||
|
|
@ -1231,7 +1237,7 @@ ATENȚIE! Această opțiune este doar pentru experți și este puternic
|
|||
recomandat să nu o utilizați.
|
||||
NU aveți protecție a datelor în timpul operațiunii \`sync\`.
|
||||
.TP
|
||||
.B \-W, \-\-force\-realloc\-tail DIMENSIUNE
|
||||
.B \-W, \-\-force\-realloc\-tail SIZE
|
||||
Funcționează ca \-R, \-\-force\-realloc, dar limitat la porțiunea finală
|
||||
specificată (ultimii DIMENSIUNE octeți) ai fiecărui fișier de paritate.
|
||||
Forțează realocarea (mutarea) oricăror fragmente/blocuri de fișiere stocate
|
||||
|
|
@ -1273,7 +1279,7 @@ Vedeți fișierul snapraid_log.txt sau pagina de manual pentru descrieri ale eti
|
|||
.B \-L, \-\-error\-limit NUMBER
|
||||
Setează o nouă limită de erori înainte de a opri execuția.
|
||||
În mod implicit, SnapRAID se oprește dacă întâlnește mai mult de 100
|
||||
de erori de intrare/ieșire, indicând că un disc probabil eșuează.
|
||||
de erori de intrare/ieșire, indicând că un disc probabil se defectează.
|
||||
Această opțiune afectează \`sync\` și \`scrub\`, cărora li se permite
|
||||
să continue după primul set de erori de disc pentru a încerca
|
||||
să își finalizeze operațiunile.
|
||||
|
|
@ -1317,7 +1323,7 @@ Tipărește un ecran de ajutor scurt.
|
|||
.TP
|
||||
.B \-V, \-\-version
|
||||
Tipărește versiunea programului.
|
||||
.SH CONFIGURARE
|
||||
.SH CONFIGURARE (CONFIGURATION)
|
||||
SnapRAID necesită un fișier de configurare pentru a ști unde se află matricea dvs. de discuri
|
||||
și unde să stocheze informațiile de paritate.
|
||||
.PP
|
||||
|
|
@ -1357,7 +1363,7 @@ Pentru fiecare nivel de paritate specificat, este activat un nivel suplimentar d
|
|||
.IP \(bu
|
||||
3\-parity activează paritatea triplă.
|
||||
.IP \(bu
|
||||
4\-parity activează paritatea quad (patru).
|
||||
4\-parity activează paritatea cvadruplă (patru).
|
||||
.IP \(bu
|
||||
5\-parity activează paritatea penta (cinci).
|
||||
.IP \(bu
|
||||
|
|
@ -1378,7 +1384,7 @@ CPU\-urilor low\-end precum ARM sau AMD Phenom, Athlon și Opteron care nu
|
|||
suportă setul de instrucțiuni SSSE3. În astfel de cazuri, oferă
|
||||
o performanță mai bună.
|
||||
.PP
|
||||
Acest format este similar, dar mai rapid decât cel utilizat de ZFS RAIDZ3.
|
||||
Acest format este similar cu cel utilizat de ZFS RAIDZ3, dar mai rapid decât acesta.
|
||||
Ca și ZFS, nu funcționează dincolo de paritatea triplă.
|
||||
.PP
|
||||
Când utilizați \`3\-parity\`, veți fi avertizați dacă este recomandat să utilizați
|
||||
|
|
@ -1388,7 +1394,7 @@ Este posibil să convertiți de la un format la altul ajustând
|
|||
fișierul de configurare cu fișierul z\-parity sau 3\-parity dorit
|
||||
și utilizând \`fix\` pentru a\-l recrea.
|
||||
.SS content FILE
|
||||
Definește fișierul de utilizat pentru a stoca lista și sumele de control (checksums) a tuturor
|
||||
Definește fișierul de utilizat pentru a stoca lista și sumele de control (checksums) ale tuturor
|
||||
fișierelor prezente în matricea dvs. de discuri.
|
||||
.PP
|
||||
Poate fi plasat pe un disc utilizat pentru date, paritate sau
|
||||
|
|
@ -1426,6 +1432,30 @@ sistemului, cum ar fi discul de pornire.
|
|||
.PP
|
||||
Rețineți că astfel de discuri nu sunt afectate de comenzile \`up\` și
|
||||
\`down\` deoarece se așteaptă ca acestea să se rotească mereu.
|
||||
.SS snapshot
|
||||
Activează utilizarea snapshot\-urilor sistemului de fișiere pentru comenzile \`sync\`, \`scrub\`,
|
||||
\`check\` și \`fix\`.
|
||||
.PP
|
||||
Când este activată, SnapRAID creează un snapshot read\-only al datelor dvs. la
|
||||
începutul unui \'sync\'. Acest lucru asigură o vizualizare consistentă, la un anumit moment în timp, a
|
||||
fișierelor dvs., prevenind erorile cauzate de modificările concurente ale fișierelor.
|
||||
.PP
|
||||
Acest lucru îmbunătățește semnificativ recuperarea: dacă un fișier este șters din sistemul de fișiere live,
|
||||
el rămâne păstrat în snapshot. Acest lucru previne ca paritatea să devină „ruptă”
|
||||
pentru acel bloc, asigurându\-vă că puteți recupera cu succes datele
|
||||
dacă un alt disc se defectează.
|
||||
.PP
|
||||
Această opțiune se aplică exclusiv discurilor de date formatate cu sistemele de
|
||||
fișiere Btrfs, Bcachefs sau ZFS în Linux și NTFS în Windows.
|
||||
Discurile de paritate, sau discurile de date care utilizează alte sisteme de fișiere, vor folosi întotdeauna
|
||||
versiunea live a sistemului de fișiere.
|
||||
.PP
|
||||
Crearea și ștergerea snapshot\-urilor necesită privilegii administrative.
|
||||
Asigurați\-vă că SnapRAID este rulat cu permisiunile necesare (de exemplu, sudo) când
|
||||
această opțiune este activată.
|
||||
.PP
|
||||
Consultați secțiunea SNAPSHOTS pentru o explicație detaliată a ciclului de viață
|
||||
al snapshot\-urilor.
|
||||
.SS nohidden
|
||||
Exclude toate fișierele și directoarele ascunse.
|
||||
În Unix, fișierele ascunse sunt cele care încep cu \`.\`.
|
||||
|
|
@ -1541,7 +1571,7 @@ RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0,51 GiB
|
|||
Salvează automat starea la sincronizare sau verificare după
|
||||
cantitatea specificată de GB procesați.
|
||||
Această opțiune este utilă pentru a evita repornirea comenzilor \`sync\` lungi
|
||||
de la zero dacă sunt întrerupte de o cădere a mașinii sau de orice alt eveniment.
|
||||
de la zero dacă sunt întrerupte de o pană de sistem sau de orice alt eveniment.
|
||||
.SS temp_limit TEMPERATURE_CELSIUS
|
||||
Setează temperatura maximă permisă a discului în Celsius. Când este specificată,
|
||||
SnapRAID verifică periodic temperatura tuturor discurilor utilizând
|
||||
|
|
@ -1549,13 +1579,13 @@ instrumentul smartctl. Temperaturile curente ale discurilor sunt afișate în ti
|
|||
SnapRAID funcționează. Dacă un disc depășește această limită, toate operațiunile
|
||||
se opresc, iar discurile sunt oprite (puse în standby) pentru durata
|
||||
definită de opțiunea \`temp_sleep\`. După perioada de așteptare, operațiunile
|
||||
reiau, putând întrerupe din nou dacă limita de temperatură este atinsă
|
||||
se reiau, putând fi întrerupte din nou dacă limita de temperatură este atinsă
|
||||
încă o dată.
|
||||
.PP
|
||||
În timpul funcționării, SnapRAID analizează și curba de încălzire a fiecărui
|
||||
disc și estimează temperatura constantă pe termen lung pe care se așteaptă să o
|
||||
atingă dacă activitatea continuă. Estimarea este efectuată numai după
|
||||
ce temperatura discului a crescut de patru ori, asigurându\-se că sunt disponibile
|
||||
ce temperatura discului a înregistrat patru creșteri, asigurându\-se că sunt disponibile
|
||||
suficiente puncte de date pentru a stabili o tendință fiabilă.
|
||||
Această temperatură constantă prezisă este afișată între paranteze lângă
|
||||
valoarea curentă și ajută la evaluarea dacă răcirea sistemului este
|
||||
|
|
@ -1606,6 +1636,9 @@ PARITY este unul dintre numele de paritate: \`parity\`, \`2\-parity\`, \`3\-pari
|
|||
numele dispozitivului. Pentru controlerele RAID, dispozitivul este
|
||||
probabil fix și este posibil să nu fie nevoie să utilizați \`%s\`.
|
||||
.PP
|
||||
De asemenea, puteți specifica un șir de opțiuni de informații personalizate
|
||||
utilizând eticheta \`[info: ...]\` pentru a înlocui opțiunea implicită \`\-a\`.
|
||||
.PP
|
||||
Consultați documentația smartmontools pentru opțiuni posibile:
|
||||
.PP
|
||||
.RS 4
|
||||
|
|
@ -1621,13 +1654,17 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices
|
|||
De exemplu:
|
||||
.PP
|
||||
.RS 4
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl parity \-d sat %s
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS smartignore DISK/PARITY ATTR [ATTR...]
|
||||
Ignoră atributul SMART specificat la calcularea probabilității
|
||||
de eșec a discului. Această opțiune este utilă dacă un disc raportează valori neobișnuite sau
|
||||
de eșec al discului. Această opțiune este utilă dacă un disc raportează valori neobișnuite sau
|
||||
înșelătoare pentru un anumit atribut.
|
||||
.PP
|
||||
DISK este același nume de disc specificat în opțiunea \`data\`.
|
||||
|
|
@ -1635,19 +1672,27 @@ PARITY este unul dintre numele de paritate: \`parity\`, \`2\-parity\`, \`3\-pari
|
|||
\`4\-parity\`, \`5\-parity\`, \`6\-parity\` sau \`z\-parity\`.
|
||||
Valoarea specială * poate fi utilizată pentru a ignora atributul pe toate discurile.
|
||||
.PP
|
||||
De exemplu, pentru a ignora atributul \`Current Pending Sector Count\` pe
|
||||
toate discurile:
|
||||
Mai multe atribute pot fi specificate separate prin spații.
|
||||
Fiecare atribut poate fi specificat ca un număr de la 1 la 255 sau ca un
|
||||
nume insensibil la majuscule (de exemplu, \`Current_Pending_Sector\`).
|
||||
.PP
|
||||
De exemplu, pentru a ignora atributele \`Current Pending Sector Count\` și
|
||||
\`Reallocated Sectors Count\` pe toate discurile după numărul sau numele lor:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore * 197
|
||||
smartignore * 197 5
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.PP
|
||||
Pentru a\-l ignora doar pe primul disc de paritate:
|
||||
Pentru a le ignora doar pe primul disc de paritate:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore parity 197
|
||||
smartignore parity 197 5
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
|
|
@ -1687,7 +1732,7 @@ exclude /tmp/
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1743,7 +1788,7 @@ exclude \\System Volume Information
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1759,6 +1804,128 @@ smartctl 2\-parity \-d areca,2/1 /dev/arcmsr0
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH SNAPSHOT\-URI (SNAPSHOTS)
|
||||
Dacă opțiunea snapshot este activată în configurație, SnapRAID
|
||||
utilizează funcționalitatea de snapshot a sistemului de fișiere pentru a asigura operațiuni atomice
|
||||
și consistente.
|
||||
.PP
|
||||
Gestionarea snapshot\-urilor este complet automată și transparentă.
|
||||
Puteți continua să utilizați SnapRAID exact ca înainte, cu protecția
|
||||
suplimentară oferită de snapshot\-uri gestionate în întregime în
|
||||
background.
|
||||
.PP
|
||||
Acest lucru oferă două avantaje principale:
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I Consistență
|
||||
Fișierele modificate pe sistemul de fișiere live în timpul unui sync sau scrub
|
||||
de lungă durată nu vor cauza nepotriviri de paritate sau operațiuni abandonate,
|
||||
deoarece SnapRAID vede o imagine înghețată la un anumit moment în timp.
|
||||
.HP 4
|
||||
.I Recuperare
|
||||
Dacă un fișier este actualizat sau șters din sistemul de fișiere live,
|
||||
el rămâne păstrat în snapshot. Dacă se produce o defecțiune a discului
|
||||
înainte de rularea următorului sync, SnapRAID utilizează datele păstrate
|
||||
în snapshot pentru a reconstrui discul defect.
|
||||
.PD
|
||||
.PP
|
||||
.RS 4
|
||||
.PD 0
|
||||
În cazul unei defecțiuni a discului în timpul unui proces de sync activ,
|
||||
SnapRAID este, de asemenea, capabil să citească automat atât din snapshot\-ul
|
||||
calculului anterior de paritate, cât și din cel curent.
|
||||
Acest lucru maximizează probabilitatea unei recuperări complete prin
|
||||
oferirea accesului la blocurile exacte de date necesare pentru a rezolva
|
||||
ecuațiile de paritate, chiar dacă acele blocuri au fost modificate
|
||||
sau șterse între sync\-uri.
|
||||
.PD
|
||||
.PP
|
||||
.PD 0
|
||||
Fără snapshot\-uri, un fișier actualizat sau șters pe un disc sănătos
|
||||
are ca rezultat lipsa unor blocuri de date care pot fi necesare pentru
|
||||
a repara alte discuri defecte.
|
||||
.PD
|
||||
.RE
|
||||
.RE
|
||||
.PP
|
||||
Snapshot\-urile sunt create doar pentru discurile de date și numai dacă sistemul de fișiere
|
||||
subiacent acceptă această funcționalitate. Discurile de paritate folosesc întotdeauna
|
||||
sistemul de fișiere live.
|
||||
.PP
|
||||
În prezent, acest lucru este acceptat pe Btrfs, Bcachefs și ZFS în Linux
|
||||
și pe NTFS în Windows.
|
||||
.PP
|
||||
Puteți amesteca discuri de date cu sisteme de fișiere diferite. Doar cele care
|
||||
acceptă snapshot\-uri le vor utiliza, în timp ce celelalte discuri vor continua
|
||||
să funcționeze direct pe sistemul de fișiere live.
|
||||
.PP
|
||||
Crearea și ștergerea snapshot\-urilor necesită privilegii administrative.
|
||||
Asigurați\-vă că SnapRAID este rulat cu permisiunile necesare (de exemplu, sudo)
|
||||
atunci când snapshot\-urile sunt activate.
|
||||
.SS Comportamentul comenzilor cu snapshot\-uri
|
||||
Comenzile \`sync\` și \`scrub\` operează ambele exclusiv pe snapshot\-uri
|
||||
pentru a se asigura că toate operațiunile de date sunt efectuate în raport cu o stare consistentă
|
||||
și înghețată. Prin utilizarea acestor snapshot\-uri, SnapRAID previne neconcordanțele de paritate
|
||||
care altfel ar fi declanșate de modificările concurente ale fișierelor pe sistemul de fișiere live.
|
||||
În timpul unui \`sync\`, comanda folosește un snapshot nou creat la
|
||||
începutul procesului pentru a captura starea curentă pentru calculul parității.
|
||||
În schimb, comanda \`scrub\` utilizează ultimul snapshot, cel
|
||||
creat în timpul celui mai recent sync, pentru a menține un punct de referință de încredere
|
||||
care se potrivește cu paritatea existentă.
|
||||
.PP
|
||||
Pentru comenzile \`check\` și \`fix\`, utilizarea ultimului snapshot
|
||||
depinde dacă anumite discuri sunt vizate folosind opțiunea
|
||||
\-d, \-\-filter\-disk.
|
||||
.PP
|
||||
Un disc selectat în mod explicit prin \-d („ținta” operațiunii)
|
||||
folosește întotdeauna sistemul de fișiere live. Pentru \`fix\`, acest lucru permite restaurarea
|
||||
datelor pe discul de înlocuire activ. Pentru \`check\`, permite simularea
|
||||
operațiunii \`fix\` în aceleași condiții.
|
||||
.PP
|
||||
Toate celelalte discuri de date (discurile de „referință”) vor fi accesate prin intermediul
|
||||
snapshot\-urilor lor. Acest lucru asigură că, chiar dacă modificați fișiere
|
||||
pe discurile sănătoase în timp ce o recuperare este în curs, SnapRAID
|
||||
are o referință stabilă, înghețată pentru a rezolva ecuațiile de paritate.
|
||||
.PP
|
||||
Dacă nu este furnizată nicio opțiune \-d, SnapRAID presupune că operațiunea se aplică
|
||||
întregii matrice, caz în care \`check\` și \`fix\` vor folosi exclusiv
|
||||
sistemele de fișiere live.
|
||||
.PP
|
||||
Toate celelalte comenzi operează exclusiv pe sistemul de fișiere live.
|
||||
.SH CICLUL DE VIAță AL SNAPSHOT\-URILOR (SNAPSHOTS LIFECYCLE)
|
||||
SnapRAID gestionează două snapshot\-uri specifice, \`stable\` și \`pending\`,
|
||||
într\-un director ascuns la rădăcina fiecărui subvolum de date.
|
||||
În Btrfs, Bcachefs și NTFS se folosește directorul \`.snapraid/\`,
|
||||
în ZFS cel standard \`.zfs/snapshot/\`.
|
||||
.PP
|
||||
Snapshot\-ul \`stable\` reprezintă starea ultimului
|
||||
\`sync\` finalizat cu succes, conținând datele exacte utilizate pentru
|
||||
a calcula paritatea curentă. Acesta servește ca sursă principală de date
|
||||
pentru comenzile \`scrub\`, \`check\` și \`fix\`.
|
||||
.PP
|
||||
Snapshot\-ul \`pending\` este o imagine temporară creată la începutul
|
||||
unui \`sync\` pentru a oferi o stare înghețată pentru calculul parității.
|
||||
După finalizarea cu succes a operațiunii, snapshot\-ul \`stable\` anterior
|
||||
este șters, iar snapshot\-ul \`pending\` este promovat pentru
|
||||
a\-i lua locul ca nouă referință stabilă.
|
||||
.PP
|
||||
Dacă un \`sync\` este întrerupt, snapshot\-ul \`pending\` este păstrat.
|
||||
Comenzile ulterioare \`scrub\`, \`check\` și \`fix\` vor folosi acest
|
||||
snapshot în așteptare, deoarece se potrivește cu starea sistemului de fișiere înregistrată în
|
||||
fișierul .content, chiar dacă paritatea este sincronizată doar parțial.
|
||||
.PP
|
||||
În cazul unei întreruperi a \`sync\`, comenzile \`check\` și \`fix\`
|
||||
citesc, de asemenea, din snapshot\-ul \`stable\` pentru a recupera blocurile de date
|
||||
din fișierele care au fost actualizate sau șterse în timpul sync\-ului.
|
||||
Acest lucru este posibil deoarece fișierul .content păstrează metadatele pentru
|
||||
toate fișierele modificate sau șterse pe parcursul procesului de sync.
|
||||
Aceste informații istorice sunt șterse numai după ce un sync se termină
|
||||
cu succes și versiunea finală a fișierului .content este salvată.
|
||||
.PP
|
||||
Dacă un \`sync\` este repornit după o întrerupere, snapshot\-ul pending existent
|
||||
este șters și se creează unul nou pentru
|
||||
a captura starea curentă a sistemului de fișiere live.
|
||||
.SH MODEL (PATTERN)
|
||||
Modelele oferă o modalitate flexibilă de a filtra fișierele pentru includere sau
|
||||
excludere. Folosind caractere de tip globbing, puteți defini reguli care să
|
||||
|
|
@ -1771,7 +1938,7 @@ caractere variabile, păstrând în același timp modelul limitat la un singur n
|
|||
.PP
|
||||
Asteriscul simplu \`*\` se potrivește cu orice secvență de caractere, dar, la fel ca
|
||||
semnul întrebării, nu trece niciodată de limitele directoarelor. Se oprește la
|
||||
slash\-ul înainte, ceea ce îl face potrivit pentru potrivirea în cadrul unei singure
|
||||
bara oblică (/), ceea ce îl face potrivit pentru potrivirea în cadrul unei singure
|
||||
componente a căii. Acesta este comportamentul standard al metacaracterelor, familiar
|
||||
din shell globbing.
|
||||
.PP
|
||||
|
|
@ -2007,8 +2174,10 @@ SnapRAID stochează lista și sumele de control (checksums) ale fișierelor dvs.
|
|||
Este un fișier binar care listează toate fișierele prezente în matricea dvs. de discuri,
|
||||
împreună cu toate sumele de control pentru a le verifica integritatea.
|
||||
.PP
|
||||
Acest fișier este citit și scris de comenzile \`sync\` și \`scrub\` și
|
||||
citit de comenzile \`fix\`, \`check\` și \`status\`.
|
||||
Fișierul de conținut este citit și scris de comenzile \`sync\`, \`scrub\`,
|
||||
\`touch\` și \`rehash\`. Este citit de comenzile \`status\`, \`diff\`, \`check\`,
|
||||
\`fix\`, \`list\`, \`dup\`, \`locate\` și \`pool\`, și este complet ignorat
|
||||
de comenzile \`smart\`, \`probe\`, \`up\`, \`down\` și \`devices\`.
|
||||
.SH PARITATE (PARITY)
|
||||
SnapRAID stochează informațiile de paritate ale matricei dvs. în fișierele de paritate.
|
||||
.PP
|
||||
|
|
@ -2030,7 +2199,25 @@ un font TrueType precum \`Lucida Console\` ca font al consolei.
|
|||
Acest lucru afectează doar numele de fișiere tipărite; dacă
|
||||
redirecționați ieșirea consolei către un fișier, fișierul rezultat este întotdeauna
|
||||
în format UTF\-8.
|
||||
.SH COD DE IEșIRE (EXIT CODE)
|
||||
SnapRAID se termină cu următoarele coduri de eroare:
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I 0
|
||||
Totul este OK.
|
||||
.HP 4
|
||||
.I 1
|
||||
Comanda a întâmpinat unele erori.
|
||||
.HP 4
|
||||
.I 2
|
||||
Comanda \`diff\` a constatat că totul este OK, dar este necesar un \`sync\`.
|
||||
.PD
|
||||
.RE
|
||||
.SH TRADUCERE (TRANSLATION)
|
||||
Acest document este o traducere automată a manualului în limba engleză.
|
||||
Consultați manualul în limba engleză pentru versiunea oficială.
|
||||
.SH DREPT DE AUTOR (COPYRIGHT)
|
||||
Acest fișier este Copyright (C) 2025 Andrea Mazzoleni
|
||||
Acest fișier este Copyright (C) 2026 Andrea Mazzoleni
|
||||
.SH VEZI șI (SEE ALSO)
|
||||
snapraid_log(1), snapraidd(1)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
Name{number}
|
||||
snapraid - SnapRAID Backup pentru Matrici de Discuri
|
||||
|
||||
Sintaxă
|
||||
Sintaxă (Synopsis)
|
||||
:snapraid [-c, --conf CONFIG]
|
||||
: [-f, --filter PATTERN] [-d, --filter-disk NAME]
|
||||
: [-m, --filter-missing] [-e, --filter-error]
|
||||
|
|
@ -23,7 +23,7 @@ Sintaxă
|
|||
|
||||
:snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
Descriere
|
||||
Descriere (Description)
|
||||
SnapRAID este un program de backup conceput pentru matrici de discuri, care stochează
|
||||
informații de paritate pentru recuperarea datelor în cazul a până la șase
|
||||
defecte de disc.
|
||||
|
|
@ -32,7 +32,7 @@ Descriere
|
|||
care se schimbă rar, SnapRAID oferă câteva caracteristici:
|
||||
|
||||
* Puteți utiliza discuri deja pline cu fișiere fără
|
||||
nevoia de a le reformat, accesându-le ca de obicei.
|
||||
nevoia de a le reformata, accesându-le ca de obicei.
|
||||
* Toate datele dvs. sunt hash-uite pentru a asigura integritatea datelor și a preveni
|
||||
corupția silențioasă.
|
||||
* Când numărul de discuri defecte depășește numărul de parități,
|
||||
|
|
@ -43,7 +43,7 @@ Descriere
|
|||
* Discurile pot avea dimensiuni diferite.
|
||||
* Puteți adăuga discuri în orice moment.
|
||||
* SnapRAID nu vă blochează datele; puteți înceta să-l utilizați
|
||||
oricând fără a reforma sau muta date.
|
||||
oricând fără a reformata sau muta date.
|
||||
* Pentru a accesa un fișier, este necesar să se rotească doar un singur disc, economisind
|
||||
energie și reducând zgomotul.
|
||||
|
||||
|
|
@ -51,22 +51,30 @@ Descriere
|
|||
|
||||
:https://www.snapraid.it/
|
||||
|
||||
Limitări
|
||||
SnapRAID este un hibrid între un program RAID și unul de backup, care urmărește să combine
|
||||
cele mai bune beneficii ale ambelor. Cu toate acestea, are unele limitări pe care ar trebui
|
||||
Limitări (Limitations)
|
||||
SnapRAID este un hibrid între un RAID și un program de backup, având ca scop combinarea
|
||||
celor mai bune avantaje ale ambelor. Cu toate acestea, are unele limitări pe care ar trebui
|
||||
să le luați în considerare înainte de a-l utiliza.
|
||||
|
||||
Principala limitare este că, dacă un disc se defectează și nu ați făcut recent o sincronizare,
|
||||
este posibil să nu puteți recupera complet.
|
||||
Mai exact, este posibil să nu puteți recupera până la dimensiunea
|
||||
fișierelor modificate sau șterse de la ultima operațiune de sincronizare.
|
||||
Acest lucru se întâmplă chiar dacă fișierele modificate sau șterse nu sunt pe
|
||||
discul defect. Acesta este motivul pentru care SnapRAID este mai potrivit pentru
|
||||
date care se schimbă rar.
|
||||
Principala limitare este că, dacă un disc se defectează, puteți recupera datele doar până la
|
||||
starea ultimei operațiuni de `sync`. Orice date adăugate sau modificări efectuate
|
||||
de la ultima sincronizare care se află pe discul defect vor fi pierdute.
|
||||
|
||||
Pe de altă parte, fișierele nou adăugate nu împiedică recuperarea fișierelor
|
||||
deja existente. Veți pierde doar fișierele adăugate recent dacă acestea
|
||||
se află pe discul defect.
|
||||
Prin urmare, SnapRAID este potrivit în principal pentru date care se modifică rar.
|
||||
|
||||
Pentru datele care existau deja la ultima sincronizare, fiabilitatea recuperării depinde
|
||||
de utilizarea sau nu a opțiunii `snapshot`:
|
||||
|
||||
* Cu suport pentru snapshot (disponibil pe Btrfs, ZFS, Bcachefs și NTFS),
|
||||
SnapRAID poate menține automat o referință înghețată a discurilor de date.
|
||||
Acest lucru asigură că, chiar dacă modificați sau ștergeți fișiere pe sistemul de fișiere live
|
||||
în timpul sau după un sync, procesul de recuperare rămâne consistent și de încredere.
|
||||
|
||||
* Fără suport pentru snapshot, ștergerea sau modificarea fișierelor după un `sync`
|
||||
poate împiedica recuperarea completă a altor discuri defecte. Acest lucru se întâmplă
|
||||
deoarece paritatea nu mai corespunde cu fișierele modificate, chiar dacă
|
||||
acele fișiere nu se află pe discul defect. Pe de altă parte, fișierele nou adăugate
|
||||
nu împiedică recuperarea fișierelor deja existente.
|
||||
|
||||
Alte limitări ale SnapRAID sunt:
|
||||
|
||||
|
|
@ -82,7 +90,7 @@ Limitări
|
|||
* Sunt salvate doar numele fișierelor, mărcile temporale, symlink-urile și hardlink-urile.
|
||||
Permisiunile, proprietarul și atributele extinse nu sunt salvate.
|
||||
|
||||
Noțiuni de Bază
|
||||
Noțiuni de Bază (Getting Started)
|
||||
Pentru a utiliza SnapRAID, trebuie mai întâi să selectați un disc în matricea dvs. de discuri
|
||||
pentru a-l dedica informațiilor de `paritate`. Cu un singur disc pentru paritate, veți
|
||||
putea recupera dintr-o singură defecțiune de disc, similar cu RAID5.
|
||||
|
|
@ -163,7 +171,7 @@ Noțiuni de Bază
|
|||
Acum puteți începe să utilizați matricea după cum doriți și
|
||||
să actualizați periodic informațiile de paritate rulând comanda `sync`.
|
||||
|
||||
Scrubbing (Verificare)
|
||||
Verificare (Scrubbing)
|
||||
Pentru a verifica periodic datele și paritatea pentru erori, puteți
|
||||
rula comanda `scrub`.
|
||||
|
||||
|
|
@ -201,10 +209,10 @@ Noțiuni de Bază
|
|||
fișiere eliminate sau modificate. Aceste erori sunt raportate în ieșirea `scrub`,
|
||||
dar blocurile aferente nu sunt marcate ca defecte.
|
||||
|
||||
Pooling (Agregare)
|
||||
Agregare (Pooling)
|
||||
Notă: Funcționalitatea de pooling descrisă mai jos a fost înlocuită de instrumentul
|
||||
mergerfs, care este acum opțiunea recomandată pentru utilizatorii Linux în
|
||||
comunitatea SnapRAID. Mergefs oferă o modalitate mai flexibilă și eficientă
|
||||
comunitatea SnapRAID. Mergerfs oferă o modalitate mai flexibilă și eficientă
|
||||
de a agrega mai multe discuri într-un singur punct de montare unificat,
|
||||
permițând accesul neîntrerupt la fișiere pe toată matricea dvs. fără a se baza
|
||||
pe link-uri simbolice. Se integrează bine cu SnapRAID pentru protecția parității
|
||||
|
|
@ -213,7 +221,7 @@ Noțiuni de Bază
|
|||
|
||||
Pentru a avea toate fișierele din matricea dvs. afișate în același arbore de directoare,
|
||||
puteți activa funcționalitatea de `pooling`. Aceasta creează o vizualizare virtuală
|
||||
doar în citire a tuturor fișierelor din matricea dvs. folosind link-uri simbolice.
|
||||
read-only a tuturor fișierelor din matricea dvs. folosind link-uri simbolice.
|
||||
|
||||
Puteți configura directorul de `pooling` în fișierul de configurare cu:
|
||||
|
||||
|
|
@ -272,7 +280,7 @@ Noțiuni de Bază
|
|||
|
||||
:fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
||||
|
||||
Undeleting (Anulare Ștergere)
|
||||
Anulare ștergere (Undeleting)
|
||||
SnapRAID funcționează mai mult ca un program de backup decât un sistem RAID și poate
|
||||
fi folosit pentru a restaura sau anula ștergerea fișierelor la starea lor anterioară utilizând
|
||||
opțiunea -f, --filter:
|
||||
|
|
@ -293,7 +301,7 @@ Noțiuni de Bază
|
|||
|
||||
:snapraid fix -m
|
||||
|
||||
Recuperare
|
||||
Recuperare (Recovering)
|
||||
Cel mai rău s-a întâmplat și ați pierdut unul sau mai multe discuri!
|
||||
|
||||
NU INTRAȚI ÎN PANICĂ! Veți putea să le recuperați!
|
||||
|
|
@ -312,7 +320,7 @@ Noțiuni de Bază
|
|||
a discului defect să indice o locație cu suficient spațiu gol
|
||||
pentru a recupera fișierele.
|
||||
|
||||
De exemplu, dacă discul `d1` a eșuat, schimbați de la:
|
||||
De exemplu, dacă discul `d1` s-a defectat, schimbați de la:
|
||||
|
||||
:data d1 /mnt/disk1/
|
||||
|
||||
|
|
@ -348,7 +356,7 @@ Noțiuni de Bază
|
|||
Dacă nu sunteți mulțumit de recuperare, o puteți reîncerca de câte
|
||||
ori doriți.
|
||||
|
||||
De exemplu, dacă ați eliminat fișiere din matrice după ultima
|
||||
De exemplu, dacă ați eliminat fișiere din matrice după ultimul
|
||||
`sync`, acest lucru poate duce la nerecuperarea unor fișiere.
|
||||
În acest caz, puteți reîncerca `fix`-ul utilizând opțiunea -i, --import,
|
||||
specificând unde se află acum aceste fișiere pentru a le include din nou în
|
||||
|
|
@ -379,14 +387,14 @@ Noțiuni de Bază
|
|||
|
||||
Dacă totul este recuperat, această comandă este imediată.
|
||||
|
||||
Comenzi
|
||||
Comenzi (Commands)
|
||||
SnapRAID oferă câteva comenzi simple care vă permit să:
|
||||
|
||||
* Tipăriți starea matricei -> `status`
|
||||
* Afișați starea matricei -> `status`
|
||||
* Controlați discurile -> `smart`, `probe`, `up`, `down`
|
||||
* Faceți un backup/snapshot -> `sync`
|
||||
* Creați un punct de backup/recuperare -> `sync`
|
||||
* Verificați periodic datele -> `scrub`
|
||||
* Restaurați ultimul backup/snapshot -> `fix`.
|
||||
* Restaurați ultimul punct de backup/recuperare -> `fix`.
|
||||
|
||||
Comenzile trebuie scrise cu litere mici.
|
||||
|
||||
|
|
@ -413,7 +421,7 @@ Comenzi
|
|||
Tipărește un raport SMART al tuturor discurilor din sistem.
|
||||
|
||||
Include o estimare a probabilității de eșec în anul următor,
|
||||
permițându-vă să planificați înlocuiri de întreținere a discurilor care prezintă
|
||||
permițându-vă să planificați înlocuiri de întreținere ale discurilor care prezintă
|
||||
atribute suspecte.
|
||||
|
||||
Această estimare a probabilității este obținută prin corelarea atributelor SMART
|
||||
|
|
@ -421,7 +429,7 @@ Comenzi
|
|||
|
||||
:https://www.backblaze.com/hard-drive-test-data.html
|
||||
|
||||
Dacă SMART raportează că un disc este pe cale să eșueze, `FAIL` sau `PREFAIL` este tipărit
|
||||
Dacă SMART raportează că un disc este pe cale să se defecteze, `FAIL` sau `PREFAIL` este tipărit
|
||||
pentru acel disc, iar SnapRAID returnează o eroare.
|
||||
În acest caz, înlocuirea imediată a discului este puternic recomandată.
|
||||
|
||||
|
|
@ -458,7 +466,7 @@ Comenzi
|
|||
Nimic nu este modificat.
|
||||
|
||||
up
|
||||
Pornirea tuturor discurilor din matrice.
|
||||
Pornește toate discurile din matrice.
|
||||
|
||||
Puteți porni doar discuri specifice utilizând opțiunea -d, --filter-disk.
|
||||
|
||||
|
|
@ -468,7 +476,7 @@ Comenzi
|
|||
Nimic nu este modificat.
|
||||
|
||||
down
|
||||
Oprirea (spin down) tuturor discurilor din matrice.
|
||||
Oprește (spin down) toate discurile din matrice.
|
||||
|
||||
Această comandă utilizează instrumentul `smartctl` și este echivalentă cu rularea
|
||||
`smartctl -s standby,now` pe toate dispozitivele.
|
||||
|
|
@ -482,7 +490,7 @@ Comenzi
|
|||
Nimic nu este modificat.
|
||||
|
||||
diff
|
||||
Listează toate fișierele modificate de la ultima `sync` care trebuie
|
||||
Listează toate fișierele modificate de la ultimul `sync` care trebuie
|
||||
să li se recalculeze datele de paritate.
|
||||
|
||||
Această comandă nu verifică datele fișierului, ci doar marca temporală,
|
||||
|
|
@ -501,23 +509,23 @@ Comenzi
|
|||
copied - Fișiere copiate pe același disc sau pe un disc diferit
|
||||
unde fișierul original încă există.
|
||||
Acestea sunt identificate prin faptul că au același nume,
|
||||
dimensiune și amprentă temporală.
|
||||
Dacă amprenta temporală sub-secundă este zero, calea completă
|
||||
dimensiune și marcă temporală.
|
||||
Dacă marca temporală sub-secundă este zero, calea completă
|
||||
trebuie să se potrivească pentru a fi identificate, nu doar
|
||||
numele.
|
||||
relocated - Fișiere mutate pe același disc sau pe un disc diferit
|
||||
unde originalul a dispărut.
|
||||
Acestea sunt identificate prin faptul că au același nume,
|
||||
dimensiune și amprentă temporală.
|
||||
Dacă amprenta temporală sub-secundă este zero, calea completă
|
||||
dimensiune și marcă temporală.
|
||||
Dacă marca temporală sub-secundă este zero, calea completă
|
||||
trebuie să se potrivească pentru a fi identificate.
|
||||
Spre deosebire de fișierele 'moved' de pe același disc, fișierele
|
||||
relocate au un inod diferit.
|
||||
restored - Fișiere cu un inod diferit, dar care se potrivesc ca
|
||||
director, nume, dimensiune și amprentă temporală.
|
||||
director, nume, dimensiune și marcă temporală.
|
||||
Acestea sunt de obicei fișiere restaurate după ce au fost șterse.
|
||||
|
||||
Dacă este necesară o `sync`, codul de retur al procesului este 2, în loc de
|
||||
Dacă este necesară o sincronizare, codul de retur al procesului este 2, în loc de
|
||||
cel implicit 0. Codul de retur 1 este utilizat pentru o condiție de eroare generică.
|
||||
|
||||
Nimic nu este modificat.
|
||||
|
|
@ -591,13 +599,12 @@ Comenzi
|
|||
fix
|
||||
Repară toate fișierele și datele de paritate.
|
||||
|
||||
Toate fișierele și datele de paritate sunt comparate cu starea snapshot-ului
|
||||
salvată la ultima `sync`.
|
||||
Dacă se găsește o diferență, este readusă la snapshot-ul stocat.
|
||||
Toate fișierele și datele de paritate sunt comparate cu starea salvată în
|
||||
ultimul `sync`. Dacă se găsește o diferență, aceasta este readusă la starea stocată.
|
||||
|
||||
ATENȚIE! Comanda `fix` nu face diferența între erori și
|
||||
modificări intenționate. Ea revine necondiționat la starea fișierului
|
||||
de la ultima `sync`.
|
||||
AVERTISMENT!
|
||||
Comanda `fix` nu face diferența între erori și modificări intenționate.
|
||||
Ea revine necondiționat la starea fișierelor de la ultimul `sync`.
|
||||
|
||||
Dacă nu este specificată nicio altă opțiune, întreaga matrice este procesată.
|
||||
Utilizați opțiunile de filtrare pentru a selecta un subset de fișiere sau discuri de operat.
|
||||
|
|
@ -605,7 +612,7 @@ Comenzi
|
|||
Pentru a repara doar blocurile marcate ca defecte în timpul `sync` și `scrub`,
|
||||
utilizați opțiunea -e, --filter-error.
|
||||
Spre deosebire de alte opțiuni de filtrare, aceasta aplică reparații doar fișierelor care sunt
|
||||
neschimbate de la ultima `sync`.
|
||||
neschimbate de la ultimul `sync`.
|
||||
|
||||
SnapRAID redenumește toate fișierele care nu pot fi reparate adăugând extensia
|
||||
`.unrecoverable`.
|
||||
|
|
@ -643,7 +650,7 @@ Comenzi
|
|||
|
||||
list
|
||||
Listează toate fișierele conținute în matrice la momentul
|
||||
ultimei `sync`.
|
||||
ultimului `sync`.
|
||||
|
||||
Cu -v sau --verbose, este afișat și timpul sub-secundă.
|
||||
|
||||
|
|
@ -728,13 +735,12 @@ Comenzi
|
|||
|
||||
Puteți utiliza opțiunea -t, --tail pentru a restricționa operațiunea la fișierele
|
||||
care ocupă porțiunea finală specificată a parității.
|
||||
|
||||
Dacă doriți să realocați aceste fișiere, puteți utiliza apoi opțiunea
|
||||
-W, --force-realloc-tail.
|
||||
-W, --force-realloc-tail. Rețineți că astfel de fișiere nu vor
|
||||
fi protejate de paritate în timpul procesului de realocare.
|
||||
|
||||
Rețineți că astfel de fișiere nu vor fi protejate de paritate în timpul procesului
|
||||
de realocare.
|
||||
|
||||
Opțiuni
|
||||
Opțiuni (Options)
|
||||
SnapRAID oferă următoarele opțiuni:
|
||||
|
||||
-c, --conf CONFIG
|
||||
|
|
@ -825,7 +831,7 @@ Opțiuni
|
|||
|
||||
-i, --import DIR
|
||||
Importă din directorul specificat orice fișiere șterse
|
||||
din matrice după ultima `sync`.
|
||||
din matrice după ultimul `sync`.
|
||||
Dacă mai aveți astfel de fișiere, ele pot fi utilizate de `check`
|
||||
și `fix` pentru a îmbunătăți procesul de recuperare.
|
||||
Fișierele sunt citite, inclusiv în subdirectoare, și sunt
|
||||
|
|
@ -843,9 +849,9 @@ Opțiuni
|
|||
-w, --bw-limit RATE
|
||||
Aplică o limită globală de lățime de bandă pentru toate discurile. RATE este
|
||||
numărul de octeți pe secundă. Puteți specifica un multiplicator
|
||||
cum ar fi K, M sau G (de exemplu, --bw-limit 1G).
|
||||
cum ar fi K, M, G sau T (de exemplu, --bw-limit 1G).
|
||||
|
||||
-t, --tail DIMENSIUNE
|
||||
-t, --tail SIZE
|
||||
Limitează listarea fișierelor la cele care nu utilizează mai mult de
|
||||
dimensiunea finală specificată a discurilor de paritate.
|
||||
Puteți utiliza multiplicatori precum K, M, G sau T (ex. --tail 1G).
|
||||
|
|
@ -888,11 +894,7 @@ Opțiuni
|
|||
dacă nu specificați această opțiune.
|
||||
Acest lucru vă permite să detectați cu ușurință când un sistem de fișiere de date nu este
|
||||
montat.
|
||||
Este permis, totuși, să aveți o singură schimbare de UUID cu
|
||||
paritate simplă și mai multe cu paritate multiplă, deoarece acesta este
|
||||
cazul normal la înlocuirea discurilor după o recuperare.
|
||||
Această opțiune poate fi utilizată doar cu `sync`, `check` sau
|
||||
`fix`.
|
||||
Această opțiune poate fi utilizată doar cu `sync`.
|
||||
|
||||
-U, --force-uuid
|
||||
Forțează operațiunea nesigură de sincronizare, verificare și reparare
|
||||
|
|
@ -949,7 +951,7 @@ Opțiuni
|
|||
recomandat să nu o utilizați.
|
||||
NU aveți protecție a datelor în timpul operațiunii `sync`.
|
||||
|
||||
-W, --force-realloc-tail DIMENSIUNE
|
||||
-W, --force-realloc-tail SIZE
|
||||
Funcționează ca -R, --force-realloc, dar limitat la porțiunea finală
|
||||
specificată (ultimii DIMENSIUNE octeți) ai fiecărui fișier de paritate.
|
||||
Forțează realocarea (mutarea) oricăror fragmente/blocuri de fișiere stocate
|
||||
|
|
@ -991,7 +993,7 @@ Opțiuni
|
|||
-L, --error-limit NUMBER
|
||||
Setează o nouă limită de erori înainte de a opri execuția.
|
||||
În mod implicit, SnapRAID se oprește dacă întâlnește mai mult de 100
|
||||
de erori de intrare/ieșire, indicând că un disc probabil eșuează.
|
||||
de erori de intrare/ieșire, indicând că un disc probabil se defectează.
|
||||
Această opțiune afectează `sync` și `scrub`, cărora li se permite
|
||||
să continue după primul set de erori de disc pentru a încerca
|
||||
să își finalizeze operațiunile.
|
||||
|
|
@ -1036,7 +1038,7 @@ Opțiuni
|
|||
-V, --version
|
||||
Tipărește versiunea programului.
|
||||
|
||||
Configurare
|
||||
Configurare (Configuration)
|
||||
SnapRAID necesită un fișier de configurare pentru a ști unde se află matricea dvs. de discuri
|
||||
și unde să stocheze informațiile de paritate.
|
||||
|
||||
|
|
@ -1075,7 +1077,7 @@ Configurare
|
|||
|
||||
* 2-parity activează paritatea dublă RAID6.
|
||||
* 3-parity activează paritatea triplă.
|
||||
* 4-parity activează paritatea quad (patru).
|
||||
* 4-parity activează paritatea cvadruplă (patru).
|
||||
* 5-parity activează paritatea penta (cinci).
|
||||
* 6-parity activează paritatea hexa (șase).
|
||||
|
||||
|
|
@ -1094,7 +1096,7 @@ Configurare
|
|||
suportă setul de instrucțiuni SSSE3. În astfel de cazuri, oferă
|
||||
o performanță mai bună.
|
||||
|
||||
Acest format este similar, dar mai rapid decât cel utilizat de ZFS RAIDZ3.
|
||||
Acest format este similar cu cel utilizat de ZFS RAIDZ3, dar mai rapid decât acesta.
|
||||
Ca și ZFS, nu funcționează dincolo de paritatea triplă.
|
||||
|
||||
Când utilizați `3-parity`, veți fi avertizați dacă este recomandat să utilizați
|
||||
|
|
@ -1105,7 +1107,7 @@ Configurare
|
|||
și utilizând `fix` pentru a-l recrea.
|
||||
|
||||
content FILE
|
||||
Definește fișierul de utilizat pentru a stoca lista și sumele de control (checksums) a tuturor
|
||||
Definește fișierul de utilizat pentru a stoca lista și sumele de control (checksums) ale tuturor
|
||||
fișierelor prezente în matricea dvs. de discuri.
|
||||
|
||||
Poate fi plasat pe un disc utilizat pentru date, paritate sau
|
||||
|
|
@ -1146,6 +1148,31 @@ Configurare
|
|||
Rețineți că astfel de discuri nu sunt afectate de comenzile `up` și
|
||||
`down` deoarece se așteaptă ca acestea să se rotească mereu.
|
||||
|
||||
snapshot
|
||||
Activează utilizarea snapshot-urilor sistemului de fișiere pentru comenzile `sync`, `scrub`,
|
||||
`check` și `fix`.
|
||||
|
||||
Când este activată, SnapRAID creează un snapshot read-only al datelor dvs. la
|
||||
începutul unui 'sync'. Acest lucru asigură o vizualizare consistentă, la un anumit moment în timp, a
|
||||
fișierelor dvs., prevenind erorile cauzate de modificările concurente ale fișierelor.
|
||||
|
||||
Acest lucru îmbunătățește semnificativ recuperarea: dacă un fișier este șters din sistemul de fișiere live,
|
||||
el rămâne păstrat în snapshot. Acest lucru previne ca paritatea să devină „ruptă”
|
||||
pentru acel bloc, asigurându-vă că puteți recupera cu succes datele
|
||||
dacă un alt disc se defectează.
|
||||
|
||||
Această opțiune se aplică exclusiv discurilor de date formatate cu sistemele de
|
||||
fișiere Btrfs, Bcachefs sau ZFS în Linux și NTFS în Windows.
|
||||
Discurile de paritate, sau discurile de date care utilizează alte sisteme de fișiere, vor folosi întotdeauna
|
||||
versiunea live a sistemului de fișiere.
|
||||
|
||||
Crearea și ștergerea snapshot-urilor necesită privilegii administrative.
|
||||
Asigurați-vă că SnapRAID este rulat cu permisiunile necesare (de exemplu, sudo) când
|
||||
această opțiune este activată.
|
||||
|
||||
Consultați secțiunea SNAPSHOTS pentru o explicație detaliată a ciclului de viață
|
||||
al snapshot-urilor.
|
||||
|
||||
nohidden
|
||||
Exclude toate fișierele și directoarele ascunse.
|
||||
În Unix, fișierele ascunse sunt cele care încep cu `.`.
|
||||
|
|
@ -1253,7 +1280,7 @@ Configurare
|
|||
Salvează automat starea la sincronizare sau verificare după
|
||||
cantitatea specificată de GB procesați.
|
||||
Această opțiune este utilă pentru a evita repornirea comenzilor `sync` lungi
|
||||
de la zero dacă sunt întrerupte de o cădere a mașinii sau de orice alt eveniment.
|
||||
de la zero dacă sunt întrerupte de o pană de sistem sau de orice alt eveniment.
|
||||
|
||||
temp_limit TEMPERATURE_CELSIUS
|
||||
Setează temperatura maximă permisă a discului în Celsius. Când este specificată,
|
||||
|
|
@ -1262,13 +1289,13 @@ Configurare
|
|||
SnapRAID funcționează. Dacă un disc depășește această limită, toate operațiunile
|
||||
se opresc, iar discurile sunt oprite (puse în standby) pentru durata
|
||||
definită de opțiunea `temp_sleep`. După perioada de așteptare, operațiunile
|
||||
reiau, putând întrerupe din nou dacă limita de temperatură este atinsă
|
||||
se reiau, putând fi întrerupte din nou dacă limita de temperatură este atinsă
|
||||
încă o dată.
|
||||
|
||||
În timpul funcționării, SnapRAID analizează și curba de încălzire a fiecărui
|
||||
disc și estimează temperatura constantă pe termen lung pe care se așteaptă să o
|
||||
atingă dacă activitatea continuă. Estimarea este efectuată numai după
|
||||
ce temperatura discului a crescut de patru ori, asigurându-se că sunt disponibile
|
||||
ce temperatura discului a înregistrat patru creșteri, asigurându-se că sunt disponibile
|
||||
suficiente puncte de date pentru a stabili o tendință fiabilă.
|
||||
Această temperatură constantă prezisă este afișată între paranteze lângă
|
||||
valoarea curentă și ajută la evaluarea dacă răcirea sistemului este
|
||||
|
|
@ -1323,6 +1350,9 @@ Configurare
|
|||
numele dispozitivului. Pentru controlerele RAID, dispozitivul este
|
||||
probabil fix și este posibil să nu fie nevoie să utilizați `%s`.
|
||||
|
||||
De asemenea, puteți specifica un șir de opțiuni de informații personalizate
|
||||
utilizând eticheta `[info: ...]` pentru a înlocui opțiunea implicită `-a`.
|
||||
|
||||
Consultați documentația smartmontools pentru opțiuni posibile:
|
||||
|
||||
:https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
|
|
@ -1330,11 +1360,12 @@ Configurare
|
|||
|
||||
De exemplu:
|
||||
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl parity -d sat %s
|
||||
|
||||
smartignore DISK/PARITY ATTR [ATTR...]
|
||||
Ignoră atributul SMART specificat la calcularea probabilității
|
||||
de eșec a discului. Această opțiune este utilă dacă un disc raportează valori neobișnuite sau
|
||||
de eșec al discului. Această opțiune este utilă dacă un disc raportează valori neobișnuite sau
|
||||
înșelătoare pentru un anumit atribut.
|
||||
|
||||
DISK este același nume de disc specificat în opțiunea `data`.
|
||||
|
|
@ -1342,14 +1373,19 @@ Configurare
|
|||
`4-parity`, `5-parity`, `6-parity` sau `z-parity`.
|
||||
Valoarea specială * poate fi utilizată pentru a ignora atributul pe toate discurile.
|
||||
|
||||
De exemplu, pentru a ignora atributul `Current Pending Sector Count` pe
|
||||
toate discurile:
|
||||
Mai multe atribute pot fi specificate separate prin spații.
|
||||
Fiecare atribut poate fi specificat ca un număr de la 1 la 255 sau ca un
|
||||
nume insensibil la majuscule (de exemplu, `Current_Pending_Sector`).
|
||||
|
||||
:smartignore * 197
|
||||
De exemplu, pentru a ignora atributele `Current Pending Sector Count` și
|
||||
`Reallocated Sectors Count` pe toate discurile după numărul sau numele lor:
|
||||
|
||||
Pentru a-l ignora doar pe primul disc de paritate:
|
||||
:smartignore * 197 5
|
||||
:smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
:smartignore parity 197
|
||||
Pentru a le ignora doar pe primul disc de paritate:
|
||||
|
||||
:smartignore parity 197 5
|
||||
|
||||
Exemple
|
||||
Un exemplu de configurare tipică pentru Unix este:
|
||||
|
|
@ -1362,7 +1398,7 @@ Configurare
|
|||
:data d3 /mnt/disk3/
|
||||
:exclude /lost+found/
|
||||
:exclude /tmp/
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/sg0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1378,11 +1414,123 @@ Configurare
|
|||
:exclude Thumbs.db
|
||||
:exclude \$RECYCLE.BIN
|
||||
:exclude \System Volume Information
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
Snapshot-uri (Snapshots)
|
||||
Dacă opțiunea snapshot este activată în configurație, SnapRAID
|
||||
utilizează funcționalitatea de snapshot a sistemului de fișiere pentru a asigura operațiuni atomice
|
||||
și consistente.
|
||||
|
||||
Gestionarea snapshot-urilor este complet automată și transparentă.
|
||||
Puteți continua să utilizați SnapRAID exact ca înainte, cu protecția
|
||||
suplimentară oferită de snapshot-uri gestionate în întregime în
|
||||
background.
|
||||
|
||||
Acest lucru oferă două avantaje principale:
|
||||
|
||||
Consistență - Fișierele modificate pe sistemul de fișiere live în timpul unui sync sau scrub
|
||||
de lungă durată nu vor cauza nepotriviri de paritate sau operațiuni abandonate,
|
||||
deoarece SnapRAID vede o imagine înghețată la un anumit moment în timp.
|
||||
Recuperare - Dacă un fișier este actualizat sau șters din sistemul de fișiere live,
|
||||
el rămâne păstrat în snapshot. Dacă se produce o defecțiune a discului
|
||||
înainte de rularea următorului sync, SnapRAID utilizează datele păstrate
|
||||
în snapshot pentru a reconstrui discul defect.
|
||||
|
||||
În cazul unei defecțiuni a discului în timpul unui proces de sync activ,
|
||||
SnapRAID este, de asemenea, capabil să citească automat atât din snapshot-ul
|
||||
calculului anterior de paritate, cât și din cel curent.
|
||||
Acest lucru maximizează probabilitatea unei recuperări complete prin
|
||||
oferirea accesului la blocurile exacte de date necesare pentru a rezolva
|
||||
ecuațiile de paritate, chiar dacă acele blocuri au fost modificate
|
||||
sau șterse între sync-uri.
|
||||
|
||||
Fără snapshot-uri, un fișier actualizat sau șters pe un disc sănătos
|
||||
are ca rezultat lipsa unor blocuri de date care pot fi necesare pentru
|
||||
a repara alte discuri defecte.
|
||||
|
||||
Snapshot-urile sunt create doar pentru discurile de date și numai dacă sistemul de fișiere
|
||||
subiacent acceptă această funcționalitate. Discurile de paritate folosesc întotdeauna
|
||||
sistemul de fișiere live.
|
||||
|
||||
În prezent, acest lucru este acceptat pe Btrfs, Bcachefs și ZFS în Linux
|
||||
și pe NTFS în Windows.
|
||||
|
||||
Puteți amesteca discuri de date cu sisteme de fișiere diferite. Doar cele care
|
||||
acceptă snapshot-uri le vor utiliza, în timp ce celelalte discuri vor continua
|
||||
să funcționeze direct pe sistemul de fișiere live.
|
||||
|
||||
Crearea și ștergerea snapshot-urilor necesită privilegii administrative.
|
||||
Asigurați-vă că SnapRAID este rulat cu permisiunile necesare (de exemplu, sudo)
|
||||
atunci când snapshot-urile sunt activate.
|
||||
|
||||
Comportamentul comenzilor cu snapshot-uri
|
||||
Comenzile `sync` și `scrub` operează ambele exclusiv pe snapshot-uri
|
||||
pentru a se asigura că toate operațiunile de date sunt efectuate în raport cu o stare consistentă
|
||||
și înghețată. Prin utilizarea acestor snapshot-uri, SnapRAID previne neconcordanțele de paritate
|
||||
care altfel ar fi declanșate de modificările concurente ale fișierelor pe sistemul de fișiere live.
|
||||
În timpul unui `sync`, comanda folosește un snapshot nou creat la
|
||||
începutul procesului pentru a captura starea curentă pentru calculul parității.
|
||||
În schimb, comanda `scrub` utilizează ultimul snapshot, cel
|
||||
creat în timpul celui mai recent sync, pentru a menține un punct de referință de încredere
|
||||
care se potrivește cu paritatea existentă.
|
||||
|
||||
Pentru comenzile `check` și `fix`, utilizarea ultimului snapshot
|
||||
depinde dacă anumite discuri sunt vizate folosind opțiunea
|
||||
-d, --filter-disk.
|
||||
|
||||
Un disc selectat în mod explicit prin -d („ținta” operațiunii)
|
||||
folosește întotdeauna sistemul de fișiere live. Pentru `fix`, acest lucru permite restaurarea
|
||||
datelor pe discul de înlocuire activ. Pentru `check`, permite simularea
|
||||
operațiunii `fix` în aceleași condiții.
|
||||
|
||||
Toate celelalte discuri de date (discurile de „referință”) vor fi accesate prin intermediul
|
||||
snapshot-urilor lor. Acest lucru asigură că, chiar dacă modificați fișiere
|
||||
pe discurile sănătoase în timp ce o recuperare este în curs, SnapRAID
|
||||
are o referință stabilă, înghețată pentru a rezolva ecuațiile de paritate.
|
||||
|
||||
Dacă nu este furnizată nicio opțiune -d, SnapRAID presupune că operațiunea se aplică
|
||||
întregii matrice, caz în care `check` și `fix` vor folosi exclusiv
|
||||
sistemele de fișiere live.
|
||||
|
||||
Toate celelalte comenzi operează exclusiv pe sistemul de fișiere live.
|
||||
|
||||
Ciclul de viață al snapshot-urilor (Snapshots Lifecycle)
|
||||
SnapRAID gestionează două snapshot-uri specifice, `stable` și `pending`,
|
||||
într-un director ascuns la rădăcina fiecărui subvolum de date.
|
||||
În Btrfs, Bcachefs și NTFS se folosește directorul `.snapraid/`,
|
||||
în ZFS cel standard `.zfs/snapshot/`.
|
||||
|
||||
Snapshot-ul `stable` reprezintă starea ultimului
|
||||
`sync` finalizat cu succes, conținând datele exacte utilizate pentru
|
||||
a calcula paritatea curentă. Acesta servește ca sursă principală de date
|
||||
pentru comenzile `scrub`, `check` și `fix`.
|
||||
|
||||
Snapshot-ul `pending` este o imagine temporară creată la începutul
|
||||
unui `sync` pentru a oferi o stare înghețată pentru calculul parității.
|
||||
După finalizarea cu succes a operațiunii, snapshot-ul `stable` anterior
|
||||
este șters, iar snapshot-ul `pending` este promovat pentru
|
||||
a-i lua locul ca nouă referință stabilă.
|
||||
|
||||
Dacă un `sync` este întrerupt, snapshot-ul `pending` este păstrat.
|
||||
Comenzile ulterioare `scrub`, `check` și `fix` vor folosi acest
|
||||
snapshot în așteptare, deoarece se potrivește cu starea sistemului de fișiere înregistrată în
|
||||
fișierul .content, chiar dacă paritatea este sincronizată doar parțial.
|
||||
|
||||
În cazul unei întreruperi a `sync`, comenzile `check` și `fix`
|
||||
citesc, de asemenea, din snapshot-ul `stable` pentru a recupera blocurile de date
|
||||
din fișierele care au fost actualizate sau șterse în timpul sync-ului.
|
||||
Acest lucru este posibil deoarece fișierul .content păstrează metadatele pentru
|
||||
toate fișierele modificate sau șterse pe parcursul procesului de sync.
|
||||
Aceste informații istorice sunt șterse numai după ce un sync se termină
|
||||
cu succes și versiunea finală a fișierului .content este salvată.
|
||||
|
||||
Dacă un `sync` este repornit după o întrerupere, snapshot-ul pending existent
|
||||
este șters și se creează unul nou pentru
|
||||
a captura starea curentă a sistemului de fișiere live.
|
||||
|
||||
Model (Pattern)
|
||||
Modelele oferă o modalitate flexibilă de a filtra fișierele pentru includere sau
|
||||
excludere. Folosind caractere de tip globbing, puteți defini reguli care să
|
||||
|
|
@ -1395,7 +1543,7 @@ Model (Pattern)
|
|||
|
||||
Asteriscul simplu `*` se potrivește cu orice secvență de caractere, dar, la fel ca
|
||||
semnul întrebării, nu trece niciodată de limitele directoarelor. Se oprește la
|
||||
slash-ul înainte, ceea ce îl face potrivit pentru potrivirea în cadrul unei singure
|
||||
bara oblică (/), ceea ce îl face potrivit pentru potrivirea în cadrul unei singure
|
||||
componente a căii. Acesta este comportamentul standard al metacaracterelor, familiar
|
||||
din shell globbing.
|
||||
|
||||
|
|
@ -1547,8 +1695,10 @@ Conținut (Content)
|
|||
Este un fișier binar care listează toate fișierele prezente în matricea dvs. de discuri,
|
||||
împreună cu toate sumele de control pentru a le verifica integritatea.
|
||||
|
||||
Acest fișier este citit și scris de comenzile `sync` și `scrub` și
|
||||
citit de comenzile `fix`, `check` și `status`.
|
||||
Fișierul de conținut este citit și scris de comenzile `sync`, `scrub`,
|
||||
`touch` și `rehash`. Este citit de comenzile `status`, `diff`, `check`,
|
||||
`fix`, `list`, `dup`, `locate` și `pool`, și este complet ignorat
|
||||
de comenzile `smart`, `probe`, `up`, `down` și `devices`.
|
||||
|
||||
Paritate (Parity)
|
||||
SnapRAID stochează informațiile de paritate ale matricei dvs. în fișierele de paritate.
|
||||
|
|
@ -1573,8 +1723,19 @@ Codare (Encoding)
|
|||
redirecționați ieșirea consolei către un fișier, fișierul rezultat este întotdeauna
|
||||
în format UTF-8.
|
||||
|
||||
Cod de ieșire (Exit Code)
|
||||
SnapRAID se termină cu următoarele coduri de eroare:
|
||||
|
||||
0 - Totul este OK.
|
||||
1 - Comanda a întâmpinat unele erori.
|
||||
2 - Comanda `diff` a constatat că totul este OK, dar este necesar un `sync`.
|
||||
|
||||
Traducere (Translation)
|
||||
Acest document este o traducere automată a manualului în limba engleză.
|
||||
Consultați manualul în limba engleză pentru versiunea oficială.
|
||||
|
||||
Drept de Autor (Copyright)
|
||||
Acest fișier este Copyright (C) 2025 Andrea Mazzoleni
|
||||
Acest fișier este Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
Vezi și (See Also)
|
||||
snapraid_log(1), snapraidd(1)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
=========================================
|
||||
|
||||
|
||||
1 SINTAXă
|
||||
=========
|
||||
1 SINTAXă (SYNOPSIS)
|
||||
====================
|
||||
|
||||
snapraid [-c, --conf CONFIG]
|
||||
[-f, --filter PATTERN] [-d, --filter-disk NAME]
|
||||
|
|
@ -28,8 +28,8 @@ snapraid [-c, --conf CONFIG]
|
|||
snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
|
||||
2 DESCRIERE
|
||||
===========
|
||||
2 DESCRIERE (DESCRIPTION)
|
||||
=========================
|
||||
|
||||
SnapRAID este un program de backup conceput pentru matrici de discuri, care stochează
|
||||
informații de paritate pentru recuperarea datelor în cazul a până la șase
|
||||
|
|
@ -39,7 +39,7 @@ Destinat în principal centrelor media de acasă cu fișiere mari,
|
|||
care se schimbă rar, SnapRAID oferă câteva caracteristici:
|
||||
|
||||
* Puteți utiliza discuri deja pline cu fișiere fără
|
||||
nevoia de a le reformat, accesându-le ca de obicei.
|
||||
nevoia de a le reformata, accesându-le ca de obicei.
|
||||
* Toate datele dvs. sunt hash-uite pentru a asigura integritatea datelor și a preveni
|
||||
corupția silențioasă.
|
||||
* Când numărul de discuri defecte depășește numărul de parități,
|
||||
|
|
@ -50,7 +50,7 @@ care se schimbă rar, SnapRAID oferă câteva caracteristici:
|
|||
* Discurile pot avea dimensiuni diferite.
|
||||
* Puteți adăuga discuri în orice moment.
|
||||
* SnapRAID nu vă blochează datele; puteți înceta să-l utilizați
|
||||
oricând fără a reforma sau muta date.
|
||||
oricând fără a reformata sau muta date.
|
||||
* Pentru a accesa un fișier, este necesar să se rotească doar un singur disc, economisind
|
||||
energie și reducând zgomotul.
|
||||
|
||||
|
|
@ -59,24 +59,32 @@ Pentru mai multe informații, vă rugăm să vizitați site-ul oficial SnapRAID:
|
|||
https://www.snapraid.it/
|
||||
|
||||
|
||||
3 LIMITăRI
|
||||
==========
|
||||
3 LIMITăRI (LIMITATIONS)
|
||||
========================
|
||||
|
||||
SnapRAID este un hibrid între un program RAID și unul de backup, care urmărește să combine
|
||||
cele mai bune beneficii ale ambelor. Cu toate acestea, are unele limitări pe care ar trebui
|
||||
SnapRAID este un hibrid între un RAID și un program de backup, având ca scop combinarea
|
||||
celor mai bune avantaje ale ambelor. Cu toate acestea, are unele limitări pe care ar trebui
|
||||
să le luați în considerare înainte de a-l utiliza.
|
||||
|
||||
Principala limitare este că, dacă un disc se defectează și nu ați făcut recent o sincronizare,
|
||||
este posibil să nu puteți recupera complet.
|
||||
Mai exact, este posibil să nu puteți recupera până la dimensiunea
|
||||
fișierelor modificate sau șterse de la ultima operațiune de sincronizare.
|
||||
Acest lucru se întâmplă chiar dacă fișierele modificate sau șterse nu sunt pe
|
||||
discul defect. Acesta este motivul pentru care SnapRAID este mai potrivit pentru
|
||||
date care se schimbă rar.
|
||||
Principala limitare este că, dacă un disc se defectează, puteți recupera datele doar până la
|
||||
starea ultimei operațiuni de `sync`. Orice date adăugate sau modificări efectuate
|
||||
de la ultima sincronizare care se află pe discul defect vor fi pierdute.
|
||||
|
||||
Pe de altă parte, fișierele nou adăugate nu împiedică recuperarea fișierelor
|
||||
deja existente. Veți pierde doar fișierele adăugate recent dacă acestea
|
||||
se află pe discul defect.
|
||||
Prin urmare, SnapRAID este potrivit în principal pentru date care se modifică rar.
|
||||
|
||||
Pentru datele care existau deja la ultima sincronizare, fiabilitatea recuperării depinde
|
||||
de utilizarea sau nu a opțiunii `snapshot`:
|
||||
|
||||
* Cu suport pentru snapshot (disponibil pe Btrfs, ZFS, Bcachefs și NTFS),
|
||||
SnapRAID poate menține automat o referință înghețată a discurilor de date.
|
||||
Acest lucru asigură că, chiar dacă modificați sau ștergeți fișiere pe sistemul de fișiere live
|
||||
în timpul sau după un sync, procesul de recuperare rămâne consistent și de încredere.
|
||||
|
||||
* Fără suport pentru snapshot, ștergerea sau modificarea fișierelor după un `sync`
|
||||
poate împiedica recuperarea completă a altor discuri defecte. Acest lucru se întâmplă
|
||||
deoarece paritatea nu mai corespunde cu fișierele modificate, chiar dacă
|
||||
acele fișiere nu se află pe discul defect. Pe de altă parte, fișierele nou adăugate
|
||||
nu împiedică recuperarea fișierelor deja existente.
|
||||
|
||||
Alte limitări ale SnapRAID sunt:
|
||||
|
||||
|
|
@ -93,8 +101,8 @@ Alte limitări ale SnapRAID sunt:
|
|||
Permisiunile, proprietarul și atributele extinse nu sunt salvate.
|
||||
|
||||
|
||||
4 NOțIUNI DE BAZă
|
||||
=================
|
||||
4 NOțIUNI DE BAZă (GETTING STARTED)
|
||||
===================================
|
||||
|
||||
Pentru a utiliza SnapRAID, trebuie mai întâi să selectați un disc în matricea dvs. de discuri
|
||||
pentru a-l dedica informațiilor de `paritate`. Cu un singur disc pentru paritate, veți
|
||||
|
|
@ -176,7 +184,7 @@ Când această comandă se finalizează, datele dvs. sunt ÎN SIGURANȚĂ.
|
|||
Acum puteți începe să utilizați matricea după cum doriți și
|
||||
să actualizați periodic informațiile de paritate rulând comanda `sync`.
|
||||
|
||||
4.1 Scrubbing (Verificare)
|
||||
4.1 Verificare (Scrubbing)
|
||||
--------------------------
|
||||
|
||||
Pentru a verifica periodic datele și paritatea pentru erori, puteți
|
||||
|
|
@ -216,12 +224,12 @@ Rularea `scrub` pe o matrice nesincronizată poate raporta erori cauzate de
|
|||
fișiere eliminate sau modificate. Aceste erori sunt raportate în ieșirea `scrub`,
|
||||
dar blocurile aferente nu sunt marcate ca defecte.
|
||||
|
||||
4.2 Pooling (Agregare)
|
||||
4.2 Agregare (Pooling)
|
||||
----------------------
|
||||
|
||||
Notă: Funcționalitatea de pooling descrisă mai jos a fost înlocuită de instrumentul
|
||||
mergerfs, care este acum opțiunea recomandată pentru utilizatorii Linux în
|
||||
comunitatea SnapRAID. Mergefs oferă o modalitate mai flexibilă și eficientă
|
||||
comunitatea SnapRAID. Mergerfs oferă o modalitate mai flexibilă și eficientă
|
||||
de a agrega mai multe discuri într-un singur punct de montare unificat,
|
||||
permițând accesul neîntrerupt la fișiere pe toată matricea dvs. fără a se baza
|
||||
pe link-uri simbolice. Se integrează bine cu SnapRAID pentru protecția parității
|
||||
|
|
@ -230,7 +238,7 @@ sau configurații NAS personalizate.
|
|||
|
||||
Pentru a avea toate fișierele din matricea dvs. afișate în același arbore de directoare,
|
||||
puteți activa funcționalitatea de `pooling`. Aceasta creează o vizualizare virtuală
|
||||
doar în citire a tuturor fișierelor din matricea dvs. folosind link-uri simbolice.
|
||||
read-only a tuturor fișierelor din matricea dvs. folosind link-uri simbolice.
|
||||
|
||||
Puteți configura directorul de `pooling` în fișierul de configurare cu:
|
||||
|
||||
|
|
@ -289,7 +297,7 @@ De asemenea, ar putea fi necesar să configurați clienții la distanță pentru
|
|||
|
||||
fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
||||
|
||||
4.3 Undeleting (Anulare Ștergere)
|
||||
4.3 Anulare ștergere (Undeleting)
|
||||
---------------------------------
|
||||
|
||||
SnapRAID funcționează mai mult ca un program de backup decât un sistem RAID și poate
|
||||
|
|
@ -312,8 +320,8 @@ Sau pentru a recupera toate fișierele șterse de pe toate unitățile cu:
|
|||
|
||||
snapraid fix -m
|
||||
|
||||
4.4 Recuperare
|
||||
--------------
|
||||
4.4 Recuperare (Recovering)
|
||||
---------------------------
|
||||
|
||||
Cel mai rău s-a întâmplat și ați pierdut unul sau mai multe discuri!
|
||||
|
||||
|
|
@ -333,7 +341,7 @@ Modificați fișierul de configurare SnapRAID pentru a face ca opțiunea `data`
|
|||
a discului defect să indice o locație cu suficient spațiu gol
|
||||
pentru a recupera fișierele.
|
||||
|
||||
De exemplu, dacă discul `d1` a eșuat, schimbați de la:
|
||||
De exemplu, dacă discul `d1` s-a defectat, schimbați de la:
|
||||
|
||||
data d1 /mnt/disk1/
|
||||
|
||||
|
|
@ -369,7 +377,7 @@ verificând toate liniile care încep cu `unrecoverable:`.
|
|||
Dacă nu sunteți mulțumit de recuperare, o puteți reîncerca de câte
|
||||
ori doriți.
|
||||
|
||||
De exemplu, dacă ați eliminat fișiere din matrice după ultima
|
||||
De exemplu, dacă ați eliminat fișiere din matrice după ultimul
|
||||
`sync`, acest lucru poate duce la nerecuperarea unor fișiere.
|
||||
În acest caz, puteți reîncerca `fix`-ul utilizând opțiunea -i, --import,
|
||||
specificând unde se află acum aceste fișiere pentru a le include din nou în
|
||||
|
|
@ -401,16 +409,16 @@ Rulați comanda `sync` pentru a resincroniza matricea cu noul disc.
|
|||
Dacă totul este recuperat, această comandă este imediată.
|
||||
|
||||
|
||||
5 COMENZI
|
||||
=========
|
||||
5 COMENZI (COMMANDS)
|
||||
====================
|
||||
|
||||
SnapRAID oferă câteva comenzi simple care vă permit să:
|
||||
|
||||
* Tipăriți starea matricei -> `status`
|
||||
* Afișați starea matricei -> `status`
|
||||
* Controlați discurile -> `smart`, `probe`, `up`, `down`
|
||||
* Faceți un backup/snapshot -> `sync`
|
||||
* Creați un punct de backup/recuperare -> `sync`
|
||||
* Verificați periodic datele -> `scrub`
|
||||
* Restaurați ultimul backup/snapshot -> `fix`.
|
||||
* Restaurați ultimul punct de backup/recuperare -> `fix`.
|
||||
|
||||
Comenzile trebuie scrise cu litere mici.
|
||||
|
||||
|
|
@ -441,7 +449,7 @@ Nimic nu este modificat.
|
|||
Tipărește un raport SMART al tuturor discurilor din sistem.
|
||||
|
||||
Include o estimare a probabilității de eșec în anul următor,
|
||||
permițându-vă să planificați înlocuiri de întreținere a discurilor care prezintă
|
||||
permițându-vă să planificați înlocuiri de întreținere ale discurilor care prezintă
|
||||
atribute suspecte.
|
||||
|
||||
Această estimare a probabilității este obținută prin corelarea atributelor SMART
|
||||
|
|
@ -449,7 +457,7 @@ ale discurilor cu datele Backblaze disponibile la:
|
|||
|
||||
https://www.backblaze.com/hard-drive-test-data.html
|
||||
|
||||
Dacă SMART raportează că un disc este pe cale să eșueze, `FAIL` sau `PREFAIL` este tipărit
|
||||
Dacă SMART raportează că un disc este pe cale să se defecteze, `FAIL` sau `PREFAIL` este tipărit
|
||||
pentru acel disc, iar SnapRAID returnează o eroare.
|
||||
În acest caz, înlocuirea imediată a discului este puternic recomandată.
|
||||
|
||||
|
|
@ -490,7 +498,7 @@ Nimic nu este modificat.
|
|||
5.4 up
|
||||
------
|
||||
|
||||
Pornirea tuturor discurilor din matrice.
|
||||
Pornește toate discurile din matrice.
|
||||
|
||||
Puteți porni doar discuri specifice utilizând opțiunea -d, --filter-disk.
|
||||
|
||||
|
|
@ -502,7 +510,7 @@ Nimic nu este modificat.
|
|||
5.5 down
|
||||
--------
|
||||
|
||||
Oprirea (spin down) tuturor discurilor din matrice.
|
||||
Oprește (spin down) toate discurile din matrice.
|
||||
|
||||
Această comandă utilizează instrumentul `smartctl` și este echivalentă cu rularea
|
||||
`smartctl -s standby,now` pe toate dispozitivele.
|
||||
|
|
@ -518,7 +526,7 @@ Nimic nu este modificat.
|
|||
5.6 diff
|
||||
--------
|
||||
|
||||
Listează toate fișierele modificate de la ultima `sync` care trebuie
|
||||
Listează toate fișierele modificate de la ultimul `sync` care trebuie
|
||||
să li se recalculeze datele de paritate.
|
||||
|
||||
Această comandă nu verifică datele fișierului, ci doar marca temporală,
|
||||
|
|
@ -537,23 +545,23 @@ grupate după:
|
|||
copied - Fișiere copiate pe același disc sau pe un disc diferit
|
||||
unde fișierul original încă există.
|
||||
Acestea sunt identificate prin faptul că au același nume,
|
||||
dimensiune și amprentă temporală.
|
||||
Dacă amprenta temporală sub-secundă este zero, calea completă
|
||||
dimensiune și marcă temporală.
|
||||
Dacă marca temporală sub-secundă este zero, calea completă
|
||||
trebuie să se potrivească pentru a fi identificate, nu doar
|
||||
numele.
|
||||
relocated - Fișiere mutate pe același disc sau pe un disc diferit
|
||||
unde originalul a dispărut.
|
||||
Acestea sunt identificate prin faptul că au același nume,
|
||||
dimensiune și amprentă temporală.
|
||||
Dacă amprenta temporală sub-secundă este zero, calea completă
|
||||
dimensiune și marcă temporală.
|
||||
Dacă marca temporală sub-secundă este zero, calea completă
|
||||
trebuie să se potrivească pentru a fi identificate.
|
||||
Spre deosebire de fișierele 'moved' de pe același disc, fișierele
|
||||
relocate au un inod diferit.
|
||||
restored - Fișiere cu un inod diferit, dar care se potrivesc ca
|
||||
director, nume, dimensiune și amprentă temporală.
|
||||
director, nume, dimensiune și marcă temporală.
|
||||
Acestea sunt de obicei fișiere restaurate după ce au fost șterse.
|
||||
|
||||
Dacă este necesară o `sync`, codul de retur al procesului este 2, în loc de
|
||||
Dacă este necesară o sincronizare, codul de retur al procesului este 2, în loc de
|
||||
cel implicit 0. Codul de retur 1 este utilizat pentru o condiție de eroare generică.
|
||||
|
||||
Nimic nu este modificat.
|
||||
|
|
@ -633,13 +641,12 @@ Fișierele din matrice NU sunt modificate.
|
|||
|
||||
Repară toate fișierele și datele de paritate.
|
||||
|
||||
Toate fișierele și datele de paritate sunt comparate cu starea snapshot-ului
|
||||
salvată la ultima `sync`.
|
||||
Dacă se găsește o diferență, este readusă la snapshot-ul stocat.
|
||||
Toate fișierele și datele de paritate sunt comparate cu starea salvată în
|
||||
ultimul `sync`. Dacă se găsește o diferență, aceasta este readusă la starea stocată.
|
||||
|
||||
ATENȚIE! Comanda `fix` nu face diferența între erori și
|
||||
modificări intenționate. Ea revine necondiționat la starea fișierului
|
||||
de la ultima `sync`.
|
||||
AVERTISMENT!
|
||||
Comanda `fix` nu face diferența între erori și modificări intenționate.
|
||||
Ea revine necondiționat la starea fișierelor de la ultimul `sync`.
|
||||
|
||||
Dacă nu este specificată nicio altă opțiune, întreaga matrice este procesată.
|
||||
Utilizați opțiunile de filtrare pentru a selecta un subset de fișiere sau discuri de operat.
|
||||
|
|
@ -647,7 +654,7 @@ Utilizați opțiunile de filtrare pentru a selecta un subset de fișiere sau dis
|
|||
Pentru a repara doar blocurile marcate ca defecte în timpul `sync` și `scrub`,
|
||||
utilizați opțiunea -e, --filter-error.
|
||||
Spre deosebire de alte opțiuni de filtrare, aceasta aplică reparații doar fișierelor care sunt
|
||||
neschimbate de la ultima `sync`.
|
||||
neschimbate de la ultimul `sync`.
|
||||
|
||||
SnapRAID redenumește toate fișierele care nu pot fi reparate adăugând extensia
|
||||
`.unrecoverable`.
|
||||
|
|
@ -689,7 +696,7 @@ Nimic nu este modificat.
|
|||
---------
|
||||
|
||||
Listează toate fișierele conținute în matrice la momentul
|
||||
ultimei `sync`.
|
||||
ultimului `sync`.
|
||||
|
||||
Cu -v sau --verbose, este afișat și timpul sub-secundă.
|
||||
|
||||
|
|
@ -786,15 +793,14 @@ fragmente pe care le ocupă.
|
|||
|
||||
Puteți utiliza opțiunea -t, --tail pentru a restricționa operațiunea la fișierele
|
||||
care ocupă porțiunea finală specificată a parității.
|
||||
|
||||
Dacă doriți să realocați aceste fișiere, puteți utiliza apoi opțiunea
|
||||
-W, --force-realloc-tail.
|
||||
|
||||
Rețineți că astfel de fișiere nu vor fi protejate de paritate în timpul procesului
|
||||
de realocare.
|
||||
-W, --force-realloc-tail. Rețineți că astfel de fișiere nu vor
|
||||
fi protejate de paritate în timpul procesului de realocare.
|
||||
|
||||
|
||||
6 OPțIUNI
|
||||
=========
|
||||
6 OPțIUNI (OPTIONS)
|
||||
===================
|
||||
|
||||
SnapRAID oferă următoarele opțiuni:
|
||||
|
||||
|
|
@ -886,7 +892,7 @@ SnapRAID oferă următoarele opțiuni:
|
|||
|
||||
-i, --import DIR
|
||||
Importă din directorul specificat orice fișiere șterse
|
||||
din matrice după ultima `sync`.
|
||||
din matrice după ultimul `sync`.
|
||||
Dacă mai aveți astfel de fișiere, ele pot fi utilizate de `check`
|
||||
și `fix` pentru a îmbunătăți procesul de recuperare.
|
||||
Fișierele sunt citite, inclusiv în subdirectoare, și sunt
|
||||
|
|
@ -904,9 +910,9 @@ SnapRAID oferă următoarele opțiuni:
|
|||
-w, --bw-limit RATE
|
||||
Aplică o limită globală de lățime de bandă pentru toate discurile. RATE este
|
||||
numărul de octeți pe secundă. Puteți specifica un multiplicator
|
||||
cum ar fi K, M sau G (de exemplu, --bw-limit 1G).
|
||||
cum ar fi K, M, G sau T (de exemplu, --bw-limit 1G).
|
||||
|
||||
-t, --tail DIMENSIUNE
|
||||
-t, --tail SIZE
|
||||
Limitează listarea fișierelor la cele care nu utilizează mai mult de
|
||||
dimensiunea finală specificată a discurilor de paritate.
|
||||
Puteți utiliza multiplicatori precum K, M, G sau T (ex. --tail 1G).
|
||||
|
|
@ -949,11 +955,7 @@ SnapRAID oferă următoarele opțiuni:
|
|||
dacă nu specificați această opțiune.
|
||||
Acest lucru vă permite să detectați cu ușurință când un sistem de fișiere de date nu este
|
||||
montat.
|
||||
Este permis, totuși, să aveți o singură schimbare de UUID cu
|
||||
paritate simplă și mai multe cu paritate multiplă, deoarece acesta este
|
||||
cazul normal la înlocuirea discurilor după o recuperare.
|
||||
Această opțiune poate fi utilizată doar cu `sync`, `check` sau
|
||||
`fix`.
|
||||
Această opțiune poate fi utilizată doar cu `sync`.
|
||||
|
||||
-U, --force-uuid
|
||||
Forțează operațiunea nesigură de sincronizare, verificare și reparare
|
||||
|
|
@ -1010,7 +1012,7 @@ SnapRAID oferă următoarele opțiuni:
|
|||
recomandat să nu o utilizați.
|
||||
NU aveți protecție a datelor în timpul operațiunii `sync`.
|
||||
|
||||
-W, --force-realloc-tail DIMENSIUNE
|
||||
-W, --force-realloc-tail SIZE
|
||||
Funcționează ca -R, --force-realloc, dar limitat la porțiunea finală
|
||||
specificată (ultimii DIMENSIUNE octeți) ai fiecărui fișier de paritate.
|
||||
Forțează realocarea (mutarea) oricăror fragmente/blocuri de fișiere stocate
|
||||
|
|
@ -1052,7 +1054,7 @@ SnapRAID oferă următoarele opțiuni:
|
|||
-L, --error-limit NUMBER
|
||||
Setează o nouă limită de erori înainte de a opri execuția.
|
||||
În mod implicit, SnapRAID se oprește dacă întâlnește mai mult de 100
|
||||
de erori de intrare/ieșire, indicând că un disc probabil eșuează.
|
||||
de erori de intrare/ieșire, indicând că un disc probabil se defectează.
|
||||
Această opțiune afectează `sync` și `scrub`, cărora li se permite
|
||||
să continue după primul set de erori de disc pentru a încerca
|
||||
să își finalizeze operațiunile.
|
||||
|
|
@ -1098,8 +1100,8 @@ SnapRAID oferă următoarele opțiuni:
|
|||
Tipărește versiunea programului.
|
||||
|
||||
|
||||
7 CONFIGURARE
|
||||
=============
|
||||
7 CONFIGURARE (CONFIGURATION)
|
||||
=============================
|
||||
|
||||
SnapRAID necesită un fișier de configurare pentru a ști unde se află matricea dvs. de discuri
|
||||
și unde să stocheze informațiile de paritate.
|
||||
|
|
@ -1143,7 +1145,7 @@ Pentru fiecare nivel de paritate specificat, este activat un nivel suplimentar d
|
|||
|
||||
* 2-parity activează paritatea dublă RAID6.
|
||||
* 3-parity activează paritatea triplă.
|
||||
* 4-parity activează paritatea quad (patru).
|
||||
* 4-parity activează paritatea cvadruplă (patru).
|
||||
* 5-parity activează paritatea penta (cinci).
|
||||
* 6-parity activează paritatea hexa (șase).
|
||||
|
||||
|
|
@ -1164,7 +1166,7 @@ CPU-urilor low-end precum ARM sau AMD Phenom, Athlon și Opteron care nu
|
|||
suportă setul de instrucțiuni SSSE3. În astfel de cazuri, oferă
|
||||
o performanță mai bună.
|
||||
|
||||
Acest format este similar, dar mai rapid decât cel utilizat de ZFS RAIDZ3.
|
||||
Acest format este similar cu cel utilizat de ZFS RAIDZ3, dar mai rapid decât acesta.
|
||||
Ca și ZFS, nu funcționează dincolo de paritatea triplă.
|
||||
|
||||
Când utilizați `3-parity`, veți fi avertizați dacă este recomandat să utilizați
|
||||
|
|
@ -1177,7 +1179,7 @@ fișierul de configurare cu fișierul z-parity sau 3-parity dorit
|
|||
7.4 content FILE
|
||||
----------------
|
||||
|
||||
Definește fișierul de utilizat pentru a stoca lista și sumele de control (checksums) a tuturor
|
||||
Definește fișierul de utilizat pentru a stoca lista și sumele de control (checksums) ale tuturor
|
||||
fișierelor prezente în matricea dvs. de discuri.
|
||||
|
||||
Poate fi plasat pe un disc utilizat pentru date, paritate sau
|
||||
|
|
@ -1222,14 +1224,41 @@ sistemului, cum ar fi discul de pornire.
|
|||
Rețineți că astfel de discuri nu sunt afectate de comenzile `up` și
|
||||
`down` deoarece se așteaptă ca acestea să se rotească mereu.
|
||||
|
||||
7.7 nohidden
|
||||
7.7 snapshot
|
||||
------------
|
||||
|
||||
Activează utilizarea snapshot-urilor sistemului de fișiere pentru comenzile `sync`, `scrub`,
|
||||
`check` și `fix`.
|
||||
|
||||
Când este activată, SnapRAID creează un snapshot read-only al datelor dvs. la
|
||||
începutul unui 'sync'. Acest lucru asigură o vizualizare consistentă, la un anumit moment în timp, a
|
||||
fișierelor dvs., prevenind erorile cauzate de modificările concurente ale fișierelor.
|
||||
|
||||
Acest lucru îmbunătățește semnificativ recuperarea: dacă un fișier este șters din sistemul de fișiere live,
|
||||
el rămâne păstrat în snapshot. Acest lucru previne ca paritatea să devină „ruptă”
|
||||
pentru acel bloc, asigurându-vă că puteți recupera cu succes datele
|
||||
dacă un alt disc se defectează.
|
||||
|
||||
Această opțiune se aplică exclusiv discurilor de date formatate cu sistemele de
|
||||
fișiere Btrfs, Bcachefs sau ZFS în Linux și NTFS în Windows.
|
||||
Discurile de paritate, sau discurile de date care utilizează alte sisteme de fișiere, vor folosi întotdeauna
|
||||
versiunea live a sistemului de fișiere.
|
||||
|
||||
Crearea și ștergerea snapshot-urilor necesită privilegii administrative.
|
||||
Asigurați-vă că SnapRAID este rulat cu permisiunile necesare (de exemplu, sudo) când
|
||||
această opțiune este activată.
|
||||
|
||||
Consultați secțiunea SNAPSHOTS pentru o explicație detaliată a ciclului de viață
|
||||
al snapshot-urilor.
|
||||
|
||||
7.8 nohidden
|
||||
------------
|
||||
|
||||
Exclude toate fișierele și directoarele ascunse.
|
||||
În Unix, fișierele ascunse sunt cele care încep cu `.`.
|
||||
În Windows, sunt cele cu atributul ascuns.
|
||||
|
||||
7.8 exclude/include PATTERN
|
||||
7.9 exclude/include PATTERN
|
||||
---------------------------
|
||||
|
||||
Definește modelele de fișiere sau directoare de exclus sau inclus
|
||||
|
|
@ -1247,8 +1276,8 @@ specificațiile modelului.
|
|||
|
||||
Această opțiune poate fi utilizată de mai multe ori.
|
||||
|
||||
7.9 blocksize SIZE_IN_KIBIBYTES
|
||||
-------------------------------
|
||||
7.10 blocksize SIZE_IN_KIBIBYTES
|
||||
--------------------------------
|
||||
|
||||
Definește dimensiunea de bază a blocului în kibibytes pentru paritate.
|
||||
Un kibibyte este 1024 de octeți.
|
||||
|
|
@ -1295,7 +1324,7 @@ Acest lucru duce la aproximativ 1,5% spațiu suplimentar, aproximativ 60 GB pent
|
|||
un disc de 4 TB, ceea ce permite aproximativ 460.000 de fișiere pe fiecare disc de date fără
|
||||
niciun spațiu irosit.
|
||||
|
||||
7.10 hashsize SIZE_IN_BYTES
|
||||
7.11 hashsize SIZE_IN_BYTES
|
||||
---------------------------
|
||||
|
||||
Definește dimensiunea hash-ului în octeți pentru blocurile salvate.
|
||||
|
|
@ -1333,15 +1362,15 @@ Trecând la ambele, o dimensiune de hash de 8 și o dimensiune de bloc de 512, o
|
|||
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0,51 GiB
|
||||
|
||||
7.11 autosave SIZE_IN_GIGABYTES
|
||||
7.12 autosave SIZE_IN_GIGABYTES
|
||||
-------------------------------
|
||||
|
||||
Salvează automat starea la sincronizare sau verificare după
|
||||
cantitatea specificată de GB procesați.
|
||||
Această opțiune este utilă pentru a evita repornirea comenzilor `sync` lungi
|
||||
de la zero dacă sunt întrerupte de o cădere a mașinii sau de orice alt eveniment.
|
||||
de la zero dacă sunt întrerupte de o pană de sistem sau de orice alt eveniment.
|
||||
|
||||
7.12 temp_limit TEMPERATURE_CELSIUS
|
||||
7.13 temp_limit TEMPERATURE_CELSIUS
|
||||
-----------------------------------
|
||||
|
||||
Setează temperatura maximă permisă a discului în Celsius. Când este specificată,
|
||||
|
|
@ -1350,13 +1379,13 @@ instrumentul smartctl. Temperaturile curente ale discurilor sunt afișate în ti
|
|||
SnapRAID funcționează. Dacă un disc depășește această limită, toate operațiunile
|
||||
se opresc, iar discurile sunt oprite (puse în standby) pentru durata
|
||||
definită de opțiunea `temp_sleep`. După perioada de așteptare, operațiunile
|
||||
reiau, putând întrerupe din nou dacă limita de temperatură este atinsă
|
||||
se reiau, putând fi întrerupte din nou dacă limita de temperatură este atinsă
|
||||
încă o dată.
|
||||
|
||||
În timpul funcționării, SnapRAID analizează și curba de încălzire a fiecărui
|
||||
disc și estimează temperatura constantă pe termen lung pe care se așteaptă să o
|
||||
atingă dacă activitatea continuă. Estimarea este efectuată numai după
|
||||
ce temperatura discului a crescut de patru ori, asigurându-se că sunt disponibile
|
||||
ce temperatura discului a înregistrat patru creșteri, asigurându-se că sunt disponibile
|
||||
suficiente puncte de date pentru a stabili o tendință fiabilă.
|
||||
Această temperatură constantă prezisă este afișată între paranteze lângă
|
||||
valoarea curentă și ajută la evaluarea dacă răcirea sistemului este
|
||||
|
|
@ -1372,14 +1401,14 @@ cea mai scăzută temperatură a discului măsurată la începutul rulării ca r
|
|||
În mod normal, SnapRAID arată doar temperatura celui mai fierbinte disc.
|
||||
Pentru a afișa temperatura tuturor discurilor, utilizați opțiunea -A sau --stats.
|
||||
|
||||
7.13 temp_sleep TIME_IN_MINUTES
|
||||
7.14 temp_sleep TIME_IN_MINUTES
|
||||
-------------------------------
|
||||
|
||||
Setează timpul de așteptare (standby), în minute, când limita de temperatură este
|
||||
atinsă. În această perioadă, discurile rămân oprite. Valoarea implicită
|
||||
este 5 minute.
|
||||
|
||||
7.14 pool DIR
|
||||
7.15 pool DIR
|
||||
-------------
|
||||
|
||||
Definește directorul de pooling unde este creată vizualizarea virtuală a matricei
|
||||
|
|
@ -1387,7 +1416,7 @@ de discuri utilizând comanda `pool`.
|
|||
|
||||
Directorul trebuie să existe deja.
|
||||
|
||||
7.15 share UNC_DIR
|
||||
7.16 share UNC_DIR
|
||||
------------------
|
||||
|
||||
Definește calea UNC Windows necesară pentru a accesa discurile de la distanță.
|
||||
|
|
@ -1403,7 +1432,7 @@ directorul și numele fișierului.
|
|||
|
||||
Această opțiune este necesară doar pentru Windows.
|
||||
|
||||
7.16 smartctl DISK/PARITY OPTIONS...
|
||||
7.17 smartctl DISK/PARITY OPTIONS...
|
||||
------------------------------------
|
||||
|
||||
Definește opțiuni smartctl personalizate pentru a obține atributele SMART pentru
|
||||
|
|
@ -1419,6 +1448,9 @@ PARITY este unul dintre numele de paritate: `parity`, `2-parity`, `3-parity`,
|
|||
numele dispozitivului. Pentru controlerele RAID, dispozitivul este
|
||||
probabil fix și este posibil să nu fie nevoie să utilizați `%s`.
|
||||
|
||||
De asemenea, puteți specifica un șir de opțiuni de informații personalizate
|
||||
utilizând eticheta `[info: ...]` pentru a înlocui opțiunea implicită `-a`.
|
||||
|
||||
Consultați documentația smartmontools pentru opțiuni posibile:
|
||||
|
||||
https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
|
|
@ -1426,13 +1458,14 @@ Consultați documentația smartmontools pentru opțiuni posibile:
|
|||
|
||||
De exemplu:
|
||||
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl parity -d sat %s
|
||||
|
||||
7.17 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
7.18 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
-------------------------------------------
|
||||
|
||||
Ignoră atributul SMART specificat la calcularea probabilității
|
||||
de eșec a discului. Această opțiune este utilă dacă un disc raportează valori neobișnuite sau
|
||||
de eșec al discului. Această opțiune este utilă dacă un disc raportează valori neobișnuite sau
|
||||
înșelătoare pentru un anumit atribut.
|
||||
|
||||
DISK este același nume de disc specificat în opțiunea `data`.
|
||||
|
|
@ -1440,16 +1473,21 @@ PARITY este unul dintre numele de paritate: `parity`, `2-parity`, `3-parity`,
|
|||
`4-parity`, `5-parity`, `6-parity` sau `z-parity`.
|
||||
Valoarea specială * poate fi utilizată pentru a ignora atributul pe toate discurile.
|
||||
|
||||
De exemplu, pentru a ignora atributul `Current Pending Sector Count` pe
|
||||
toate discurile:
|
||||
Mai multe atribute pot fi specificate separate prin spații.
|
||||
Fiecare atribut poate fi specificat ca un număr de la 1 la 255 sau ca un
|
||||
nume insensibil la majuscule (de exemplu, `Current_Pending_Sector`).
|
||||
|
||||
smartignore * 197
|
||||
De exemplu, pentru a ignora atributele `Current Pending Sector Count` și
|
||||
`Reallocated Sectors Count` pe toate discurile după numărul sau numele lor:
|
||||
|
||||
Pentru a-l ignora doar pe primul disc de paritate:
|
||||
smartignore * 197 5
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
smartignore parity 197
|
||||
Pentru a le ignora doar pe primul disc de paritate:
|
||||
|
||||
7.18 Exemple
|
||||
smartignore parity 197 5
|
||||
|
||||
7.19 Exemple
|
||||
------------
|
||||
|
||||
Un exemplu de configurare tipică pentru Unix este:
|
||||
|
|
@ -1462,7 +1500,7 @@ Un exemplu de configurare tipică pentru Unix este:
|
|||
data d3 /mnt/disk3/
|
||||
exclude /lost+found/
|
||||
exclude /tmp/
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/sg0
|
||||
smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1478,14 +1516,134 @@ Un exemplu de configurare tipică pentru Windows este:
|
|||
exclude Thumbs.db
|
||||
exclude \$RECYCLE.BIN
|
||||
exclude \System Volume Information
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
|
||||
8 MODEL (PATTERN)
|
||||
=================
|
||||
8 SNAPSHOT-URI (SNAPSHOTS)
|
||||
==========================
|
||||
|
||||
Dacă opțiunea snapshot este activată în configurație, SnapRAID
|
||||
utilizează funcționalitatea de snapshot a sistemului de fișiere pentru a asigura operațiuni atomice
|
||||
și consistente.
|
||||
|
||||
Gestionarea snapshot-urilor este complet automată și transparentă.
|
||||
Puteți continua să utilizați SnapRAID exact ca înainte, cu protecția
|
||||
suplimentară oferită de snapshot-uri gestionate în întregime în
|
||||
background.
|
||||
|
||||
Acest lucru oferă două avantaje principale:
|
||||
|
||||
Consistență - Fișierele modificate pe sistemul de fișiere live în timpul unui sync sau scrub
|
||||
de lungă durată nu vor cauza nepotriviri de paritate sau operațiuni abandonate,
|
||||
deoarece SnapRAID vede o imagine înghețată la un anumit moment în timp.
|
||||
Recuperare - Dacă un fișier este actualizat sau șters din sistemul de fișiere live,
|
||||
el rămâne păstrat în snapshot. Dacă se produce o defecțiune a discului
|
||||
înainte de rularea următorului sync, SnapRAID utilizează datele păstrate
|
||||
în snapshot pentru a reconstrui discul defect.
|
||||
|
||||
În cazul unei defecțiuni a discului în timpul unui proces de sync activ,
|
||||
SnapRAID este, de asemenea, capabil să citească automat atât din snapshot-ul
|
||||
calculului anterior de paritate, cât și din cel curent.
|
||||
Acest lucru maximizează probabilitatea unei recuperări complete prin
|
||||
oferirea accesului la blocurile exacte de date necesare pentru a rezolva
|
||||
ecuațiile de paritate, chiar dacă acele blocuri au fost modificate
|
||||
sau șterse între sync-uri.
|
||||
|
||||
Fără snapshot-uri, un fișier actualizat sau șters pe un disc sănătos
|
||||
are ca rezultat lipsa unor blocuri de date care pot fi necesare pentru
|
||||
a repara alte discuri defecte.
|
||||
|
||||
Snapshot-urile sunt create doar pentru discurile de date și numai dacă sistemul de fișiere
|
||||
subiacent acceptă această funcționalitate. Discurile de paritate folosesc întotdeauna
|
||||
sistemul de fișiere live.
|
||||
|
||||
În prezent, acest lucru este acceptat pe Btrfs, Bcachefs și ZFS în Linux
|
||||
și pe NTFS în Windows.
|
||||
|
||||
Puteți amesteca discuri de date cu sisteme de fișiere diferite. Doar cele care
|
||||
acceptă snapshot-uri le vor utiliza, în timp ce celelalte discuri vor continua
|
||||
să funcționeze direct pe sistemul de fișiere live.
|
||||
|
||||
Crearea și ștergerea snapshot-urilor necesită privilegii administrative.
|
||||
Asigurați-vă că SnapRAID este rulat cu permisiunile necesare (de exemplu, sudo)
|
||||
atunci când snapshot-urile sunt activate.
|
||||
|
||||
8.1 Comportamentul comenzilor cu snapshot-uri
|
||||
---------------------------------------------
|
||||
|
||||
Comenzile `sync` și `scrub` operează ambele exclusiv pe snapshot-uri
|
||||
pentru a se asigura că toate operațiunile de date sunt efectuate în raport cu o stare consistentă
|
||||
și înghețată. Prin utilizarea acestor snapshot-uri, SnapRAID previne neconcordanțele de paritate
|
||||
care altfel ar fi declanșate de modificările concurente ale fișierelor pe sistemul de fișiere live.
|
||||
În timpul unui `sync`, comanda folosește un snapshot nou creat la
|
||||
începutul procesului pentru a captura starea curentă pentru calculul parității.
|
||||
În schimb, comanda `scrub` utilizează ultimul snapshot, cel
|
||||
creat în timpul celui mai recent sync, pentru a menține un punct de referință de încredere
|
||||
care se potrivește cu paritatea existentă.
|
||||
|
||||
Pentru comenzile `check` și `fix`, utilizarea ultimului snapshot
|
||||
depinde dacă anumite discuri sunt vizate folosind opțiunea
|
||||
-d, --filter-disk.
|
||||
|
||||
Un disc selectat în mod explicit prin -d („ținta” operațiunii)
|
||||
folosește întotdeauna sistemul de fișiere live. Pentru `fix`, acest lucru permite restaurarea
|
||||
datelor pe discul de înlocuire activ. Pentru `check`, permite simularea
|
||||
operațiunii `fix` în aceleași condiții.
|
||||
|
||||
Toate celelalte discuri de date (discurile de „referință”) vor fi accesate prin intermediul
|
||||
snapshot-urilor lor. Acest lucru asigură că, chiar dacă modificați fișiere
|
||||
pe discurile sănătoase în timp ce o recuperare este în curs, SnapRAID
|
||||
are o referință stabilă, înghețată pentru a rezolva ecuațiile de paritate.
|
||||
|
||||
Dacă nu este furnizată nicio opțiune -d, SnapRAID presupune că operațiunea se aplică
|
||||
întregii matrice, caz în care `check` și `fix` vor folosi exclusiv
|
||||
sistemele de fișiere live.
|
||||
|
||||
Toate celelalte comenzi operează exclusiv pe sistemul de fișiere live.
|
||||
|
||||
|
||||
9 CICLUL DE VIAță AL SNAPSHOT-URILOR (SNAPSHOTS LIFECYCLE)
|
||||
==========================================================
|
||||
|
||||
SnapRAID gestionează două snapshot-uri specifice, `stable` și `pending`,
|
||||
într-un director ascuns la rădăcina fiecărui subvolum de date.
|
||||
În Btrfs, Bcachefs și NTFS se folosește directorul `.snapraid/`,
|
||||
în ZFS cel standard `.zfs/snapshot/`.
|
||||
|
||||
Snapshot-ul `stable` reprezintă starea ultimului
|
||||
`sync` finalizat cu succes, conținând datele exacte utilizate pentru
|
||||
a calcula paritatea curentă. Acesta servește ca sursă principală de date
|
||||
pentru comenzile `scrub`, `check` și `fix`.
|
||||
|
||||
Snapshot-ul `pending` este o imagine temporară creată la începutul
|
||||
unui `sync` pentru a oferi o stare înghețată pentru calculul parității.
|
||||
După finalizarea cu succes a operațiunii, snapshot-ul `stable` anterior
|
||||
este șters, iar snapshot-ul `pending` este promovat pentru
|
||||
a-i lua locul ca nouă referință stabilă.
|
||||
|
||||
Dacă un `sync` este întrerupt, snapshot-ul `pending` este păstrat.
|
||||
Comenzile ulterioare `scrub`, `check` și `fix` vor folosi acest
|
||||
snapshot în așteptare, deoarece se potrivește cu starea sistemului de fișiere înregistrată în
|
||||
fișierul .content, chiar dacă paritatea este sincronizată doar parțial.
|
||||
|
||||
În cazul unei întreruperi a `sync`, comenzile `check` și `fix`
|
||||
citesc, de asemenea, din snapshot-ul `stable` pentru a recupera blocurile de date
|
||||
din fișierele care au fost actualizate sau șterse în timpul sync-ului.
|
||||
Acest lucru este posibil deoarece fișierul .content păstrează metadatele pentru
|
||||
toate fișierele modificate sau șterse pe parcursul procesului de sync.
|
||||
Aceste informații istorice sunt șterse numai după ce un sync se termină
|
||||
cu succes și versiunea finală a fișierului .content este salvată.
|
||||
|
||||
Dacă un `sync` este repornit după o întrerupere, snapshot-ul pending existent
|
||||
este șters și se creează unul nou pentru
|
||||
a captura starea curentă a sistemului de fișiere live.
|
||||
|
||||
|
||||
10 MODEL (PATTERN)
|
||||
==================
|
||||
|
||||
Modelele oferă o modalitate flexibilă de a filtra fișierele pentru includere sau
|
||||
excludere. Folosind caractere de tip globbing, puteți defini reguli care să
|
||||
|
|
@ -1498,7 +1656,7 @@ caractere variabile, păstrând în același timp modelul limitat la un singur n
|
|||
|
||||
Asteriscul simplu `*` se potrivește cu orice secvență de caractere, dar, la fel ca
|
||||
semnul întrebării, nu trece niciodată de limitele directoarelor. Se oprește la
|
||||
slash-ul înainte, ceea ce îl face potrivit pentru potrivirea în cadrul unei singure
|
||||
bara oblică (/), ceea ce îl face potrivit pentru potrivirea în cadrul unei singure
|
||||
componente a căii. Acesta este comportamentul standard al metacaracterelor, familiar
|
||||
din shell globbing.
|
||||
|
||||
|
|
@ -1603,8 +1761,8 @@ De exemplu:
|
|||
să le citați pentru a împiedica shell-ul să le extindă.
|
||||
|
||||
|
||||
9 FIșIERE DE IGNORAT (IGNORE FILE)
|
||||
==================================
|
||||
11 FIșIERE DE IGNORAT (IGNORE FILE)
|
||||
===================================
|
||||
|
||||
Pe lângă regulile globale din fișierul de configurare, puteți plasa fișiere
|
||||
`.snapraidignore` în orice director din array pentru a defini reguli de excludere
|
||||
|
|
@ -1648,7 +1806,7 @@ De exemplu, dacă aveți un `.snapraidignore` în `/mnt/disk1/projects/`:
|
|||
*.tmp
|
||||
|
||||
|
||||
10 CONțINUT (CONTENT)
|
||||
12 CONțINUT (CONTENT)
|
||||
=====================
|
||||
|
||||
SnapRAID stochează lista și sumele de control (checksums) ale fișierelor dvs. în fișierul de conținut.
|
||||
|
|
@ -1656,11 +1814,13 @@ SnapRAID stochează lista și sumele de control (checksums) ale fișierelor dvs.
|
|||
Este un fișier binar care listează toate fișierele prezente în matricea dvs. de discuri,
|
||||
împreună cu toate sumele de control pentru a le verifica integritatea.
|
||||
|
||||
Acest fișier este citit și scris de comenzile `sync` și `scrub` și
|
||||
citit de comenzile `fix`, `check` și `status`.
|
||||
Fișierul de conținut este citit și scris de comenzile `sync`, `scrub`,
|
||||
`touch` și `rehash`. Este citit de comenzile `status`, `diff`, `check`,
|
||||
`fix`, `list`, `dup`, `locate` și `pool`, și este complet ignorat
|
||||
de comenzile `smart`, `probe`, `up`, `down` și `devices`.
|
||||
|
||||
|
||||
11 PARITATE (PARITY)
|
||||
13 PARITATE (PARITY)
|
||||
====================
|
||||
|
||||
SnapRAID stochează informațiile de paritate ale matricei dvs. în fișierele de paritate.
|
||||
|
|
@ -1672,7 +1832,7 @@ Aceste fișiere sunt citite și scrise de comenzile `sync` și `fix` și
|
|||
doar citite de comenzile `scrub` și `check`.
|
||||
|
||||
|
||||
12 CODARE (ENCODING)
|
||||
14 CODARE (ENCODING)
|
||||
====================
|
||||
|
||||
SnapRAID în Unix ignoră orice codare. Citește și stochează
|
||||
|
|
@ -1689,13 +1849,30 @@ redirecționați ieșirea consolei către un fișier, fișierul rezultat este î
|
|||
în format UTF-8.
|
||||
|
||||
|
||||
13 DREPT DE AUTOR (COPYRIGHT)
|
||||
15 COD DE IEșIRE (EXIT CODE)
|
||||
============================
|
||||
|
||||
SnapRAID se termină cu următoarele coduri de eroare:
|
||||
|
||||
0 - Totul este OK.
|
||||
1 - Comanda a întâmpinat unele erori.
|
||||
2 - Comanda `diff` a constatat că totul este OK, dar este necesar un `sync`.
|
||||
|
||||
|
||||
16 TRADUCERE (TRANSLATION)
|
||||
==========================
|
||||
|
||||
Acest document este o traducere automată a manualului în limba engleză.
|
||||
Consultați manualul în limba engleză pentru versiunea oficială.
|
||||
|
||||
|
||||
17 DREPT DE AUTOR (COPYRIGHT)
|
||||
=============================
|
||||
|
||||
Acest fișier este Copyright (C) 2025 Andrea Mazzoleni
|
||||
Acest fișier este Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
|
||||
14 VEZI șI (SEE ALSO)
|
||||
18 VEZI șI (SEE ALSO)
|
||||
=====================
|
||||
|
||||
snapraid_log(1), snapraidd(1)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
.TH "Резервное копирование SnapRAID для дисковых массивов" 1
|
||||
.SH NAME
|
||||
snapraid \- Резервное копирование SnapRAID для дисковых массивов
|
||||
.SH SYNOPSIS
|
||||
.SH Синопсис (SYNOPSIS)
|
||||
snapraid [\-c, \-\-conf CONFIG]
|
||||
.PD 0
|
||||
.PP
|
||||
|
|
@ -77,7 +77,7 @@ snapraid [\-c, \-\-conf CONFIG]
|
|||
snapraid [\-V, \-\-version] [\-H, \-\-help] [\-C, \-\-gen\-conf CONTENT]
|
||||
.PD 0
|
||||
.PD
|
||||
.SH DESCRIPTION
|
||||
.SH Описание (DESCRIPTION)
|
||||
SnapRAID — это программа резервного копирования, разработанная для дисковых массивов,
|
||||
хранящая информацию четности для восстановления данных в случае сбоя
|
||||
до шести дисков.
|
||||
|
|
@ -116,22 +116,34 @@ https://www.snapraid.it/
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH LIMITATIONS
|
||||
SnapRAID — это гибрид программы RAID и программы резервного копирования,
|
||||
стремящийся объединить лучшие преимущества обеих. Однако у него есть
|
||||
некоторые ограничения, которые следует учитывать перед использованием.
|
||||
.SH Ограничения (LIMITATIONS)
|
||||
SnapRAID — это гибрид между RAID и программой резервного копирования, стремящийся сочетать
|
||||
в себе лучшие преимущества обоих подходов. Однако у него есть некоторые ограничения, которые вам
|
||||
следует учесть перед использованием.
|
||||
.PP
|
||||
Основное ограничение заключается в том, что если диск выходит из строя, а вы
|
||||
недавно не выполняли синхронизацию, вы можете не восстановить данные полностью.
|
||||
В частности, вы можете не восстановить данные в объеме, равном размеру
|
||||
измененных или удаленных файлов с момента последней операции синхронизации.
|
||||
Это происходит, даже если измененные или удаленные файлы не находятся
|
||||
на отказавшем диске. Вот почему SnapRAID лучше подходит для
|
||||
данных, которые редко меняются.
|
||||
Основное ограничение заключается в том, что в случае сбоя диска вы можете восстановить данные только до
|
||||
состояния последней операции синхронизации (\`sync\`). Любые данные, добавленные или измененные
|
||||
с момента последней синхронизации и находящиеся на отказавшем диске, будут потеряны.
|
||||
.PP
|
||||
С другой стороны, недавно добавленные файлы не препятствуют восстановлению уже
|
||||
существующих файлов. Вы потеряете только недавно добавленные файлы,
|
||||
если они находятся на отказавшем диске.
|
||||
Следовательно, SnapRAID в первую очередь подходит для данных, которые редко меняются.
|
||||
.PP
|
||||
Для данных, которые уже существовали на момент последней синхронизации, надежность восстановления зависит
|
||||
от того, используется ли опция снимка (\`snapshot\`):
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
При наличии поддержки снимков (доступно на Btrfs, ZFS, Bcachefs и NTFS),
|
||||
SnapRAID может автоматически поддерживать замороженную копию ваших дисков с данными.
|
||||
Это гарантирует, что даже если вы измените или удалите файлы в вашей живой файловой системе
|
||||
во время или после синхронизации, процесс восстановления останется согласованным и надежным.
|
||||
.PD
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Без поддержки снимков удаление или изменение файлов после \`sync\`
|
||||
может предотвратить полное восстановление других отказавших дисков. Это происходит
|
||||
потому, что четность больше не соответствует измененным файлам, даже если
|
||||
эти файлы находятся не на отказавшем диске. С другой стороны, недавно добавленные
|
||||
файлы не препятствуют восстановлению уже существующих файлов.
|
||||
.PD
|
||||
.PP
|
||||
Другие ограничения SnapRAID:
|
||||
.PD 0
|
||||
|
|
@ -152,7 +164,7 @@ SnapRAID может восстановить данные только при о
|
|||
Сохраняются только имена файлов, метки времени, символические ссылки и жесткие ссылки.
|
||||
Разрешения, права владения и расширенные атрибуты не сохраняются.
|
||||
.PD
|
||||
.SH GETTING STARTED
|
||||
.SH Начало работы (GETTING STARTED)
|
||||
Чтобы использовать SnapRAID, вам нужно сначала выбрать один диск в вашем дисковом массиве
|
||||
для выделения под информацию \`четности\` (parity). С одним диском для четности, вы
|
||||
сможете восстановиться после одного сбоя диска, подобно RAID5.
|
||||
|
|
@ -297,7 +309,7 @@ snapraid sync
|
|||
.PP
|
||||
Теперь вы можете начать использовать свой массив, как вам угодно, и периодически
|
||||
обновлять информацию четности, запуская команду \`sync\`.
|
||||
.SS Scrubbing
|
||||
.SS Скрабирование (Scrubbing)
|
||||
Для периодической проверки данных и четности на наличие ошибок, вы можете
|
||||
запустить команду \`scrub\`.
|
||||
.PP
|
||||
|
|
@ -354,10 +366,10 @@ snapraid \-p bad scrub
|
|||
Запуск \`scrub\` на несинхронизированном массиве может сообщить об ошибках, вызванных
|
||||
удаленными или измененными файлами. Эти ошибки сообщаются в выводе \`scrub\`,
|
||||
но соответствующие блоки не помечаются как плохие.
|
||||
.SS Pooling
|
||||
.SS Объединение (Pooling)
|
||||
Примечание: Функция объединения (pooling), описанная ниже, была заменена инструментом
|
||||
mergerfs, который теперь является рекомендуемым вариантом для пользователей Linux
|
||||
в сообществе SnapRAID. Mergefs предоставляет более гибкий и эффективный
|
||||
в сообществе SnapRAID. Mergerfs предоставляет более гибкий и эффективный
|
||||
способ объединения нескольких дисков в единую точку монтирования,
|
||||
обеспечивая беспрепятственный доступ к файлам по всему массиву без
|
||||
опоры на символические ссылки. Он хорошо интегрируется со SnapRAID для
|
||||
|
|
@ -504,7 +516,7 @@ fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Undeleting
|
||||
.SS Восстановление удаленных файлов (Undeleting)
|
||||
SnapRAID функционирует скорее как программа резервного копирования, чем как система RAID,
|
||||
и может использоваться для восстановления или отмены удаления файлов до их
|
||||
предыдущего состояния с помощью опции \-f, \-\-filter:
|
||||
|
|
@ -540,7 +552,7 @@ snapraid fix \-m
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Recovering
|
||||
.SS Восстановление (Recovering)
|
||||
Случилось худшее, и вы потеряли один или несколько дисков!
|
||||
.PP
|
||||
НЕ ПАНИКУЙТЕ! Вы сможете их восстановить!
|
||||
|
|
@ -641,22 +653,22 @@ snapraid sync
|
|||
.RE
|
||||
.PP
|
||||
Если все восстановлено, эта команда выполняется немедленно.
|
||||
.SH COMMANDS
|
||||
.SH Команды (COMMANDS)
|
||||
SnapRAID предоставляет несколько простых команд, которые позволяют:
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Печатать статус массива \-> \`status\`
|
||||
Вывести статус массива \-> \`status\`
|
||||
.IP \(bu
|
||||
Управлять дисками \-> \`smart\`, \`probe\`, \`up\`, \`down\`
|
||||
.IP \(bu
|
||||
Сделать резервную копию/снимок \-> \`sync\`
|
||||
Создать точку резервного копирования/восстановления \-> \`sync\`
|
||||
.IP \(bu
|
||||
Периодически проверять данные \-> \`scrub\`
|
||||
.IP \(bu
|
||||
Восстановить последнюю резервную копию/снимок \-> \`fix\`.
|
||||
Восстановить последнюю точку резервного копирования/восстановления \-> \`fix\`.
|
||||
.PD
|
||||
.PP
|
||||
Команды должны быть написаны строчными буквами.
|
||||
Команды должны быть написаны строчными (маленькими) буквами.
|
||||
.SS status
|
||||
Печатает сводку состояния дискового массива.
|
||||
.PP
|
||||
|
|
@ -884,15 +896,14 @@ full \- Проверить все.
|
|||
Файлы \`parity\` НЕ изменяются.
|
||||
Файлы в массиве НЕ изменяются.
|
||||
.SS fix
|
||||
Исправляет все файлы и данные четности.
|
||||
Восстанавливает все файлы и данные четности.
|
||||
.PP
|
||||
Все файлы и данные четности сравниваются с состоянием снимка,
|
||||
сохраненным при последнем \`sync\`.
|
||||
Если обнаружено различие, оно возвращается к сохраненному снимку.
|
||||
Все файлы и данные четности сравниваются с состоянием, сохраненным во время
|
||||
последней синхронизации \`sync\`. Если обнаружено отличие, оно возвращается к сохраненному состоянию.
|
||||
.PP
|
||||
ВНИМАНИЕ! Команда \`fix\` не различает ошибки и
|
||||
преднамеренные изменения. Она безусловно возвращает состояние файла
|
||||
к последнему \`sync\`.
|
||||
ВНИМАНИЕ!
|
||||
Команда \`fix\` не делает различий между ошибками и преднамеренными изменениями.
|
||||
Она безоговорочно возвращает состояние файлов к моменту последней \`sync\`.
|
||||
.PP
|
||||
Если не указана другая опция, обрабатывается весь массив.
|
||||
Используйте опции фильтрации, чтобы выбрать подмножество файлов или дисков для работы.
|
||||
|
|
@ -1020,7 +1031,7 @@ MurmurHash3 на более быстрый SpookyHash.
|
|||
\-W, \-\-force\-realloc\-tail.
|
||||
Имейте в виду, что такие файлы не будут защищены четностью во время процесса
|
||||
перераспределения.
|
||||
.SH OPTIONS
|
||||
.SH Параметры (OPTIONS)
|
||||
SnapRAID предоставляет следующие опции:
|
||||
.TP
|
||||
.B \-c, \-\-conf CONFIG
|
||||
|
|
@ -1129,9 +1140,9 @@ DAYS — это минимальный возраст в днях для бло
|
|||
.B \-w, \-\-bw\-limit RATE
|
||||
Применяет глобальное ограничение пропускной способности для всех дисков. RATE — это
|
||||
количество байтов в секунду. Вы можете указать множитель,
|
||||
например K, M или G (например, \-\-bw\-limit 1G).
|
||||
например K, M, G или T (например, \-\-bw\-limit 1G).
|
||||
.TP
|
||||
.B \-t, \-\-tail РАЗМЕР
|
||||
.B \-t, \-\-tail SIZE
|
||||
Ограничивает список файлов теми, которые используют не более
|
||||
указанного размера хвоста дисков четности.
|
||||
Можно использовать множители, такие как K, M, G или T (например, \-\-tail 1G).
|
||||
|
|
@ -1233,9 +1244,9 @@ DAYS — это минимальный возраст в днях для бло
|
|||
настоятельно не рекомендуется ее использовать.
|
||||
У вас НЕТ защиты данных во время операции \`sync\`.
|
||||
.TP
|
||||
.B \-W, \-\-force\-realloc\-tail РАЗМЕР
|
||||
.B \-W, \-\-force\-realloc\-tail SIZE
|
||||
Работает как \-R, \-\-force\-realloc, но ограничивается указанной хвостовой
|
||||
частью (последние РАЗМЕР байт) каждого файла четности.
|
||||
частью (последние SIZE байт) каждого файла четности.
|
||||
Принудительно перераспределяет (перемещает) любые фрагменты/блоки файлов,
|
||||
хранящиеся в данный момент в этой хвостовой части, позволяя разместить
|
||||
их в любом месте файла(ов) четности, где есть свободное место
|
||||
|
|
@ -1319,7 +1330,7 @@ SnapRAID.
|
|||
.TP
|
||||
.B \-V, \-\-version
|
||||
Печатает версию программы.
|
||||
.SH CONFIGURATION
|
||||
.SH Конфигурация (CONFIGURATION)
|
||||
SnapRAID требует файл конфигурации, чтобы знать, где находится ваш дисковый массив
|
||||
и где хранить информацию четности.
|
||||
.PP
|
||||
|
|
@ -1427,6 +1438,29 @@ UUID дисков.
|
|||
.PP
|
||||
Обратите внимание, что такие диски не затрагиваются командами \`up\` и
|
||||
\`down\`, так как предполагается, что они всегда вращаются.
|
||||
.SS snapshot
|
||||
Включает использование снимков файловой системы для команд \`sync\`, \`scrub\`,
|
||||
\`check\` и \`fix\`.
|
||||
.PP
|
||||
Если опция включена, SnapRAID создает снимок ваших данных только для чтения в
|
||||
начале операции \'sync\'. Это обеспечивает согласованный срез ваших файлов на определенный
|
||||
момент времени, предотвращая ошибки, вызванные одновременным изменением файлов.
|
||||
.PP
|
||||
Это значительно улучшает восстановление: если файл удаляется из живой файловой системы,
|
||||
он остается сохраненным в снимке. Это предотвращает «нарушение» четности
|
||||
для этого блока, гарантируя, что вы все еще сможете успешно восстановить данные
|
||||
в случае сбоя другого диска.
|
||||
.PP
|
||||
Эта опция применяется исключительно к дискам с данными, отформатированным в файловых
|
||||
системах Btrfs, Bcachefs или ZFS в Linux и NTFS в Windows.
|
||||
Диски четности или диски с данными, использующие другие файловые системы, всегда будут использовать
|
||||
живую версию файловой системы.
|
||||
.PP
|
||||
Создание и удаление снимков требуют прав администратора.
|
||||
Убедитесь, что SnapRAID запущен с необходимыми привилегиями (например, sudo), когда
|
||||
включена эта опция.
|
||||
.PP
|
||||
Подробное объяснение жизненного цикла снимков см. в разделе SNAPSHOTS.
|
||||
.SS nohidden
|
||||
Исключает все скрытые файлы и каталоги.
|
||||
В Unix скрытые файлы — это те, которые начинаются с \`.\`.
|
||||
|
|
@ -1609,6 +1643,9 @@ PARITY — это одно из имен четности: \`parity\`, \`2\-pari
|
|||
именем устройства. Для контроллеров RAID устройство,
|
||||
вероятно, фиксировано, и вам может не потребоваться использовать \`%s\`.
|
||||
.PP
|
||||
Вы также можете указать пользовательскую строку параметров информации с помощью
|
||||
тега \`[info: ...]\`, чтобы заменить параметр по умолчанию \`\-a\`.
|
||||
.PP
|
||||
Возможные опции см. в документации smartmontools:
|
||||
.PP
|
||||
.RS 4
|
||||
|
|
@ -1624,6 +1661,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices
|
|||
Например:
|
||||
.PP
|
||||
.RS 4
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl parity \-d sat %s
|
||||
.PD 0
|
||||
.PD
|
||||
|
|
@ -1638,23 +1679,31 @@ PARITY — это одно из имен четности: \`parity\`, \`2\-pari
|
|||
\`4\-parity\`, \`5\-parity\`, \`6\-parity\` или \`z\-parity\`.
|
||||
Специальное значение * может использоваться для игнорирования атрибута на всех дисках.
|
||||
.PP
|
||||
Например, чтобы игнорировать атрибут \`Current Pending Sector Count\` на
|
||||
всех дисках:
|
||||
Можно указать несколько атрибутов, разделенных пробелами.
|
||||
Каждый атрибут может быть указан как число от 1 до 255 или как имя,
|
||||
нечувствительное к регистру (например, \`Current_Pending_Sector\`).
|
||||
.PP
|
||||
Например, чтобы игнорировать атрибуты \`Current Pending Sector Count\` и
|
||||
\`Reallocated Sectors Count\` на всех дисках по их номеру или имени:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore * 197
|
||||
smartignore * 197 5
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.PP
|
||||
Чтобы игнорировать его только на первом диске четности:
|
||||
Чтобы игнорировать их только на первом диске четности:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore parity 197
|
||||
smartignore parity 197 5
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Examples
|
||||
.SS Примеры (Examples)
|
||||
Пример типичной конфигурации для Unix:
|
||||
.PP
|
||||
.RS 4
|
||||
|
|
@ -1690,7 +1739,7 @@ exclude /tmp/
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1746,7 +1795,7 @@ exclude \\System Volume Information
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1762,7 +1811,126 @@ smartctl 2\-parity \-d areca,2/1 /dev/arcmsr0
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH PATTERN
|
||||
.SH Снимки (SNAPSHOTS)
|
||||
Если в конфигурации включена опция снимков, SnapRAID использует
|
||||
функциональность снимков файловой системы для обеспечения атомарности и
|
||||
согласованности операций.
|
||||
.PP
|
||||
Управление снимками происходит полностью автоматически и прозрачно.
|
||||
Вы можете продолжать использовать SnapRAID точно так же, как и раньше, получая
|
||||
дополнительную защиту, обеспечиваемую снимками, которые полностью обрабатываются в
|
||||
фоновом режиме.
|
||||
.PP
|
||||
Это дает два основных преимущества:
|
||||
.PP
|
||||
Согласованность — Файлы, измененные в живой файловой системе во время длительного
|
||||
.PP
|
||||
.RS 4
|
||||
процесса sync или scrub, не вызовут несоответствия четности или прерывания
|
||||
операций, поскольку SnapRAID видит замороженный снимок на момент времени.
|
||||
.RE
|
||||
.PP
|
||||
Восстановление — Если файл обновляется или удаляется из живой файловой системы,
|
||||
.PP
|
||||
.RS 4
|
||||
он остается сохраненным в снимке. Если сбой диска произойдет
|
||||
до запуска следующей синхронизации sync, SnapRAID использует данные, сохраненные
|
||||
в снимке, для реконструкции отказавшего диска.
|
||||
.RE
|
||||
.PP
|
||||
.RS 4
|
||||
В случае сбоя диска во время активного процесса sync,
|
||||
SnapRAID также может автоматически читать как из снимка предыдущего
|
||||
вычисления четности, так и из текущего.
|
||||
Это максимизирует вероятность полного восстановления, предоставляя
|
||||
доступ к точным блокам данных, необходимым для решения уравнений четности,
|
||||
даже если эти блоки были изменены или удалены между синхронизациями.
|
||||
.RE
|
||||
.PP
|
||||
.RS 4
|
||||
Без снимков обновленный или удаленный файл на исправном диске
|
||||
приводит к отсутствию блоков данных, которые могут потребоваться для
|
||||
восстановления других отказавших дисков.
|
||||
.RE
|
||||
.PP
|
||||
Снимки создаются только для дисков с данными и только в том случае, если базовая
|
||||
файловая система поддерживает эту функциональность. Диски четности всегда используют
|
||||
живую файловую систему.
|
||||
.PP
|
||||
В настоящее время это поддерживается на Btrfs, Bcachefs и ZFS в Linux
|
||||
и на NTFS в Windows.
|
||||
.PP
|
||||
Вы можете комбинировать диски с данными с различными файловыми системами. Только те из них,
|
||||
которые поддерживают снимки, будут использовать их, в то время как другие диски продолжат
|
||||
работать напрямую с живой файловой системой.
|
||||
.PP
|
||||
Создание и удаление снимков требуют прав администратора.
|
||||
Убедитесь, что SnapRAID запущен с необходимыми привилегиями (например, sudo),
|
||||
когда снимки включены.
|
||||
.SS Поведение команд при использовании снимков
|
||||
Команды \`sync\` и \`scrub\` работают исключительно со снимками,
|
||||
чтобы гарантировать, что все операции с данными выполняются на согласованном,
|
||||
замороженном состоянии. Используя эти снимки, SnapRAID предотвращает несоответствия
|
||||
четности, которые в противном случае были бы вызваны одновременными изменениями файлов в живой файловой системе.
|
||||
Во время \`sync\` команда использует новый снимок, созданный в начале
|
||||
процесса, для фиксации текущего состояния для вычисления четности.
|
||||
Напротив, команда \`scrub\` использует последний снимок, созданный во время
|
||||
самой последней синхронизации, чтобы поддерживать надежную точку отсчета,
|
||||
соответствующую существующей четности.
|
||||
.PP
|
||||
Для команд \`check\` и \`fix\` использование последнего снимка
|
||||
зависит от того, нацелены ли конкретные диски с помощью опции
|
||||
\-d, \-\-filter\-disk.
|
||||
.PP
|
||||
Диск, явно выбранный с помощью \-d («цель» операции),
|
||||
всегда использует живую файловую систему. Для \`fix\` это позволяет восстановить
|
||||
данные на активную замену диска. Для \`check\` это позволяет симулировать
|
||||
операцию \`fix\` при тех же условиях.
|
||||
.PP
|
||||
Доступ ко всем остальным дискам с данными («справочным» дискам) будет осуществляться через
|
||||
их снимки. Это гарантирует, что даже если вы изменяете файлы
|
||||
на своих исправных дисках во время восстановления, SnapRAID
|
||||
имеет стабильную, замороженную точку отсчета для решения уравнений четности.
|
||||
.PP
|
||||
Если опция \-d не предоставлена, SnapRAID предполагает, что операция применяется
|
||||
ко всему массиву; в этом случае \`check\` и \`fix\` будут использовать исключительно
|
||||
живые файловые системы.
|
||||
.PP
|
||||
Все остальные команды работают исключительно с живой файловой системой.
|
||||
.SH Жизненный цикл снимков (SNAPSHOTS LIFECYCLE)
|
||||
SnapRAID управляет двумя конкретными снимками, \`stable\` и \`pending\`,
|
||||
внутри скрытого каталога в корне каждого подтома данных.
|
||||
В Btrfs, Bcachefs и NTFS используется каталог \`.snapraid/\`,
|
||||
в ZFS — стандартный \`.zfs/snapshot/\`.
|
||||
.PP
|
||||
Снимок \`stable\` представляет собой состояние последней успешно
|
||||
завершенной синхронизации \`sync\`, содержащей точные данные, использованные для
|
||||
вычисления текущей четности. Он служит основным источником данных
|
||||
для команд \`scrub\`, \`check\` и \`fix\`.
|
||||
.PP
|
||||
Снимок \`pending\` — это временный образ, создаваемый в начале
|
||||
\`sync\` для обеспечения замороженного состояния для вычисления четности.
|
||||
После успешного завершения операции предыдущий снимок \`stable\`
|
||||
удаляется, а снимок \`pending\` повышается в статусе, чтобы
|
||||
занять его место в качестве нового стабильного ориентира.
|
||||
.PP
|
||||
Если процесс \`sync\` прерывается, снимок \`pending\` сохраняется.
|
||||
Последующие команды \`scrub\`, \`check\` и \`fix\` будут использовать этот
|
||||
ожидающий снимок, так как он соответствует состоянию файловой системы, записанному в
|
||||
файле .content, даже если четность синхронизирована лишь частично.
|
||||
.PP
|
||||
В случае прерывания \`sync\` команды \`check\` и \`fix\`
|
||||
также читают данные из снимка \`stable\` для извлечения блоков данных
|
||||
из файлов, которые были обновлены или удалены во время синхронизации.
|
||||
Это возможно потому, что файл .content сохраняет метаданные для
|
||||
всех измененных или удаленных файлов на протяжении всего процесса sync.
|
||||
Эта историческая информация очищается только после успешного завершения sync
|
||||
и сохранения финальной версии файла .content.
|
||||
.PP
|
||||
Если \`sync\` перезапускается после прерывания, существующий
|
||||
ожидающий (pending) снимок удаляется, и создается новый для
|
||||
фиксации текущего состояния живой файловой системы.
|
||||
.SH Шаблон (PATTERN)
|
||||
Шаблоны обеспечивают гибкий способ фильтрации файлов для включения или
|
||||
исключения. Используя символы подстановки (globbing), вы можете определить правила,
|
||||
которые соответствуют конкретным именам файлов или целым структурам каталогов без
|
||||
|
|
@ -1944,7 +2112,7 @@ snapraid \-f \[dq]*.mp3\[dq] check
|
|||
.PP
|
||||
В Unix при использовании символов глоббинга в командной строке вы должны
|
||||
заключить их в кавычки, чтобы предотвратить их расширение оболочкой.
|
||||
.SH IGNORE FILE
|
||||
.SH Файл исключений (IGNORE FILE)
|
||||
В дополнение к глобальным правилам в файле конфигурации, вы можете
|
||||
размещать файлы \`.snapraidignore\` в любом каталоге внутри массива для
|
||||
определения децентрализованных правил исключения.
|
||||
|
|
@ -2004,15 +2172,17 @@ build/
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH CONTENT
|
||||
.SH Содержимое (CONTENT)
|
||||
SnapRAID хранит список и контрольные суммы ваших файлов в файле content.
|
||||
.PP
|
||||
Это бинарный файл, который перечисляет все файлы, присутствующие в вашем дисковом массиве,
|
||||
вместе со всеми контрольными суммами для проверки их целостности.
|
||||
.PP
|
||||
Этот файл считывается и записывается командами \`sync\` и \`scrub\` и
|
||||
считывается командами \`fix\`, \`check\` и \`status\`.
|
||||
.SH PARITY
|
||||
Файл content считывается и записывается командами \`sync\`, \`scrub\`,
|
||||
\`touch\` и \`rehash\`. Он считывается командами \`status\`, \`diff\`, \`check\`,
|
||||
\`fix\`, \`list\`, \`dup\`, \`locate\` и \`pool\`, и полностью игнорируется
|
||||
командами \`smart\`, \`probe\`, \`up\`, \`down\` и \`devices\`.
|
||||
.SH Четность (PARITY)
|
||||
SnapRAID хранит информацию четности вашего массива в файлах parity.
|
||||
.PP
|
||||
Это бинарные файлы, содержащие вычисленную четность всех
|
||||
|
|
@ -2020,7 +2190,7 @@ SnapRAID хранит информацию четности вашего мас
|
|||
.PP
|
||||
Эти файлы считываются и записываются командами \`sync\` и \`fix\` и
|
||||
только считываются командами \`scrub\` и \`check\`.
|
||||
.SH ENCODING
|
||||
.SH Кодировка (ENCODING)
|
||||
SnapRAID в Unix игнорирует любое кодирование. Он считывает и хранит
|
||||
имена файлов с тем же кодированием, которое используется файловой системой.
|
||||
.PP
|
||||
|
|
@ -2033,7 +2203,25 @@ SnapRAID в Unix игнорирует любое кодирование. Он с
|
|||
Это влияет только на печатаемые имена файлов; если вы
|
||||
перенаправляете вывод консоли в файл, результирующий файл всегда
|
||||
в формате UTF\-8.
|
||||
.SH COPYRIGHT
|
||||
Этот файл защищен авторским правом (C) 2025 Andrea Mazzoleni
|
||||
.SH SEE ALSO
|
||||
snapraid_log(1), snapraidd(1)
|
||||
.SH Код возврата (EXIT CODE)
|
||||
SnapRAID завершает работу со следующими кодами ошибок:
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I 0
|
||||
Все в порядке.
|
||||
.HP 4
|
||||
.I 1
|
||||
Команда обнаружила ошибки.
|
||||
.HP 4
|
||||
.I 2
|
||||
Команда \`diff\` определила, что все в порядке, но требуется \`sync\`.
|
||||
.PD
|
||||
.RE
|
||||
.SH Перевод (TRANSLATION)
|
||||
Этот документ является автоматическим переводом английского руководства.
|
||||
Обратитесь к английскому руководству за официальной версией.
|
||||
.SH Авторские права (COPYRIGHT)
|
||||
Этот файл защищен авторским правом (C) 2026 Andrea Mazzoleni
|
||||
.SH См. также (SEE ALSO)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
Name{number}
|
||||
snapraid - Резервное копирование SnapRAID для дисковых массивов
|
||||
|
||||
Synopsis
|
||||
Синопсис (Synopsis)
|
||||
:snapraid [-c, --conf CONFIG]
|
||||
: [-f, --filter PATTERN] [-d, --filter-disk NAME]
|
||||
: [-m, --filter-missing] [-e, --filter-error]
|
||||
|
|
@ -23,7 +23,7 @@ Synopsis
|
|||
|
||||
:snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
Description
|
||||
Описание (Description)
|
||||
SnapRAID — это программа резервного копирования, разработанная для дисковых массивов,
|
||||
хранящая информацию четности для восстановления данных в случае сбоя
|
||||
до шести дисков.
|
||||
|
|
@ -50,22 +50,30 @@ Description
|
|||
|
||||
:https://www.snapraid.it/
|
||||
|
||||
Limitations
|
||||
SnapRAID — это гибрид программы RAID и программы резервного копирования,
|
||||
стремящийся объединить лучшие преимущества обеих. Однако у него есть
|
||||
некоторые ограничения, которые следует учитывать перед использованием.
|
||||
Ограничения (Limitations)
|
||||
SnapRAID — это гибрид между RAID и программой резервного копирования, стремящийся сочетать
|
||||
в себе лучшие преимущества обоих подходов. Однако у него есть некоторые ограничения, которые вам
|
||||
следует учесть перед использованием.
|
||||
|
||||
Основное ограничение заключается в том, что если диск выходит из строя, а вы
|
||||
недавно не выполняли синхронизацию, вы можете не восстановить данные полностью.
|
||||
В частности, вы можете не восстановить данные в объеме, равном размеру
|
||||
измененных или удаленных файлов с момента последней операции синхронизации.
|
||||
Это происходит, даже если измененные или удаленные файлы не находятся
|
||||
на отказавшем диске. Вот почему SnapRAID лучше подходит для
|
||||
данных, которые редко меняются.
|
||||
Основное ограничение заключается в том, что в случае сбоя диска вы можете восстановить данные только до
|
||||
состояния последней операции синхронизации (`sync`). Любые данные, добавленные или измененные
|
||||
с момента последней синхронизации и находящиеся на отказавшем диске, будут потеряны.
|
||||
|
||||
С другой стороны, недавно добавленные файлы не препятствуют восстановлению уже
|
||||
существующих файлов. Вы потеряете только недавно добавленные файлы,
|
||||
если они находятся на отказавшем диске.
|
||||
Следовательно, SnapRAID в первую очередь подходит для данных, которые редко меняются.
|
||||
|
||||
Для данных, которые уже существовали на момент последней синхронизации, надежность восстановления зависит
|
||||
от того, используется ли опция снимка (`snapshot`):
|
||||
|
||||
* При наличии поддержки снимков (доступно на Btrfs, ZFS, Bcachefs и NTFS),
|
||||
SnapRAID может автоматически поддерживать замороженную копию ваших дисков с данными.
|
||||
Это гарантирует, что даже если вы измените или удалите файлы в вашей живой файловой системе
|
||||
во время или после синхронизации, процесс восстановления останется согласованным и надежным.
|
||||
|
||||
* Без поддержки снимков удаление или изменение файлов после `sync`
|
||||
может предотвратить полное восстановление других отказавших дисков. Это происходит
|
||||
потому, что четность больше не соответствует измененным файлам, даже если
|
||||
эти файлы находятся не на отказавшем диске. С другой стороны, недавно добавленные
|
||||
файлы не препятствуют восстановлению уже существующих файлов.
|
||||
|
||||
Другие ограничения SnapRAID:
|
||||
|
||||
|
|
@ -81,7 +89,7 @@ Limitations
|
|||
* Сохраняются только имена файлов, метки времени, символические ссылки и жесткие ссылки.
|
||||
Разрешения, права владения и расширенные атрибуты не сохраняются.
|
||||
|
||||
Getting Started
|
||||
Начало работы (Getting Started)
|
||||
Чтобы использовать SnapRAID, вам нужно сначала выбрать один диск в вашем дисковом массиве
|
||||
для выделения под информацию `четности` (parity). С одним диском для четности, вы
|
||||
сможете восстановиться после одного сбоя диска, подобно RAID5.
|
||||
|
|
@ -162,7 +170,7 @@ Getting Started
|
|||
Теперь вы можете начать использовать свой массив, как вам угодно, и периодически
|
||||
обновлять информацию четности, запуская команду `sync`.
|
||||
|
||||
Scrubbing
|
||||
Скрабирование (Scrubbing)
|
||||
Для периодической проверки данных и четности на наличие ошибок, вы можете
|
||||
запустить команду `scrub`.
|
||||
|
||||
|
|
@ -200,10 +208,10 @@ Getting Started
|
|||
удаленными или измененными файлами. Эти ошибки сообщаются в выводе `scrub`,
|
||||
но соответствующие блоки не помечаются как плохие.
|
||||
|
||||
Pooling
|
||||
Объединение (Pooling)
|
||||
Примечание: Функция объединения (pooling), описанная ниже, была заменена инструментом
|
||||
mergerfs, который теперь является рекомендуемым вариантом для пользователей Linux
|
||||
в сообществе SnapRAID. Mergefs предоставляет более гибкий и эффективный
|
||||
в сообществе SnapRAID. Mergerfs предоставляет более гибкий и эффективный
|
||||
способ объединения нескольких дисков в единую точку монтирования,
|
||||
обеспечивая беспрепятственный доступ к файлам по всему массиву без
|
||||
опоры на символические ссылки. Он хорошо интегрируется со SnapRAID для
|
||||
|
|
@ -274,7 +282,7 @@ Getting Started
|
|||
|
||||
:fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
||||
|
||||
Undeleting
|
||||
Восстановление удаленных файлов (Undeleting)
|
||||
SnapRAID функционирует скорее как программа резервного копирования, чем как система RAID,
|
||||
и может использоваться для восстановления или отмены удаления файлов до их
|
||||
предыдущего состояния с помощью опции -f, --filter:
|
||||
|
|
@ -295,7 +303,7 @@ Getting Started
|
|||
|
||||
:snapraid fix -m
|
||||
|
||||
Recovering
|
||||
Восстановление (Recovering)
|
||||
Случилось худшее, и вы потеряли один или несколько дисков!
|
||||
|
||||
НЕ ПАНИКУЙТЕ! Вы сможете их восстановить!
|
||||
|
|
@ -381,16 +389,16 @@ Getting Started
|
|||
|
||||
Если все восстановлено, эта команда выполняется немедленно.
|
||||
|
||||
Commands
|
||||
Команды (Commands)
|
||||
SnapRAID предоставляет несколько простых команд, которые позволяют:
|
||||
|
||||
* Печатать статус массива -> `status`
|
||||
* Вывести статус массива -> `status`
|
||||
* Управлять дисками -> `smart`, `probe`, `up`, `down`
|
||||
* Сделать резервную копию/снимок -> `sync`
|
||||
* Создать точку резервного копирования/восстановления -> `sync`
|
||||
* Периодически проверять данные -> `scrub`
|
||||
* Восстановить последнюю резервную копию/снимок -> `fix`.
|
||||
* Восстановить последнюю точку резервного копирования/восстановления -> `fix`.
|
||||
|
||||
Команды должны быть написаны строчными буквами.
|
||||
Команды должны быть написаны строчными (маленькими) буквами.
|
||||
|
||||
status
|
||||
Печатает сводку состояния дискового массива.
|
||||
|
|
@ -593,15 +601,14 @@ Commands
|
|||
Файлы в массиве НЕ изменяются.
|
||||
|
||||
fix
|
||||
Исправляет все файлы и данные четности.
|
||||
Восстанавливает все файлы и данные четности.
|
||||
|
||||
Все файлы и данные четности сравниваются с состоянием снимка,
|
||||
сохраненным при последнем `sync`.
|
||||
Если обнаружено различие, оно возвращается к сохраненному снимку.
|
||||
Все файлы и данные четности сравниваются с состоянием, сохраненным во время
|
||||
последней синхронизации `sync`. Если обнаружено отличие, оно возвращается к сохраненному состоянию.
|
||||
|
||||
ВНИМАНИЕ! Команда `fix` не различает ошибки и
|
||||
преднамеренные изменения. Она безусловно возвращает состояние файла
|
||||
к последнему `sync`.
|
||||
ВНИМАНИЕ!
|
||||
Команда `fix` не делает различий между ошибками и преднамеренными изменениями.
|
||||
Она безоговорочно возвращает состояние файлов к моменту последней `sync`.
|
||||
|
||||
Если не указана другая опция, обрабатывается весь массив.
|
||||
Используйте опции фильтрации, чтобы выбрать подмножество файлов или дисков для работы.
|
||||
|
|
@ -738,7 +745,7 @@ Commands
|
|||
Имейте в виду, что такие файлы не будут защищены четностью во время процесса
|
||||
перераспределения.
|
||||
|
||||
Options
|
||||
Параметры (Options)
|
||||
SnapRAID предоставляет следующие опции:
|
||||
|
||||
-c, --conf CONFIG
|
||||
|
|
@ -847,9 +854,9 @@ Options
|
|||
-w, --bw-limit RATE
|
||||
Применяет глобальное ограничение пропускной способности для всех дисков. RATE — это
|
||||
количество байтов в секунду. Вы можете указать множитель,
|
||||
например K, M или G (например, --bw-limit 1G).
|
||||
например K, M, G или T (например, --bw-limit 1G).
|
||||
|
||||
-t, --tail РАЗМЕР
|
||||
-t, --tail SIZE
|
||||
Ограничивает список файлов теми, которые используют не более
|
||||
указанного размера хвоста дисков четности.
|
||||
Можно использовать множители, такие как K, M, G или T (например, --tail 1G).
|
||||
|
|
@ -951,9 +958,9 @@ Options
|
|||
настоятельно не рекомендуется ее использовать.
|
||||
У вас НЕТ защиты данных во время операции `sync`.
|
||||
|
||||
-W, --force-realloc-tail РАЗМЕР
|
||||
-W, --force-realloc-tail SIZE
|
||||
Работает как -R, --force-realloc, но ограничивается указанной хвостовой
|
||||
частью (последние РАЗМЕР байт) каждого файла четности.
|
||||
частью (последние SIZE байт) каждого файла четности.
|
||||
Принудительно перераспределяет (перемещает) любые фрагменты/блоки файлов,
|
||||
хранящиеся в данный момент в этой хвостовой части, позволяя разместить
|
||||
их в любом месте файла(ов) четности, где есть свободное место
|
||||
|
|
@ -1038,7 +1045,7 @@ Options
|
|||
-V, --version
|
||||
Печатает версию программы.
|
||||
|
||||
Configuration
|
||||
Конфигурация (Configuration)
|
||||
SnapRAID требует файл конфигурации, чтобы знать, где находится ваш дисковый массив
|
||||
и где хранить информацию четности.
|
||||
|
||||
|
|
@ -1147,6 +1154,30 @@ Configuration
|
|||
Обратите внимание, что такие диски не затрагиваются командами `up` и
|
||||
`down`, так как предполагается, что они всегда вращаются.
|
||||
|
||||
snapshot
|
||||
Включает использование снимков файловой системы для команд `sync`, `scrub`,
|
||||
`check` и `fix`.
|
||||
|
||||
Если опция включена, SnapRAID создает снимок ваших данных только для чтения в
|
||||
начале операции 'sync'. Это обеспечивает согласованный срез ваших файлов на определенный
|
||||
момент времени, предотвращая ошибки, вызванные одновременным изменением файлов.
|
||||
|
||||
Это значительно улучшает восстановление: если файл удаляется из живой файловой системы,
|
||||
он остается сохраненным в снимке. Это предотвращает «нарушение» четности
|
||||
для этого блока, гарантируя, что вы все еще сможете успешно восстановить данные
|
||||
в случае сбоя другого диска.
|
||||
|
||||
Эта опция применяется исключительно к дискам с данными, отформатированным в файловых
|
||||
системах Btrfs, Bcachefs или ZFS в Linux и NTFS в Windows.
|
||||
Диски четности или диски с данными, использующие другие файловые системы, всегда будут использовать
|
||||
живую версию файловой системы.
|
||||
|
||||
Создание и удаление снимков требуют прав администратора.
|
||||
Убедитесь, что SnapRAID запущен с необходимыми привилегиями (например, sudo), когда
|
||||
включена эта опция.
|
||||
|
||||
Подробное объяснение жизненного цикла снимков см. в разделе SNAPSHOTS.
|
||||
|
||||
nohidden
|
||||
Исключает все скрытые файлы и каталоги.
|
||||
В Unix скрытые файлы — это те, которые начинаются с `.`.
|
||||
|
|
@ -1326,6 +1357,9 @@ Configuration
|
|||
именем устройства. Для контроллеров RAID устройство,
|
||||
вероятно, фиксировано, и вам может не потребоваться использовать `%s`.
|
||||
|
||||
Вы также можете указать пользовательскую строку параметров информации с помощью
|
||||
тега `[info: ...]`, чтобы заменить параметр по умолчанию `-a`.
|
||||
|
||||
Возможные опции см. в документации smartmontools:
|
||||
|
||||
:https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
|
|
@ -1333,6 +1367,7 @@ Configuration
|
|||
|
||||
Например:
|
||||
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl parity -d sat %s
|
||||
|
||||
smartignore DISK/PARITY ATTR [ATTR...]
|
||||
|
|
@ -1345,16 +1380,21 @@ Configuration
|
|||
`4-parity`, `5-parity`, `6-parity` или `z-parity`.
|
||||
Специальное значение * может использоваться для игнорирования атрибута на всех дисках.
|
||||
|
||||
Например, чтобы игнорировать атрибут `Current Pending Sector Count` на
|
||||
всех дисках:
|
||||
Можно указать несколько атрибутов, разделенных пробелами.
|
||||
Каждый атрибут может быть указан как число от 1 до 255 или как имя,
|
||||
нечувствительное к регистру (например, `Current_Pending_Sector`).
|
||||
|
||||
:smartignore * 197
|
||||
Например, чтобы игнорировать атрибуты `Current Pending Sector Count` и
|
||||
`Reallocated Sectors Count` на всех дисках по их номеру или имени:
|
||||
|
||||
Чтобы игнорировать его только на первом диске четности:
|
||||
:smartignore * 197 5
|
||||
:smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
:smartignore parity 197
|
||||
Чтобы игнорировать их только на первом диске четности:
|
||||
|
||||
Examples
|
||||
:smartignore parity 197 5
|
||||
|
||||
Примеры (Examples)
|
||||
Пример типичной конфигурации для Unix:
|
||||
|
||||
:parity /mnt/diskp/snapraid.parity
|
||||
|
|
@ -1365,7 +1405,7 @@ Configuration
|
|||
:data d3 /mnt/disk3/
|
||||
:exclude /lost+found/
|
||||
:exclude /tmp/
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/sg0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1381,12 +1421,123 @@ Configuration
|
|||
:exclude Thumbs.db
|
||||
:exclude \$RECYCLE.BIN
|
||||
:exclude \System Volume Information
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
Pattern
|
||||
Снимки (Snapshots)
|
||||
Если в конфигурации включена опция снимков, SnapRAID использует
|
||||
функциональность снимков файловой системы для обеспечения атомарности и
|
||||
согласованности операций.
|
||||
|
||||
Управление снимками происходит полностью автоматически и прозрачно.
|
||||
Вы можете продолжать использовать SnapRAID точно так же, как и раньше, получая
|
||||
дополнительную защиту, обеспечиваемую снимками, которые полностью обрабатываются в
|
||||
фоновом режиме.
|
||||
|
||||
Это дает два основных преимущества:
|
||||
|
||||
Согласованность — Файлы, измененные в живой файловой системе во время длительного
|
||||
процесса sync или scrub, не вызовут несоответствия четности или прерывания
|
||||
операций, поскольку SnapRAID видит замороженный снимок на момент времени.
|
||||
Восстановление — Если файл обновляется или удаляется из живой файловой системы,
|
||||
он остается сохраненным в снимке. Если сбой диска произойдет
|
||||
до запуска следующей синхронизации sync, SnapRAID использует данные, сохраненные
|
||||
в снимке, для реконструкции отказавшего диска.
|
||||
|
||||
В случае сбоя диска во время активного процесса sync,
|
||||
SnapRAID также может автоматически читать как из снимка предыдущего
|
||||
вычисления четности, так и из текущего.
|
||||
Это максимизирует вероятность полного восстановления, предоставляя
|
||||
доступ к точным блокам данных, необходимым для решения уравнений четности,
|
||||
даже если эти блоки были изменены или удалены между синхронизациями.
|
||||
|
||||
Без снимков обновленный или удаленный файл на исправном диске
|
||||
приводит к отсутствию блоков данных, которые могут потребоваться для
|
||||
восстановления других отказавших дисков.
|
||||
|
||||
Снимки создаются только для дисков с данными и только в том случае, если базовая
|
||||
файловая система поддерживает эту функциональность. Диски четности всегда используют
|
||||
живую файловую систему.
|
||||
|
||||
В настоящее время это поддерживается на Btrfs, Bcachefs и ZFS в Linux
|
||||
и на NTFS в Windows.
|
||||
|
||||
Вы можете комбинировать диски с данными с различными файловыми системами. Только те из них,
|
||||
которые поддерживают снимки, будут использовать их, в то время как другие диски продолжат
|
||||
работать напрямую с живой файловой системой.
|
||||
|
||||
Создание и удаление снимков требуют прав администратора.
|
||||
Убедитесь, что SnapRAID запущен с необходимыми привилегиями (например, sudo),
|
||||
когда снимки включены.
|
||||
|
||||
Поведение команд при использовании снимков
|
||||
Команды `sync` и `scrub` работают исключительно со снимками,
|
||||
чтобы гарантировать, что все операции с данными выполняются на согласованном,
|
||||
замороженном состоянии. Используя эти снимки, SnapRAID предотвращает несоответствия
|
||||
четности, которые в противном случае были бы вызваны одновременными изменениями файлов в живой файловой системе.
|
||||
Во время `sync` команда использует новый снимок, созданный в начале
|
||||
процесса, для фиксации текущего состояния для вычисления четности.
|
||||
Напротив, команда `scrub` использует последний снимок, созданный во время
|
||||
самой последней синхронизации, чтобы поддерживать надежную точку отсчета,
|
||||
соответствующую существующей четности.
|
||||
|
||||
Для команд `check` и `fix` использование последнего снимка
|
||||
зависит от того, нацелены ли конкретные диски с помощью опции
|
||||
-d, --filter-disk.
|
||||
|
||||
Диск, явно выбранный с помощью -d («цель» операции),
|
||||
всегда использует живую файловую систему. Для `fix` это позволяет восстановить
|
||||
данные на активную замену диска. Для `check` это позволяет симулировать
|
||||
операцию `fix` при тех же условиях.
|
||||
|
||||
Доступ ко всем остальным дискам с данными («справочным» дискам) будет осуществляться через
|
||||
их снимки. Это гарантирует, что даже если вы изменяете файлы
|
||||
на своих исправных дисках во время восстановления, SnapRAID
|
||||
имеет стабильную, замороженную точку отсчета для решения уравнений четности.
|
||||
|
||||
Если опция -d не предоставлена, SnapRAID предполагает, что операция применяется
|
||||
ко всему массиву; в этом случае `check` и `fix` будут использовать исключительно
|
||||
живые файловые системы.
|
||||
|
||||
Все остальные команды работают исключительно с живой файловой системой.
|
||||
|
||||
Жизненный цикл снимков (Snapshots Lifecycle)
|
||||
SnapRAID управляет двумя конкретными снимками, `stable` и `pending`,
|
||||
внутри скрытого каталога в корне каждого подтома данных.
|
||||
В Btrfs, Bcachefs и NTFS используется каталог `.snapraid/`,
|
||||
в ZFS — стандартный `.zfs/snapshot/`.
|
||||
|
||||
Снимок `stable` представляет собой состояние последней успешно
|
||||
завершенной синхронизации `sync`, содержащей точные данные, использованные для
|
||||
вычисления текущей четности. Он служит основным источником данных
|
||||
для команд `scrub`, `check` и `fix`.
|
||||
|
||||
Снимок `pending` — это временный образ, создаваемый в начале
|
||||
`sync` для обеспечения замороженного состояния для вычисления четности.
|
||||
После успешного завершения операции предыдущий снимок `stable`
|
||||
удаляется, а снимок `pending` повышается в статусе, чтобы
|
||||
занять его место в качестве нового стабильного ориентира.
|
||||
|
||||
Если процесс `sync` прерывается, снимок `pending` сохраняется.
|
||||
Последующие команды `scrub`, `check` и `fix` будут использовать этот
|
||||
ожидающий снимок, так как он соответствует состоянию файловой системы, записанному в
|
||||
файле .content, даже если четность синхронизирована лишь частично.
|
||||
|
||||
В случае прерывания `sync` команды `check` и `fix`
|
||||
также читают данные из снимка `stable` для извлечения блоков данных
|
||||
из файлов, которые были обновлены или удалены во время синхронизации.
|
||||
Это возможно потому, что файл .content сохраняет метаданные для
|
||||
всех измененных или удаленных файлов на протяжении всего процесса sync.
|
||||
Эта историческая информация очищается только после успешного завершения sync
|
||||
и сохранения финальной версии файла .content.
|
||||
|
||||
Если `sync` перезапускается после прерывания, существующий
|
||||
ожидающий (pending) снимок удаляется, и создается новый для
|
||||
фиксации текущего состояния живой файловой системы.
|
||||
|
||||
Шаблон (Pattern)
|
||||
Шаблоны обеспечивают гибкий способ фильтрации файлов для включения или
|
||||
исключения. Используя символы подстановки (globbing), вы можете определить правила,
|
||||
которые соответствуют конкретным именам файлов или целым структурам каталогов без
|
||||
|
|
@ -1502,7 +1653,7 @@ Pattern
|
|||
В Unix при использовании символов глоббинга в командной строке вы должны
|
||||
заключить их в кавычки, чтобы предотвратить их расширение оболочкой.
|
||||
|
||||
Ignore File
|
||||
Файл исключений (Ignore File)
|
||||
В дополнение к глобальным правилам в файле конфигурации, вы можете
|
||||
размещать файлы `.snapraidignore` в любом каталоге внутри массива для
|
||||
определения децентрализованных правил исключения.
|
||||
|
|
@ -1544,16 +1695,18 @@ Ignore File
|
|||
:# Исключает любой .tmp файл внутри projects/ или его подпапок
|
||||
:*.tmp
|
||||
|
||||
Content
|
||||
Содержимое (Content)
|
||||
SnapRAID хранит список и контрольные суммы ваших файлов в файле content.
|
||||
|
||||
Это бинарный файл, который перечисляет все файлы, присутствующие в вашем дисковом массиве,
|
||||
вместе со всеми контрольными суммами для проверки их целостности.
|
||||
|
||||
Этот файл считывается и записывается командами `sync` и `scrub` и
|
||||
считывается командами `fix`, `check` и `status`.
|
||||
Файл content считывается и записывается командами `sync`, `scrub`,
|
||||
`touch` и `rehash`. Он считывается командами `status`, `diff`, `check`,
|
||||
`fix`, `list`, `dup`, `locate` и `pool`, и полностью игнорируется
|
||||
командами `smart`, `probe`, `up`, `down` и `devices`.
|
||||
|
||||
Parity
|
||||
Четность (Parity)
|
||||
SnapRAID хранит информацию четности вашего массива в файлах parity.
|
||||
|
||||
Это бинарные файлы, содержащие вычисленную четность всех
|
||||
|
|
@ -1562,7 +1715,7 @@ Parity
|
|||
Эти файлы считываются и записываются командами `sync` и `fix` и
|
||||
только считываются командами `scrub` и `check`.
|
||||
|
||||
Encoding
|
||||
Кодировка (Encoding)
|
||||
SnapRAID в Unix игнорирует любое кодирование. Он считывает и хранит
|
||||
имена файлов с тем же кодированием, которое используется файловой системой.
|
||||
|
||||
|
|
@ -1576,8 +1729,19 @@ Encoding
|
|||
перенаправляете вывод консоли в файл, результирующий файл всегда
|
||||
в формате UTF-8.
|
||||
|
||||
Copyright
|
||||
Этот файл защищен авторским правом (C) 2025 Andrea Mazzoleni
|
||||
Код возврата (Exit Code)
|
||||
SnapRAID завершает работу со следующими кодами ошибок:
|
||||
|
||||
See Also
|
||||
snapraid_log(1), snapraidd(1)
|
||||
0 - Все в порядке.
|
||||
1 - Команда обнаружила ошибки.
|
||||
2 - Команда `diff` определила, что все в порядке, но требуется `sync`.
|
||||
|
||||
Перевод (Translation)
|
||||
Этот документ является автоматическим переводом английского руководства.
|
||||
Обратитесь к английскому руководству за официальной версией.
|
||||
|
||||
Авторские права (Copyright)
|
||||
Этот файл защищен авторским правом (C) 2026 Andrea Mazzoleni
|
||||
|
||||
См. также (See Also)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
====================================================
|
||||
|
||||
|
||||
1 SYNOPSIS
|
||||
==========
|
||||
1 Синопсис (SYNOPSIS)
|
||||
=====================
|
||||
|
||||
snapraid [-c, --conf CONFIG]
|
||||
[-f, --filter PATTERN] [-d, --filter-disk NAME]
|
||||
|
|
@ -28,8 +28,8 @@ snapraid [-c, --conf CONFIG]
|
|||
snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
|
||||
2 DESCRIPTION
|
||||
=============
|
||||
2 Описание (DESCRIPTION)
|
||||
========================
|
||||
|
||||
SnapRAID — это программа резервного копирования, разработанная для дисковых массивов,
|
||||
хранящая информацию четности для восстановления данных в случае сбоя
|
||||
|
|
@ -58,24 +58,32 @@ SnapRAID — это программа резервного копировани
|
|||
https://www.snapraid.it/
|
||||
|
||||
|
||||
3 LIMITATIONS
|
||||
=============
|
||||
3 Ограничения (LIMITATIONS)
|
||||
===========================
|
||||
|
||||
SnapRAID — это гибрид программы RAID и программы резервного копирования,
|
||||
стремящийся объединить лучшие преимущества обеих. Однако у него есть
|
||||
некоторые ограничения, которые следует учитывать перед использованием.
|
||||
SnapRAID — это гибрид между RAID и программой резервного копирования, стремящийся сочетать
|
||||
в себе лучшие преимущества обоих подходов. Однако у него есть некоторые ограничения, которые вам
|
||||
следует учесть перед использованием.
|
||||
|
||||
Основное ограничение заключается в том, что если диск выходит из строя, а вы
|
||||
недавно не выполняли синхронизацию, вы можете не восстановить данные полностью.
|
||||
В частности, вы можете не восстановить данные в объеме, равном размеру
|
||||
измененных или удаленных файлов с момента последней операции синхронизации.
|
||||
Это происходит, даже если измененные или удаленные файлы не находятся
|
||||
на отказавшем диске. Вот почему SnapRAID лучше подходит для
|
||||
данных, которые редко меняются.
|
||||
Основное ограничение заключается в том, что в случае сбоя диска вы можете восстановить данные только до
|
||||
состояния последней операции синхронизации (`sync`). Любые данные, добавленные или измененные
|
||||
с момента последней синхронизации и находящиеся на отказавшем диске, будут потеряны.
|
||||
|
||||
С другой стороны, недавно добавленные файлы не препятствуют восстановлению уже
|
||||
существующих файлов. Вы потеряете только недавно добавленные файлы,
|
||||
если они находятся на отказавшем диске.
|
||||
Следовательно, SnapRAID в первую очередь подходит для данных, которые редко меняются.
|
||||
|
||||
Для данных, которые уже существовали на момент последней синхронизации, надежность восстановления зависит
|
||||
от того, используется ли опция снимка (`snapshot`):
|
||||
|
||||
* При наличии поддержки снимков (доступно на Btrfs, ZFS, Bcachefs и NTFS),
|
||||
SnapRAID может автоматически поддерживать замороженную копию ваших дисков с данными.
|
||||
Это гарантирует, что даже если вы измените или удалите файлы в вашей живой файловой системе
|
||||
во время или после синхронизации, процесс восстановления останется согласованным и надежным.
|
||||
|
||||
* Без поддержки снимков удаление или изменение файлов после `sync`
|
||||
может предотвратить полное восстановление других отказавших дисков. Это происходит
|
||||
потому, что четность больше не соответствует измененным файлам, даже если
|
||||
эти файлы находятся не на отказавшем диске. С другой стороны, недавно добавленные
|
||||
файлы не препятствуют восстановлению уже существующих файлов.
|
||||
|
||||
Другие ограничения SnapRAID:
|
||||
|
||||
|
|
@ -92,8 +100,8 @@ SnapRAID — это гибрид программы RAID и программы
|
|||
Разрешения, права владения и расширенные атрибуты не сохраняются.
|
||||
|
||||
|
||||
4 GETTING STARTED
|
||||
=================
|
||||
4 Начало работы (GETTING STARTED)
|
||||
=================================
|
||||
|
||||
Чтобы использовать SnapRAID, вам нужно сначала выбрать один диск в вашем дисковом массиве
|
||||
для выделения под информацию `четности` (parity). С одним диском для четности, вы
|
||||
|
|
@ -175,8 +183,8 @@ SnapRAID — это гибрид программы RAID и программы
|
|||
Теперь вы можете начать использовать свой массив, как вам угодно, и периодически
|
||||
обновлять информацию четности, запуская команду `sync`.
|
||||
|
||||
4.1 Scrubbing
|
||||
-------------
|
||||
4.1 Скрабирование (Scrubbing)
|
||||
-----------------------------
|
||||
|
||||
Для периодической проверки данных и четности на наличие ошибок, вы можете
|
||||
запустить команду `scrub`.
|
||||
|
|
@ -215,12 +223,12 @@ SnapRAID — это гибрид программы RAID и программы
|
|||
удаленными или измененными файлами. Эти ошибки сообщаются в выводе `scrub`,
|
||||
но соответствующие блоки не помечаются как плохие.
|
||||
|
||||
4.2 Pooling
|
||||
-----------
|
||||
4.2 Объединение (Pooling)
|
||||
-------------------------
|
||||
|
||||
Примечание: Функция объединения (pooling), описанная ниже, была заменена инструментом
|
||||
mergerfs, который теперь является рекомендуемым вариантом для пользователей Linux
|
||||
в сообществе SnapRAID. Mergefs предоставляет более гибкий и эффективный
|
||||
в сообществе SnapRAID. Mergerfs предоставляет более гибкий и эффективный
|
||||
способ объединения нескольких дисков в единую точку монтирования,
|
||||
обеспечивая беспрепятственный доступ к файлам по всему массиву без
|
||||
опоры на символические ссылки. Он хорошо интегрируется со SnapRAID для
|
||||
|
|
@ -291,8 +299,8 @@ mergerfs, который теперь является рекомендуемы
|
|||
|
||||
fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
||||
|
||||
4.3 Undeleting
|
||||
--------------
|
||||
4.3 Восстановление удаленных файлов (Undeleting)
|
||||
------------------------------------------------
|
||||
|
||||
SnapRAID функционирует скорее как программа резервного копирования, чем как система RAID,
|
||||
и может использоваться для восстановления или отмены удаления файлов до их
|
||||
|
|
@ -314,8 +322,8 @@ SnapRAID функционирует скорее как программа ре
|
|||
|
||||
snapraid fix -m
|
||||
|
||||
4.4 Recovering
|
||||
--------------
|
||||
4.4 Восстановление (Recovering)
|
||||
-------------------------------
|
||||
|
||||
Случилось худшее, и вы потеряли один или несколько дисков!
|
||||
|
||||
|
|
@ -403,18 +411,18 @@ SnapRAID функционирует скорее как программа ре
|
|||
Если все восстановлено, эта команда выполняется немедленно.
|
||||
|
||||
|
||||
5 COMMANDS
|
||||
==========
|
||||
5 Команды (COMMANDS)
|
||||
====================
|
||||
|
||||
SnapRAID предоставляет несколько простых команд, которые позволяют:
|
||||
|
||||
* Печатать статус массива -> `status`
|
||||
* Вывести статус массива -> `status`
|
||||
* Управлять дисками -> `smart`, `probe`, `up`, `down`
|
||||
* Сделать резервную копию/снимок -> `sync`
|
||||
* Создать точку резервного копирования/восстановления -> `sync`
|
||||
* Периодически проверять данные -> `scrub`
|
||||
* Восстановить последнюю резервную копию/снимок -> `fix`.
|
||||
* Восстановить последнюю точку резервного копирования/восстановления -> `fix`.
|
||||
|
||||
Команды должны быть написаны строчными буквами.
|
||||
Команды должны быть написаны строчными (маленькими) буквами.
|
||||
|
||||
5.1 status
|
||||
----------
|
||||
|
|
@ -635,15 +643,14 @@ full - Проверить все.
|
|||
5.9 fix
|
||||
-------
|
||||
|
||||
Исправляет все файлы и данные четности.
|
||||
Восстанавливает все файлы и данные четности.
|
||||
|
||||
Все файлы и данные четности сравниваются с состоянием снимка,
|
||||
сохраненным при последнем `sync`.
|
||||
Если обнаружено различие, оно возвращается к сохраненному снимку.
|
||||
Все файлы и данные четности сравниваются с состоянием, сохраненным во время
|
||||
последней синхронизации `sync`. Если обнаружено отличие, оно возвращается к сохраненному состоянию.
|
||||
|
||||
ВНИМАНИЕ! Команда `fix` не различает ошибки и
|
||||
преднамеренные изменения. Она безусловно возвращает состояние файла
|
||||
к последнему `sync`.
|
||||
ВНИМАНИЕ!
|
||||
Команда `fix` не делает различий между ошибками и преднамеренными изменениями.
|
||||
Она безоговорочно возвращает состояние файлов к моменту последней `sync`.
|
||||
|
||||
Если не указана другая опция, обрабатывается весь массив.
|
||||
Используйте опции фильтрации, чтобы выбрать подмножество файлов или дисков для работы.
|
||||
|
|
@ -797,8 +804,8 @@ MurmurHash3 на более быстрый SpookyHash.
|
|||
перераспределения.
|
||||
|
||||
|
||||
6 OPTIONS
|
||||
=========
|
||||
6 Параметры (OPTIONS)
|
||||
=====================
|
||||
|
||||
SnapRAID предоставляет следующие опции:
|
||||
|
||||
|
|
@ -908,9 +915,9 @@ SnapRAID предоставляет следующие опции:
|
|||
-w, --bw-limit RATE
|
||||
Применяет глобальное ограничение пропускной способности для всех дисков. RATE — это
|
||||
количество байтов в секунду. Вы можете указать множитель,
|
||||
например K, M или G (например, --bw-limit 1G).
|
||||
например K, M, G или T (например, --bw-limit 1G).
|
||||
|
||||
-t, --tail РАЗМЕР
|
||||
-t, --tail SIZE
|
||||
Ограничивает список файлов теми, которые используют не более
|
||||
указанного размера хвоста дисков четности.
|
||||
Можно использовать множители, такие как K, M, G или T (например, --tail 1G).
|
||||
|
|
@ -1012,9 +1019,9 @@ SnapRAID предоставляет следующие опции:
|
|||
настоятельно не рекомендуется ее использовать.
|
||||
У вас НЕТ защиты данных во время операции `sync`.
|
||||
|
||||
-W, --force-realloc-tail РАЗМЕР
|
||||
-W, --force-realloc-tail SIZE
|
||||
Работает как -R, --force-realloc, но ограничивается указанной хвостовой
|
||||
частью (последние РАЗМЕР байт) каждого файла четности.
|
||||
частью (последние SIZE байт) каждого файла четности.
|
||||
Принудительно перераспределяет (перемещает) любые фрагменты/блоки файлов,
|
||||
хранящиеся в данный момент в этой хвостовой части, позволяя разместить
|
||||
их в любом месте файла(ов) четности, где есть свободное место
|
||||
|
|
@ -1100,8 +1107,8 @@ SnapRAID предоставляет следующие опции:
|
|||
Печатает версию программы.
|
||||
|
||||
|
||||
7 CONFIGURATION
|
||||
===============
|
||||
7 Конфигурация (CONFIGURATION)
|
||||
==============================
|
||||
|
||||
SnapRAID требует файл конфигурации, чтобы знать, где находится ваш дисковый массив
|
||||
и где хранить информацию четности.
|
||||
|
|
@ -1223,14 +1230,40 @@ UUID дисков.
|
|||
Обратите внимание, что такие диски не затрагиваются командами `up` и
|
||||
`down`, так как предполагается, что они всегда вращаются.
|
||||
|
||||
7.7 nohidden
|
||||
7.7 snapshot
|
||||
------------
|
||||
|
||||
Включает использование снимков файловой системы для команд `sync`, `scrub`,
|
||||
`check` и `fix`.
|
||||
|
||||
Если опция включена, SnapRAID создает снимок ваших данных только для чтения в
|
||||
начале операции 'sync'. Это обеспечивает согласованный срез ваших файлов на определенный
|
||||
момент времени, предотвращая ошибки, вызванные одновременным изменением файлов.
|
||||
|
||||
Это значительно улучшает восстановление: если файл удаляется из живой файловой системы,
|
||||
он остается сохраненным в снимке. Это предотвращает «нарушение» четности
|
||||
для этого блока, гарантируя, что вы все еще сможете успешно восстановить данные
|
||||
в случае сбоя другого диска.
|
||||
|
||||
Эта опция применяется исключительно к дискам с данными, отформатированным в файловых
|
||||
системах Btrfs, Bcachefs или ZFS в Linux и NTFS в Windows.
|
||||
Диски четности или диски с данными, использующие другие файловые системы, всегда будут использовать
|
||||
живую версию файловой системы.
|
||||
|
||||
Создание и удаление снимков требуют прав администратора.
|
||||
Убедитесь, что SnapRAID запущен с необходимыми привилегиями (например, sudo), когда
|
||||
включена эта опция.
|
||||
|
||||
Подробное объяснение жизненного цикла снимков см. в разделе SNAPSHOTS.
|
||||
|
||||
7.8 nohidden
|
||||
------------
|
||||
|
||||
Исключает все скрытые файлы и каталоги.
|
||||
В Unix скрытые файлы — это те, которые начинаются с `.`.
|
||||
В Windows — это те, у которых есть скрытый атрибут.
|
||||
|
||||
7.8 exclude/include PATTERN
|
||||
7.9 exclude/include PATTERN
|
||||
---------------------------
|
||||
|
||||
Определяет шаблоны файлов или каталогов для исключения или включения
|
||||
|
|
@ -1247,8 +1280,8 @@ UUID дисков.
|
|||
|
||||
Эту опцию можно использовать несколько раз.
|
||||
|
||||
7.9 blocksize SIZE_IN_KIBIBYTES
|
||||
-------------------------------
|
||||
7.10 blocksize SIZE_IN_KIBIBYTES
|
||||
--------------------------------
|
||||
|
||||
Определяет базовый размер блока в кибибайтах для четности.
|
||||
Один кибибайт — это 1024 байта.
|
||||
|
|
@ -1296,7 +1329,7 @@ UUID дисков.
|
|||
диска 4 ТБ, что позволяет разместить около 460 000 файлов на каждом диске данных без
|
||||
каких-либо потерь пространства.
|
||||
|
||||
7.10 hashsize SIZE_IN_BYTES
|
||||
7.11 hashsize SIZE_IN_BYTES
|
||||
---------------------------
|
||||
|
||||
Определяет размер хэша в байтах для сохраненных блоков.
|
||||
|
|
@ -1334,7 +1367,7 @@ RAM = (8 * 4 * 10^12) * (1+16) / (512 * 2^10) = 0.96 GiB
|
|||
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0.51 GiB
|
||||
|
||||
7.11 autosave SIZE_IN_GIGABYTES
|
||||
7.12 autosave SIZE_IN_GIGABYTES
|
||||
-------------------------------
|
||||
|
||||
Автоматически сохраняет состояние при синхронизации или проверке после
|
||||
|
|
@ -1342,7 +1375,7 @@ RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0.51 GiB
|
|||
Эта опция полезна, чтобы избежать перезапуска длительных команд `sync`
|
||||
с нуля, если они были прерваны сбоем машины или любым другим событием.
|
||||
|
||||
7.12 temp_limit TEMPERATURE_CELSIUS
|
||||
7.13 temp_limit TEMPERATURE_CELSIUS
|
||||
-----------------------------------
|
||||
|
||||
Устанавливает максимально допустимую температуру диска в Цельсиях. Если указано,
|
||||
|
|
@ -1375,13 +1408,13 @@ SnapRAID периодически проверяет температуру вс
|
|||
Обычно SnapRAID показывает только температуру самого горячего диска.
|
||||
Чтобы отобразить температуру всех дисков, используйте опцию -A или --stats.
|
||||
|
||||
7.13 temp_sleep TIME_IN_MINUTES
|
||||
7.14 temp_sleep TIME_IN_MINUTES
|
||||
-------------------------------
|
||||
|
||||
Устанавливает время ожидания, в минутах, когда достигается предел температуры.
|
||||
В течение этого периода диски остаются остановленными. По умолчанию — 5 минут.
|
||||
|
||||
7.14 pool DIR
|
||||
7.15 pool DIR
|
||||
-------------
|
||||
|
||||
Определяет каталог объединения (pooling), где создается виртуальное представление
|
||||
|
|
@ -1389,7 +1422,7 @@ SnapRAID периодически проверяет температуру вс
|
|||
|
||||
Каталог должен уже существовать.
|
||||
|
||||
7.15 share UNC_DIR
|
||||
7.16 share UNC_DIR
|
||||
------------------
|
||||
|
||||
Определяет путь UNC Windows, необходимый для удаленного доступа к дискам.
|
||||
|
|
@ -1405,7 +1438,7 @@ SnapRAID периодически проверяет температуру вс
|
|||
|
||||
Эта опция требуется только для Windows.
|
||||
|
||||
7.16 smartctl DISK/PARITY OPTIONS...
|
||||
7.17 smartctl DISK/PARITY OPTIONS...
|
||||
------------------------------------
|
||||
|
||||
Определяет пользовательские опции smartctl для получения атрибутов SMART для
|
||||
|
|
@ -1422,6 +1455,9 @@ PARITY — это одно из имен четности: `parity`, `2-parity`,
|
|||
именем устройства. Для контроллеров RAID устройство,
|
||||
вероятно, фиксировано, и вам может не потребоваться использовать `%s`.
|
||||
|
||||
Вы также можете указать пользовательскую строку параметров информации с помощью
|
||||
тега `[info: ...]`, чтобы заменить параметр по умолчанию `-a`.
|
||||
|
||||
Возможные опции см. в документации smartmontools:
|
||||
|
||||
https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
|
|
@ -1429,9 +1465,10 @@ PARITY — это одно из имен четности: `parity`, `2-parity`,
|
|||
|
||||
Например:
|
||||
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl parity -d sat %s
|
||||
|
||||
7.17 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
7.18 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
-------------------------------------------
|
||||
|
||||
Игнорирует указанный атрибут SMART при вычислении вероятности
|
||||
|
|
@ -1443,17 +1480,22 @@ PARITY — это одно из имен четности: `parity`, `2-parity`,
|
|||
`4-parity`, `5-parity`, `6-parity` или `z-parity`.
|
||||
Специальное значение * может использоваться для игнорирования атрибута на всех дисках.
|
||||
|
||||
Например, чтобы игнорировать атрибут `Current Pending Sector Count` на
|
||||
всех дисках:
|
||||
Можно указать несколько атрибутов, разделенных пробелами.
|
||||
Каждый атрибут может быть указан как число от 1 до 255 или как имя,
|
||||
нечувствительное к регистру (например, `Current_Pending_Sector`).
|
||||
|
||||
smartignore * 197
|
||||
Например, чтобы игнорировать атрибуты `Current Pending Sector Count` и
|
||||
`Reallocated Sectors Count` на всех дисках по их номеру или имени:
|
||||
|
||||
Чтобы игнорировать его только на первом диске четности:
|
||||
smartignore * 197 5
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
smartignore parity 197
|
||||
Чтобы игнорировать их только на первом диске четности:
|
||||
|
||||
7.18 Examples
|
||||
-------------
|
||||
smartignore parity 197 5
|
||||
|
||||
7.19 Примеры (Examples)
|
||||
-----------------------
|
||||
|
||||
Пример типичной конфигурации для Unix:
|
||||
|
||||
|
|
@ -1465,7 +1507,7 @@ PARITY — это одно из имен четности: `parity`, `2-parity`,
|
|||
data d3 /mnt/disk3/
|
||||
exclude /lost+found/
|
||||
exclude /tmp/
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/sg0
|
||||
smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1481,14 +1523,133 @@ PARITY — это одно из имен четности: `parity`, `2-parity`,
|
|||
exclude Thumbs.db
|
||||
exclude \$RECYCLE.BIN
|
||||
exclude \System Volume Information
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
|
||||
8 PATTERN
|
||||
=========
|
||||
8 Снимки (SNAPSHOTS)
|
||||
====================
|
||||
|
||||
Если в конфигурации включена опция снимков, SnapRAID использует
|
||||
функциональность снимков файловой системы для обеспечения атомарности и
|
||||
согласованности операций.
|
||||
|
||||
Управление снимками происходит полностью автоматически и прозрачно.
|
||||
Вы можете продолжать использовать SnapRAID точно так же, как и раньше, получая
|
||||
дополнительную защиту, обеспечиваемую снимками, которые полностью обрабатываются в
|
||||
фоновом режиме.
|
||||
|
||||
Это дает два основных преимущества:
|
||||
|
||||
Согласованность — Файлы, измененные в живой файловой системе во время длительного
|
||||
процесса sync или scrub, не вызовут несоответствия четности или прерывания
|
||||
операций, поскольку SnapRAID видит замороженный снимок на момент времени.
|
||||
Восстановление — Если файл обновляется или удаляется из живой файловой системы,
|
||||
он остается сохраненным в снимке. Если сбой диска произойдет
|
||||
до запуска следующей синхронизации sync, SnapRAID использует данные, сохраненные
|
||||
в снимке, для реконструкции отказавшего диска.
|
||||
|
||||
В случае сбоя диска во время активного процесса sync,
|
||||
SnapRAID также может автоматически читать как из снимка предыдущего
|
||||
вычисления четности, так и из текущего.
|
||||
Это максимизирует вероятность полного восстановления, предоставляя
|
||||
доступ к точным блокам данных, необходимым для решения уравнений четности,
|
||||
даже если эти блоки были изменены или удалены между синхронизациями.
|
||||
|
||||
Без снимков обновленный или удаленный файл на исправном диске
|
||||
приводит к отсутствию блоков данных, которые могут потребоваться для
|
||||
восстановления других отказавших дисков.
|
||||
|
||||
Снимки создаются только для дисков с данными и только в том случае, если базовая
|
||||
файловая система поддерживает эту функциональность. Диски четности всегда используют
|
||||
живую файловую систему.
|
||||
|
||||
В настоящее время это поддерживается на Btrfs, Bcachefs и ZFS в Linux
|
||||
и на NTFS в Windows.
|
||||
|
||||
Вы можете комбинировать диски с данными с различными файловыми системами. Только те из них,
|
||||
которые поддерживают снимки, будут использовать их, в то время как другие диски продолжат
|
||||
работать напрямую с живой файловой системой.
|
||||
|
||||
Создание и удаление снимков требуют прав администратора.
|
||||
Убедитесь, что SnapRAID запущен с необходимыми привилегиями (например, sudo),
|
||||
когда снимки включены.
|
||||
|
||||
8.1 Поведение команд при использовании снимков
|
||||
----------------------------------------------
|
||||
|
||||
Команды `sync` и `scrub` работают исключительно со снимками,
|
||||
чтобы гарантировать, что все операции с данными выполняются на согласованном,
|
||||
замороженном состоянии. Используя эти снимки, SnapRAID предотвращает несоответствия
|
||||
четности, которые в противном случае были бы вызваны одновременными изменениями файлов в живой файловой системе.
|
||||
Во время `sync` команда использует новый снимок, созданный в начале
|
||||
процесса, для фиксации текущего состояния для вычисления четности.
|
||||
Напротив, команда `scrub` использует последний снимок, созданный во время
|
||||
самой последней синхронизации, чтобы поддерживать надежную точку отсчета,
|
||||
соответствующую существующей четности.
|
||||
|
||||
Для команд `check` и `fix` использование последнего снимка
|
||||
зависит от того, нацелены ли конкретные диски с помощью опции
|
||||
-d, --filter-disk.
|
||||
|
||||
Диск, явно выбранный с помощью -d («цель» операции),
|
||||
всегда использует живую файловую систему. Для `fix` это позволяет восстановить
|
||||
данные на активную замену диска. Для `check` это позволяет симулировать
|
||||
операцию `fix` при тех же условиях.
|
||||
|
||||
Доступ ко всем остальным дискам с данными («справочным» дискам) будет осуществляться через
|
||||
их снимки. Это гарантирует, что даже если вы изменяете файлы
|
||||
на своих исправных дисках во время восстановления, SnapRAID
|
||||
имеет стабильную, замороженную точку отсчета для решения уравнений четности.
|
||||
|
||||
Если опция -d не предоставлена, SnapRAID предполагает, что операция применяется
|
||||
ко всему массиву; в этом случае `check` и `fix` будут использовать исключительно
|
||||
живые файловые системы.
|
||||
|
||||
Все остальные команды работают исключительно с живой файловой системой.
|
||||
|
||||
|
||||
9 Жизненный цикл снимков (SNAPSHOTS LIFECYCLE)
|
||||
==============================================
|
||||
|
||||
SnapRAID управляет двумя конкретными снимками, `stable` и `pending`,
|
||||
внутри скрытого каталога в корне каждого подтома данных.
|
||||
В Btrfs, Bcachefs и NTFS используется каталог `.snapraid/`,
|
||||
в ZFS — стандартный `.zfs/snapshot/`.
|
||||
|
||||
Снимок `stable` представляет собой состояние последней успешно
|
||||
завершенной синхронизации `sync`, содержащей точные данные, использованные для
|
||||
вычисления текущей четности. Он служит основным источником данных
|
||||
для команд `scrub`, `check` и `fix`.
|
||||
|
||||
Снимок `pending` — это временный образ, создаваемый в начале
|
||||
`sync` для обеспечения замороженного состояния для вычисления четности.
|
||||
После успешного завершения операции предыдущий снимок `stable`
|
||||
удаляется, а снимок `pending` повышается в статусе, чтобы
|
||||
занять его место в качестве нового стабильного ориентира.
|
||||
|
||||
Если процесс `sync` прерывается, снимок `pending` сохраняется.
|
||||
Последующие команды `scrub`, `check` и `fix` будут использовать этот
|
||||
ожидающий снимок, так как он соответствует состоянию файловой системы, записанному в
|
||||
файле .content, даже если четность синхронизирована лишь частично.
|
||||
|
||||
В случае прерывания `sync` команды `check` и `fix`
|
||||
также читают данные из снимка `stable` для извлечения блоков данных
|
||||
из файлов, которые были обновлены или удалены во время синхронизации.
|
||||
Это возможно потому, что файл .content сохраняет метаданные для
|
||||
всех измененных или удаленных файлов на протяжении всего процесса sync.
|
||||
Эта историческая информация очищается только после успешного завершения sync
|
||||
и сохранения финальной версии файла .content.
|
||||
|
||||
Если `sync` перезапускается после прерывания, существующий
|
||||
ожидающий (pending) снимок удаляется, и создается новый для
|
||||
фиксации текущего состояния живой файловой системы.
|
||||
|
||||
|
||||
10 Шаблон (PATTERN)
|
||||
===================
|
||||
|
||||
Шаблоны обеспечивают гибкий способ фильтрации файлов для включения или
|
||||
исключения. Используя символы подстановки (globbing), вы можете определить правила,
|
||||
|
|
@ -1606,8 +1767,8 @@ PARITY — это одно из имен четности: `parity`, `2-parity`,
|
|||
заключить их в кавычки, чтобы предотвратить их расширение оболочкой.
|
||||
|
||||
|
||||
9 IGNORE FILE
|
||||
=============
|
||||
11 Файл исключений (IGNORE FILE)
|
||||
================================
|
||||
|
||||
В дополнение к глобальным правилам в файле конфигурации, вы можете
|
||||
размещать файлы `.snapraidignore` в любом каталоге внутри массива для
|
||||
|
|
@ -1651,20 +1812,22 @@ PARITY — это одно из имен четности: `parity`, `2-parity`,
|
|||
*.tmp
|
||||
|
||||
|
||||
10 CONTENT
|
||||
==========
|
||||
12 Содержимое (CONTENT)
|
||||
=======================
|
||||
|
||||
SnapRAID хранит список и контрольные суммы ваших файлов в файле content.
|
||||
|
||||
Это бинарный файл, который перечисляет все файлы, присутствующие в вашем дисковом массиве,
|
||||
вместе со всеми контрольными суммами для проверки их целостности.
|
||||
|
||||
Этот файл считывается и записывается командами `sync` и `scrub` и
|
||||
считывается командами `fix`, `check` и `status`.
|
||||
Файл content считывается и записывается командами `sync`, `scrub`,
|
||||
`touch` и `rehash`. Он считывается командами `status`, `diff`, `check`,
|
||||
`fix`, `list`, `dup`, `locate` и `pool`, и полностью игнорируется
|
||||
командами `smart`, `probe`, `up`, `down` и `devices`.
|
||||
|
||||
|
||||
11 PARITY
|
||||
=========
|
||||
13 Четность (PARITY)
|
||||
====================
|
||||
|
||||
SnapRAID хранит информацию четности вашего массива в файлах parity.
|
||||
|
||||
|
|
@ -1675,8 +1838,8 @@ SnapRAID хранит информацию четности вашего мас
|
|||
только считываются командами `scrub` и `check`.
|
||||
|
||||
|
||||
12 ENCODING
|
||||
===========
|
||||
14 Кодировка (ENCODING)
|
||||
=======================
|
||||
|
||||
SnapRAID в Unix игнорирует любое кодирование. Он считывает и хранит
|
||||
имена файлов с тем же кодированием, которое используется файловой системой.
|
||||
|
|
@ -1692,13 +1855,30 @@ SnapRAID в Unix игнорирует любое кодирование. Он с
|
|||
в формате UTF-8.
|
||||
|
||||
|
||||
13 COPYRIGHT
|
||||
============
|
||||
15 Код возврата (EXIT CODE)
|
||||
===========================
|
||||
|
||||
Этот файл защищен авторским правом (C) 2025 Andrea Mazzoleni
|
||||
SnapRAID завершает работу со следующими кодами ошибок:
|
||||
|
||||
0 - Все в порядке.
|
||||
1 - Команда обнаружила ошибки.
|
||||
2 - Команда `diff` определила, что все в порядке, но требуется `sync`.
|
||||
|
||||
|
||||
14 SEE ALSO
|
||||
===========
|
||||
16 Перевод (TRANSLATION)
|
||||
========================
|
||||
|
||||
snapraid_log(1), snapraidd(1)
|
||||
Этот документ является автоматическим переводом английского руководства.
|
||||
Обратитесь к английскому руководству за официальной версией.
|
||||
|
||||
|
||||
17 Авторские права (COPYRIGHT)
|
||||
==============================
|
||||
|
||||
Этот файл защищен авторским правом (C) 2026 Andrea Mazzoleni
|
||||
|
||||
|
||||
18 См. также (SEE ALSO)
|
||||
=======================
|
||||
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ snapraid [\-c, \-\-conf CONFIG]
|
|||
snapraid [\-V, \-\-version] [\-H, \-\-help] [\-C, \-\-gen\-conf CONTENT]
|
||||
.PD 0
|
||||
.PD
|
||||
.SH BESKRIVNING
|
||||
.SH BESKRIVNING (DESCRIPTION)
|
||||
SnapRAID är ett säkerhetskopieringsprogram designat för disk\-arrayer,
|
||||
som lagrar paritetsinformation för dataåterställning vid upp till sex
|
||||
diskfel.
|
||||
|
|
@ -117,22 +117,34 @@ https://www.snapraid.it/
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH BEGRäNSNINGAR
|
||||
SnapRAID är en hybrid mellan ett RAID\- och ett säkerhetskopieringsprogram,
|
||||
som syftar till att kombinera de bästa fördelarna med båda. Den har dock
|
||||
vissa begränsningar som du bör överväga innan du använder den.
|
||||
.SH BEGRäNSNINGAR (LIMITATIONS)
|
||||
SnapRAID är en hybrid mellan en RAID och ett backupprogram, med målet att kombinera
|
||||
de bästa fördelarna med båda. Det har dock vissa begränsningar som du bör
|
||||
överväga innan du använder det.
|
||||
.PP
|
||||
Huvudbegränsningen är att om en disk misslyckas och du inte nyligen har
|
||||
synkat, kanske du inte kan återställa fullständigt.
|
||||
Mer specifikt, kanske du inte kan återställa upp till storleken på
|
||||
de ändrade eller raderade filerna sedan den senaste synkroniseringsoperationen.
|
||||
Detta inträffar även om de ändrade eller raderade filerna inte finns på
|
||||
den felaktiga disken. Det är därför SnapRAID passar bättre för
|
||||
data som sällan ändras.
|
||||
Den huvudsakliga begränsningen är att om en disk havererar kan du endast återställa data fram till
|
||||
tillståndet för den senaste \`sync\`\-operationen. Data som lagts till eller modifieringar som gjorts
|
||||
sedan den senaste synkroniseringen och som är placerade på den felaktiga disken kommer att gå förlorade.
|
||||
.PP
|
||||
Å andra sidan förhindrar nyligen tillagda filer inte återställning av redan
|
||||
befintliga filer. Du kommer bara att förlora de nyligen tillagda filerna om de
|
||||
finns på den felaktiga disken.
|
||||
Följaktligen är SnapRAID främst lämpat för data som sällan ändras.
|
||||
.PP
|
||||
För data som redan existerade vid den senaste synkroniseringen beror återställningens tillförlitlighet
|
||||
på om alternativet \`snapshot\` (ögonblicksbild) används:
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Med stöd för ögonblicksbilder (tillgängligt på Btrfs, ZFS, Bcachefs och NTFS)
|
||||
kan SnapRAID automatiskt upprätthålla en frusen referens av dina datadiskar.
|
||||
Detta säkerställer att även om du ändrar eller tar bort filer på ditt aktiva filsystem
|
||||
under eller efter en synkronisering, förblir återställningsprocessen konsekvent och tillförlitlig.
|
||||
.PD
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Utan stöd för ögonblicksbilder kan borttagning eller ändring av filer efter en \`sync\`
|
||||
förhindra fullständig återställning av andra felaktiga diskar. Detta inträffar
|
||||
eftersom pariteten inte längre matchar de modifierade filerna, även om
|
||||
dessa filer inte finns på den havererade disken. Å andra sidan förhindrar inte nyinkomna
|
||||
filer återställning av redan existerande filer.
|
||||
.PD
|
||||
.PP
|
||||
Andra SnapRAID\-begränsningar är:
|
||||
.PD 0
|
||||
|
|
@ -153,7 +165,7 @@ fel på hela disk\-arrayen.
|
|||
Endast filnamn, tidsstämplar, symboliska länkar och hårda länkar sparas.
|
||||
Behörigheter, ägarskap och utökade attribut sparas inte.
|
||||
.PD
|
||||
.SH KOM IGåNG
|
||||
.SH KOM IGåNG (GETTING STARTED)
|
||||
För att använda SnapRAID måste du först välja en disk i din disk\-array
|
||||
som ska dediceras till \`parity\`\-information. Med en disk för paritet,
|
||||
kommer du att kunna återställa från ett enda diskfel, liknande RAID5.
|
||||
|
|
@ -356,10 +368,10 @@ snapraid \-p bad scrub
|
|||
Att köra \`scrub\` på en osynkad array kan rapportera fel orsakade av
|
||||
borttagna eller modifierade filer. Dessa fel rapporteras i \`scrub\`\-
|
||||
utdata, men de relaterade blocken markeras inte som dåliga.
|
||||
.SS Poolning
|
||||
.SS Poolning (Pooling)
|
||||
Obs: Poolningsfunktionen som beskrivs nedan har ersatts av verktyget
|
||||
mergerfs, som nu är det rekommenderade alternativet för Linux\-användare i
|
||||
SnapRAID\-communityt. Mergefs ger ett mer flexibelt och effektivt
|
||||
SnapRAID\-communityt. Mergerfs ger ett mer flexibelt och effektivt
|
||||
sätt att poola flera enheter till en enda enhetlig monteringspunkt,
|
||||
vilket möjliggör sömlös åtkomst till filer över din array utan att förlita sig
|
||||
på symboliska länkar. Det integreras väl med SnapRAID för paritetsskydd
|
||||
|
|
@ -510,7 +522,7 @@ kan användas för att återställa eller ångra radering av filer till deras ti
|
|||
med hjälp av alternativet \-f, \-\-filter:
|
||||
.PP
|
||||
.RS 4
|
||||
snapraid fix \-f FIL
|
||||
snapraid fix \-f FILE
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
|
|
@ -518,7 +530,7 @@ snapraid fix \-f FIL
|
|||
eller för en katalog:
|
||||
.PP
|
||||
.RS 4
|
||||
snapraid fix \-f KATALOG/
|
||||
snapraid fix \-f DIR/
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
|
|
@ -528,7 +540,7 @@ en katalog med hjälp av alternativet \-m, \-\-filter\-missing, som återställe
|
|||
endast saknade filer, och lämnar alla andra orörda.
|
||||
.PP
|
||||
.RS 4
|
||||
snapraid fix \-m \-f KATALOG/
|
||||
snapraid fix \-m \-f DIR/
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
|
|
@ -540,7 +552,7 @@ snapraid fix \-m
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Återställning
|
||||
.SS Återställning (Recovering)
|
||||
Det värsta har hänt, och du har förlorat en eller flera diskar!
|
||||
.PP
|
||||
FÅ INTE PANIK! Du kommer att kunna återställa dem!
|
||||
|
|
@ -581,12 +593,12 @@ Om du har flera felaktiga diskar, uppdatera alla deras konfigurationsalternativ.
|
|||
Kör kommandot fix och lagra loggen i en extern fil med:
|
||||
.PP
|
||||
.RS 4
|
||||
snapraid \-d NAMN \-l fix.log fix
|
||||
snapraid \-d NAME \-l fix.log fix
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.PP
|
||||
Där NAMN är namnet på disken, till exempel \`d1\` i vårt tidigare exempel.
|
||||
Där NAME är namnet på disken, till exempel \`d1\` i vårt tidigare exempel.
|
||||
Om disken som ska återställas är en paritetsdisk, använd namnen \`parity\`, \`2\-parity\`,
|
||||
etc.
|
||||
Om du har flera felaktiga diskar, använd flera \-d\-alternativ för att specificera alla
|
||||
|
|
@ -609,24 +621,24 @@ gånger du vill.
|
|||
.PP
|
||||
Om du till exempel har tagit bort filer från arrayen efter den senaste
|
||||
\`sync\`, kan detta leda till att vissa filer inte återställs.
|
||||
I detta fall kan du försöka igen \`fix\` med alternativet \-i, \-\-import,
|
||||
I detta fall kan du köra \`fix\` igen med alternativet \-i, \-\-import,
|
||||
specificera var dessa filer nu finns för att inkludera dem igen i
|
||||
återställningsprocessen.
|
||||
.PP
|
||||
Om du är nöjd med återställningen kan du fortsätta,
|
||||
men notera att efter synkronisering kan du inte försöka igen kommandot \`fix\`
|
||||
men notera att efter synkronisering kan du inte köra \`fix\`\-kommandot igen
|
||||
längre!
|
||||
.SS STEG 3 \-> Kontrollera
|
||||
Som en försiktighetsåtgärd kan du nu köra ett \`check\`\-kommando för att säkerställa att
|
||||
allt är korrekt på den återställda disken.
|
||||
.PP
|
||||
.RS 4
|
||||
snapraid \-d NAMN \-a check
|
||||
snapraid \-d NAME \-a check
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.PP
|
||||
Där NAMN är namnet på disken, till exempel \`d1\` i vårt tidigare exempel.
|
||||
Där NAME är namnet på disken, till exempel \`d1\` i vårt tidigare exempel.
|
||||
.PP
|
||||
Alternativen \-d och \-a talar om för SnapRAID att endast kontrollera den specificerade disken
|
||||
och ignorera all paritetsdata.
|
||||
|
|
@ -643,22 +655,22 @@ snapraid sync
|
|||
.RE
|
||||
.PP
|
||||
Om allt är återställt är detta kommando omedelbart.
|
||||
.SH KOMMANDON
|
||||
SnapRAID tillhandahåller några enkla kommandon som låter dig:
|
||||
.SH KOMMANDON (COMMANDS)
|
||||
SnapRAID tillhandahåller några enkla kommandon som gör att du kan:
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Skriva ut statusen för arrayen \-> \`status\`
|
||||
Skriva ut arrayens status \-> \`status\`
|
||||
.IP \(bu
|
||||
Kontrollera diskarna \-> \`smart\`, \`probe\`, \`up\`, \`down\`
|
||||
.IP \(bu
|
||||
Göra en säkerhetskopia/ögonblicksbild \-> \`sync\`
|
||||
Skapa en backup\-/återställningspunkt \-> \`sync\`
|
||||
.IP \(bu
|
||||
Periodiskt kontrollera data \-> \`scrub\`
|
||||
.IP \(bu
|
||||
Återställa den senaste säkerhetskopian/ögonblicksbilden \-> \`fix\`.
|
||||
Återställa den senaste backup\-/återställningspunkten \-> \`fix\`.
|
||||
.PD
|
||||
.PP
|
||||
Kommandon måste skrivas med gemener.
|
||||
Kommandon måste skrivas med gemener (små bokstäver).
|
||||
.SS status
|
||||
Skriver ut en sammanfattning av tillståndet för disk\-arrayen.
|
||||
.PP
|
||||
|
|
@ -886,15 +898,14 @@ för varje block och för att markera dåliga block.
|
|||
\`parity\`\-filerna modifieras INTE.
|
||||
Filerna i arrayen modifieras INTE.
|
||||
.SS fix
|
||||
Fixar alla filer och paritetsdata.
|
||||
Lagar alla filer och paritetsdata.
|
||||
.PP
|
||||
Alla filer och paritetsdata jämförs med ögonblicksbilds\-
|
||||
tillståndet som sparades i den senaste \`sync\`.
|
||||
Om en skillnad hittas, återställs den till det lagrade ögonblicksbildstillståndet.
|
||||
Alla filer och paritetsdata jämförs med det tillstånd som sparades i
|
||||
den senaste \`sync\`\-operationen. Om en skillnad hittas återställs den till det sparade tillståndet.
|
||||
.PP
|
||||
VARNING! Kommandot \`fix\` skiljer inte mellan fel och
|
||||
avsiktliga modifieringar. Det återställer ovillkorligen filtillståndet
|
||||
till den senaste \`sync\`.
|
||||
VARNING!
|
||||
Kommandot \`fix\` skiljer inte mellan fel och avsiktliga modifieringar.
|
||||
Det återställer villkorslöst filtillståndet till den senaste \`sync\`\-operationen.
|
||||
.PP
|
||||
Om inget annat alternativ specificeras, behandlas hela arrayen.
|
||||
Använd filteralternativen för att välja en delmängd av filer eller diskar att arbeta med.
|
||||
|
|
@ -909,7 +920,7 @@ SnapRAID döper om alla filer som inte kan fixas genom att lägga till tillägge
|
|||
.PP
|
||||
Innan fixningen skannas hela arrayen för att hitta alla filer som flyttats
|
||||
sedan den senaste \`sync\`\-operationen.
|
||||
Dessa filer identifieras av deras tidsstämpel, ignorera deras namn
|
||||
Dessa filer identifieras av deras tidsstämpel, oavsett namn
|
||||
och katalog, och används i återställningsprocessen vid behov.
|
||||
Om du flyttade några av dem utanför arrayen kan du använda alternativet \-i, \-\-import
|
||||
för att specificera ytterligare kataloger att skanna.
|
||||
|
|
@ -940,7 +951,7 @@ Inget ändras.
|
|||
Listar alla filer som finns i arrayen vid tidpunkten för den
|
||||
senaste \`sync\`.
|
||||
.PP
|
||||
Med \-v eller \-\-verbose visas även undertiden.
|
||||
Med \-v eller \-\-verbose visas även subsekundprecisionen.
|
||||
.PP
|
||||
Inget ändras.
|
||||
.SS dup
|
||||
|
|
@ -977,16 +988,16 @@ lågnivåenheter som används av en enda disk i arrayen.
|
|||
.PP
|
||||
Inget ändras.
|
||||
.SS touch
|
||||
Anger en godtycklig undertidsstämpel för alla filer
|
||||
Anger en godtycklig tidsstämpel för undersekunder för alla filer
|
||||
som har den satt till noll.
|
||||
.PP
|
||||
Detta förbättrar SnapRAIDs förmåga att känna igen flyttade
|
||||
och kopierade filer, eftersom det gör tidsstämpeln nästan unik,
|
||||
vilket minskar möjliga dubbletter.
|
||||
.PP
|
||||
Mer specifikt, om undertidsstämpeln inte är noll,
|
||||
Mer specifikt, om tidsstämpeln för undersekunder inte är noll,
|
||||
identifieras en flyttad eller kopierad fil som sådan om den matchar
|
||||
namn, storlek och tidsstämpel. Om undertidsstämpeln
|
||||
namn, storlek och tidsstämpel. Om tidsstämpeln för undersekunder
|
||||
är noll, betraktas den som en kopia endast om hela sökvägen,
|
||||
storlek och tidsstämpel alla matchar.
|
||||
.PP
|
||||
|
|
@ -1021,7 +1032,7 @@ Om du vill omallokera dessa filer kan du använda alternativet
|
|||
\-W, \-\-force\-realloc\-tail.
|
||||
Var medveten om att sådana filer inte skyddas av paritet under
|
||||
omallokeringsprocessen.
|
||||
.SH ALTERNATIV
|
||||
.SH ALTERNATIV (OPTIONS)
|
||||
SnapRAID tillhandahåller följande alternativ:
|
||||
.TP
|
||||
.B \-c, \-\-conf CONFIG
|
||||
|
|
@ -1035,7 +1046,7 @@ katalog som \`snapraid.exe\`.
|
|||
Filtrerar filerna att behandla i \`check\` och \`fix\`.
|
||||
Endast filerna som matchar det specificerade mönstret behandlas.
|
||||
Detta alternativ kan användas flera gånger.
|
||||
Se avsnittet MÖNSTER för mer information om
|
||||
Se avsnittet PATTERN för mer information om
|
||||
mönsterspecifikationer.
|
||||
I Unix, se till att globbing\-tecken citeras om de används.
|
||||
Detta alternativ kan endast användas med \`check\` och \`fix\`.
|
||||
|
|
@ -1133,7 +1144,7 @@ Tillämpar en global bandbreddsbegränsning för alla diskar. RATE är
|
|||
antalet byte per sekund. Du kan specificera en multiplikator
|
||||
som K, M eller G (t.ex. \-\-bw\-limit 1G).
|
||||
.TP
|
||||
.B \-t, \-\-tail STORLEK
|
||||
.B \-t, \-\-tail SIZE
|
||||
Begränsa fillistan till de som inte använder mer än den angivna
|
||||
slutstorleken på paritetsdiskarna.
|
||||
Du kan använda multiplikatorer som K, M, G eller T (t.ex. \-\-tail 1G).
|
||||
|
|
@ -1195,7 +1206,7 @@ Detta alternativ kan endast användas med \`sync\`, \`check\` eller
|
|||
.B \-D, \-\-force\-device
|
||||
Tvingar den osäkra operationen att fixa med otillgängliga diskar
|
||||
eller med diskar på samma fysiska enhet.
|
||||
Till exempel, om du förlorade två datadisker och har en reservdisk för att återställa
|
||||
Till exempel, om du förlorade två datadiskar och har en reservdisk för att återställa
|
||||
endast den första, kan du ignorera den andra otillgängliga disken.
|
||||
Eller, om du vill återställa en disk i det lediga utrymme som finns kvar på en
|
||||
redan använd disk, dela samma fysiska enhet.
|
||||
|
|
@ -1234,9 +1245,9 @@ VARNING! Detta alternativ är endast för experter, och det rekommenderas
|
|||
starkt att inte använda det.
|
||||
Du HAR INGET dataskydd under \`sync\`\-operationen.
|
||||
.TP
|
||||
.B \-W, \-\-force\-realloc\-tail STORLEK
|
||||
.B \-W, \-\-force\-realloc\-tail SIZE
|
||||
Fungerar som \-R, \-\-force\-realloc, men begränsat till den angivna
|
||||
slutdelen (de sista STORLEK byten) av varje paritetsfil.
|
||||
slutdelen (de sista SIZE byten) av varje paritetsfil.
|
||||
Den tvingar omallokering (flytt) av alla filfragment/block som för
|
||||
närvarande lagras i den slutsektionen, vilket gör att de kan placeras
|
||||
var som helst i paritetsfilen/filerna där ledigt utrymme finns
|
||||
|
|
@ -1283,7 +1294,7 @@ Däremot stoppar \`check\` och \`fix\` alltid vid det första felet.
|
|||
.TP
|
||||
.B \-S, \-\-start BLKSTART
|
||||
Börjar behandlingen från det specificerade
|
||||
blocknumret. Detta kan vara användbart för att försöka igen att kontrollera
|
||||
blocknumret. Detta kan vara användbart för att på nytt försöka kontrollera
|
||||
eller fixa specifika block i händelse av en skadad disk.
|
||||
Detta alternativ är främst för avancerad manuell återställning.
|
||||
.TP
|
||||
|
|
@ -1319,7 +1330,7 @@ Skriver ut en kort hjälpskärm.
|
|||
.TP
|
||||
.B \-V, \-\-version
|
||||
Skriver ut programversionen.
|
||||
.SH KONFIGURATION
|
||||
.SH KONFIGURATION (CONFIGURATION)
|
||||
SnapRAID kräver en konfigurationsfil för att veta var din disk\-array
|
||||
finns och var paritetsinformationen ska lagras.
|
||||
.PP
|
||||
|
|
@ -1329,7 +1340,7 @@ I Windows används filen \`snapraid.conf\` i samma
|
|||
katalog som \`snapraid.exe\`.
|
||||
.PP
|
||||
Den måste innehålla följande alternativ (skiftlägeskänsligt):
|
||||
.SS parity FIL [,FIL] ...
|
||||
.SS parity FILE [,FILE] ...
|
||||
Definierar de filer som ska användas för att lagra paritetsinformationen.
|
||||
Pariteten möjliggör skydd från ett enda disk\-
|
||||
fel, liknande RAID5.
|
||||
|
|
@ -1349,7 +1360,7 @@ I Windows lämnas 256 MB oanvänt på varje disk för att undvika
|
|||
varningen om fulla diskar.
|
||||
.PP
|
||||
Detta alternativ är obligatoriskt och kan endast användas en gång.
|
||||
.SS (2,3,4,5,6)\-parity FIL [,FIL] ...
|
||||
.SS (2,3,4,5,6)\-parity FILE [,FILE] ...
|
||||
Definierar de filer som ska användas för att lagra extra paritetsinformation.
|
||||
.PP
|
||||
För varje paritetsnivå som specificeras aktiveras en ytterligare skyddsnivå:
|
||||
|
|
@ -1372,7 +1383,7 @@ nivåer.
|
|||
Samma överväganden som för alternativet \`parity\` gäller.
|
||||
.PP
|
||||
Dessa alternativ är valfria och kan endast användas en gång.
|
||||
.SS z\-parity FIL [,FIL] ...
|
||||
.SS z\-parity FILE [,FILE] ...
|
||||
Definierar en alternativ fil och ett format för att lagra trippel paritet.
|
||||
.PP
|
||||
Detta alternativ är ett alternativ till \`3\-parity\`, främst avsett för
|
||||
|
|
@ -1389,7 +1400,7 @@ formatet \`z\-parity\` för prestandaförbättring.
|
|||
Det är möjligt att konvertera från ett format till ett annat genom att justera
|
||||
konfigurationsfilen med önskad z\-parity eller 3\-parity fil
|
||||
och använda \`fix\` för att återskapa den.
|
||||
.SS content FIL
|
||||
.SS content FILE
|
||||
Definierar den fil som ska användas för att lagra listan och checksummorna för alla
|
||||
filer som finns i din disk\-array.
|
||||
.PP
|
||||
|
|
@ -1403,18 +1414,18 @@ flera kopior av samma fil.
|
|||
.PP
|
||||
Du måste lagra minst en kopia för varje paritetsdisk som används
|
||||
plus en. Att använda ytterligare kopior skadar inte.
|
||||
.SS data NAMN KATALOG
|
||||
.SS data NAME DIR
|
||||
Definierar namnet och monteringspunkten för datadiskarna i
|
||||
arrayen. NAMN används för att identifiera disken och måste
|
||||
vara unikt. KATALOG är monteringspunkten för disken i
|
||||
arrayen. NAME används för att identifiera disken och måste
|
||||
vara unikt. DIR är monteringspunkten för disken i
|
||||
filsystemet.
|
||||
.PP
|
||||
Du kan ändra monteringspunkten vid behov, så länge
|
||||
du behåller NAMN fixerat.
|
||||
du behåller NAME fixerat.
|
||||
.PP
|
||||
Du bör använda ett alternativ för varje datadisk i arrayen.
|
||||
.PP
|
||||
Du kan byta namn på en disk senare genom att ändra NAMN direkt
|
||||
Du kan byta namn på en disk senare genom att ändra NAME direkt
|
||||
i konfigurationsfilen och sedan köra ett \`sync\`\-kommando.
|
||||
I händelse av namnbyte görs associationen med hjälp av den lagrade
|
||||
UUID:n för diskarna.
|
||||
|
|
@ -1428,11 +1439,34 @@ startdisken.
|
|||
.PP
|
||||
Observera att sådana diskar inte påverkas av kommandona \`up\` och
|
||||
\`down\` eftersom de förväntas alltid snurra.
|
||||
.SS snapshot
|
||||
Aktiverar användningen av filsystemets ögonblicksbilder för kommandona \`sync\`, \`scrub\`,
|
||||
\`check\` och \`fix\`.
|
||||
.PP
|
||||
När det är aktiverat skapar SnapRAID en skrivskyddad ögonblicksbild av dina data vid
|
||||
början av en \'sync\'. Detta säkerställer en konsekvent tidpunktsvy av dina
|
||||
filer, vilket förhindrar fel som orsakas av samtidiga filändringar.
|
||||
.PP
|
||||
Detta förbättrar återställningen avsevärt: om en fil tas bort från det aktiva filsystemet
|
||||
förblir den bevarad i ögonblicksbilden. Detta förhindrar att pariteten blir \[dq]trasig\[dq]
|
||||
för det blocket, vilket säkerställer att du fortfarande kan återställa data framgångsrikt
|
||||
om en annan disk havererar.
|
||||
.PP
|
||||
Detta alternativ gäller uteslutande datadiskar formaterade med filsystemen
|
||||
Btrfs, Bcachefs eller ZFS i Linux och NTFS i Windows.
|
||||
Paritetsdiskar, eller datadiskar som använder andra filsystem, kommer alltid att använda
|
||||
den aktiva versionen av filsystemet.
|
||||
.PP
|
||||
Att skapa och ta bort ögonblicksbilder kräver administratörsbehörighet.
|
||||
Se till att SnapRAID körs med nödvändiga rättigheter (t.ex. sudo) när
|
||||
detta alternativ är aktiverat.
|
||||
.PP
|
||||
Se avsnittet SNAPSHOTS för en detaljerad förklaring av ögonblicksbildens livscykel.
|
||||
.SS nohidden
|
||||
Exkluderar alla dolda filer och kataloger.
|
||||
I Unix är dolda filer de som börjar med \`.\`.
|
||||
I Windows är de de med det dolda attributet.
|
||||
.SS exclude/include MÖNSTER
|
||||
.SS exclude/include PATTERN
|
||||
Definierar fil\- eller katalogmönstren att exkludera eller inkludera
|
||||
i sync\-processen.
|
||||
Alla mönster behandlas i den specificerade ordningen.
|
||||
|
|
@ -1443,11 +1477,11 @@ Om inget mönster matchar, exkluderas filen om det sista mönstret
|
|||
som specificerats är ett \`include\`\-mönster, eller inkluderas om det sista mönstret
|
||||
som specificerats är ett \`exclude\`\-mönster.
|
||||
.PP
|
||||
Se avsnittet MÖNSTER för mer information om mönster\-
|
||||
Se avsnittet PATTERN för mer information om mönster\-
|
||||
specifikationer.
|
||||
.PP
|
||||
Detta alternativ kan användas flera gånger.
|
||||
.SS blocksize STORLEK_I_KIBIBYTES
|
||||
.SS blocksize SIZE_IN_KIBIBYTES
|
||||
Definierar den grundläggande blockstorleken i kibibytes för pariteten.
|
||||
En kibibyte är 1024 byte.
|
||||
.PP
|
||||
|
|
@ -1496,7 +1530,7 @@ mkfs.ext4 \-m 0 \-T largefile4 DEVICE
|
|||
Detta resulterar i cirka 1,5% extra utrymme, ungefär 60 GB för
|
||||
en 4 TB\-disk, vilket möjliggör cirka 460 000 filer på varje datadisk utan
|
||||
något bortkastat utrymme.
|
||||
.SS hashsize STORLEK_I_BYTE
|
||||
.SS hashsize SIZE_IN_BYTES
|
||||
Definierar hash\-storleken i byte för de sparade blocken.
|
||||
.PP
|
||||
Standard hash\-storlek är 16 byte (128 bitar), vilket bör fungera
|
||||
|
|
@ -1539,12 +1573,12 @@ Om du byter till både en hash\-storlek på 8 och en blockstorlek på 512 får d
|
|||
RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0,51 GiB
|
||||
.PD 0
|
||||
.PD
|
||||
.SS autosave STORLEK_I_GIGABYTES
|
||||
.SS autosave SIZE_IN_GIGABYTES
|
||||
Sparar automatiskt tillståndet vid synkronisering eller skrubbning efter att den
|
||||
specificerade mängden GB har behandlats.
|
||||
Detta alternativ är användbart för att undvika att starta om långa \`sync\`\-
|
||||
kommandon från början om de avbryts av en maskinkrasch eller någon annan händelse.
|
||||
.SS temp_limit TEMPERATUR_CELSIUS
|
||||
.SS temp_limit TEMPERATURE_CELSIUS
|
||||
Anger den maximalt tillåtna disk\-temperaturen i Celsius. När den specificeras,
|
||||
kontrollerar SnapRAID periodiskt temperaturen på alla diskar med hjälp av
|
||||
verktyget smartctl. De aktuella disk\-temperaturerna visas medan
|
||||
|
|
@ -1559,29 +1593,29 @@ disk och uppskattar den långsiktiga stabila temperaturen de förväntas
|
|||
nå om aktiviteten fortsätter. Uppskattningen utförs först efter att
|
||||
disk\-temperaturen har ökat fyra gånger, vilket säkerställer att tillräckligt med
|
||||
datapoäng finns tillgängliga för att fastställa en pålitlig trend.
|
||||
Denna förutsagda stabila temperatur visas inom parentes bredvid den
|
||||
Denna förutsagda stabila temperatur visas inom parentes bredvid det
|
||||
aktuella värdet och hjälper till att bedöma om systemets kylning är
|
||||
tillräcklig. Denna uppskattade temperatur är endast för informationssyfte
|
||||
och har ingen effekt på SnapRAIDs beteende. Programmens
|
||||
och har ingen effekt på SnapRAIDs beteende. Programmets
|
||||
åtgärder baseras enbart på de faktiska uppmätta disk\-temperaturerna.
|
||||
.PP
|
||||
För att utföra denna analys behöver SnapRAID en referens för system\-
|
||||
temperaturen. Det försöker först läsa den från tillgängliga hårdvaru\-
|
||||
sensorer. Om ingen system\-sensor kan nås, används den lägsta disk\-
|
||||
temperaturen som mättes vid start av körningen som en reservreferens.
|
||||
För att utföra denna analys behöver SnapRAID en referens för systemtemperaturen.
|
||||
Det försöker först läsa den från tillgängliga hårdvarusensorer.
|
||||
Om ingen systemsensor kan nås, används den lägsta disk\-
|
||||
temperaturen som mättes i början av körningen som en reservreferens.
|
||||
.PP
|
||||
Normalt visar SnapRAID endast temperaturen på den hetaste disken.
|
||||
För att visa temperaturen på alla diskar, använd alternativet \-A eller \-\-stats.
|
||||
.SS temp_sleep TID_I_MINUTER
|
||||
.SS temp_sleep TIME_IN_MINUTES
|
||||
Anger standby\-tiden, i minuter, när temperaturgränsen har
|
||||
nåtts. Under denna period förblir diskarna nedsnurrade. Standard
|
||||
är 5 minuter.
|
||||
.SS pool KATALOG
|
||||
.SS pool DIR
|
||||
Definierar poolningskatalogen där den virtuella vyn av disk\-
|
||||
arrayen skapas med hjälp av kommandot \`pool\`.
|
||||
.PP
|
||||
Katalogen måste redan existera.
|
||||
.SS share UNC_KATALOG
|
||||
.SS share UNC_DIR
|
||||
Definierar Windows UNC\-sökvägen som krävs för att få åtkomst till diskarna på distans.
|
||||
.PP
|
||||
Om detta alternativ specificeras, använder de symboliska länkarna som skapats i pool\-
|
||||
|
|
@ -1594,7 +1628,7 @@ disk\-namnet som specificeras i \`data\`\-alternativet, och lägger slutligen ti
|
|||
katalog och namn.
|
||||
.PP
|
||||
Detta alternativ krävs endast för Windows.
|
||||
.SS smartctl DISK/PARITY ALTERNATIV...
|
||||
.SS smartctl DISK/PARITY OPTIONS...
|
||||
Definierar anpassade smartctl\-alternativ för att få SMART\-attributen för
|
||||
varje disk. Detta kan krävas för RAID\-kontroller och vissa USB\-
|
||||
diskar som inte kan upptäckas automatiskt. Platsinnehavaren %s ersätts av
|
||||
|
|
@ -1608,6 +1642,9 @@ I de specificerade ALTERNATIVEN ersätts strängen \`%s\` med
|
|||
enhetens namn. För RAID\-kontroller är enheten
|
||||
sannolikt fixerad, och du kanske inte behöver använda \`%s\`.
|
||||
.PP
|
||||
Du kan också specificera en anpassad sträng för informationsalternativ med
|
||||
hjälp av taggen \`[info: ...]\` för att ersätta standardalternativet \`\-a\`.
|
||||
.PP
|
||||
Se smartmontools dokumentation för möjliga alternativ:
|
||||
.PP
|
||||
.RS 4
|
||||
|
|
@ -1623,6 +1660,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices
|
|||
Till exempel:
|
||||
.PP
|
||||
.RS 4
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl parity \-d sat %s
|
||||
.PD 0
|
||||
.PD
|
||||
|
|
@ -1637,19 +1678,27 @@ PARITY är ett av paritetsnamnen: \`parity\`, \`2\-parity\`, \`3\-parity\`,
|
|||
\`4\-parity\`, \`5\-parity\`, \`6\-parity\` eller \`z\-parity\`.
|
||||
Det speciella värdet * kan användas för att ignorera attributet på alla diskar.
|
||||
.PP
|
||||
Till exempel, för att ignorera attributet \`Current Pending Sector Count\` på
|
||||
alla diskar:
|
||||
Flera attribut kan specificeras separerade med mellanslag.
|
||||
Varje attribut kan specificeras som ett nummer från 1 till 255, eller som ett
|
||||
skiftlägesokänsligt namn (t.ex. \`Current_Pending_Sector\`).
|
||||
.PP
|
||||
Till exempel, för att ignorera attributen \`Current Pending Sector Count\` och
|
||||
\`Reallocated Sectors Count\` på alla diskar med deras nummer eller namn:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore * 197
|
||||
smartignore * 197 5
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.PP
|
||||
För att ignorera det endast på den första paritetsdisken:
|
||||
För att ignorera dem endast på den första paritetsdisken:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore parity 197
|
||||
smartignore parity 197 5
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
|
|
@ -1689,7 +1738,7 @@ exclude /tmp/
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1745,7 +1794,7 @@ exclude \\System Volume Information
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1761,6 +1810,126 @@ smartctl 2\-parity \-d areca,2/1 /dev/arcmsr0
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH ÖGONBLICKSBILDER (SNAPSHOTS)
|
||||
Om alternativet för ögonblicksbilder är aktiverat i konfigurationen använder SnapRAID
|
||||
filsystemets funktionalitet för ögonblicksbilder för att säkerställa atomära och
|
||||
konsekventa operationer.
|
||||
.PP
|
||||
Hanteringen av ögonblicksbilder är helt automatisk och transparent.
|
||||
Du kan fortsätta att använda SnapRAID exakt som tidigare, med det
|
||||
ytterligare skydd som ögonblicksbilder ger, helt hanterat i
|
||||
bakgrunden.
|
||||
.PP
|
||||
Detta ger två huvudsakliga fördelar:
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I Konsistens
|
||||
Filer som ändras på det aktiva filsystemet under en långvarig
|
||||
sync eller scrub kommer inte att orsaka paritetsfel eller avbrutna
|
||||
operationer, eftersom SnapRAID ser en frusen tidpunktsbild.
|
||||
.HP 4
|
||||
.I Återställning
|
||||
Om en fil uppdateras eller tas bort från det aktiva filsystemet
|
||||
förblir den bevarad i ögonblicksbilden. Om ett diskhaveri inträffar
|
||||
innan nästa sync körs, använder SnapRAID den data som bevarats
|
||||
i ögonblicksbilden för att rekonstruera den felaktiga disken.
|
||||
.PD
|
||||
.PP
|
||||
.RS 4
|
||||
.PD 0
|
||||
I händelse av ett diskhaveri under en aktiv synkroniseringsprocess
|
||||
kan SnapRAID också läsa automatiskt från både ögonblicksbilden
|
||||
av den föregående paritetsberäkningen och den aktuella.
|
||||
Detta maximerar sannolikheten för en fullständig återställning genom att
|
||||
ge tillgång till de exakta datablock som krävs för att lösa paritetsekvationerna,
|
||||
även om dessa block modifierades eller togs bort mellan synkroniseringar.
|
||||
.PD
|
||||
.PP
|
||||
.PD 0
|
||||
Utan ögonblicksbilder leder en uppdaterad eller borttagen fil på en frisk disk
|
||||
till saknade datablock som kan krävas för att laga andra felaktiga diskar.
|
||||
.PD
|
||||
.RE
|
||||
.RE
|
||||
.PP
|
||||
Ögonblicksbilder skapas endast för datadiskar och endast om det underliggande
|
||||
filsystemet stöder denna funktionalitet. Paritetsdiskar använder alltid
|
||||
det aktiva filsystemet.
|
||||
.PP
|
||||
För närvarande stöds detta på Btrfs, Bcachefs och ZFS i Linux
|
||||
och på NTFS i Windows.
|
||||
.PP
|
||||
Du kan blanda datadiskar med olika filsystem. Endast de som
|
||||
stöder ögonblicksbilder kommer att använda dem, medan andra diskar kommer att fortsätta
|
||||
att fungera direkt på det aktiva filsystemet.
|
||||
.PP
|
||||
Att skapa och ta bort ögonblicksbilder kräver administratörsbehörighet.
|
||||
Se till att SnapRAID körs med nödvändiga rättigheter (t.ex. sudo)
|
||||
när ögonblicksbilder är aktiverade.
|
||||
.SS Kommandobeteende med ögonblicksbilder
|
||||
Kommandona \`sync\` och \`scrub\` arbetar båda uteslutande på ögonblicksbilder
|
||||
för att säkerställa att alla dataoperationer utförs mot ett konsekvent,
|
||||
fruset tillstånd. Genom att använda dessa ögonblicksbilder förhindrar SnapRAID paritetsfel
|
||||
som annars skulle utlösas av samtidiga filändringar på det aktiva filsystemet.
|
||||
Under en \`sync\` använder kommandot en ny ögonblicksbild som skapas vid
|
||||
början av processen för att fånga det aktuella tillståndet för paritetsberäkning.
|
||||
I motsats till detta använder kommandot \`scrub\` den senaste ögonblicksbilden, den som
|
||||
skapades under den senaste synkroniseringen, för att upprätthålla en tillförlitlig referenspunkt
|
||||
som matchar den befintliga pariteten.
|
||||
.PP
|
||||
För kommandona \`check\` och \`fix\` beror användningen av den senaste ögonblicksbilden
|
||||
på om specifika diskar är måltavla med alternativet
|
||||
\-d, \-\-filter\-disk.
|
||||
.PP
|
||||
En disk som uttryckligen valts via \-d (operationens \[dq]mål\[dq])
|
||||
använder alltid det aktiva filsystemet. För \`fix\` tillåter detta återställning
|
||||
av data till den aktiva ersättningsdisken. För \`check\` tillåter det att simulera
|
||||
\`fix\`\-operationen under samma förhållanden.
|
||||
.PP
|
||||
Alla andra datadiskar (\[dq]referensdiskarna\[dq]) kommer att nås via
|
||||
sina ögonblicksbilder. Detta säkerställer att även om du ändrar filer
|
||||
på dina friska diskar medan en återställning pågår, har SnapRAID
|
||||
en stabil, frusen referens för att lösa paritetsekvationerna.
|
||||
.PP
|
||||
Om inget \-d\-alternativ anges antar SnapRAID att operationen gäller
|
||||
hela arrayen, i detta fall kommer \`check\` och \`fix\` att använda de
|
||||
aktiva filsystemen uteslutande.
|
||||
.PP
|
||||
Alla andra kommandon fungerar uteslutande på det aktiva filsystemet.
|
||||
.SH LIVSCYKEL FöR öGONBLICKSBILDER (SNAPSHOTS LIFECYCLE)
|
||||
SnapRAID hanterar två specifika ögonblicksbilder, \`stable\` och \`pending\`,
|
||||
inom en dold katalog i roten av varje datavolym.
|
||||
I Btrfs, Bcachefs och NTFS används katalogen \`.snapraid/\`,
|
||||
i ZFS standardkatalogen \`.zfs/snapshot/\`.
|
||||
.PP
|
||||
Ögonblicksbilden \`stable\` representerar tillståndet för den senaste
|
||||
framgångsrikt slutförda \`sync\`\-iseringen, och innehåller exakt den data som användes för
|
||||
att beräkna den aktuella pariteten. Den fungerar som den primära datakällan
|
||||
för kommandona \`scrub\`, \`check\` och \`fix\`.
|
||||
.PP
|
||||
Ögonblicksbilden \`pending\` är en tillfällig bild som skapas i början
|
||||
av en \`sync\` för att tillhandahålla ett fruset tillstånd för paritetsberäkning.
|
||||
Efter framgångsrik slutförande av operationen raderas den föregående \`stable\`
|
||||
ögonblicksbilden, och \`pending\`\-ögonblicksbilden upphöjs till
|
||||
att ta dess plats som den nya stabila referensen.
|
||||
.PP
|
||||
Om en \`sync\` avbryts bevaras ögonblicksbilden \`pending\`.
|
||||
Efterföljande \`scrub\`\-, \`check\`\- och \`fix\`\-kommandon kommer att använda denna
|
||||
vilande ögonblicksbild eftersom den matchar filsystemets tillstånd som registrerats i
|
||||
.content\-filen, även om pariteten endast är delvis synkroniserad.
|
||||
.PP
|
||||
I händelse av ett avbrott i en \`sync\` läser kommandona \`check\` och \`fix\`
|
||||
också från ögonblicksbilden \`stable\` för att hämta datablock
|
||||
från filer som uppdaterades eller togs bort under synkroniseringen.
|
||||
Detta är möjligt eftersom .content\-filen behåller metadata för
|
||||
alla modifierade eller borttagna filer under hela synkroniseringsprocessen.
|
||||
Denna historiska information rensas först när en sync slutförts
|
||||
framgångsrikt och den slutliga versionen av .content\-filen sparats.
|
||||
.PP
|
||||
Om en \`sync\` startas om efter ett avbrott raderas den befintliga
|
||||
vilande (pending) ögonblicksbilden och en ny skapas för att
|
||||
fånga det aktuella tillståndet för det aktiva filsystemet.
|
||||
.SH MöNSTER (PATTERN)
|
||||
Mönster ger ett flexibelt sätt att filtrera filer för inkludering eller
|
||||
exkludering. Genom att använda jokertecken kan du definiera regler som
|
||||
|
|
@ -2009,8 +2178,10 @@ SnapRAID lagrar listan och checksummorna för dina filer i content\-filen.
|
|||
Det är en binär fil som listar alla filer som finns i din disk\-array,
|
||||
tillsammans med alla checksummor för att verifiera deras integritet.
|
||||
.PP
|
||||
Denna fil läses och skrivs av kommandona \`sync\` och \`scrub\` och
|
||||
läses av kommandona \`fix\`, \`check\` och \`status\`.
|
||||
Content\-filen läses och skrivs av kommandona \`sync\`, \`scrub\`, \`touch\`
|
||||
och \`rehash\`. Den läses av kommandona \`status\`, \`diff\`, \`check\`, \`fix\`,
|
||||
\`list\`, \`dup\`, \`locate\` och \`pool\`, och den ignoreras helt av
|
||||
kommandona \`smart\`, \`probe\`, \`up\`, \`down\` och \`devices\`.
|
||||
.SH PARITET (PARITY)
|
||||
SnapRAID lagrar paritetsinformationen för din array i parity\-
|
||||
filerna.
|
||||
|
|
@ -2020,7 +2191,7 @@ block definierade i \`content\`\-filen.
|
|||
.PP
|
||||
Dessa filer läses och skrivs av kommandona \`sync\` och \`fix\` och
|
||||
läses endast av kommandona \`scrub\` och \`check\`.
|
||||
.SH KODNING
|
||||
.SH KODNING (ENCODING)
|
||||
SnapRAID i Unix ignorerar all kodning. Det läser och lagrar
|
||||
filnamnen med samma kodning som används av filsystemet.
|
||||
.PP
|
||||
|
|
@ -2033,7 +2204,25 @@ ett TrueType\-typsnitt som \`Lucida Console\` som konsoltypsnitt.
|
|||
Detta påverkar endast de utskrivna filnamnen; om du
|
||||
omdirigerar konsolutdata till en fil, är den resulterande filen alltid
|
||||
i UTF\-8\-format.
|
||||
.SH SLUTKOD (EXIT CODE)
|
||||
SnapRAID avslutas med följande statuskoder:
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I 0
|
||||
Allt OK.
|
||||
.HP 4
|
||||
.I 1
|
||||
Kommandot stötte på fel.
|
||||
.HP 4
|
||||
.I 2
|
||||
Kommandot \`diff\` fann att allt är OK, men en \`sync\` behövs.
|
||||
.PD
|
||||
.RE
|
||||
.SH ÖVERSäTTNING (TRANSLATION)
|
||||
Detta dokument är en automatisk översättning av den engelska manualen.
|
||||
Se den engelska manualen för den officiella versionen.
|
||||
.SH UPPHOVSRäTT (COPYRIGHT)
|
||||
Denna fil är Copyright (C) 2025 Andrea Mazzoleni
|
||||
.SH SE ÄVEN (SEE ALSO)
|
||||
snapraid_log(1), snapraidd(1)
|
||||
Denna fil är Copyright (C) 2026 Andrea Mazzoleni
|
||||
.SH SE äVEN (SEE ALSO)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ Synopsis
|
|||
|
||||
:snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
Beskrivning
|
||||
Beskrivning (Description)
|
||||
SnapRAID är ett säkerhetskopieringsprogram designat för disk-arrayer,
|
||||
som lagrar paritetsinformation för dataåterställning vid upp till sex
|
||||
diskfel.
|
||||
|
|
@ -51,22 +51,30 @@ Beskrivning
|
|||
|
||||
:https://www.snapraid.it/
|
||||
|
||||
Begränsningar
|
||||
SnapRAID är en hybrid mellan ett RAID- och ett säkerhetskopieringsprogram,
|
||||
som syftar till att kombinera de bästa fördelarna med båda. Den har dock
|
||||
vissa begränsningar som du bör överväga innan du använder den.
|
||||
Begränsningar (Limitations)
|
||||
SnapRAID är en hybrid mellan en RAID och ett backupprogram, med målet att kombinera
|
||||
de bästa fördelarna med båda. Det har dock vissa begränsningar som du bör
|
||||
överväga innan du använder det.
|
||||
|
||||
Huvudbegränsningen är att om en disk misslyckas och du inte nyligen har
|
||||
synkat, kanske du inte kan återställa fullständigt.
|
||||
Mer specifikt, kanske du inte kan återställa upp till storleken på
|
||||
de ändrade eller raderade filerna sedan den senaste synkroniseringsoperationen.
|
||||
Detta inträffar även om de ändrade eller raderade filerna inte finns på
|
||||
den felaktiga disken. Det är därför SnapRAID passar bättre för
|
||||
data som sällan ändras.
|
||||
Den huvudsakliga begränsningen är att om en disk havererar kan du endast återställa data fram till
|
||||
tillståndet för den senaste `sync`-operationen. Data som lagts till eller modifieringar som gjorts
|
||||
sedan den senaste synkroniseringen och som är placerade på den felaktiga disken kommer att gå förlorade.
|
||||
|
||||
Å andra sidan förhindrar nyligen tillagda filer inte återställning av redan
|
||||
befintliga filer. Du kommer bara att förlora de nyligen tillagda filerna om de
|
||||
finns på den felaktiga disken.
|
||||
Följaktligen är SnapRAID främst lämpat för data som sällan ändras.
|
||||
|
||||
För data som redan existerade vid den senaste synkroniseringen beror återställningens tillförlitlighet
|
||||
på om alternativet `snapshot` (ögonblicksbild) används:
|
||||
|
||||
* Med stöd för ögonblicksbilder (tillgängligt på Btrfs, ZFS, Bcachefs och NTFS)
|
||||
kan SnapRAID automatiskt upprätthålla en frusen referens av dina datadiskar.
|
||||
Detta säkerställer att även om du ändrar eller tar bort filer på ditt aktiva filsystem
|
||||
under eller efter en synkronisering, förblir återställningsprocessen konsekvent och tillförlitlig.
|
||||
|
||||
* Utan stöd för ögonblicksbilder kan borttagning eller ändring av filer efter en `sync`
|
||||
förhindra fullständig återställning av andra felaktiga diskar. Detta inträffar
|
||||
eftersom pariteten inte längre matchar de modifierade filerna, även om
|
||||
dessa filer inte finns på den havererade disken. Å andra sidan förhindrar inte nyinkomna
|
||||
filer återställning av redan existerande filer.
|
||||
|
||||
Andra SnapRAID-begränsningar är:
|
||||
|
||||
|
|
@ -82,7 +90,7 @@ Begränsningar
|
|||
* Endast filnamn, tidsstämplar, symboliska länkar och hårda länkar sparas.
|
||||
Behörigheter, ägarskap och utökade attribut sparas inte.
|
||||
|
||||
Kom igång
|
||||
Kom igång (Getting Started)
|
||||
För att använda SnapRAID måste du först välja en disk i din disk-array
|
||||
som ska dediceras till `parity`-information. Med en disk för paritet,
|
||||
kommer du att kunna återställa från ett enda diskfel, liknande RAID5.
|
||||
|
|
@ -202,10 +210,10 @@ Kom igång
|
|||
borttagna eller modifierade filer. Dessa fel rapporteras i `scrub`-
|
||||
utdata, men de relaterade blocken markeras inte som dåliga.
|
||||
|
||||
Poolning
|
||||
Poolning (Pooling)
|
||||
Obs: Poolningsfunktionen som beskrivs nedan har ersatts av verktyget
|
||||
mergerfs, som nu är det rekommenderade alternativet för Linux-användare i
|
||||
SnapRAID-communityt. Mergefs ger ett mer flexibelt och effektivt
|
||||
SnapRAID-communityt. Mergerfs ger ett mer flexibelt och effektivt
|
||||
sätt att poola flera enheter till en enda enhetlig monteringspunkt,
|
||||
vilket möjliggör sömlös åtkomst till filer över din array utan att förlita sig
|
||||
på symboliska länkar. Det integreras väl med SnapRAID för paritetsskydd
|
||||
|
|
@ -279,23 +287,23 @@ Kom igång
|
|||
kan användas för att återställa eller ångra radering av filer till deras tidigare tillstånd
|
||||
med hjälp av alternativet -f, --filter:
|
||||
|
||||
:snapraid fix -f FIL
|
||||
:snapraid fix -f FILE
|
||||
|
||||
eller för en katalog:
|
||||
|
||||
:snapraid fix -f KATALOG/
|
||||
:snapraid fix -f DIR/
|
||||
|
||||
Du kan också använda det för att återställa endast oavsiktligt raderade filer inuti
|
||||
en katalog med hjälp av alternativet -m, --filter-missing, som återställer
|
||||
endast saknade filer, och lämnar alla andra orörda.
|
||||
|
||||
:snapraid fix -m -f KATALOG/
|
||||
:snapraid fix -m -f DIR/
|
||||
|
||||
Eller för att återställa alla raderade filer på alla enheter med:
|
||||
|
||||
:snapraid fix -m
|
||||
|
||||
Återställning
|
||||
Återställning (Recovering)
|
||||
Det värsta har hänt, och du har förlorat en eller flera diskar!
|
||||
|
||||
FÅ INTE PANIK! Du kommer att kunna återställa dem!
|
||||
|
|
@ -329,9 +337,9 @@ Kom igång
|
|||
STEG 2 -> Fixa
|
||||
Kör kommandot fix och lagra loggen i en extern fil med:
|
||||
|
||||
:snapraid -d NAMN -l fix.log fix
|
||||
:snapraid -d NAME -l fix.log fix
|
||||
|
||||
Där NAMN är namnet på disken, till exempel `d1` i vårt tidigare exempel.
|
||||
Där NAME är namnet på disken, till exempel `d1` i vårt tidigare exempel.
|
||||
Om disken som ska återställas är en paritetsdisk, använd namnen `parity`, `2-parity`,
|
||||
etc.
|
||||
Om du har flera felaktiga diskar, använd flera -d-alternativ för att specificera alla
|
||||
|
|
@ -354,21 +362,21 @@ Kom igång
|
|||
|
||||
Om du till exempel har tagit bort filer från arrayen efter den senaste
|
||||
`sync`, kan detta leda till att vissa filer inte återställs.
|
||||
I detta fall kan du försöka igen `fix` med alternativet -i, --import,
|
||||
I detta fall kan du köra `fix` igen med alternativet -i, --import,
|
||||
specificera var dessa filer nu finns för att inkludera dem igen i
|
||||
återställningsprocessen.
|
||||
|
||||
Om du är nöjd med återställningen kan du fortsätta,
|
||||
men notera att efter synkronisering kan du inte försöka igen kommandot `fix`
|
||||
men notera att efter synkronisering kan du inte köra `fix`-kommandot igen
|
||||
längre!
|
||||
|
||||
STEG 3 -> Kontrollera
|
||||
Som en försiktighetsåtgärd kan du nu köra ett `check`-kommando för att säkerställa att
|
||||
allt är korrekt på den återställda disken.
|
||||
|
||||
:snapraid -d NAMN -a check
|
||||
:snapraid -d NAME -a check
|
||||
|
||||
Där NAMN är namnet på disken, till exempel `d1` i vårt tidigare exempel.
|
||||
Där NAME är namnet på disken, till exempel `d1` i vårt tidigare exempel.
|
||||
|
||||
Alternativen -d och -a talar om för SnapRAID att endast kontrollera den specificerade disken
|
||||
och ignorera all paritetsdata.
|
||||
|
|
@ -383,16 +391,16 @@ Kom igång
|
|||
|
||||
Om allt är återställt är detta kommando omedelbart.
|
||||
|
||||
Kommandon
|
||||
SnapRAID tillhandahåller några enkla kommandon som låter dig:
|
||||
Kommandon (Commands)
|
||||
SnapRAID tillhandahåller några enkla kommandon som gör att du kan:
|
||||
|
||||
* Skriva ut statusen för arrayen -> `status`
|
||||
* Skriva ut arrayens status -> `status`
|
||||
* Kontrollera diskarna -> `smart`, `probe`, `up`, `down`
|
||||
* Göra en säkerhetskopia/ögonblicksbild -> `sync`
|
||||
* Skapa en backup-/återställningspunkt -> `sync`
|
||||
* Periodiskt kontrollera data -> `scrub`
|
||||
* Återställa den senaste säkerhetskopian/ögonblicksbilden -> `fix`.
|
||||
* Återställa den senaste backup-/återställningspunkten -> `fix`.
|
||||
|
||||
Kommandon måste skrivas med gemener.
|
||||
Kommandon måste skrivas med gemener (små bokstäver).
|
||||
|
||||
status
|
||||
Skriver ut en sammanfattning av tillståndet för disk-arrayen.
|
||||
|
|
@ -595,15 +603,14 @@ Kommandon
|
|||
Filerna i arrayen modifieras INTE.
|
||||
|
||||
fix
|
||||
Fixar alla filer och paritetsdata.
|
||||
Lagar alla filer och paritetsdata.
|
||||
|
||||
Alla filer och paritetsdata jämförs med ögonblicksbilds-
|
||||
tillståndet som sparades i den senaste `sync`.
|
||||
Om en skillnad hittas, återställs den till det lagrade ögonblicksbildstillståndet.
|
||||
Alla filer och paritetsdata jämförs med det tillstånd som sparades i
|
||||
den senaste `sync`-operationen. Om en skillnad hittas återställs den till det sparade tillståndet.
|
||||
|
||||
VARNING! Kommandot `fix` skiljer inte mellan fel och
|
||||
avsiktliga modifieringar. Det återställer ovillkorligen filtillståndet
|
||||
till den senaste `sync`.
|
||||
VARNING!
|
||||
Kommandot `fix` skiljer inte mellan fel och avsiktliga modifieringar.
|
||||
Det återställer villkorslöst filtillståndet till den senaste `sync`-operationen.
|
||||
|
||||
Om inget annat alternativ specificeras, behandlas hela arrayen.
|
||||
Använd filteralternativen för att välja en delmängd av filer eller diskar att arbeta med.
|
||||
|
|
@ -618,7 +625,7 @@ Kommandon
|
|||
|
||||
Innan fixningen skannas hela arrayen för att hitta alla filer som flyttats
|
||||
sedan den senaste `sync`-operationen.
|
||||
Dessa filer identifieras av deras tidsstämpel, ignorera deras namn
|
||||
Dessa filer identifieras av deras tidsstämpel, oavsett namn
|
||||
och katalog, och används i återställningsprocessen vid behov.
|
||||
Om du flyttade några av dem utanför arrayen kan du använda alternativet -i, --import
|
||||
för att specificera ytterligare kataloger att skanna.
|
||||
|
|
@ -651,7 +658,7 @@ Kommandon
|
|||
Listar alla filer som finns i arrayen vid tidpunkten för den
|
||||
senaste `sync`.
|
||||
|
||||
Med -v eller --verbose visas även undertiden.
|
||||
Med -v eller --verbose visas även subsekundprecisionen.
|
||||
|
||||
Inget ändras.
|
||||
|
||||
|
|
@ -692,16 +699,16 @@ Kommandon
|
|||
Inget ändras.
|
||||
|
||||
touch
|
||||
Anger en godtycklig undertidsstämpel för alla filer
|
||||
Anger en godtycklig tidsstämpel för undersekunder för alla filer
|
||||
som har den satt till noll.
|
||||
|
||||
Detta förbättrar SnapRAIDs förmåga att känna igen flyttade
|
||||
och kopierade filer, eftersom det gör tidsstämpeln nästan unik,
|
||||
vilket minskar möjliga dubbletter.
|
||||
|
||||
Mer specifikt, om undertidsstämpeln inte är noll,
|
||||
Mer specifikt, om tidsstämpeln för undersekunder inte är noll,
|
||||
identifieras en flyttad eller kopierad fil som sådan om den matchar
|
||||
namn, storlek och tidsstämpel. Om undertidsstämpeln
|
||||
namn, storlek och tidsstämpel. Om tidsstämpeln för undersekunder
|
||||
är noll, betraktas den som en kopia endast om hela sökvägen,
|
||||
storlek och tidsstämpel alla matchar.
|
||||
|
||||
|
|
@ -739,7 +746,7 @@ Kommandon
|
|||
Var medveten om att sådana filer inte skyddas av paritet under
|
||||
omallokeringsprocessen.
|
||||
|
||||
Alternativ
|
||||
Alternativ (Options)
|
||||
SnapRAID tillhandahåller följande alternativ:
|
||||
|
||||
-c, --conf CONFIG
|
||||
|
|
@ -753,7 +760,7 @@ Alternativ
|
|||
Filtrerar filerna att behandla i `check` och `fix`.
|
||||
Endast filerna som matchar det specificerade mönstret behandlas.
|
||||
Detta alternativ kan användas flera gånger.
|
||||
Se avsnittet MÖNSTER för mer information om
|
||||
Se avsnittet PATTERN för mer information om
|
||||
mönsterspecifikationer.
|
||||
I Unix, se till att globbing-tecken citeras om de används.
|
||||
Detta alternativ kan endast användas med `check` och `fix`.
|
||||
|
|
@ -851,7 +858,7 @@ Alternativ
|
|||
antalet byte per sekund. Du kan specificera en multiplikator
|
||||
som K, M eller G (t.ex. --bw-limit 1G).
|
||||
|
||||
-t, --tail STORLEK
|
||||
-t, --tail SIZE
|
||||
Begränsa fillistan till de som inte använder mer än den angivna
|
||||
slutstorleken på paritetsdiskarna.
|
||||
Du kan använda multiplikatorer som K, M, G eller T (t.ex. --tail 1G).
|
||||
|
|
@ -913,7 +920,7 @@ Alternativ
|
|||
-D, --force-device
|
||||
Tvingar den osäkra operationen att fixa med otillgängliga diskar
|
||||
eller med diskar på samma fysiska enhet.
|
||||
Till exempel, om du förlorade två datadisker och har en reservdisk för att återställa
|
||||
Till exempel, om du förlorade två datadiskar och har en reservdisk för att återställa
|
||||
endast den första, kan du ignorera den andra otillgängliga disken.
|
||||
Eller, om du vill återställa en disk i det lediga utrymme som finns kvar på en
|
||||
redan använd disk, dela samma fysiska enhet.
|
||||
|
|
@ -952,9 +959,9 @@ Alternativ
|
|||
starkt att inte använda det.
|
||||
Du HAR INGET dataskydd under `sync`-operationen.
|
||||
|
||||
-W, --force-realloc-tail STORLEK
|
||||
-W, --force-realloc-tail SIZE
|
||||
Fungerar som -R, --force-realloc, men begränsat till den angivna
|
||||
slutdelen (de sista STORLEK byten) av varje paritetsfil.
|
||||
slutdelen (de sista SIZE byten) av varje paritetsfil.
|
||||
Den tvingar omallokering (flytt) av alla filfragment/block som för
|
||||
närvarande lagras i den slutsektionen, vilket gör att de kan placeras
|
||||
var som helst i paritetsfilen/filerna där ledigt utrymme finns
|
||||
|
|
@ -1001,7 +1008,7 @@ Alternativ
|
|||
|
||||
-S, --start BLKSTART
|
||||
Börjar behandlingen från det specificerade
|
||||
blocknumret. Detta kan vara användbart för att försöka igen att kontrollera
|
||||
blocknumret. Detta kan vara användbart för att på nytt försöka kontrollera
|
||||
eller fixa specifika block i händelse av en skadad disk.
|
||||
Detta alternativ är främst för avancerad manuell återställning.
|
||||
|
||||
|
|
@ -1038,7 +1045,7 @@ Alternativ
|
|||
-V, --version
|
||||
Skriver ut programversionen.
|
||||
|
||||
Konfiguration
|
||||
Konfiguration (Configuration)
|
||||
SnapRAID kräver en konfigurationsfil för att veta var din disk-array
|
||||
finns och var paritetsinformationen ska lagras.
|
||||
|
||||
|
|
@ -1049,7 +1056,7 @@ Konfiguration
|
|||
|
||||
Den måste innehålla följande alternativ (skiftlägeskänsligt):
|
||||
|
||||
parity FIL [,FIL] ...
|
||||
parity FILE [,FILE] ...
|
||||
Definierar de filer som ska användas för att lagra paritetsinformationen.
|
||||
Pariteten möjliggör skydd från ett enda disk-
|
||||
fel, liknande RAID5.
|
||||
|
|
@ -1070,7 +1077,7 @@ Konfiguration
|
|||
|
||||
Detta alternativ är obligatoriskt och kan endast användas en gång.
|
||||
|
||||
(2,3,4,5,6)-parity FIL [,FIL] ...
|
||||
(2,3,4,5,6)-parity FILE [,FILE] ...
|
||||
Definierar de filer som ska användas för att lagra extra paritetsinformation.
|
||||
|
||||
För varje paritetsnivå som specificeras aktiveras en ytterligare skyddsnivå:
|
||||
|
|
@ -1088,7 +1095,7 @@ Konfiguration
|
|||
|
||||
Dessa alternativ är valfria och kan endast användas en gång.
|
||||
|
||||
z-parity FIL [,FIL] ...
|
||||
z-parity FILE [,FILE] ...
|
||||
Definierar en alternativ fil och ett format för att lagra trippel paritet.
|
||||
|
||||
Detta alternativ är ett alternativ till `3-parity`, främst avsett för
|
||||
|
|
@ -1106,7 +1113,7 @@ Konfiguration
|
|||
konfigurationsfilen med önskad z-parity eller 3-parity fil
|
||||
och använda `fix` för att återskapa den.
|
||||
|
||||
content FIL
|
||||
content FILE
|
||||
Definierar den fil som ska användas för att lagra listan och checksummorna för alla
|
||||
filer som finns i din disk-array.
|
||||
|
||||
|
|
@ -1121,18 +1128,18 @@ Konfiguration
|
|||
Du måste lagra minst en kopia för varje paritetsdisk som används
|
||||
plus en. Att använda ytterligare kopior skadar inte.
|
||||
|
||||
data NAMN KATALOG
|
||||
data NAME DIR
|
||||
Definierar namnet och monteringspunkten för datadiskarna i
|
||||
arrayen. NAMN används för att identifiera disken och måste
|
||||
vara unikt. KATALOG är monteringspunkten för disken i
|
||||
arrayen. NAME används för att identifiera disken och måste
|
||||
vara unikt. DIR är monteringspunkten för disken i
|
||||
filsystemet.
|
||||
|
||||
Du kan ändra monteringspunkten vid behov, så länge
|
||||
du behåller NAMN fixerat.
|
||||
du behåller NAME fixerat.
|
||||
|
||||
Du bör använda ett alternativ för varje datadisk i arrayen.
|
||||
|
||||
Du kan byta namn på en disk senare genom att ändra NAMN direkt
|
||||
Du kan byta namn på en disk senare genom att ändra NAME direkt
|
||||
i konfigurationsfilen och sedan köra ett `sync`-kommando.
|
||||
I händelse av namnbyte görs associationen med hjälp av den lagrade
|
||||
UUID:n för diskarna.
|
||||
|
|
@ -1148,12 +1155,36 @@ Konfiguration
|
|||
Observera att sådana diskar inte påverkas av kommandona `up` och
|
||||
`down` eftersom de förväntas alltid snurra.
|
||||
|
||||
snapshot
|
||||
Aktiverar användningen av filsystemets ögonblicksbilder för kommandona `sync`, `scrub`,
|
||||
`check` och `fix`.
|
||||
|
||||
När det är aktiverat skapar SnapRAID en skrivskyddad ögonblicksbild av dina data vid
|
||||
början av en 'sync'. Detta säkerställer en konsekvent tidpunktsvy av dina
|
||||
filer, vilket förhindrar fel som orsakas av samtidiga filändringar.
|
||||
|
||||
Detta förbättrar återställningen avsevärt: om en fil tas bort från det aktiva filsystemet
|
||||
förblir den bevarad i ögonblicksbilden. Detta förhindrar att pariteten blir "trasig"
|
||||
för det blocket, vilket säkerställer att du fortfarande kan återställa data framgångsrikt
|
||||
om en annan disk havererar.
|
||||
|
||||
Detta alternativ gäller uteslutande datadiskar formaterade med filsystemen
|
||||
Btrfs, Bcachefs eller ZFS i Linux och NTFS i Windows.
|
||||
Paritetsdiskar, eller datadiskar som använder andra filsystem, kommer alltid att använda
|
||||
den aktiva versionen av filsystemet.
|
||||
|
||||
Att skapa och ta bort ögonblicksbilder kräver administratörsbehörighet.
|
||||
Se till att SnapRAID körs med nödvändiga rättigheter (t.ex. sudo) när
|
||||
detta alternativ är aktiverat.
|
||||
|
||||
Se avsnittet SNAPSHOTS för en detaljerad förklaring av ögonblicksbildens livscykel.
|
||||
|
||||
nohidden
|
||||
Exkluderar alla dolda filer och kataloger.
|
||||
I Unix är dolda filer de som börjar med `.`.
|
||||
I Windows är de de med det dolda attributet.
|
||||
|
||||
exclude/include MÖNSTER
|
||||
exclude/include PATTERN
|
||||
Definierar fil- eller katalogmönstren att exkludera eller inkludera
|
||||
i sync-processen.
|
||||
Alla mönster behandlas i den specificerade ordningen.
|
||||
|
|
@ -1164,12 +1195,12 @@ Konfiguration
|
|||
som specificerats är ett `include`-mönster, eller inkluderas om det sista mönstret
|
||||
som specificerats är ett `exclude`-mönster.
|
||||
|
||||
Se avsnittet MÖNSTER för mer information om mönster-
|
||||
Se avsnittet PATTERN för mer information om mönster-
|
||||
specifikationer.
|
||||
|
||||
Detta alternativ kan användas flera gånger.
|
||||
|
||||
blocksize STORLEK_I_KIBIBYTES
|
||||
blocksize SIZE_IN_KIBIBYTES
|
||||
Definierar den grundläggande blockstorleken i kibibytes för pariteten.
|
||||
En kibibyte är 1024 byte.
|
||||
|
||||
|
|
@ -1215,7 +1246,7 @@ Konfiguration
|
|||
en 4 TB-disk, vilket möjliggör cirka 460 000 filer på varje datadisk utan
|
||||
något bortkastat utrymme.
|
||||
|
||||
hashsize STORLEK_I_BYTE
|
||||
hashsize SIZE_IN_BYTES
|
||||
Definierar hash-storleken i byte för de sparade blocken.
|
||||
|
||||
Standard hash-storlek är 16 byte (128 bitar), vilket bör fungera
|
||||
|
|
@ -1251,13 +1282,13 @@ Konfiguration
|
|||
|
||||
:RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0,51 GiB
|
||||
|
||||
autosave STORLEK_I_GIGABYTES
|
||||
autosave SIZE_IN_GIGABYTES
|
||||
Sparar automatiskt tillståndet vid synkronisering eller skrubbning efter att den
|
||||
specificerade mängden GB har behandlats.
|
||||
Detta alternativ är användbart för att undvika att starta om långa `sync`-
|
||||
kommandon från början om de avbryts av en maskinkrasch eller någon annan händelse.
|
||||
|
||||
temp_limit TEMPERATUR_CELSIUS
|
||||
temp_limit TEMPERATURE_CELSIUS
|
||||
Anger den maximalt tillåtna disk-temperaturen i Celsius. När den specificeras,
|
||||
kontrollerar SnapRAID periodiskt temperaturen på alla diskar med hjälp av
|
||||
verktyget smartctl. De aktuella disk-temperaturerna visas medan
|
||||
|
|
@ -1272,32 +1303,32 @@ Konfiguration
|
|||
nå om aktiviteten fortsätter. Uppskattningen utförs först efter att
|
||||
disk-temperaturen har ökat fyra gånger, vilket säkerställer att tillräckligt med
|
||||
datapoäng finns tillgängliga för att fastställa en pålitlig trend.
|
||||
Denna förutsagda stabila temperatur visas inom parentes bredvid den
|
||||
Denna förutsagda stabila temperatur visas inom parentes bredvid det
|
||||
aktuella värdet och hjälper till att bedöma om systemets kylning är
|
||||
tillräcklig. Denna uppskattade temperatur är endast för informationssyfte
|
||||
och har ingen effekt på SnapRAIDs beteende. Programmens
|
||||
och har ingen effekt på SnapRAIDs beteende. Programmets
|
||||
åtgärder baseras enbart på de faktiska uppmätta disk-temperaturerna.
|
||||
|
||||
För att utföra denna analys behöver SnapRAID en referens för system-
|
||||
temperaturen. Det försöker först läsa den från tillgängliga hårdvaru-
|
||||
sensorer. Om ingen system-sensor kan nås, används den lägsta disk-
|
||||
temperaturen som mättes vid start av körningen som en reservreferens.
|
||||
För att utföra denna analys behöver SnapRAID en referens för systemtemperaturen.
|
||||
Det försöker först läsa den från tillgängliga hårdvarusensorer.
|
||||
Om ingen systemsensor kan nås, används den lägsta disk-
|
||||
temperaturen som mättes i början av körningen som en reservreferens.
|
||||
|
||||
Normalt visar SnapRAID endast temperaturen på den hetaste disken.
|
||||
För att visa temperaturen på alla diskar, använd alternativet -A eller --stats.
|
||||
|
||||
temp_sleep TID_I_MINUTER
|
||||
temp_sleep TIME_IN_MINUTES
|
||||
Anger standby-tiden, i minuter, när temperaturgränsen har
|
||||
nåtts. Under denna period förblir diskarna nedsnurrade. Standard
|
||||
är 5 minuter.
|
||||
|
||||
pool KATALOG
|
||||
pool DIR
|
||||
Definierar poolningskatalogen där den virtuella vyn av disk-
|
||||
arrayen skapas med hjälp av kommandot `pool`.
|
||||
|
||||
Katalogen måste redan existera.
|
||||
|
||||
share UNC_KATALOG
|
||||
share UNC_DIR
|
||||
Definierar Windows UNC-sökvägen som krävs för att få åtkomst till diskarna på distans.
|
||||
|
||||
Om detta alternativ specificeras, använder de symboliska länkarna som skapats i pool-
|
||||
|
|
@ -1311,7 +1342,7 @@ Konfiguration
|
|||
|
||||
Detta alternativ krävs endast för Windows.
|
||||
|
||||
smartctl DISK/PARITY ALTERNATIV...
|
||||
smartctl DISK/PARITY OPTIONS...
|
||||
Definierar anpassade smartctl-alternativ för att få SMART-attributen för
|
||||
varje disk. Detta kan krävas för RAID-kontroller och vissa USB-
|
||||
diskar som inte kan upptäckas automatiskt. Platsinnehavaren %s ersätts av
|
||||
|
|
@ -1325,6 +1356,9 @@ Konfiguration
|
|||
enhetens namn. För RAID-kontroller är enheten
|
||||
sannolikt fixerad, och du kanske inte behöver använda `%s`.
|
||||
|
||||
Du kan också specificera en anpassad sträng för informationsalternativ med
|
||||
hjälp av taggen `[info: ...]` för att ersätta standardalternativet `-a`.
|
||||
|
||||
Se smartmontools dokumentation för möjliga alternativ:
|
||||
|
||||
:https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
|
|
@ -1332,6 +1366,7 @@ Konfiguration
|
|||
|
||||
Till exempel:
|
||||
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl parity -d sat %s
|
||||
|
||||
smartignore DISK/PARITY ATTR [ATTR...]
|
||||
|
|
@ -1344,14 +1379,19 @@ Konfiguration
|
|||
`4-parity`, `5-parity`, `6-parity` eller `z-parity`.
|
||||
Det speciella värdet * kan användas för att ignorera attributet på alla diskar.
|
||||
|
||||
Till exempel, för att ignorera attributet `Current Pending Sector Count` på
|
||||
alla diskar:
|
||||
Flera attribut kan specificeras separerade med mellanslag.
|
||||
Varje attribut kan specificeras som ett nummer från 1 till 255, eller som ett
|
||||
skiftlägesokänsligt namn (t.ex. `Current_Pending_Sector`).
|
||||
|
||||
:smartignore * 197
|
||||
Till exempel, för att ignorera attributen `Current Pending Sector Count` och
|
||||
`Reallocated Sectors Count` på alla diskar med deras nummer eller namn:
|
||||
|
||||
För att ignorera det endast på den första paritetsdisken:
|
||||
:smartignore * 197 5
|
||||
:smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
:smartignore parity 197
|
||||
För att ignorera dem endast på den första paritetsdisken:
|
||||
|
||||
:smartignore parity 197 5
|
||||
|
||||
Exempel
|
||||
Ett exempel på en typisk konfiguration för Unix är:
|
||||
|
|
@ -1364,7 +1404,7 @@ Konfiguration
|
|||
:data d3 /mnt/disk3/
|
||||
:exclude /lost+found/
|
||||
:exclude /tmp/
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/sg0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1380,11 +1420,121 @@ Konfiguration
|
|||
:exclude Thumbs.db
|
||||
:exclude \$RECYCLE.BIN
|
||||
:exclude \System Volume Information
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
Ögonblicksbilder (Snapshots)
|
||||
Om alternativet för ögonblicksbilder är aktiverat i konfigurationen använder SnapRAID
|
||||
filsystemets funktionalitet för ögonblicksbilder för att säkerställa atomära och
|
||||
konsekventa operationer.
|
||||
|
||||
Hanteringen av ögonblicksbilder är helt automatisk och transparent.
|
||||
Du kan fortsätta att använda SnapRAID exakt som tidigare, med det
|
||||
ytterligare skydd som ögonblicksbilder ger, helt hanterat i
|
||||
bakgrunden.
|
||||
|
||||
Detta ger två huvudsakliga fördelar:
|
||||
|
||||
Konsistens - Filer som ändras på det aktiva filsystemet under en långvarig
|
||||
sync eller scrub kommer inte att orsaka paritetsfel eller avbrutna
|
||||
operationer, eftersom SnapRAID ser en frusen tidpunktsbild.
|
||||
Återställning - Om en fil uppdateras eller tas bort från det aktiva filsystemet
|
||||
förblir den bevarad i ögonblicksbilden. Om ett diskhaveri inträffar
|
||||
innan nästa sync körs, använder SnapRAID den data som bevarats
|
||||
i ögonblicksbilden för att rekonstruera den felaktiga disken.
|
||||
|
||||
I händelse av ett diskhaveri under en aktiv synkroniseringsprocess
|
||||
kan SnapRAID också läsa automatiskt från både ögonblicksbilden
|
||||
av den föregående paritetsberäkningen och den aktuella.
|
||||
Detta maximerar sannolikheten för en fullständig återställning genom att
|
||||
ge tillgång till de exakta datablock som krävs för att lösa paritetsekvationerna,
|
||||
även om dessa block modifierades eller togs bort mellan synkroniseringar.
|
||||
|
||||
Utan ögonblicksbilder leder en uppdaterad eller borttagen fil på en frisk disk
|
||||
till saknade datablock som kan krävas för att laga andra felaktiga diskar.
|
||||
|
||||
Ögonblicksbilder skapas endast för datadiskar och endast om det underliggande
|
||||
filsystemet stöder denna funktionalitet. Paritetsdiskar använder alltid
|
||||
det aktiva filsystemet.
|
||||
|
||||
För närvarande stöds detta på Btrfs, Bcachefs och ZFS i Linux
|
||||
och på NTFS i Windows.
|
||||
|
||||
Du kan blanda datadiskar med olika filsystem. Endast de som
|
||||
stöder ögonblicksbilder kommer att använda dem, medan andra diskar kommer att fortsätta
|
||||
att fungera direkt på det aktiva filsystemet.
|
||||
|
||||
Att skapa och ta bort ögonblicksbilder kräver administratörsbehörighet.
|
||||
Se till att SnapRAID körs med nödvändiga rättigheter (t.ex. sudo)
|
||||
när ögonblicksbilder är aktiverade.
|
||||
|
||||
Kommandobeteende med ögonblicksbilder
|
||||
Kommandona `sync` och `scrub` arbetar båda uteslutande på ögonblicksbilder
|
||||
för att säkerställa att alla dataoperationer utförs mot ett konsekvent,
|
||||
fruset tillstånd. Genom att använda dessa ögonblicksbilder förhindrar SnapRAID paritetsfel
|
||||
som annars skulle utlösas av samtidiga filändringar på det aktiva filsystemet.
|
||||
Under en `sync` använder kommandot en ny ögonblicksbild som skapas vid
|
||||
början av processen för att fånga det aktuella tillståndet för paritetsberäkning.
|
||||
I motsats till detta använder kommandot `scrub` den senaste ögonblicksbilden, den som
|
||||
skapades under den senaste synkroniseringen, för att upprätthålla en tillförlitlig referenspunkt
|
||||
som matchar den befintliga pariteten.
|
||||
|
||||
För kommandona `check` och `fix` beror användningen av den senaste ögonblicksbilden
|
||||
på om specifika diskar är måltavla med alternativet
|
||||
-d, --filter-disk.
|
||||
|
||||
En disk som uttryckligen valts via -d (operationens "mål")
|
||||
använder alltid det aktiva filsystemet. För `fix` tillåter detta återställning
|
||||
av data till den aktiva ersättningsdisken. För `check` tillåter det att simulera
|
||||
`fix`-operationen under samma förhållanden.
|
||||
|
||||
Alla andra datadiskar ("referensdiskarna") kommer att nås via
|
||||
sina ögonblicksbilder. Detta säkerställer att även om du ändrar filer
|
||||
på dina friska diskar medan en återställning pågår, har SnapRAID
|
||||
en stabil, frusen referens för att lösa paritetsekvationerna.
|
||||
|
||||
Om inget -d-alternativ anges antar SnapRAID att operationen gäller
|
||||
hela arrayen, i detta fall kommer `check` och `fix` att använda de
|
||||
aktiva filsystemen uteslutande.
|
||||
|
||||
Alla andra kommandon fungerar uteslutande på det aktiva filsystemet.
|
||||
|
||||
Livscykel för ögonblicksbilder (Snapshots Lifecycle)
|
||||
SnapRAID hanterar två specifika ögonblicksbilder, `stable` och `pending`,
|
||||
inom en dold katalog i roten av varje datavolym.
|
||||
I Btrfs, Bcachefs och NTFS används katalogen `.snapraid/`,
|
||||
i ZFS standardkatalogen `.zfs/snapshot/`.
|
||||
|
||||
Ögonblicksbilden `stable` representerar tillståndet för den senaste
|
||||
framgångsrikt slutförda `sync`-iseringen, och innehåller exakt den data som användes för
|
||||
att beräkna den aktuella pariteten. Den fungerar som den primära datakällan
|
||||
för kommandona `scrub`, `check` och `fix`.
|
||||
|
||||
Ögonblicksbilden `pending` är en tillfällig bild som skapas i början
|
||||
av en `sync` för att tillhandahålla ett fruset tillstånd för paritetsberäkning.
|
||||
Efter framgångsrik slutförande av operationen raderas den föregående `stable`
|
||||
ögonblicksbilden, och `pending`-ögonblicksbilden upphöjs till
|
||||
att ta dess plats som den nya stabila referensen.
|
||||
|
||||
Om en `sync` avbryts bevaras ögonblicksbilden `pending`.
|
||||
Efterföljande `scrub`-, `check`- och `fix`-kommandon kommer att använda denna
|
||||
vilande ögonblicksbild eftersom den matchar filsystemets tillstånd som registrerats i
|
||||
.content-filen, även om pariteten endast är delvis synkroniserad.
|
||||
|
||||
I händelse av ett avbrott i en `sync` läser kommandona `check` och `fix`
|
||||
också från ögonblicksbilden `stable` för att hämta datablock
|
||||
från filer som uppdaterades eller togs bort under synkroniseringen.
|
||||
Detta är möjligt eftersom .content-filen behåller metadata för
|
||||
alla modifierade eller borttagna filer under hela synkroniseringsprocessen.
|
||||
Denna historiska information rensas först när en sync slutförts
|
||||
framgångsrikt och den slutliga versionen av .content-filen sparats.
|
||||
|
||||
Om en `sync` startas om efter ett avbrott raderas den befintliga
|
||||
vilande (pending) ögonblicksbilden och en ny skapas för att
|
||||
fånga det aktuella tillståndet för det aktiva filsystemet.
|
||||
|
||||
Mönster (Pattern)
|
||||
Mönster ger ett flexibelt sätt att filtrera filer för inkludering eller
|
||||
exkludering. Genom att använda jokertecken kan du definiera regler som
|
||||
|
|
@ -1549,8 +1699,10 @@ Innehåll (Content)
|
|||
Det är en binär fil som listar alla filer som finns i din disk-array,
|
||||
tillsammans med alla checksummor för att verifiera deras integritet.
|
||||
|
||||
Denna fil läses och skrivs av kommandona `sync` och `scrub` och
|
||||
läses av kommandona `fix`, `check` och `status`.
|
||||
Content-filen läses och skrivs av kommandona `sync`, `scrub`, `touch`
|
||||
och `rehash`. Den läses av kommandona `status`, `diff`, `check`, `fix`,
|
||||
`list`, `dup`, `locate` och `pool`, och den ignoreras helt av
|
||||
kommandona `smart`, `probe`, `up`, `down` och `devices`.
|
||||
|
||||
Paritet (Parity)
|
||||
SnapRAID lagrar paritetsinformationen för din array i parity-
|
||||
|
|
@ -1562,7 +1714,7 @@ Paritet (Parity)
|
|||
Dessa filer läses och skrivs av kommandona `sync` och `fix` och
|
||||
läses endast av kommandona `scrub` och `check`.
|
||||
|
||||
Kodning
|
||||
Kodning (Encoding)
|
||||
SnapRAID i Unix ignorerar all kodning. Det läser och lagrar
|
||||
filnamnen med samma kodning som används av filsystemet.
|
||||
|
||||
|
|
@ -1576,8 +1728,19 @@ Kodning
|
|||
omdirigerar konsolutdata till en fil, är den resulterande filen alltid
|
||||
i UTF-8-format.
|
||||
|
||||
Upphovsrätt (Copyright)
|
||||
Denna fil är Copyright (C) 2025 Andrea Mazzoleni
|
||||
Slutkod (Exit Code)
|
||||
SnapRAID avslutas med följande statuskoder:
|
||||
|
||||
Se Även (See Also)
|
||||
snapraid_log(1), snapraidd(1)
|
||||
0 - Allt OK.
|
||||
1 - Kommandot stötte på fel.
|
||||
2 - Kommandot `diff` fann att allt är OK, men en `sync` behövs.
|
||||
|
||||
Översättning (Translation)
|
||||
Detta dokument är en automatisk översättning av den engelska manualen.
|
||||
Se den engelska manualen för den officiella versionen.
|
||||
|
||||
Upphovsrätt (Copyright)
|
||||
Denna fil är Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
Se även (See Also)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ snapraid [-c, --conf CONFIG]
|
|||
snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
|
||||
2 BESKRIVNING
|
||||
=============
|
||||
2 BESKRIVNING (DESCRIPTION)
|
||||
===========================
|
||||
|
||||
SnapRAID är ett säkerhetskopieringsprogram designat för disk-arrayer,
|
||||
som lagrar paritetsinformation för dataåterställning vid upp till sex
|
||||
|
|
@ -59,24 +59,32 @@ För mer information, besök den officiella SnapRAID-webbplatsen:
|
|||
https://www.snapraid.it/
|
||||
|
||||
|
||||
3 BEGRäNSNINGAR
|
||||
===============
|
||||
3 BEGRäNSNINGAR (LIMITATIONS)
|
||||
=============================
|
||||
|
||||
SnapRAID är en hybrid mellan ett RAID- och ett säkerhetskopieringsprogram,
|
||||
som syftar till att kombinera de bästa fördelarna med båda. Den har dock
|
||||
vissa begränsningar som du bör överväga innan du använder den.
|
||||
SnapRAID är en hybrid mellan en RAID och ett backupprogram, med målet att kombinera
|
||||
de bästa fördelarna med båda. Det har dock vissa begränsningar som du bör
|
||||
överväga innan du använder det.
|
||||
|
||||
Huvudbegränsningen är att om en disk misslyckas och du inte nyligen har
|
||||
synkat, kanske du inte kan återställa fullständigt.
|
||||
Mer specifikt, kanske du inte kan återställa upp till storleken på
|
||||
de ändrade eller raderade filerna sedan den senaste synkroniseringsoperationen.
|
||||
Detta inträffar även om de ändrade eller raderade filerna inte finns på
|
||||
den felaktiga disken. Det är därför SnapRAID passar bättre för
|
||||
data som sällan ändras.
|
||||
Den huvudsakliga begränsningen är att om en disk havererar kan du endast återställa data fram till
|
||||
tillståndet för den senaste `sync`-operationen. Data som lagts till eller modifieringar som gjorts
|
||||
sedan den senaste synkroniseringen och som är placerade på den felaktiga disken kommer att gå förlorade.
|
||||
|
||||
Å andra sidan förhindrar nyligen tillagda filer inte återställning av redan
|
||||
befintliga filer. Du kommer bara att förlora de nyligen tillagda filerna om de
|
||||
finns på den felaktiga disken.
|
||||
Följaktligen är SnapRAID främst lämpat för data som sällan ändras.
|
||||
|
||||
För data som redan existerade vid den senaste synkroniseringen beror återställningens tillförlitlighet
|
||||
på om alternativet `snapshot` (ögonblicksbild) används:
|
||||
|
||||
* Med stöd för ögonblicksbilder (tillgängligt på Btrfs, ZFS, Bcachefs och NTFS)
|
||||
kan SnapRAID automatiskt upprätthålla en frusen referens av dina datadiskar.
|
||||
Detta säkerställer att även om du ändrar eller tar bort filer på ditt aktiva filsystem
|
||||
under eller efter en synkronisering, förblir återställningsprocessen konsekvent och tillförlitlig.
|
||||
|
||||
* Utan stöd för ögonblicksbilder kan borttagning eller ändring av filer efter en `sync`
|
||||
förhindra fullständig återställning av andra felaktiga diskar. Detta inträffar
|
||||
eftersom pariteten inte längre matchar de modifierade filerna, även om
|
||||
dessa filer inte finns på den havererade disken. Å andra sidan förhindrar inte nyinkomna
|
||||
filer återställning av redan existerande filer.
|
||||
|
||||
Andra SnapRAID-begränsningar är:
|
||||
|
||||
|
|
@ -93,8 +101,8 @@ Andra SnapRAID-begränsningar är:
|
|||
Behörigheter, ägarskap och utökade attribut sparas inte.
|
||||
|
||||
|
||||
4 KOM IGåNG
|
||||
===========
|
||||
4 KOM IGåNG (GETTING STARTED)
|
||||
=============================
|
||||
|
||||
För att använda SnapRAID måste du först välja en disk i din disk-array
|
||||
som ska dediceras till `parity`-information. Med en disk för paritet,
|
||||
|
|
@ -217,12 +225,12 @@ Att köra `scrub` på en osynkad array kan rapportera fel orsakade av
|
|||
borttagna eller modifierade filer. Dessa fel rapporteras i `scrub`-
|
||||
utdata, men de relaterade blocken markeras inte som dåliga.
|
||||
|
||||
4.2 Poolning
|
||||
------------
|
||||
4.2 Poolning (Pooling)
|
||||
----------------------
|
||||
|
||||
Obs: Poolningsfunktionen som beskrivs nedan har ersatts av verktyget
|
||||
mergerfs, som nu är det rekommenderade alternativet för Linux-användare i
|
||||
SnapRAID-communityt. Mergefs ger ett mer flexibelt och effektivt
|
||||
SnapRAID-communityt. Mergerfs ger ett mer flexibelt och effektivt
|
||||
sätt att poola flera enheter till en enda enhetlig monteringspunkt,
|
||||
vilket möjliggör sömlös åtkomst till filer över din array utan att förlita sig
|
||||
på symboliska länkar. Det integreras väl med SnapRAID för paritetsskydd
|
||||
|
|
@ -298,24 +306,24 @@ SnapRAID fungerar mer som ett säkerhetskopieringsprogram än ett RAID-system, o
|
|||
kan användas för att återställa eller ångra radering av filer till deras tidigare tillstånd
|
||||
med hjälp av alternativet -f, --filter:
|
||||
|
||||
snapraid fix -f FIL
|
||||
snapraid fix -f FILE
|
||||
|
||||
eller för en katalog:
|
||||
|
||||
snapraid fix -f KATALOG/
|
||||
snapraid fix -f DIR/
|
||||
|
||||
Du kan också använda det för att återställa endast oavsiktligt raderade filer inuti
|
||||
en katalog med hjälp av alternativet -m, --filter-missing, som återställer
|
||||
endast saknade filer, och lämnar alla andra orörda.
|
||||
|
||||
snapraid fix -m -f KATALOG/
|
||||
snapraid fix -m -f DIR/
|
||||
|
||||
Eller för att återställa alla raderade filer på alla enheter med:
|
||||
|
||||
snapraid fix -m
|
||||
|
||||
4.4 Återställning
|
||||
-----------------
|
||||
4.4 Återställning (Recovering)
|
||||
------------------------------
|
||||
|
||||
Det värsta har hänt, och du har förlorat en eller flera diskar!
|
||||
|
||||
|
|
@ -350,9 +358,9 @@ Om du har flera felaktiga diskar, uppdatera alla deras konfigurationsalternativ.
|
|||
---- 4.4.2 STEG 2 -> Fixa ----
|
||||
Kör kommandot fix och lagra loggen i en extern fil med:
|
||||
|
||||
snapraid -d NAMN -l fix.log fix
|
||||
snapraid -d NAME -l fix.log fix
|
||||
|
||||
Där NAMN är namnet på disken, till exempel `d1` i vårt tidigare exempel.
|
||||
Där NAME är namnet på disken, till exempel `d1` i vårt tidigare exempel.
|
||||
Om disken som ska återställas är en paritetsdisk, använd namnen `parity`, `2-parity`,
|
||||
etc.
|
||||
Om du har flera felaktiga diskar, använd flera -d-alternativ för att specificera alla
|
||||
|
|
@ -375,21 +383,21 @@ gånger du vill.
|
|||
|
||||
Om du till exempel har tagit bort filer från arrayen efter den senaste
|
||||
`sync`, kan detta leda till att vissa filer inte återställs.
|
||||
I detta fall kan du försöka igen `fix` med alternativet -i, --import,
|
||||
I detta fall kan du köra `fix` igen med alternativet -i, --import,
|
||||
specificera var dessa filer nu finns för att inkludera dem igen i
|
||||
återställningsprocessen.
|
||||
|
||||
Om du är nöjd med återställningen kan du fortsätta,
|
||||
men notera att efter synkronisering kan du inte försöka igen kommandot `fix`
|
||||
men notera att efter synkronisering kan du inte köra `fix`-kommandot igen
|
||||
längre!
|
||||
|
||||
---- 4.4.3 STEG 3 -> Kontrollera ----
|
||||
Som en försiktighetsåtgärd kan du nu köra ett `check`-kommando för att säkerställa att
|
||||
allt är korrekt på den återställda disken.
|
||||
|
||||
snapraid -d NAMN -a check
|
||||
snapraid -d NAME -a check
|
||||
|
||||
Där NAMN är namnet på disken, till exempel `d1` i vårt tidigare exempel.
|
||||
Där NAME är namnet på disken, till exempel `d1` i vårt tidigare exempel.
|
||||
|
||||
Alternativen -d och -a talar om för SnapRAID att endast kontrollera den specificerade disken
|
||||
och ignorera all paritetsdata.
|
||||
|
|
@ -405,18 +413,18 @@ Kör kommandot `sync` för att synkronisera arrayen igen med den nya disken.
|
|||
Om allt är återställt är detta kommando omedelbart.
|
||||
|
||||
|
||||
5 KOMMANDON
|
||||
===========
|
||||
5 KOMMANDON (COMMANDS)
|
||||
======================
|
||||
|
||||
SnapRAID tillhandahåller några enkla kommandon som låter dig:
|
||||
SnapRAID tillhandahåller några enkla kommandon som gör att du kan:
|
||||
|
||||
* Skriva ut statusen för arrayen -> `status`
|
||||
* Skriva ut arrayens status -> `status`
|
||||
* Kontrollera diskarna -> `smart`, `probe`, `up`, `down`
|
||||
* Göra en säkerhetskopia/ögonblicksbild -> `sync`
|
||||
* Skapa en backup-/återställningspunkt -> `sync`
|
||||
* Periodiskt kontrollera data -> `scrub`
|
||||
* Återställa den senaste säkerhetskopian/ögonblicksbilden -> `fix`.
|
||||
* Återställa den senaste backup-/återställningspunkten -> `fix`.
|
||||
|
||||
Kommandon måste skrivas med gemener.
|
||||
Kommandon måste skrivas med gemener (små bokstäver).
|
||||
|
||||
5.1 status
|
||||
----------
|
||||
|
|
@ -637,15 +645,14 @@ Filerna i arrayen modifieras INTE.
|
|||
5.9 fix
|
||||
-------
|
||||
|
||||
Fixar alla filer och paritetsdata.
|
||||
Lagar alla filer och paritetsdata.
|
||||
|
||||
Alla filer och paritetsdata jämförs med ögonblicksbilds-
|
||||
tillståndet som sparades i den senaste `sync`.
|
||||
Om en skillnad hittas, återställs den till det lagrade ögonblicksbildstillståndet.
|
||||
Alla filer och paritetsdata jämförs med det tillstånd som sparades i
|
||||
den senaste `sync`-operationen. Om en skillnad hittas återställs den till det sparade tillståndet.
|
||||
|
||||
VARNING! Kommandot `fix` skiljer inte mellan fel och
|
||||
avsiktliga modifieringar. Det återställer ovillkorligen filtillståndet
|
||||
till den senaste `sync`.
|
||||
VARNING!
|
||||
Kommandot `fix` skiljer inte mellan fel och avsiktliga modifieringar.
|
||||
Det återställer villkorslöst filtillståndet till den senaste `sync`-operationen.
|
||||
|
||||
Om inget annat alternativ specificeras, behandlas hela arrayen.
|
||||
Använd filteralternativen för att välja en delmängd av filer eller diskar att arbeta med.
|
||||
|
|
@ -660,7 +667,7 @@ SnapRAID döper om alla filer som inte kan fixas genom att lägga till tillägge
|
|||
|
||||
Innan fixningen skannas hela arrayen för att hitta alla filer som flyttats
|
||||
sedan den senaste `sync`-operationen.
|
||||
Dessa filer identifieras av deras tidsstämpel, ignorera deras namn
|
||||
Dessa filer identifieras av deras tidsstämpel, oavsett namn
|
||||
och katalog, och används i återställningsprocessen vid behov.
|
||||
Om du flyttade några av dem utanför arrayen kan du använda alternativet -i, --import
|
||||
för att specificera ytterligare kataloger att skanna.
|
||||
|
|
@ -697,7 +704,7 @@ Inget ändras.
|
|||
Listar alla filer som finns i arrayen vid tidpunkten för den
|
||||
senaste `sync`.
|
||||
|
||||
Med -v eller --verbose visas även undertiden.
|
||||
Med -v eller --verbose visas även subsekundprecisionen.
|
||||
|
||||
Inget ändras.
|
||||
|
||||
|
|
@ -746,16 +753,16 @@ Inget ändras.
|
|||
5.15 touch
|
||||
----------
|
||||
|
||||
Anger en godtycklig undertidsstämpel för alla filer
|
||||
Anger en godtycklig tidsstämpel för undersekunder för alla filer
|
||||
som har den satt till noll.
|
||||
|
||||
Detta förbättrar SnapRAIDs förmåga att känna igen flyttade
|
||||
och kopierade filer, eftersom det gör tidsstämpeln nästan unik,
|
||||
vilket minskar möjliga dubbletter.
|
||||
|
||||
Mer specifikt, om undertidsstämpeln inte är noll,
|
||||
Mer specifikt, om tidsstämpeln för undersekunder inte är noll,
|
||||
identifieras en flyttad eller kopierad fil som sådan om den matchar
|
||||
namn, storlek och tidsstämpel. Om undertidsstämpeln
|
||||
namn, storlek och tidsstämpel. Om tidsstämpeln för undersekunder
|
||||
är noll, betraktas den som en kopia endast om hela sökvägen,
|
||||
storlek och tidsstämpel alla matchar.
|
||||
|
||||
|
|
@ -798,8 +805,8 @@ Var medveten om att sådana filer inte skyddas av paritet under
|
|||
omallokeringsprocessen.
|
||||
|
||||
|
||||
6 ALTERNATIV
|
||||
============
|
||||
6 ALTERNATIV (OPTIONS)
|
||||
======================
|
||||
|
||||
SnapRAID tillhandahåller följande alternativ:
|
||||
|
||||
|
|
@ -814,7 +821,7 @@ SnapRAID tillhandahåller följande alternativ:
|
|||
Filtrerar filerna att behandla i `check` och `fix`.
|
||||
Endast filerna som matchar det specificerade mönstret behandlas.
|
||||
Detta alternativ kan användas flera gånger.
|
||||
Se avsnittet MÖNSTER för mer information om
|
||||
Se avsnittet PATTERN för mer information om
|
||||
mönsterspecifikationer.
|
||||
I Unix, se till att globbing-tecken citeras om de används.
|
||||
Detta alternativ kan endast användas med `check` och `fix`.
|
||||
|
|
@ -912,7 +919,7 @@ SnapRAID tillhandahåller följande alternativ:
|
|||
antalet byte per sekund. Du kan specificera en multiplikator
|
||||
som K, M eller G (t.ex. --bw-limit 1G).
|
||||
|
||||
-t, --tail STORLEK
|
||||
-t, --tail SIZE
|
||||
Begränsa fillistan till de som inte använder mer än den angivna
|
||||
slutstorleken på paritetsdiskarna.
|
||||
Du kan använda multiplikatorer som K, M, G eller T (t.ex. --tail 1G).
|
||||
|
|
@ -974,7 +981,7 @@ SnapRAID tillhandahåller följande alternativ:
|
|||
-D, --force-device
|
||||
Tvingar den osäkra operationen att fixa med otillgängliga diskar
|
||||
eller med diskar på samma fysiska enhet.
|
||||
Till exempel, om du förlorade två datadisker och har en reservdisk för att återställa
|
||||
Till exempel, om du förlorade två datadiskar och har en reservdisk för att återställa
|
||||
endast den första, kan du ignorera den andra otillgängliga disken.
|
||||
Eller, om du vill återställa en disk i det lediga utrymme som finns kvar på en
|
||||
redan använd disk, dela samma fysiska enhet.
|
||||
|
|
@ -1013,9 +1020,9 @@ SnapRAID tillhandahåller följande alternativ:
|
|||
starkt att inte använda det.
|
||||
Du HAR INGET dataskydd under `sync`-operationen.
|
||||
|
||||
-W, --force-realloc-tail STORLEK
|
||||
-W, --force-realloc-tail SIZE
|
||||
Fungerar som -R, --force-realloc, men begränsat till den angivna
|
||||
slutdelen (de sista STORLEK byten) av varje paritetsfil.
|
||||
slutdelen (de sista SIZE byten) av varje paritetsfil.
|
||||
Den tvingar omallokering (flytt) av alla filfragment/block som för
|
||||
närvarande lagras i den slutsektionen, vilket gör att de kan placeras
|
||||
var som helst i paritetsfilen/filerna där ledigt utrymme finns
|
||||
|
|
@ -1062,7 +1069,7 @@ SnapRAID tillhandahåller följande alternativ:
|
|||
|
||||
-S, --start BLKSTART
|
||||
Börjar behandlingen från det specificerade
|
||||
blocknumret. Detta kan vara användbart för att försöka igen att kontrollera
|
||||
blocknumret. Detta kan vara användbart för att på nytt försöka kontrollera
|
||||
eller fixa specifika block i händelse av en skadad disk.
|
||||
Detta alternativ är främst för avancerad manuell återställning.
|
||||
|
||||
|
|
@ -1100,8 +1107,8 @@ SnapRAID tillhandahåller följande alternativ:
|
|||
Skriver ut programversionen.
|
||||
|
||||
|
||||
7 KONFIGURATION
|
||||
===============
|
||||
7 KONFIGURATION (CONFIGURATION)
|
||||
===============================
|
||||
|
||||
SnapRAID kräver en konfigurationsfil för att veta var din disk-array
|
||||
finns och var paritetsinformationen ska lagras.
|
||||
|
|
@ -1113,8 +1120,8 @@ katalog som `snapraid.exe`.
|
|||
|
||||
Den måste innehålla följande alternativ (skiftlägeskänsligt):
|
||||
|
||||
7.1 parity FIL [,FIL] ...
|
||||
-------------------------
|
||||
7.1 parity FILE [,FILE] ...
|
||||
---------------------------
|
||||
|
||||
Definierar de filer som ska användas för att lagra paritetsinformationen.
|
||||
Pariteten möjliggör skydd från ett enda disk-
|
||||
|
|
@ -1136,8 +1143,8 @@ varningen om fulla diskar.
|
|||
|
||||
Detta alternativ är obligatoriskt och kan endast användas en gång.
|
||||
|
||||
7.2 (2,3,4,5,6)-parity FIL [,FIL] ...
|
||||
-------------------------------------
|
||||
7.2 (2,3,4,5,6)-parity FILE [,FILE] ...
|
||||
---------------------------------------
|
||||
|
||||
Definierar de filer som ska användas för att lagra extra paritetsinformation.
|
||||
|
||||
|
|
@ -1156,8 +1163,8 @@ Samma överväganden som för alternativet `parity` gäller.
|
|||
|
||||
Dessa alternativ är valfria och kan endast användas en gång.
|
||||
|
||||
7.3 z-parity FIL [,FIL] ...
|
||||
---------------------------
|
||||
7.3 z-parity FILE [,FILE] ...
|
||||
-----------------------------
|
||||
|
||||
Definierar en alternativ fil och ett format för att lagra trippel paritet.
|
||||
|
||||
|
|
@ -1176,8 +1183,8 @@ Det är möjligt att konvertera från ett format till ett annat genom att juster
|
|||
konfigurationsfilen med önskad z-parity eller 3-parity fil
|
||||
och använda `fix` för att återskapa den.
|
||||
|
||||
7.4 content FIL
|
||||
---------------
|
||||
7.4 content FILE
|
||||
----------------
|
||||
|
||||
Definierar den fil som ska användas för att lagra listan och checksummorna för alla
|
||||
filer som finns i din disk-array.
|
||||
|
|
@ -1193,20 +1200,20 @@ flera kopior av samma fil.
|
|||
Du måste lagra minst en kopia för varje paritetsdisk som används
|
||||
plus en. Att använda ytterligare kopior skadar inte.
|
||||
|
||||
7.5 data NAMN KATALOG
|
||||
---------------------
|
||||
7.5 data NAME DIR
|
||||
-----------------
|
||||
|
||||
Definierar namnet och monteringspunkten för datadiskarna i
|
||||
arrayen. NAMN används för att identifiera disken och måste
|
||||
vara unikt. KATALOG är monteringspunkten för disken i
|
||||
arrayen. NAME används för att identifiera disken och måste
|
||||
vara unikt. DIR är monteringspunkten för disken i
|
||||
filsystemet.
|
||||
|
||||
Du kan ändra monteringspunkten vid behov, så länge
|
||||
du behåller NAMN fixerat.
|
||||
du behåller NAME fixerat.
|
||||
|
||||
Du bör använda ett alternativ för varje datadisk i arrayen.
|
||||
|
||||
Du kan byta namn på en disk senare genom att ändra NAMN direkt
|
||||
Du kan byta namn på en disk senare genom att ändra NAME direkt
|
||||
i konfigurationsfilen och sedan köra ett `sync`-kommando.
|
||||
I händelse av namnbyte görs associationen med hjälp av den lagrade
|
||||
UUID:n för diskarna.
|
||||
|
|
@ -1224,14 +1231,40 @@ startdisken.
|
|||
Observera att sådana diskar inte påverkas av kommandona `up` och
|
||||
`down` eftersom de förväntas alltid snurra.
|
||||
|
||||
7.7 nohidden
|
||||
7.7 snapshot
|
||||
------------
|
||||
|
||||
Aktiverar användningen av filsystemets ögonblicksbilder för kommandona `sync`, `scrub`,
|
||||
`check` och `fix`.
|
||||
|
||||
När det är aktiverat skapar SnapRAID en skrivskyddad ögonblicksbild av dina data vid
|
||||
början av en 'sync'. Detta säkerställer en konsekvent tidpunktsvy av dina
|
||||
filer, vilket förhindrar fel som orsakas av samtidiga filändringar.
|
||||
|
||||
Detta förbättrar återställningen avsevärt: om en fil tas bort från det aktiva filsystemet
|
||||
förblir den bevarad i ögonblicksbilden. Detta förhindrar att pariteten blir "trasig"
|
||||
för det blocket, vilket säkerställer att du fortfarande kan återställa data framgångsrikt
|
||||
om en annan disk havererar.
|
||||
|
||||
Detta alternativ gäller uteslutande datadiskar formaterade med filsystemen
|
||||
Btrfs, Bcachefs eller ZFS i Linux och NTFS i Windows.
|
||||
Paritetsdiskar, eller datadiskar som använder andra filsystem, kommer alltid att använda
|
||||
den aktiva versionen av filsystemet.
|
||||
|
||||
Att skapa och ta bort ögonblicksbilder kräver administratörsbehörighet.
|
||||
Se till att SnapRAID körs med nödvändiga rättigheter (t.ex. sudo) när
|
||||
detta alternativ är aktiverat.
|
||||
|
||||
Se avsnittet SNAPSHOTS för en detaljerad förklaring av ögonblicksbildens livscykel.
|
||||
|
||||
7.8 nohidden
|
||||
------------
|
||||
|
||||
Exkluderar alla dolda filer och kataloger.
|
||||
I Unix är dolda filer de som börjar med `.`.
|
||||
I Windows är de de med det dolda attributet.
|
||||
|
||||
7.8 exclude/include MÖNSTER
|
||||
7.9 exclude/include PATTERN
|
||||
---------------------------
|
||||
|
||||
Definierar fil- eller katalogmönstren att exkludera eller inkludera
|
||||
|
|
@ -1244,13 +1277,13 @@ Om inget mönster matchar, exkluderas filen om det sista mönstret
|
|||
som specificerats är ett `include`-mönster, eller inkluderas om det sista mönstret
|
||||
som specificerats är ett `exclude`-mönster.
|
||||
|
||||
Se avsnittet MÖNSTER för mer information om mönster-
|
||||
Se avsnittet PATTERN för mer information om mönster-
|
||||
specifikationer.
|
||||
|
||||
Detta alternativ kan användas flera gånger.
|
||||
|
||||
7.9 blocksize STORLEK_I_KIBIBYTES
|
||||
---------------------------------
|
||||
7.10 blocksize SIZE_IN_KIBIBYTES
|
||||
--------------------------------
|
||||
|
||||
Definierar den grundläggande blockstorleken i kibibytes för pariteten.
|
||||
En kibibyte är 1024 byte.
|
||||
|
|
@ -1297,8 +1330,8 @@ Detta resulterar i cirka 1,5% extra utrymme, ungefär 60 GB för
|
|||
en 4 TB-disk, vilket möjliggör cirka 460 000 filer på varje datadisk utan
|
||||
något bortkastat utrymme.
|
||||
|
||||
7.10 hashsize STORLEK_I_BYTE
|
||||
----------------------------
|
||||
7.11 hashsize SIZE_IN_BYTES
|
||||
---------------------------
|
||||
|
||||
Definierar hash-storleken i byte för de sparade blocken.
|
||||
|
||||
|
|
@ -1335,16 +1368,16 @@ Om du byter till både en hash-storlek på 8 och en blockstorlek på 512 får du
|
|||
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0,51 GiB
|
||||
|
||||
7.11 autosave STORLEK_I_GIGABYTES
|
||||
---------------------------------
|
||||
7.12 autosave SIZE_IN_GIGABYTES
|
||||
-------------------------------
|
||||
|
||||
Sparar automatiskt tillståndet vid synkronisering eller skrubbning efter att den
|
||||
specificerade mängden GB har behandlats.
|
||||
Detta alternativ är användbart för att undvika att starta om långa `sync`-
|
||||
kommandon från början om de avbryts av en maskinkrasch eller någon annan händelse.
|
||||
|
||||
7.12 temp_limit TEMPERATUR_CELSIUS
|
||||
----------------------------------
|
||||
7.13 temp_limit TEMPERATURE_CELSIUS
|
||||
-----------------------------------
|
||||
|
||||
Anger den maximalt tillåtna disk-temperaturen i Celsius. När den specificeras,
|
||||
kontrollerar SnapRAID periodiskt temperaturen på alla diskar med hjälp av
|
||||
|
|
@ -1360,37 +1393,37 @@ disk och uppskattar den långsiktiga stabila temperaturen de förväntas
|
|||
nå om aktiviteten fortsätter. Uppskattningen utförs först efter att
|
||||
disk-temperaturen har ökat fyra gånger, vilket säkerställer att tillräckligt med
|
||||
datapoäng finns tillgängliga för att fastställa en pålitlig trend.
|
||||
Denna förutsagda stabila temperatur visas inom parentes bredvid den
|
||||
Denna förutsagda stabila temperatur visas inom parentes bredvid det
|
||||
aktuella värdet och hjälper till att bedöma om systemets kylning är
|
||||
tillräcklig. Denna uppskattade temperatur är endast för informationssyfte
|
||||
och har ingen effekt på SnapRAIDs beteende. Programmens
|
||||
och har ingen effekt på SnapRAIDs beteende. Programmets
|
||||
åtgärder baseras enbart på de faktiska uppmätta disk-temperaturerna.
|
||||
|
||||
För att utföra denna analys behöver SnapRAID en referens för system-
|
||||
temperaturen. Det försöker först läsa den från tillgängliga hårdvaru-
|
||||
sensorer. Om ingen system-sensor kan nås, används den lägsta disk-
|
||||
temperaturen som mättes vid start av körningen som en reservreferens.
|
||||
För att utföra denna analys behöver SnapRAID en referens för systemtemperaturen.
|
||||
Det försöker först läsa den från tillgängliga hårdvarusensorer.
|
||||
Om ingen systemsensor kan nås, används den lägsta disk-
|
||||
temperaturen som mättes i början av körningen som en reservreferens.
|
||||
|
||||
Normalt visar SnapRAID endast temperaturen på den hetaste disken.
|
||||
För att visa temperaturen på alla diskar, använd alternativet -A eller --stats.
|
||||
|
||||
7.13 temp_sleep TID_I_MINUTER
|
||||
-----------------------------
|
||||
7.14 temp_sleep TIME_IN_MINUTES
|
||||
-------------------------------
|
||||
|
||||
Anger standby-tiden, i minuter, när temperaturgränsen har
|
||||
nåtts. Under denna period förblir diskarna nedsnurrade. Standard
|
||||
är 5 minuter.
|
||||
|
||||
7.14 pool KATALOG
|
||||
-----------------
|
||||
7.15 pool DIR
|
||||
-------------
|
||||
|
||||
Definierar poolningskatalogen där den virtuella vyn av disk-
|
||||
arrayen skapas med hjälp av kommandot `pool`.
|
||||
|
||||
Katalogen måste redan existera.
|
||||
|
||||
7.15 share UNC_KATALOG
|
||||
----------------------
|
||||
7.16 share UNC_DIR
|
||||
------------------
|
||||
|
||||
Definierar Windows UNC-sökvägen som krävs för att få åtkomst till diskarna på distans.
|
||||
|
||||
|
|
@ -1405,8 +1438,8 @@ katalog och namn.
|
|||
|
||||
Detta alternativ krävs endast för Windows.
|
||||
|
||||
7.16 smartctl DISK/PARITY ALTERNATIV...
|
||||
---------------------------------------
|
||||
7.17 smartctl DISK/PARITY OPTIONS...
|
||||
------------------------------------
|
||||
|
||||
Definierar anpassade smartctl-alternativ för att få SMART-attributen för
|
||||
varje disk. Detta kan krävas för RAID-kontroller och vissa USB-
|
||||
|
|
@ -1421,6 +1454,9 @@ I de specificerade ALTERNATIVEN ersätts strängen `%s` med
|
|||
enhetens namn. För RAID-kontroller är enheten
|
||||
sannolikt fixerad, och du kanske inte behöver använda `%s`.
|
||||
|
||||
Du kan också specificera en anpassad sträng för informationsalternativ med
|
||||
hjälp av taggen `[info: ...]` för att ersätta standardalternativet `-a`.
|
||||
|
||||
Se smartmontools dokumentation för möjliga alternativ:
|
||||
|
||||
https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
|
|
@ -1428,9 +1464,10 @@ Se smartmontools dokumentation för möjliga alternativ:
|
|||
|
||||
Till exempel:
|
||||
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl parity -d sat %s
|
||||
|
||||
7.17 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
7.18 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
-------------------------------------------
|
||||
|
||||
Ignorerar det specificerade SMART-attributet vid beräkning av sannolikheten
|
||||
|
|
@ -1442,16 +1479,21 @@ PARITY är ett av paritetsnamnen: `parity`, `2-parity`, `3-parity`,
|
|||
`4-parity`, `5-parity`, `6-parity` eller `z-parity`.
|
||||
Det speciella värdet * kan användas för att ignorera attributet på alla diskar.
|
||||
|
||||
Till exempel, för att ignorera attributet `Current Pending Sector Count` på
|
||||
alla diskar:
|
||||
Flera attribut kan specificeras separerade med mellanslag.
|
||||
Varje attribut kan specificeras som ett nummer från 1 till 255, eller som ett
|
||||
skiftlägesokänsligt namn (t.ex. `Current_Pending_Sector`).
|
||||
|
||||
smartignore * 197
|
||||
Till exempel, för att ignorera attributen `Current Pending Sector Count` och
|
||||
`Reallocated Sectors Count` på alla diskar med deras nummer eller namn:
|
||||
|
||||
För att ignorera det endast på den första paritetsdisken:
|
||||
smartignore * 197 5
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
smartignore parity 197
|
||||
För att ignorera dem endast på den första paritetsdisken:
|
||||
|
||||
7.18 Exempel
|
||||
smartignore parity 197 5
|
||||
|
||||
7.19 Exempel
|
||||
------------
|
||||
|
||||
Ett exempel på en typisk konfiguration för Unix är:
|
||||
|
|
@ -1464,7 +1506,7 @@ Ett exempel på en typisk konfiguration för Unix är:
|
|||
data d3 /mnt/disk3/
|
||||
exclude /lost+found/
|
||||
exclude /tmp/
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/sg0
|
||||
smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1480,14 +1522,132 @@ Ett exempel på en typisk konfiguration för Windows är:
|
|||
exclude Thumbs.db
|
||||
exclude \$RECYCLE.BIN
|
||||
exclude \System Volume Information
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
|
||||
8 MöNSTER (PATTERN)
|
||||
===================
|
||||
8 ÖGONBLICKSBILDER (SNAPSHOTS)
|
||||
==============================
|
||||
|
||||
Om alternativet för ögonblicksbilder är aktiverat i konfigurationen använder SnapRAID
|
||||
filsystemets funktionalitet för ögonblicksbilder för att säkerställa atomära och
|
||||
konsekventa operationer.
|
||||
|
||||
Hanteringen av ögonblicksbilder är helt automatisk och transparent.
|
||||
Du kan fortsätta att använda SnapRAID exakt som tidigare, med det
|
||||
ytterligare skydd som ögonblicksbilder ger, helt hanterat i
|
||||
bakgrunden.
|
||||
|
||||
Detta ger två huvudsakliga fördelar:
|
||||
|
||||
Konsistens - Filer som ändras på det aktiva filsystemet under en långvarig
|
||||
sync eller scrub kommer inte att orsaka paritetsfel eller avbrutna
|
||||
operationer, eftersom SnapRAID ser en frusen tidpunktsbild.
|
||||
Återställning - Om en fil uppdateras eller tas bort från det aktiva filsystemet
|
||||
förblir den bevarad i ögonblicksbilden. Om ett diskhaveri inträffar
|
||||
innan nästa sync körs, använder SnapRAID den data som bevarats
|
||||
i ögonblicksbilden för att rekonstruera den felaktiga disken.
|
||||
|
||||
I händelse av ett diskhaveri under en aktiv synkroniseringsprocess
|
||||
kan SnapRAID också läsa automatiskt från både ögonblicksbilden
|
||||
av den föregående paritetsberäkningen och den aktuella.
|
||||
Detta maximerar sannolikheten för en fullständig återställning genom att
|
||||
ge tillgång till de exakta datablock som krävs för att lösa paritetsekvationerna,
|
||||
även om dessa block modifierades eller togs bort mellan synkroniseringar.
|
||||
|
||||
Utan ögonblicksbilder leder en uppdaterad eller borttagen fil på en frisk disk
|
||||
till saknade datablock som kan krävas för att laga andra felaktiga diskar.
|
||||
|
||||
Ögonblicksbilder skapas endast för datadiskar och endast om det underliggande
|
||||
filsystemet stöder denna funktionalitet. Paritetsdiskar använder alltid
|
||||
det aktiva filsystemet.
|
||||
|
||||
För närvarande stöds detta på Btrfs, Bcachefs och ZFS i Linux
|
||||
och på NTFS i Windows.
|
||||
|
||||
Du kan blanda datadiskar med olika filsystem. Endast de som
|
||||
stöder ögonblicksbilder kommer att använda dem, medan andra diskar kommer att fortsätta
|
||||
att fungera direkt på det aktiva filsystemet.
|
||||
|
||||
Att skapa och ta bort ögonblicksbilder kräver administratörsbehörighet.
|
||||
Se till att SnapRAID körs med nödvändiga rättigheter (t.ex. sudo)
|
||||
när ögonblicksbilder är aktiverade.
|
||||
|
||||
8.1 Kommandobeteende med ögonblicksbilder
|
||||
-----------------------------------------
|
||||
|
||||
Kommandona `sync` och `scrub` arbetar båda uteslutande på ögonblicksbilder
|
||||
för att säkerställa att alla dataoperationer utförs mot ett konsekvent,
|
||||
fruset tillstånd. Genom att använda dessa ögonblicksbilder förhindrar SnapRAID paritetsfel
|
||||
som annars skulle utlösas av samtidiga filändringar på det aktiva filsystemet.
|
||||
Under en `sync` använder kommandot en ny ögonblicksbild som skapas vid
|
||||
början av processen för att fånga det aktuella tillståndet för paritetsberäkning.
|
||||
I motsats till detta använder kommandot `scrub` den senaste ögonblicksbilden, den som
|
||||
skapades under den senaste synkroniseringen, för att upprätthålla en tillförlitlig referenspunkt
|
||||
som matchar den befintliga pariteten.
|
||||
|
||||
För kommandona `check` och `fix` beror användningen av den senaste ögonblicksbilden
|
||||
på om specifika diskar är måltavla med alternativet
|
||||
-d, --filter-disk.
|
||||
|
||||
En disk som uttryckligen valts via -d (operationens "mål")
|
||||
använder alltid det aktiva filsystemet. För `fix` tillåter detta återställning
|
||||
av data till den aktiva ersättningsdisken. För `check` tillåter det att simulera
|
||||
`fix`-operationen under samma förhållanden.
|
||||
|
||||
Alla andra datadiskar ("referensdiskarna") kommer att nås via
|
||||
sina ögonblicksbilder. Detta säkerställer att även om du ändrar filer
|
||||
på dina friska diskar medan en återställning pågår, har SnapRAID
|
||||
en stabil, frusen referens för att lösa paritetsekvationerna.
|
||||
|
||||
Om inget -d-alternativ anges antar SnapRAID att operationen gäller
|
||||
hela arrayen, i detta fall kommer `check` och `fix` att använda de
|
||||
aktiva filsystemen uteslutande.
|
||||
|
||||
Alla andra kommandon fungerar uteslutande på det aktiva filsystemet.
|
||||
|
||||
|
||||
9 LIVSCYKEL FöR öGONBLICKSBILDER (SNAPSHOTS LIFECYCLE)
|
||||
======================================================
|
||||
|
||||
SnapRAID hanterar två specifika ögonblicksbilder, `stable` och `pending`,
|
||||
inom en dold katalog i roten av varje datavolym.
|
||||
I Btrfs, Bcachefs och NTFS används katalogen `.snapraid/`,
|
||||
i ZFS standardkatalogen `.zfs/snapshot/`.
|
||||
|
||||
Ögonblicksbilden `stable` representerar tillståndet för den senaste
|
||||
framgångsrikt slutförda `sync`-iseringen, och innehåller exakt den data som användes för
|
||||
att beräkna den aktuella pariteten. Den fungerar som den primära datakällan
|
||||
för kommandona `scrub`, `check` och `fix`.
|
||||
|
||||
Ögonblicksbilden `pending` är en tillfällig bild som skapas i början
|
||||
av en `sync` för att tillhandahålla ett fruset tillstånd för paritetsberäkning.
|
||||
Efter framgångsrik slutförande av operationen raderas den föregående `stable`
|
||||
ögonblicksbilden, och `pending`-ögonblicksbilden upphöjs till
|
||||
att ta dess plats som den nya stabila referensen.
|
||||
|
||||
Om en `sync` avbryts bevaras ögonblicksbilden `pending`.
|
||||
Efterföljande `scrub`-, `check`- och `fix`-kommandon kommer att använda denna
|
||||
vilande ögonblicksbild eftersom den matchar filsystemets tillstånd som registrerats i
|
||||
.content-filen, även om pariteten endast är delvis synkroniserad.
|
||||
|
||||
I händelse av ett avbrott i en `sync` läser kommandona `check` och `fix`
|
||||
också från ögonblicksbilden `stable` för att hämta datablock
|
||||
från filer som uppdaterades eller togs bort under synkroniseringen.
|
||||
Detta är möjligt eftersom .content-filen behåller metadata för
|
||||
alla modifierade eller borttagna filer under hela synkroniseringsprocessen.
|
||||
Denna historiska information rensas först när en sync slutförts
|
||||
framgångsrikt och den slutliga versionen av .content-filen sparats.
|
||||
|
||||
Om en `sync` startas om efter ett avbrott raderas den befintliga
|
||||
vilande (pending) ögonblicksbilden och en ny skapas för att
|
||||
fånga det aktuella tillståndet för det aktiva filsystemet.
|
||||
|
||||
|
||||
10 MöNSTER (PATTERN)
|
||||
====================
|
||||
|
||||
Mönster ger ett flexibelt sätt att filtrera filer för inkludering eller
|
||||
exkludering. Genom att använda jokertecken kan du definiera regler som
|
||||
|
|
@ -1605,8 +1765,8 @@ I Unix, när du använder globbing-tecken på kommandoraden, måste du
|
|||
citattecken dem för att förhindra att skalet expanderar dem.
|
||||
|
||||
|
||||
9 IGNORERA FILER (IGNORE FILE)
|
||||
==============================
|
||||
11 IGNORERA FILER (IGNORE FILE)
|
||||
===============================
|
||||
|
||||
Utöver de globala reglerna i konfigurationsfilen kan du placera
|
||||
`.snapraidignore`-filer i vilken katalog som helst i arrayen för att definiera
|
||||
|
|
@ -1650,7 +1810,7 @@ Till exempel, om du har en `.snapraidignore` i `/mnt/disk1/projects/`:
|
|||
*.tmp
|
||||
|
||||
|
||||
10 INNEHåLL (CONTENT)
|
||||
12 INNEHåLL (CONTENT)
|
||||
=====================
|
||||
|
||||
SnapRAID lagrar listan och checksummorna för dina filer i content-filen.
|
||||
|
|
@ -1658,11 +1818,13 @@ SnapRAID lagrar listan och checksummorna för dina filer i content-filen.
|
|||
Det är en binär fil som listar alla filer som finns i din disk-array,
|
||||
tillsammans med alla checksummor för att verifiera deras integritet.
|
||||
|
||||
Denna fil läses och skrivs av kommandona `sync` och `scrub` och
|
||||
läses av kommandona `fix`, `check` och `status`.
|
||||
Content-filen läses och skrivs av kommandona `sync`, `scrub`, `touch`
|
||||
och `rehash`. Den läses av kommandona `status`, `diff`, `check`, `fix`,
|
||||
`list`, `dup`, `locate` och `pool`, och den ignoreras helt av
|
||||
kommandona `smart`, `probe`, `up`, `down` och `devices`.
|
||||
|
||||
|
||||
11 PARITET (PARITY)
|
||||
13 PARITET (PARITY)
|
||||
===================
|
||||
|
||||
SnapRAID lagrar paritetsinformationen för din array i parity-
|
||||
|
|
@ -1675,8 +1837,8 @@ Dessa filer läses och skrivs av kommandona `sync` och `fix` och
|
|||
läses endast av kommandona `scrub` och `check`.
|
||||
|
||||
|
||||
12 KODNING
|
||||
==========
|
||||
14 KODNING (ENCODING)
|
||||
=====================
|
||||
|
||||
SnapRAID i Unix ignorerar all kodning. Det läser och lagrar
|
||||
filnamnen med samma kodning som används av filsystemet.
|
||||
|
|
@ -1692,13 +1854,30 @@ omdirigerar konsolutdata till en fil, är den resulterande filen alltid
|
|||
i UTF-8-format.
|
||||
|
||||
|
||||
13 UPPHOVSRäTT (COPYRIGHT)
|
||||
15 SLUTKOD (EXIT CODE)
|
||||
======================
|
||||
|
||||
SnapRAID avslutas med följande statuskoder:
|
||||
|
||||
0 - Allt OK.
|
||||
1 - Kommandot stötte på fel.
|
||||
2 - Kommandot `diff` fann att allt är OK, men en `sync` behövs.
|
||||
|
||||
|
||||
16 ÖVERSäTTNING (TRANSLATION)
|
||||
=============================
|
||||
|
||||
Detta dokument är en automatisk översättning av den engelska manualen.
|
||||
Se den engelska manualen för den officiella versionen.
|
||||
|
||||
|
||||
17 UPPHOVSRäTT (COPYRIGHT)
|
||||
==========================
|
||||
|
||||
Denna fil är Copyright (C) 2025 Andrea Mazzoleni
|
||||
Denna fil är Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
|
||||
14 SE ÄVEN (SEE ALSO)
|
||||
18 SE äVEN (SEE ALSO)
|
||||
=====================
|
||||
|
||||
snapraid_log(1), snapraidd(1)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
.TH "SnapRAID Резервне копіювання для дискових масивів" 1
|
||||
.SH NAME
|
||||
snapraid \- SnapRAID Резервне копіювання для дискових масивів
|
||||
.SH Короткий опис
|
||||
.SH Короткий опис (SYNOPSIS)
|
||||
snapraid [\-c, \-\-conf CONFIG]
|
||||
.PD 0
|
||||
.PP
|
||||
|
|
@ -77,13 +77,13 @@ snapraid [\-c, \-\-conf CONFIG]
|
|||
snapraid [\-V, \-\-version] [\-H, \-\-help] [\-C, \-\-gen\-conf CONTENT]
|
||||
.PD 0
|
||||
.PD
|
||||
.SH Опис
|
||||
.SH Опис (DESCRIPTION)
|
||||
SnapRAID — це програма резервного копіювання, розроблена для
|
||||
дискових масивів, яка зберігає інформацію парності для
|
||||
відновлення даних у випадку відмови до шести дисків.
|
||||
.PP
|
||||
В першу чергу призначена для домашніх медіацентрів з великими
|
||||
файлами, що рідко змінюються, SnapRAID пропонує кілька функцій:
|
||||
Насамперед призначений для домашніх медіацентрів з великими
|
||||
файлами, які рідко змінюються, SnapRAID пропонує кілька функцій:
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Ви можете використовувати диски, вже заповнені файлами, без
|
||||
|
|
@ -120,24 +120,34 @@ https://www.snapraid.it/
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH Обмеження
|
||||
SnapRAID є гібридом між RAID та програмою резервного копіювання,
|
||||
прагнучи поєднати найкращі переваги обох. Однак, він має деякі
|
||||
обмеження, які слід врахувати перед його використанням.
|
||||
.SH Обмеження (LIMITATIONS)
|
||||
SnapRAID є гібридом між RAID і програмою резервного копіювання, що має на меті поєднати
|
||||
найкращі переваги обох рішень. Однак у нього є деякі обмеження, які вам слід
|
||||
врахувати перед використанням.
|
||||
.PP
|
||||
Основне обмеження полягає в тому, що якщо диск виходить з ладу,
|
||||
а ви нещодавно не виконували синхронізацію, ви можете не
|
||||
змогти повністю відновити дані.
|
||||
Конкретніше, ви можете втратити можливість відновлення даних
|
||||
обсягом до розміру змінених або видалених файлів з моменту
|
||||
останньої операції синхронізації.
|
||||
Це відбувається, навіть якщо змінені або видалені файли не
|
||||
знаходяться на диску, що вийшов з ладу. Ось чому SnapRAID
|
||||
краще підходить для даних, які рідко змінюються.
|
||||
Головне обмеження полягає в тому, що у разі збою диска ви можете відновити дані лише до
|
||||
стану останньої операції синхронізації (\`sync\`). Будь\-які дані, додані або змінені
|
||||
з моменту останньої синхронізації, які розташовані на пошкодженому диску, будуть втрачені.
|
||||
.PP
|
||||
З іншого боку, щойно додані файли не перешкоджають відновленню
|
||||
вже існуючих файлів. Ви втратите лише нещодавно додані файли,
|
||||
якщо вони знаходяться на диску, що вийшов з ладу.
|
||||
Відповідно, SnapRAID насамперед підходить для даних, які рідко змінюються.
|
||||
.PP
|
||||
Для даних, які вже існували на момент останньої синхронізації, надійність відновлення залежить
|
||||
від того, чи використовується опція знімка (\`snapshot\`):
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
За наявності підтримки знімків (доступно на Btrfs, ZFS, Bcachefs та NTFS),
|
||||
SnapRAID може автоматично підтримувати заморожену копію ваших дисків із даними.
|
||||
Це гарантує, що навіть якщо ви зміните або видалите файли у вашій живій файловій системі
|
||||
під час або після синхронізації, процес відновлення залишиться узгодженим і надійним.
|
||||
.PD
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
Без підтримки знімків видалення або зміна файлів після \`sync\`
|
||||
може запобігти повному відновленню інших дисків, що зазнали збою. Це відбувається
|
||||
тому, що парність більше не відповідає зміненим файлам, навіть якщо
|
||||
ці файли знаходяться не на пошкодженому диску. З іншого боку, щойно додані
|
||||
файли не перешкоджають відновленню вже існуючих файлів.
|
||||
.PD
|
||||
.PP
|
||||
Інші обмеження SnapRAID:
|
||||
.PD 0
|
||||
|
|
@ -159,10 +169,10 @@ SnapRAID може відновлювати дані лише з обмежено
|
|||
всього дискового масиву.
|
||||
.IP \(bu
|
||||
Зберігаються лише імена файлів, часові мітки, символічні
|
||||
та жорсткі посилання. Права доступу, власність та
|
||||
та жорсткі посилання. Права доступу, власники та
|
||||
розширені атрибути не зберігаються.
|
||||
.PD
|
||||
.SH Початок роботи
|
||||
.SH Початок роботи (GETTING STARTED)
|
||||
Щоб використовувати SnapRAID, спершу потрібно вибрати один диск
|
||||
у вашому дисковому масиві, щоб присвятити його інформації
|
||||
\`парності\`. З одним диском для парності ви зможете відновити
|
||||
|
|
@ -377,7 +387,7 @@ snapraid \-p bad scrub
|
|||
.SS Об\'єднання (Pooling)
|
||||
Примітка: Функція об\'єднання, описана нижче, була замінена
|
||||
інструментом mergerfs, який тепер є рекомендованою опцією для
|
||||
користувачів Linux у спільноті SnapRAID. Mergefs забезпечує
|
||||
користувачів Linux у спільноті SnapRAID. Mergerfs забезпечує
|
||||
більш гнучкий та ефективний спосіб об\'єднання кількох дисків
|
||||
в єдину уніфіковану точку монтування, дозволяючи безперешкодний
|
||||
доступ до файлів у вашому масиві без використання символічних
|
||||
|
|
@ -684,7 +694,7 @@ snapraid sync
|
|||
.RE
|
||||
.PP
|
||||
Якщо все відновлено, ця команда виконується миттєво.
|
||||
.SH Команди
|
||||
.SH Команди (COMMANDS)
|
||||
SnapRAID надає кілька простих команд, які дозволяють:
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
|
|
@ -692,14 +702,14 @@ SnapRAID надає кілька простих команд, які дозво
|
|||
.IP \(bu
|
||||
Керувати дисками \-> \`smart\`, \`probe\`, \`up\`, \`down\`
|
||||
.IP \(bu
|
||||
Створити резервну копію/знімок \-> \`sync\`
|
||||
Створити точку резервного копіювання/відновлення \-> \`sync\`
|
||||
.IP \(bu
|
||||
Періодично перевіряти дані \-> \`scrub\`
|
||||
.IP \(bu
|
||||
Відновити останню резервну копію/знімок \-> \`fix\`.
|
||||
Відновити останню точку резервного копіювання/відновлення \-> \`fix\`.
|
||||
.PD
|
||||
.PP
|
||||
Команди повинні бути написані малими літерами.
|
||||
Команди обов\'язково повинні бути написані малими літерами.
|
||||
.SS status
|
||||
Виводить зведення стану дискового масиву.
|
||||
.PP
|
||||
|
|
@ -723,7 +733,7 @@ SnapRAID надає кілька простих команд, які дозво
|
|||
Виводить звіт SMART усіх дисків у системі.
|
||||
.PP
|
||||
Включає оцінку ймовірності відмови протягом наступного року,
|
||||
дозволяючи вам планувати планову заміну дисків, які
|
||||
дозволяючи вам планувати своєчасну заміну дисків, які
|
||||
виявляють підозрілі атрибути.
|
||||
.PP
|
||||
Ця оцінка ймовірності отримана шляхом кореляції атрибутів
|
||||
|
|
@ -737,7 +747,7 @@ https://www.backblaze.com/hard\-drive\-test\-data.html
|
|||
.PP
|
||||
Якщо SMART повідомляє, що диск виходить з ладу, для цього
|
||||
диска виводиться \`FAIL\` або \`PREFAIL\`, і SnapRAID повертає
|
||||
помилку. У цьому випадку настійно рекомендується негайна
|
||||
помилку. У цьому випадку наполегливо рекомендується негайна
|
||||
заміна диска.
|
||||
.PP
|
||||
Інші можливі рядки стану:
|
||||
|
|
@ -838,16 +848,16 @@ https://www.backblaze.com/hard\-drive\-test\-data.html
|
|||
іменем, розміром, часовою міткою та inode, але іншим
|
||||
каталогом.
|
||||
.HP 4
|
||||
.I copied
|
||||
файли, скопійовані на той самий або інший диск, де
|
||||
.I copied (скопійовані)
|
||||
Файли, скопійовані на той самий або інший диск, де
|
||||
оригінальний файл все ще існує.
|
||||
Вони ідентифікуються за однаковою назвою, розміром та міткою
|
||||
часу.
|
||||
Якщо мітка часу з точністю до часток секунди дорівнює нулю, для
|
||||
ідентифікації має збігатися повний шлях, а не лише назва.
|
||||
.HP 4
|
||||
.I relocated
|
||||
файли, переміщені на той самий або інший диск, де
|
||||
.I relocated (перерозміщені)
|
||||
Файли, переміщені на той самий або інший диск, де
|
||||
оригінал зник.
|
||||
Вони ідентифікуються за однаковою назвою, розміром та міткою
|
||||
часу.
|
||||
|
|
@ -856,8 +866,8 @@ https://www.backblaze.com/hard\-drive\-test\-data.html
|
|||
На відміну від файлів \'moved\' на тому ж диску, переміщені файли
|
||||
мають інший inode.
|
||||
.HP 4
|
||||
.I restored
|
||||
файли з іншим inode, але зі збігом каталогу, назви,
|
||||
.I restored (відновлені)
|
||||
Файли з іншим inode, але зі збігом каталогу, назви,
|
||||
розміру та мітки часу.
|
||||
Зазвичай це файли, відновлені після видалення.
|
||||
.PD
|
||||
|
|
@ -952,15 +962,14 @@ new \- Скрабувати щойно синхронізовані блоки,
|
|||
Файли \`parity\` НЕ змінюються.
|
||||
Файли в масиві НЕ змінюються.
|
||||
.SS fix
|
||||
Виправляє всі файли та дані парності.
|
||||
Відновлює всі файли та дані парності.
|
||||
.PP
|
||||
Усі файли та дані парності порівнюються зі станом знімка,
|
||||
збереженим під час останньої \`sync\`.
|
||||
Якщо знайдено різницю, вона повертається до збереженого знімка.
|
||||
Усі файли та дані парності порівнюються зі станом, збереженим під час
|
||||
останньої синхронізації \`sync\`. Якщо виявлено відмінність, стан повертається до збереженого.
|
||||
.PP
|
||||
УВАГА! Команда \`fix\` не розрізняє помилки та навмисні
|
||||
модифікації. Вона безумовно повертає стан файлу до останньої
|
||||
\`sync\`.
|
||||
УВАГА!
|
||||
Команда \`fix\` не робить різниці між помилками та навмисними змінами.
|
||||
Вона безумовно повертає стан файлів до моменту останньої синхронізації \`sync\`.
|
||||
.PP
|
||||
Якщо не вказано жодної іншої опції, обробляється весь масив.
|
||||
Використовуйте опції фільтра, щоб вибрати підмножину файлів
|
||||
|
|
@ -994,7 +1003,7 @@ SnapRAID перейменовує всі файли, які не можуть б
|
|||
Працює як \`fix\`, але лише імітує відновлення, і жодні зміни
|
||||
не записуються в масив.
|
||||
.PP
|
||||
Ця команда в першу чергу призначена для ручної перевірки,
|
||||
Ця команда насамперед призначена для ручної перевірки,
|
||||
наприклад, після процесу відновлення або в інших особливих
|
||||
умовах. Для періодичних та запланованих перевірок використовуйте
|
||||
\`scrub\`.
|
||||
|
|
@ -1011,7 +1020,7 @@ SnapRAID перейменовує всі файли, які не можуть б
|
|||
останньої \`sync\`.
|
||||
.PP
|
||||
З \-v або \-\-verbose також показується час з точністю до
|
||||
долі секунди.
|
||||
часток секунди.
|
||||
.PP
|
||||
Нічого не змінюється.
|
||||
.SS dup
|
||||
|
|
@ -1052,17 +1061,17 @@ SnapRAID перейменовує всі файли, які не можуть б
|
|||
.PP
|
||||
Нічого не змінюється.
|
||||
.SS touch
|
||||
Встановлює довільну часову мітку з точністю до долі секунди
|
||||
Встановлює довільну часову мітку з точністю до часток секунди
|
||||
для всіх файлів, у яких вона встановлена на нуль.
|
||||
.PP
|
||||
Це покращує здатність SnapRAID розпізнавати переміщені та
|
||||
скопійовані файли, оскільки робить часову мітку майже
|
||||
унікальною, зменшуючи можливі дублікати.
|
||||
.PP
|
||||
Зокрема, якщо часова мітка з точністю до долі секунди не
|
||||
Зокрема, якщо часова мітка з точністю до часток секунди не
|
||||
дорівнює нулю, переміщений або скопійований файл ідентифікується
|
||||
як такий, якщо він збігається з іменем, розміром та часовою
|
||||
міткою. Якщо часова мітка з точністю до долі секунди дорівнює
|
||||
міткою. Якщо часова мітка з точністю до часток секунди дорівнює
|
||||
нулю, він вважається копією, лише якщо повний шлях, розмір та
|
||||
часова мітка збігаються.
|
||||
.PP
|
||||
|
|
@ -1099,7 +1108,7 @@ SnapRAID перейменовує всі файли, які не можуть б
|
|||
\-W, \-\-force\-realloc\-tail.
|
||||
Майте на увазі, що такі файли не будуть захищені парністю під час процесу
|
||||
перерозподілу.
|
||||
.SH Опції
|
||||
.SH Опції (OPTIONS)
|
||||
SnapRAID надає наступні опції:
|
||||
.TP
|
||||
.B \-c, \-\-conf CONFIG
|
||||
|
|
@ -1115,7 +1124,7 @@ SnapRAID надає наступні опції:
|
|||
шаблону. Цю опцію можна використовувати кілька разів.
|
||||
Дивіться розділ PATTERN для отримання додаткової
|
||||
інформації про специфікації шаблонів.
|
||||
В Unix переконайтеся, що символи глоббінгу взяті
|
||||
В Unix переконайтеся, що символи глобінгу взяті
|
||||
в лапки, якщо вони використовуються.
|
||||
Цю опцію можна використовувати лише з \`check\` та \`fix\`.
|
||||
Її не можна використовувати з \`sync\` та \`scrub\`, оскільки
|
||||
|
|
@ -1226,7 +1235,7 @@ DAYS — це мінімальний вік у днях для блоку, як
|
|||
Ви можете вказати множник, такий як K, M або G (наприклад,
|
||||
\-\-bw\-limit 1G).
|
||||
.TP
|
||||
.B \-t, \-\-tail РОЗМІР
|
||||
.B \-t, \-\-tail SIZE
|
||||
Обмежує список файлів тими, що використовують не більше зазначеного
|
||||
розміру хвоста дисків парності.
|
||||
Можна використовувати множники, такі як K, M, G або T (наприклад, \-\-tail 1G).
|
||||
|
|
@ -1339,12 +1348,12 @@ ext3/ext4.
|
|||
вмісту, для перевірки даних.
|
||||
Цю опцію можна використовувати лише з \`sync\`.
|
||||
УВАГА! Ця опція лише для експертів, і
|
||||
настійно не рекомендується її використовувати.
|
||||
наполегливо не рекомендується її використовувати.
|
||||
Ви НЕ маєте захисту даних під час операції \`sync\`.
|
||||
.TP
|
||||
.B \-W, \-\-force\-realloc\-tail РОЗМІР
|
||||
.B \-W, \-\-force\-realloc\-tail SIZE
|
||||
Працює як \-R, \-\-force\-realloc, але обмежується вказаною кінцевою
|
||||
частиною (останні РОЗМІР байт) кожного файлу парності.
|
||||
частиною (останні SIZE\-байт) кожного файлу парності.
|
||||
Примусово перерозподіляє (переміщує) будь\-які фрагменти/блоки файлів,
|
||||
що наразі зберігаються в цій кінцевій секції, дозволяючи розмістити
|
||||
їх будь\-де у файлі(ах) парності, де є вільне місце (включно з
|
||||
|
|
@ -1358,7 +1367,7 @@ ext3/ext4.
|
|||
Ви можете використовувати locate \-t, \-\-tail, щоб заздалегідь дізнатися
|
||||
про зачеплені файли.
|
||||
УВАГА!
|
||||
Цей параметр призначений лише для експертів, і його настійно
|
||||
Цей параметр призначений лише для експертів, і його наполегливо
|
||||
не рекомендується використовувати.
|
||||
Під час операції \`sync\` захист даних для зачеплених файлів ВІДСУТНІЙ.
|
||||
.TP
|
||||
|
|
@ -1434,7 +1443,7 @@ ext3/ext4.
|
|||
.TP
|
||||
.B \-V, \-\-version
|
||||
Виводить версію програми.
|
||||
.SH Конфігурація
|
||||
.SH Конфігурація (CONFIGURATION)
|
||||
SnapRAID вимагає конфігураційний файл, щоб знати, де
|
||||
розташований ваш дисковий масив і де зберігати інформацію
|
||||
парності.
|
||||
|
|
@ -1497,8 +1506,8 @@ SnapRAID вимагає конфігураційний файл, щоб знат
|
|||
Визначає альтернативний файл та формат для зберігання
|
||||
потрійної парності.
|
||||
.PP
|
||||
Ця опція є альтернативою \`3\-parity\`, в першу чергу
|
||||
призначена для ЦП низького класу, таких як ARM або
|
||||
Ця опція є альтернативою \`3\-parity\`, насамперед
|
||||
призначена для малопотужних ЦП, таких як ARM або
|
||||
AMD Phenom, Athlon та Opteron, які не підтримують
|
||||
набір інструкцій SSSE3. У таких випадках вона
|
||||
забезпечує кращу продуктивність.
|
||||
|
|
@ -1557,6 +1566,29 @@ UUID дисків.
|
|||
.PP
|
||||
Зверніть увагу, що на такі диски не впливають команди \`up\` та \`down\`,
|
||||
оскільки очікується, що вони завжди обертаються.
|
||||
.SS snapshot
|
||||
Включає використання знімків файлової системи для команд \`sync\`, \`scrub\`,
|
||||
\`check\` та \`fix\`.
|
||||
.PP
|
||||
Якщо увімкнено, SnapRAID створює знімок ваших даних лише для читання на
|
||||
початку операції \'sync\'. Це забезпечує узгоджений зріз ваших файлів на певний момент часу,
|
||||
запобігаючи помилкам, викликаним одночасним зміненням файлів.
|
||||
.PP
|
||||
Це значно покращує відновлення: якщо файл видаляється з живої файлової системи,
|
||||
він залишається збереженим у знімку. Це запобігає «порушенню» парності
|
||||
для цього блоку, гарантуючи, що ви все одно зможете успішно відновити дані,
|
||||
якщо інший диск зазнає збою.
|
||||
.PP
|
||||
Ця опція застосовується виключно до дисків із даними, відформатованих у файлових
|
||||
системах Btrfs, Bcachefs або ZFS у Linux та NTFS у Windows.
|
||||
Диски парності або диски з даними, що використовують інші файлові системи, завжди використовуватимуть
|
||||
живу версію файлової системи.
|
||||
.PP
|
||||
Створення та видалення знімків вимагають прав адміністратора.
|
||||
Переконайтеся, що SnapRAID запущено з необхідними привілеями (наприклад, sudo), коли
|
||||
увімкнено цю опцію.
|
||||
.PP
|
||||
Детальне пояснення життєвого циклу знімків див. у розділі SNAPSHOTS.
|
||||
.SS nohidden
|
||||
Виключає всі приховані файли та каталоги.
|
||||
В Unix приховані файли — це ті, що починаються з \`.\`.
|
||||
|
|
@ -1584,7 +1616,7 @@ UUID дисків.
|
|||
Розмір блоку за замовчуванням становить 256, що має
|
||||
працювати для більшості випадків.
|
||||
.PP
|
||||
УВАГА! Ця опція лише для експертів, і настійно
|
||||
УВАГА! Ця опція лише для експертів, і наполегливо
|
||||
не рекомендується змінювати це значення. Щоб змінити
|
||||
це значення в майбутньому, вам потрібно буде
|
||||
перестворити всю парність!
|
||||
|
|
@ -1598,15 +1630,15 @@ UUID дисків.
|
|||
це може призвести до значного невикористаного місця
|
||||
парності. Коли ви повністю заповнюєте диск парності,
|
||||
вам не дозволяється додавати більше файлів на диски
|
||||
даних. Однак, витрачена парність не накопичується
|
||||
між дисками даних. Витрачене місце внаслідок великої
|
||||
даних. Однак, втрачена парність не накопичується
|
||||
між дисками даних. Марно втрачений простір внаслідок великої
|
||||
кількості файлів на диску даних обмежує лише кількість
|
||||
даних на цьому диску даних, а не на інших.
|
||||
.PP
|
||||
Як наближення, ви можете припустити, що половина
|
||||
розміру блоку витрачається для кожного файлу.
|
||||
розміру блоку втрачається марно для кожного файлу.
|
||||
Наприклад, зі 100 000 файлами та розміром блоку 256 КіБ
|
||||
ви витратите 12,8 ГБ парності, що може призвести до
|
||||
ви втратите 12,8 ГБ парності, що може призвести до
|
||||
того, що на диску даних буде на 12,8 ГБ менше місця.
|
||||
.PP
|
||||
Ви можете перевірити кількість витраченого місця на
|
||||
|
|
@ -1644,18 +1676,18 @@ mkfs.ext4 \-m 0 \-T largefile4 DEVICE
|
|||
Розмір хешу за замовчуванням становить 16 байтів
|
||||
(128 біт), що має працювати для більшості випадків.
|
||||
.PP
|
||||
УВАГА! Ця опція лише для експертів, і настійно
|
||||
УВАГА! Ця опція лише для експертів, і наполегливо
|
||||
не рекомендується змінювати це значення. Щоб змінити
|
||||
це значення в майбутньому, вам потрібно буде
|
||||
перестворити всю парність!
|
||||
.PP
|
||||
Причина використовувати інший розмір хешу полягає
|
||||
в тому, якщо ваша система має обмежену пам\'ять.
|
||||
Як правило, SnapRAID зазвичай вимагає 1 ГіБ ОЗП
|
||||
на кожні 16 ТБ даних у масиві.
|
||||
Інший розмір хешу варто використовувати, якщо ваша
|
||||
система має обмежену пам\'ять.
|
||||
Зазвичай SnapRAID потребує 1 ГіБ ОЗП на кожні 16 ТБ
|
||||
даних у масиві.
|
||||
.PP
|
||||
Зокрема, для зберігання хешів даних SnapRAID
|
||||
вимагає приблизно $TS \\times (1+HS) / BS$ байтів
|
||||
вимагає приблизно TS*(1+HS)/BS байтів
|
||||
ОЗП, де TS — загальний розмір вашого дискового масиву
|
||||
у байтах, BS — розмір блоку у байтах, а HS —
|
||||
розмір хешу у байтах.
|
||||
|
|
@ -1663,25 +1695,25 @@ mkfs.ext4 \-m 0 \-T largefile4 DEVICE
|
|||
Наприклад, з 8 дисками по 4 ТБ, розміром блоку 256 КіБ
|
||||
(1 КіБ = 1024 байта) та розміром хешу 16, ви отримуєте:
|
||||
.PP
|
||||
RAM = $(8 \\times 4 \\times 10^{12}) \\times (1+16) / (256 \\times 2^{10}) = 1.93$ ГіБ
|
||||
RAM = (8 * 4 * 10^12) * (1+16) / (256 * 2^10) = 1.93 ГіБ
|
||||
.PD 0
|
||||
.PD
|
||||
.PP
|
||||
Перехід до розміру хешу 8, ви отримуєте:
|
||||
.PP
|
||||
RAM = $(8 \\times 4 \\times 10^{12}) \\times (1+8) / (256 \\times 2^{10}) = 1.02$ ГіБ
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (256 * 2^10) = 1.02 ГіБ
|
||||
.PD 0
|
||||
.PD
|
||||
.PP
|
||||
Перехід до розміру блоку 512, ви отримуєте:
|
||||
.PP
|
||||
RAM = $(8 \\times 4 \\times 10^{12}) \\times (1+16) / (512 \\times 2^{10}) = 0.96$ ГіБ
|
||||
RAM = (8 * 4 * 10^12) * (1+16) / (512 * 2^10) = 0.96 ГіБ
|
||||
.PD 0
|
||||
.PD
|
||||
.PP
|
||||
Перехід до розміру хешу 8 та розміру блоку 512, ви отримуєте:
|
||||
.PP
|
||||
RAM = $(8 \\times 4 \\times 10^{12}) \\times (1+8) / (512 \\times 2^{10}) = 0.51$ ГіБ
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0.51 ГіБ
|
||||
.PD 0
|
||||
.PD
|
||||
.SS autosave SIZE_IN_GIGABYTES
|
||||
|
|
@ -1719,13 +1751,13 @@ smartctl. Поточні температури дисків відобража
|
|||
виключно на фактично виміряних температурах
|
||||
дисків.
|
||||
.PP
|
||||
Для виконання цього аналізу SnapRAID потрібна
|
||||
довідкова інформація про температуру системи.
|
||||
Для виконання цього аналізу SnapRAID потрібне
|
||||
опорне значення температури системи.
|
||||
Спочатку він намагається зчитати її з доступних
|
||||
апаратних датчиків. Якщо до системного датчика
|
||||
неможливо отримати доступ, він використовує
|
||||
найнижчу температуру диска, виміряну на початку
|
||||
запуску, як резервну довідкову інформацію.
|
||||
запуску, як резервне опорне значення.
|
||||
.PP
|
||||
Зазвичай SnapRAID показує лише температуру
|
||||
найгарячішого диска. Щоб відобразити температуру
|
||||
|
|
@ -1779,6 +1811,9 @@ PARITY — це одне з імен парності: \`parity\`,
|
|||
ймовірно фіксований, і вам може не знадобитися
|
||||
використовувати \`%s\`.
|
||||
.PP
|
||||
Ви також можете вказати користувацький рядок параметрів інформації за допомогою
|
||||
тега \`[info: ...]\`, щоб замінити параметр за замовчуванням \`\-a\`.
|
||||
.PP
|
||||
Зверніться до документації smartmontools
|
||||
для можливих опцій:
|
||||
.PP
|
||||
|
|
@ -1795,6 +1830,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices
|
|||
Наприклад:
|
||||
.PP
|
||||
.RS 4
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl parity \-d sat %s
|
||||
.PD 0
|
||||
.PD
|
||||
|
|
@ -1812,19 +1851,27 @@ PARITY — це одне з імен парності: \`parity\`,
|
|||
Спеціальне значення * можна використовувати
|
||||
для ігнорування атрибута на всіх дисках.
|
||||
.PP
|
||||
Наприклад, щоб ігнорувати атрибут \`Current Pending Sector Count\`
|
||||
на всіх дисках:
|
||||
Можна вказати кілька атрибутів, розділених пробілами.
|
||||
Кожен атрибут може бути вказаний як число від 1 до 255 або як регістронезалежне
|
||||
ім\'я (наприклад, \`Current_Pending_Sector\`).
|
||||
.PP
|
||||
Наприклад, щоб ігнорувати атрибути \`Current Pending Sector Count\` та
|
||||
\`Reallocated Sectors Count\` на всіх дисках за їхнім номером або ім\'ям:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore * 197
|
||||
smartignore * 197 5
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.PP
|
||||
Щоб ігнорувати його лише на першому диску парності:
|
||||
Щоб ігнорувати їх лише на першому диску парності:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore parity 197
|
||||
smartignore parity 197 5
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
|
|
@ -1864,7 +1911,7 @@ exclude /tmp/
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1920,7 +1967,7 @@ exclude \\System Volume Information
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1936,6 +1983,125 @@ smartctl 2\-parity \-d areca,2/1 /dev/arcmsr0
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH Знімки (SNAPSHOTS)
|
||||
Якщо в конфігурації увімкнено опцію знімків, SnapRAID використовує
|
||||
функціональність знімків файлової системи для забезпечення атомарності та
|
||||
узгодженості операцій.
|
||||
.PP
|
||||
Керування знімками відбувається повністю автоматично та прозоро.
|
||||
Ви можете продовжувати використовувати SnapRAID точно так само, як і раніше, отримуючи
|
||||
додатковий захист, що забезпечується знімками, які повністю обробляються у
|
||||
фоновому режимі.
|
||||
.PP
|
||||
Це дає дві основні переваги:
|
||||
.PP
|
||||
Узгодженість — Файли, змінені в живій файловій системі під час тривалого
|
||||
.PP
|
||||
.RS 4
|
||||
процесу sync або scrub, не викликатимуть невідповідності парності або переривання
|
||||
операцій, оскільки SnapRAID бачить заморожений знімок на момент часу.
|
||||
.RE
|
||||
.PP
|
||||
Відновлення — Якщо файл оновлюється або видаляється з живої файлової системи,
|
||||
.PP
|
||||
.RS 4
|
||||
він залишається збереженим у знімку. Якщо збій диска станеться
|
||||
до запуску наступної синхронізації sync, SnapRAID використає дані, збережені
|
||||
в знімку, для реконструкції диска, що зазнав збою.
|
||||
.RE
|
||||
.PP
|
||||
.RS 4
|
||||
У разі збою диска під час активного процесу sync,
|
||||
SnapRAID також може автоматично читати як зі знімка попереднього
|
||||
обчислення парності, так і з поточного.
|
||||
Це максимізує ймовірність повного відновлення, надаючи
|
||||
доступ до точних блоків даних, необхідних для вирішення рівнянь парності,
|
||||
навіть якщо ці блоки були змінені або видалені між синхронізаціями.
|
||||
.RE
|
||||
.PP
|
||||
.RS 4
|
||||
Без знімків оновлений або видалений файл на справному диску
|
||||
призводить до відсутності блоків даних, які можуть знадобитися для
|
||||
відновлення інших дисків, що зазнали збою.
|
||||
.RE
|
||||
.PP
|
||||
Знімки створюються лише для дисків із даними і лише в тому випадку, якщо базова
|
||||
файлова система підтримує цю функціональність. Диски парності завжди використовують
|
||||
живу файлову систему.
|
||||
.PP
|
||||
Наразі це підтримується на Btrfs, Bcachefs та ZFS в Linux
|
||||
і на NTFS у Windows.
|
||||
.PP
|
||||
Ви можете комбінувати диски з даними з різними файловими системами. Тільки ті з них,
|
||||
які підтримують знімки, використовуватимуть їх, тоді як інші диски продовжуватимуть
|
||||
працювати безпосередньо з живою файловою системою.
|
||||
.PP
|
||||
Створення та видалення знімків вимагають прав адміністратора.
|
||||
Переконайтеся, що SnapRAID запущено з необхідними привілеями (наприклад, sudo),
|
||||
коли знімки увімкнено.
|
||||
.SS Поведінка команд із знімками
|
||||
Команди \`sync\` та \`scrub\` працюють виключно зі знімками,
|
||||
щоб гарантувати, що всі операції з даними виконуються на узгодженому,
|
||||
замороженому стані. Використовуючи ці знімки, SnapRAID запобігає невідповідності
|
||||
парності, яка в іншому випадку була б викликана одночасними змінами файлів у живій файловій системі.
|
||||
Під час \`sync\` команда використовує новий знімок, створений на початку
|
||||
процесу, для фіксації поточного стану для обчислення парності.
|
||||
Навпаки, команда \`scrub\` використовує останній знімок, створений під час
|
||||
найостаннішої синхронізації, щоб підтримувати надійну точку відліку,
|
||||
яка відповідає існуючій парності.
|
||||
.PP
|
||||
Для команд \`check\` та \`fix\` використання останнього знімка
|
||||
залежить від того, чи націлені конкретні диски за допомогою опції
|
||||
\-d, \-\-filter\-disk.
|
||||
.PP
|
||||
Диск, явно вибраний за допомогою \-d («ціль» операції),
|
||||
завжди використовує живу файлову систему. Для \`fix\` це дозволяє відновити
|
||||
дані на активну заміну диска. Для \`check\` це дозволяє симулювати
|
||||
операцію \`fix\` за тих самих умов.
|
||||
.PP
|
||||
Доступ до всіх інших дисків із даними («довідкових» дисків) здійснюватиметься через
|
||||
їхні знімки. Це гарантує, що навіть якщо ви змінюєте файли
|
||||
на своїх справних дисках під час відновлення, SnapRAID
|
||||
має стабільну, замороженну точку відліку для вирішення рівнянь парності.
|
||||
.PP
|
||||
Якщо опція \-d не надана, SnapRAID припускає, що операція застосовується
|
||||
до всього масиву; у цьому випадку \`check\` та \`fix\` використовуватимуть виключно
|
||||
живі файлові системи.
|
||||
.PP
|
||||
Усі інші команди працюють виключно з живою файловою системою.
|
||||
.SH Життєвий цикл знімків (SNAPSHOTS LIFECYCLE)
|
||||
SnapRAID керує двома конкретними знімками, \`stable\` та \`pending\`,
|
||||
всередині прихованого каталогу в корінному каталозі кожного підтому даних.
|
||||
У Btrfs, Bcachefs та NTFS використовується каталог \`.snapraid/\`,
|
||||
у ZFS — стандартний \`.zfs/snapshot/\`.
|
||||
.PP
|
||||
Знімок \`stable\` представляє стан останньої успішно
|
||||
завершеної синхронізації \`sync\`, що містить точні дані, використані для
|
||||
обчислення поточної парності. Він служить основним джерелом даних
|
||||
для команд \`scrub\`, \`check\` та \`fix\`.
|
||||
.PP
|
||||
Знімок \`pending\` — це тимчасовий образ, що створюється на початку
|
||||
\`sync\` для забезпечення замороженого стану для обчислення парності.
|
||||
Після успішного завершення операції попередній знімок \`stable\`
|
||||
видаляється, а знімок \`pending\` підвищується в статусі, щоб
|
||||
зайняти його місце в якості нового стабільного орієнтира.
|
||||
.PP
|
||||
Якщо процес \`sync\` переривається, знімок \`pending\` зберігається.
|
||||
Наступні команди \`scrub\`, \`check\` та \`fix\` використовуватимуть цей
|
||||
очікуваний знімок, оскільки він відповідає стану файлової системи, записаному в
|
||||
файлі .content, навіть якщо парність синхронізована лише частково.
|
||||
.PP
|
||||
У разі переривання \`sync\` команди \`check\` та \`fix\`
|
||||
також читають дані зі знімка \`stable\` для вилучення блоків даних
|
||||
із файлів, які були оновлені або видалені під час синхронізації.
|
||||
Це можливо тому, що файл .content зберігає метадані для
|
||||
усіх змінених або видалених файлів протягом усього процесу sync.
|
||||
Ця історична інформація очищається лише після успішного завершення sync
|
||||
і збереження фінальної версії файлу .content.
|
||||
.PP
|
||||
Якщо \`sync\` перезапускається після переривання, існуючий
|
||||
очікуваний (pending) знімок видаляється, і створюється новий для
|
||||
фіксації поточного стану живої файлової системи.
|
||||
.SH Шаблон (PATTERN)
|
||||
Шаблони забезпечують гнучкий спосіб фільтрації файлів для включення або
|
||||
виключення. Використовуючи символи підстановки (globbing), ви можете визначити правила, які
|
||||
|
|
@ -1968,7 +2134,7 @@ smartctl 2\-parity \-d areca,2/1 /dev/arcmsr0
|
|||
Класи символів із використанням квадратних дужок \`[]\` відповідають одному символу з
|
||||
визначеного набору або діапазону. Як і інші односимвольні шаблони, вони
|
||||
не відповідають роздільникам каталогів. Класи підтримують діапазони та заперечення за допомогою
|
||||
знаку оклику.
|
||||
знака оклику.
|
||||
.PP
|
||||
Фундаментальна відмінність, яку слід пам\'ятати, полягає в тому, що \`*\`, \`?\` та класи символів
|
||||
усі дотримуються меж каталогів і відповідають лише в межах одного компонента
|
||||
|
|
@ -1979,19 +2145,19 @@ smartctl 2\-parity \-d areca,2/1 /dev/arcmsr0
|
|||
.TP
|
||||
.B FILE
|
||||
Вибирає будь\-який файл з ім\'ям FILE.
|
||||
Цей шаблон застосовується тільки до файлів, а не до директорій.
|
||||
Цей шаблон застосовується тільки до файлів, а не до каталогів.
|
||||
.TP
|
||||
.B DIR/
|
||||
Вибирає будь\-яку директорію з ім\'ям DIR і все, що знаходиться всередині.
|
||||
Цей шаблон застосовується тільки до директорій, а не до файлів.
|
||||
Вибирає будь\-який каталог з ім\'ям DIR і все, що знаходиться всередині.
|
||||
Цей шаблон застосовується тільки до каталогів, а не до файлів.
|
||||
.TP
|
||||
.B /PATH/FILE
|
||||
Вибирає точно вказаний шлях до файлу. Цей шаблон застосовується
|
||||
тільки до файлів, а не до директорій.
|
||||
тільки до файлів, а не до каталогів.
|
||||
.TP
|
||||
.B /PATH/DIR/
|
||||
Вибирає точно вказаний шлях до директорії і все, що знаходиться
|
||||
всередині. Цей шаблон застосовується тільки до директорій, а не до файлів.
|
||||
Вибирає точно вказаний шлях до каталогу і все, що знаходиться
|
||||
всередині. Цей шаблон застосовується тільки до каталогів, а не до файлів.
|
||||
.PP
|
||||
Коли ви вказуєте абсолютний шлях, що починається
|
||||
з /, він застосовується до кореневого каталогу
|
||||
|
|
@ -2008,7 +2174,7 @@ smartctl 2\-parity \-d areca,2/1 /dev/arcmsr0
|
|||
.PP
|
||||
Якщо ім\'я файлу містить символи \`*\`, \`?\`, \`[\`,
|
||||
або \`]\`, ви повинні екранувати їх, щоб уникнути
|
||||
їх інтерпретації як символу глоббінгу.
|
||||
їх інтерпретації як символу глобінгу.
|
||||
В Unix символом екранування є \`\\\`; у Windows — \`^\`.
|
||||
Коли шаблон знаходиться в командному рядку,
|
||||
ви повинні подвоїти символ екранування, щоб
|
||||
|
|
@ -2125,7 +2291,7 @@ include /pictures/
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
# розширення глоббінгу оболонкою.
|
||||
# розширення глобінгу оболонкою.
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -2134,7 +2300,7 @@ snapraid \-f \[dq]*.mp3\[dq] check
|
|||
.PD
|
||||
.RE
|
||||
.PP
|
||||
В Unix, при використанні символів глоббінгу в
|
||||
В Unix, при використанні символів глобінгу в
|
||||
командному рядку, ви повинні взяти їх у лапки,
|
||||
щоб запобігти їх розширенню оболонкою.
|
||||
.SH Ігнорування файлів (IGNORE FILE)
|
||||
|
|
@ -2206,9 +2372,10 @@ SnapRAID зберігає список та контрольні суми
|
|||
усіма контрольними сумами для перевірки їх
|
||||
цілісності.
|
||||
.PP
|
||||
Цей файл зчитується та записується командами
|
||||
\`sync\` та \`scrub\` та зчитується командами \`fix\`,
|
||||
\`check\` та \`status\`.
|
||||
Файл вмісту зчитується та записується командами \`sync\`, \`scrub\`,
|
||||
\`touch\` та \`rehash\`. Він зчитується командами \`status\`, \`diff\`,
|
||||
\`check\`, \`fix\`, \`list\`, \`dup\`, \`locate\` та \`pool\`, і повністю
|
||||
ігнорується командами \`smart\`, \`probe\`, \`up\`, \`down\` та \`devices\`.
|
||||
.SH Парність (PARITY)
|
||||
SnapRAID зберігає інформацію парності вашого
|
||||
масиву у файлах парності.
|
||||
|
|
@ -2240,7 +2407,25 @@ TrueType, такий як \`Lucida Console\`, як
|
|||
файлів; якщо ви перенаправляєте вивід
|
||||
консолі у файл, отриманий файл завжди
|
||||
буде у форматі UTF\-8.
|
||||
.SH Код завершення (EXIT CODE)
|
||||
SnapRAID завершує роботу з такими кодами помилок:
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I 0
|
||||
Все в порядку.
|
||||
.HP 4
|
||||
.I 1
|
||||
Команда виявила помилки.
|
||||
.HP 4
|
||||
.I 2
|
||||
Команда \`diff\` визначила, що все в порядку, але потрібен \`sync\`.
|
||||
.PD
|
||||
.RE
|
||||
.SH Переклад (TRANSLATION)
|
||||
Цей документ є автоматичним перекладом англійського посібника.
|
||||
Зверніться до англійського посібника для отримання офіційної версії.
|
||||
.SH Авторське право (COPYRIGHT)
|
||||
Цей файл захищений авторським правом (C) 2025 Andrea Mazzoleni
|
||||
Цей файл захищений авторським правом (C) 2026 Andrea Mazzoleni
|
||||
.SH Див. також (SEE ALSO)
|
||||
snapraid_log(1), snapraidd(1)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
Name{number}
|
||||
snapraid - SnapRAID Резервне копіювання для дискових масивів
|
||||
|
||||
Короткий опис
|
||||
Короткий опис (Synopsis)
|
||||
:snapraid [-c, --conf CONFIG]
|
||||
: [-f, --filter PATTERN] [-d, --filter-disk NAME]
|
||||
: [-m, --filter-missing] [-e, --filter-error]
|
||||
|
|
@ -23,13 +23,13 @@ Name{number}
|
|||
|
||||
:snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
Опис
|
||||
Опис (Description)
|
||||
SnapRAID — це програма резервного копіювання, розроблена для
|
||||
дискових масивів, яка зберігає інформацію парності для
|
||||
відновлення даних у випадку відмови до шести дисків.
|
||||
|
||||
В першу чергу призначена для домашніх медіацентрів з великими
|
||||
файлами, що рідко змінюються, SnapRAID пропонує кілька функцій:
|
||||
Насамперед призначений для домашніх медіацентрів з великими
|
||||
файлами, які рідко змінюються, SnapRAID пропонує кілька функцій:
|
||||
|
||||
* Ви можете використовувати диски, вже заповнені файлами, без
|
||||
необхідності їх переформатування, отримуючи доступ до них
|
||||
|
|
@ -54,24 +54,30 @@ Name{number}
|
|||
|
||||
:https://www.snapraid.it/
|
||||
|
||||
Обмеження
|
||||
SnapRAID є гібридом між RAID та програмою резервного копіювання,
|
||||
прагнучи поєднати найкращі переваги обох. Однак, він має деякі
|
||||
обмеження, які слід врахувати перед його використанням.
|
||||
Обмеження (Limitations)
|
||||
SnapRAID є гібридом між RAID і програмою резервного копіювання, що має на меті поєднати
|
||||
найкращі переваги обох рішень. Однак у нього є деякі обмеження, які вам слід
|
||||
врахувати перед використанням.
|
||||
|
||||
Основне обмеження полягає в тому, що якщо диск виходить з ладу,
|
||||
а ви нещодавно не виконували синхронізацію, ви можете не
|
||||
змогти повністю відновити дані.
|
||||
Конкретніше, ви можете втратити можливість відновлення даних
|
||||
обсягом до розміру змінених або видалених файлів з моменту
|
||||
останньої операції синхронізації.
|
||||
Це відбувається, навіть якщо змінені або видалені файли не
|
||||
знаходяться на диску, що вийшов з ладу. Ось чому SnapRAID
|
||||
краще підходить для даних, які рідко змінюються.
|
||||
Головне обмеження полягає в тому, що у разі збою диска ви можете відновити дані лише до
|
||||
стану останньої операції синхронізації (`sync`). Будь-які дані, додані або змінені
|
||||
з моменту останньої синхронізації, які розташовані на пошкодженому диску, будуть втрачені.
|
||||
|
||||
З іншого боку, щойно додані файли не перешкоджають відновленню
|
||||
вже існуючих файлів. Ви втратите лише нещодавно додані файли,
|
||||
якщо вони знаходяться на диску, що вийшов з ладу.
|
||||
Відповідно, SnapRAID насамперед підходить для даних, які рідко змінюються.
|
||||
|
||||
Для даних, які вже існували на момент останньої синхронізації, надійність відновлення залежить
|
||||
від того, чи використовується опція знімка (`snapshot`):
|
||||
|
||||
* За наявності підтримки знімків (доступно на Btrfs, ZFS, Bcachefs та NTFS),
|
||||
SnapRAID може автоматично підтримувати заморожену копію ваших дисків із даними.
|
||||
Це гарантує, що навіть якщо ви зміните або видалите файли у вашій живій файловій системі
|
||||
під час або після синхронізації, процес відновлення залишиться узгодженим і надійним.
|
||||
|
||||
* Без підтримки знімків видалення або зміна файлів після `sync`
|
||||
може запобігти повному відновленню інших дисків, що зазнали збою. Це відбувається
|
||||
тому, що парність більше не відповідає зміненим файлам, навіть якщо
|
||||
ці файли знаходяться не на пошкодженому диску. З іншого боку, щойно додані
|
||||
файли не перешкоджають відновленню вже існуючих файлів.
|
||||
|
||||
Інші обмеження SnapRAID:
|
||||
|
||||
|
|
@ -88,10 +94,10 @@ Name{number}
|
|||
можете відновити дані навіть після повної відмови
|
||||
всього дискового масиву.
|
||||
* Зберігаються лише імена файлів, часові мітки, символічні
|
||||
та жорсткі посилання. Права доступу, власність та
|
||||
та жорсткі посилання. Права доступу, власники та
|
||||
розширені атрибути не зберігаються.
|
||||
|
||||
Початок роботи
|
||||
Початок роботи (Getting Started)
|
||||
Щоб використовувати SnapRAID, спершу потрібно вибрати один диск
|
||||
у вашому дисковому масиві, щоб присвятити його інформації
|
||||
`парності`. З одним диском для парності ви зможете відновити
|
||||
|
|
@ -223,7 +229,7 @@ Name{number}
|
|||
Об'єднання (Pooling)
|
||||
Примітка: Функція об'єднання, описана нижче, була замінена
|
||||
інструментом mergerfs, який тепер є рекомендованою опцією для
|
||||
користувачів Linux у спільноті SnapRAID. Mergefs забезпечує
|
||||
користувачів Linux у спільноті SnapRAID. Mergerfs забезпечує
|
||||
більш гнучкий та ефективний спосіб об'єднання кількох дисків
|
||||
в єдину уніфіковану точку монтування, дозволяючи безперешкодний
|
||||
доступ до файлів у вашому масиві без використання символічних
|
||||
|
|
@ -424,16 +430,16 @@ Name{number}
|
|||
|
||||
Якщо все відновлено, ця команда виконується миттєво.
|
||||
|
||||
Команди
|
||||
Команди (Commands)
|
||||
SnapRAID надає кілька простих команд, які дозволяють:
|
||||
|
||||
* Вивести статус масиву -> `status`
|
||||
* Керувати дисками -> `smart`, `probe`, `up`, `down`
|
||||
* Створити резервну копію/знімок -> `sync`
|
||||
* Створити точку резервного копіювання/відновлення -> `sync`
|
||||
* Періодично перевіряти дані -> `scrub`
|
||||
* Відновити останню резервну копію/знімок -> `fix`.
|
||||
* Відновити останню точку резервного копіювання/відновлення -> `fix`.
|
||||
|
||||
Команди повинні бути написані малими літерами.
|
||||
Команди обов'язково повинні бути написані малими літерами.
|
||||
|
||||
status
|
||||
Виводить зведення стану дискового масиву.
|
||||
|
|
@ -459,7 +465,7 @@ Name{number}
|
|||
Виводить звіт SMART усіх дисків у системі.
|
||||
|
||||
Включає оцінку ймовірності відмови протягом наступного року,
|
||||
дозволяючи вам планувати планову заміну дисків, які
|
||||
дозволяючи вам планувати своєчасну заміну дисків, які
|
||||
виявляють підозрілі атрибути.
|
||||
|
||||
Ця оцінка ймовірності отримана шляхом кореляції атрибутів
|
||||
|
|
@ -469,7 +475,7 @@ Name{number}
|
|||
|
||||
Якщо SMART повідомляє, що диск виходить з ладу, для цього
|
||||
диска виводиться `FAIL` або `PREFAIL`, і SnapRAID повертає
|
||||
помилку. У цьому випадку настійно рекомендується негайна
|
||||
помилку. У цьому випадку наполегливо рекомендується негайна
|
||||
заміна диска.
|
||||
|
||||
Інші можливі рядки стану:
|
||||
|
|
@ -551,13 +557,13 @@ Name{number}
|
|||
на тому ж диску. Вони ідентифікуються за тим же
|
||||
іменем, розміром, часовою міткою та inode, але іншим
|
||||
каталогом.
|
||||
copied - файли, скопійовані на той самий або інший диск, де
|
||||
copied (скопійовані) - Файли, скопійовані на той самий або інший диск, де
|
||||
оригінальний файл все ще існує.
|
||||
Вони ідентифікуються за однаковою назвою, розміром та міткою
|
||||
часу.
|
||||
Якщо мітка часу з точністю до часток секунди дорівнює нулю, для
|
||||
ідентифікації має збігатися повний шлях, а не лише назва.
|
||||
relocated - файли, переміщені на той самий або інший диск, де
|
||||
relocated (перерозміщені) - Файли, переміщені на той самий або інший диск, де
|
||||
оригінал зник.
|
||||
Вони ідентифікуються за однаковою назвою, розміром та міткою
|
||||
часу.
|
||||
|
|
@ -565,7 +571,7 @@ Name{number}
|
|||
ідентифікації має збігатися повний шлях.
|
||||
На відміну від файлів 'moved' на тому ж диску, переміщені файли
|
||||
мають інший inode.
|
||||
restored - файли з іншим inode, але зі збігом каталогу, назви,
|
||||
restored (відновлені) - Файли з іншим inode, але зі збігом каталогу, назви,
|
||||
розміру та мітки часу.
|
||||
Зазвичай це файли, відновлені після видалення.
|
||||
|
||||
|
|
@ -650,15 +656,14 @@ Name{number}
|
|||
Файли в масиві НЕ змінюються.
|
||||
|
||||
fix
|
||||
Виправляє всі файли та дані парності.
|
||||
Відновлює всі файли та дані парності.
|
||||
|
||||
Усі файли та дані парності порівнюються зі станом знімка,
|
||||
збереженим під час останньої `sync`.
|
||||
Якщо знайдено різницю, вона повертається до збереженого знімка.
|
||||
Усі файли та дані парності порівнюються зі станом, збереженим під час
|
||||
останньої синхронізації `sync`. Якщо виявлено відмінність, стан повертається до збереженого.
|
||||
|
||||
УВАГА! Команда `fix` не розрізняє помилки та навмисні
|
||||
модифікації. Вона безумовно повертає стан файлу до останньої
|
||||
`sync`.
|
||||
УВАГА!
|
||||
Команда `fix` не робить різниці між помилками та навмисними змінами.
|
||||
Вона безумовно повертає стан файлів до моменту останньої синхронізації `sync`.
|
||||
|
||||
Якщо не вказано жодної іншої опції, обробляється весь масив.
|
||||
Використовуйте опції фільтра, щоб вибрати підмножину файлів
|
||||
|
|
@ -693,7 +698,7 @@ Name{number}
|
|||
Працює як `fix`, але лише імітує відновлення, і жодні зміни
|
||||
не записуються в масив.
|
||||
|
||||
Ця команда в першу чергу призначена для ручної перевірки,
|
||||
Ця команда насамперед призначена для ручної перевірки,
|
||||
наприклад, після процесу відновлення або в інших особливих
|
||||
умовах. Для періодичних та запланованих перевірок використовуйте
|
||||
`scrub`.
|
||||
|
|
@ -711,7 +716,7 @@ Name{number}
|
|||
останньої `sync`.
|
||||
|
||||
З -v або --verbose також показується час з точністю до
|
||||
долі секунди.
|
||||
часток секунди.
|
||||
|
||||
Нічого не змінюється.
|
||||
|
||||
|
|
@ -756,17 +761,17 @@ Name{number}
|
|||
Нічого не змінюється.
|
||||
|
||||
touch
|
||||
Встановлює довільну часову мітку з точністю до долі секунди
|
||||
Встановлює довільну часову мітку з точністю до часток секунди
|
||||
для всіх файлів, у яких вона встановлена на нуль.
|
||||
|
||||
Це покращує здатність SnapRAID розпізнавати переміщені та
|
||||
скопійовані файли, оскільки робить часову мітку майже
|
||||
унікальною, зменшуючи можливі дублікати.
|
||||
|
||||
Зокрема, якщо часова мітка з точністю до долі секунди не
|
||||
Зокрема, якщо часова мітка з точністю до часток секунди не
|
||||
дорівнює нулю, переміщений або скопійований файл ідентифікується
|
||||
як такий, якщо він збігається з іменем, розміром та часовою
|
||||
міткою. Якщо часова мітка з точністю до долі секунди дорівнює
|
||||
міткою. Якщо часова мітка з точністю до часток секунди дорівнює
|
||||
нулю, він вважається копією, лише якщо повний шлях, розмір та
|
||||
часова мітка збігаються.
|
||||
|
||||
|
|
@ -806,7 +811,7 @@ Name{number}
|
|||
Майте на увазі, що такі файли не будуть захищені парністю під час процесу
|
||||
перерозподілу.
|
||||
|
||||
Опції
|
||||
Опції (Options)
|
||||
SnapRAID надає наступні опції:
|
||||
|
||||
-c, --conf CONFIG
|
||||
|
|
@ -822,7 +827,7 @@ Name{number}
|
|||
шаблону. Цю опцію можна використовувати кілька разів.
|
||||
Дивіться розділ PATTERN для отримання додаткової
|
||||
інформації про специфікації шаблонів.
|
||||
В Unix переконайтеся, що символи глоббінгу взяті
|
||||
В Unix переконайтеся, що символи глобінгу взяті
|
||||
в лапки, якщо вони використовуються.
|
||||
Цю опцію можна використовувати лише з `check` та `fix`.
|
||||
Її не можна використовувати з `sync` та `scrub`, оскільки
|
||||
|
|
@ -933,7 +938,7 @@ Name{number}
|
|||
Ви можете вказати множник, такий як K, M або G (наприклад,
|
||||
--bw-limit 1G).
|
||||
|
||||
-t, --tail РОЗМІР
|
||||
-t, --tail SIZE
|
||||
Обмежує список файлів тими, що використовують не більше зазначеного
|
||||
розміру хвоста дисків парності.
|
||||
Можна використовувати множники, такі як K, M, G або T (наприклад, --tail 1G).
|
||||
|
|
@ -1046,12 +1051,12 @@ Name{number}
|
|||
вмісту, для перевірки даних.
|
||||
Цю опцію можна використовувати лише з `sync`.
|
||||
УВАГА! Ця опція лише для експертів, і
|
||||
настійно не рекомендується її використовувати.
|
||||
наполегливо не рекомендується її використовувати.
|
||||
Ви НЕ маєте захисту даних під час операції `sync`.
|
||||
|
||||
-W, --force-realloc-tail РОЗМІР
|
||||
-W, --force-realloc-tail SIZE
|
||||
Працює як -R, --force-realloc, але обмежується вказаною кінцевою
|
||||
частиною (останні РОЗМІР байт) кожного файлу парності.
|
||||
частиною (останні SIZE-байт) кожного файлу парності.
|
||||
Примусово перерозподіляє (переміщує) будь-які фрагменти/блоки файлів,
|
||||
що наразі зберігаються в цій кінцевій секції, дозволяючи розмістити
|
||||
їх будь-де у файлі(ах) парності, де є вільне місце (включно з
|
||||
|
|
@ -1065,7 +1070,7 @@ Name{number}
|
|||
Ви можете використовувати locate -t, --tail, щоб заздалегідь дізнатися
|
||||
про зачеплені файли.
|
||||
УВАГА!
|
||||
Цей параметр призначений лише для експертів, і його настійно
|
||||
Цей параметр призначений лише для експертів, і його наполегливо
|
||||
не рекомендується використовувати.
|
||||
Під час операції `sync` захист даних для зачеплених файлів ВІДСУТНІЙ.
|
||||
|
||||
|
|
@ -1142,7 +1147,7 @@ Name{number}
|
|||
-V, --version
|
||||
Виводить версію програми.
|
||||
|
||||
Конфігурація
|
||||
Конфігурація (Configuration)
|
||||
SnapRAID вимагає конфігураційний файл, щоб знати, де
|
||||
розташований ваш дисковий масив і де зберігати інформацію
|
||||
парності.
|
||||
|
|
@ -1202,8 +1207,8 @@ Name{number}
|
|||
Визначає альтернативний файл та формат для зберігання
|
||||
потрійної парності.
|
||||
|
||||
Ця опція є альтернативою `3-parity`, в першу чергу
|
||||
призначена для ЦП низького класу, таких як ARM або
|
||||
Ця опція є альтернативою `3-parity`, насамперед
|
||||
призначена для малопотужних ЦП, таких як ARM або
|
||||
AMD Phenom, Athlon та Opteron, які не підтримують
|
||||
набір інструкцій SSSE3. У таких випадках вона
|
||||
забезпечує кращу продуктивність.
|
||||
|
|
@ -1266,6 +1271,30 @@ Name{number}
|
|||
Зверніть увагу, що на такі диски не впливають команди `up` та `down`,
|
||||
оскільки очікується, що вони завжди обертаються.
|
||||
|
||||
snapshot
|
||||
Включає використання знімків файлової системи для команд `sync`, `scrub`,
|
||||
`check` та `fix`.
|
||||
|
||||
Якщо увімкнено, SnapRAID створює знімок ваших даних лише для читання на
|
||||
початку операції 'sync'. Це забезпечує узгоджений зріз ваших файлів на певний момент часу,
|
||||
запобігаючи помилкам, викликаним одночасним зміненням файлів.
|
||||
|
||||
Це значно покращує відновлення: якщо файл видаляється з живої файлової системи,
|
||||
він залишається збереженим у знімку. Це запобігає «порушенню» парності
|
||||
для цього блоку, гарантуючи, що ви все одно зможете успішно відновити дані,
|
||||
якщо інший диск зазнає збою.
|
||||
|
||||
Ця опція застосовується виключно до дисків із даними, відформатованих у файлових
|
||||
системах Btrfs, Bcachefs або ZFS у Linux та NTFS у Windows.
|
||||
Диски парності або диски з даними, що використовують інші файлові системи, завжди використовуватимуть
|
||||
живу версію файлової системи.
|
||||
|
||||
Створення та видалення знімків вимагають прав адміністратора.
|
||||
Переконайтеся, що SnapRAID запущено з необхідними привілеями (наприклад, sudo), коли
|
||||
увімкнено цю опцію.
|
||||
|
||||
Детальне пояснення життєвого циклу знімків див. у розділі SNAPSHOTS.
|
||||
|
||||
nohidden
|
||||
Виключає всі приховані файли та каталоги.
|
||||
В Unix приховані файли — це ті, що починаються з `.`.
|
||||
|
|
@ -1295,7 +1324,7 @@ Name{number}
|
|||
Розмір блоку за замовчуванням становить 256, що має
|
||||
працювати для більшості випадків.
|
||||
|
||||
УВАГА! Ця опція лише для експертів, і настійно
|
||||
УВАГА! Ця опція лише для експертів, і наполегливо
|
||||
не рекомендується змінювати це значення. Щоб змінити
|
||||
це значення в майбутньому, вам потрібно буде
|
||||
перестворити всю парність!
|
||||
|
|
@ -1309,15 +1338,15 @@ Name{number}
|
|||
це може призвести до значного невикористаного місця
|
||||
парності. Коли ви повністю заповнюєте диск парності,
|
||||
вам не дозволяється додавати більше файлів на диски
|
||||
даних. Однак, витрачена парність не накопичується
|
||||
між дисками даних. Витрачене місце внаслідок великої
|
||||
даних. Однак, втрачена парність не накопичується
|
||||
між дисками даних. Марно втрачений простір внаслідок великої
|
||||
кількості файлів на диску даних обмежує лише кількість
|
||||
даних на цьому диску даних, а не на інших.
|
||||
|
||||
Як наближення, ви можете припустити, що половина
|
||||
розміру блоку витрачається для кожного файлу.
|
||||
розміру блоку втрачається марно для кожного файлу.
|
||||
Наприклад, зі 100 000 файлами та розміром блоку 256 КіБ
|
||||
ви витратите 12,8 ГБ парності, що може призвести до
|
||||
ви втратите 12,8 ГБ парності, що може призвести до
|
||||
того, що на диску даних буде на 12,8 ГБ менше місця.
|
||||
|
||||
Ви можете перевірити кількість витраченого місця на
|
||||
|
|
@ -1352,18 +1381,18 @@ Name{number}
|
|||
Розмір хешу за замовчуванням становить 16 байтів
|
||||
(128 біт), що має працювати для більшості випадків.
|
||||
|
||||
УВАГА! Ця опція лише для експертів, і настійно
|
||||
УВАГА! Ця опція лише для експертів, і наполегливо
|
||||
не рекомендується змінювати це значення. Щоб змінити
|
||||
це значення в майбутньому, вам потрібно буде
|
||||
перестворити всю парність!
|
||||
|
||||
Причина використовувати інший розмір хешу полягає
|
||||
в тому, якщо ваша система має обмежену пам'ять.
|
||||
Як правило, SnapRAID зазвичай вимагає 1 ГіБ ОЗП
|
||||
на кожні 16 ТБ даних у масиві.
|
||||
Інший розмір хешу варто використовувати, якщо ваша
|
||||
система має обмежену пам'ять.
|
||||
Зазвичай SnapRAID потребує 1 ГіБ ОЗП на кожні 16 ТБ
|
||||
даних у масиві.
|
||||
|
||||
Зокрема, для зберігання хешів даних SnapRAID
|
||||
вимагає приблизно $TS \times (1+HS) / BS$ байтів
|
||||
вимагає приблизно TS*(1+HS)/BS байтів
|
||||
ОЗП, де TS — загальний розмір вашого дискового масиву
|
||||
у байтах, BS — розмір блоку у байтах, а HS —
|
||||
розмір хешу у байтах.
|
||||
|
|
@ -1371,19 +1400,19 @@ Name{number}
|
|||
Наприклад, з 8 дисками по 4 ТБ, розміром блоку 256 КіБ
|
||||
(1 КіБ = 1024 байта) та розміром хешу 16, ви отримуєте:
|
||||
|
||||
:RAM = $(8 \times 4 \times 10^{12}) \times (1+16) / (256 \times 2^{10}) = 1.93$ ГіБ
|
||||
:RAM = (8 * 4 * 10^12) * (1+16) / (256 * 2^10) = 1.93 ГіБ
|
||||
|
||||
Перехід до розміру хешу 8, ви отримуєте:
|
||||
|
||||
:RAM = $(8 \times 4 \times 10^{12}) \times (1+8) / (256 \times 2^{10}) = 1.02$ ГіБ
|
||||
:RAM = (8 * 4 * 10^12) * (1+8) / (256 * 2^10) = 1.02 ГіБ
|
||||
|
||||
Перехід до розміру блоку 512, ви отримуєте:
|
||||
|
||||
:RAM = $(8 \times 4 \times 10^{12}) \times (1+16) / (512 \times 2^{10}) = 0.96$ ГіБ
|
||||
:RAM = (8 * 4 * 10^12) * (1+16) / (512 * 2^10) = 0.96 ГіБ
|
||||
|
||||
Перехід до розміру хешу 8 та розміру блоку 512, ви отримуєте:
|
||||
|
||||
:RAM = $(8 \times 4 \times 10^{12}) \times (1+8) / (512 \times 2^{10}) = 0.51$ ГіБ
|
||||
:RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0.51 ГіБ
|
||||
|
||||
autosave SIZE_IN_GIGABYTES
|
||||
Автоматично зберігає стан під час синхронізації або
|
||||
|
|
@ -1421,13 +1450,13 @@ Name{number}
|
|||
виключно на фактично виміряних температурах
|
||||
дисків.
|
||||
|
||||
Для виконання цього аналізу SnapRAID потрібна
|
||||
довідкова інформація про температуру системи.
|
||||
Для виконання цього аналізу SnapRAID потрібне
|
||||
опорне значення температури системи.
|
||||
Спочатку він намагається зчитати її з доступних
|
||||
апаратних датчиків. Якщо до системного датчика
|
||||
неможливо отримати доступ, він використовує
|
||||
найнижчу температуру диска, виміряну на початку
|
||||
запуску, як резервну довідкову інформацію.
|
||||
запуску, як резервне опорне значення.
|
||||
|
||||
Зазвичай SnapRAID показує лише температуру
|
||||
найгарячішого диска. Щоб відобразити температуру
|
||||
|
|
@ -1485,6 +1514,9 @@ Name{number}
|
|||
ймовірно фіксований, і вам може не знадобитися
|
||||
використовувати `%s`.
|
||||
|
||||
Ви також можете вказати користувацький рядок параметрів інформації за допомогою
|
||||
тега `[info: ...]`, щоб замінити параметр за замовчуванням `-a`.
|
||||
|
||||
Зверніться до документації smartmontools
|
||||
для можливих опцій:
|
||||
|
||||
|
|
@ -1493,6 +1525,7 @@ Name{number}
|
|||
|
||||
Наприклад:
|
||||
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl parity -d sat %s
|
||||
|
||||
smartignore DISK/PARITY ATTR [ATTR...]
|
||||
|
|
@ -1508,14 +1541,19 @@ Name{number}
|
|||
Спеціальне значення * можна використовувати
|
||||
для ігнорування атрибута на всіх дисках.
|
||||
|
||||
Наприклад, щоб ігнорувати атрибут `Current Pending Sector Count`
|
||||
на всіх дисках:
|
||||
Можна вказати кілька атрибутів, розділених пробілами.
|
||||
Кожен атрибут може бути вказаний як число від 1 до 255 або як регістронезалежне
|
||||
ім'я (наприклад, `Current_Pending_Sector`).
|
||||
|
||||
:smartignore * 197
|
||||
Наприклад, щоб ігнорувати атрибути `Current Pending Sector Count` та
|
||||
`Reallocated Sectors Count` на всіх дисках за їхнім номером або ім'ям:
|
||||
|
||||
Щоб ігнорувати його лише на першому диску парності:
|
||||
:smartignore * 197 5
|
||||
:smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
:smartignore parity 197
|
||||
Щоб ігнорувати їх лише на першому диску парності:
|
||||
|
||||
:smartignore parity 197 5
|
||||
|
||||
Приклади
|
||||
Приклад типової конфігурації для Unix:
|
||||
|
|
@ -1528,7 +1566,7 @@ Name{number}
|
|||
:data d3 /mnt/disk3/
|
||||
:exclude /lost+found/
|
||||
:exclude /tmp/
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/sg0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1544,11 +1582,122 @@ Name{number}
|
|||
:exclude Thumbs.db
|
||||
:exclude \$RECYCLE.BIN
|
||||
:exclude \System Volume Information
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
Знімки (Snapshots)
|
||||
Якщо в конфігурації увімкнено опцію знімків, SnapRAID використовує
|
||||
функціональність знімків файлової системи для забезпечення атомарності та
|
||||
узгодженості операцій.
|
||||
|
||||
Керування знімками відбувається повністю автоматично та прозоро.
|
||||
Ви можете продовжувати використовувати SnapRAID точно так само, як і раніше, отримуючи
|
||||
додатковий захист, що забезпечується знімками, які повністю обробляються у
|
||||
фоновому режимі.
|
||||
|
||||
Це дає дві основні переваги:
|
||||
|
||||
Узгодженість — Файли, змінені в живій файловій системі під час тривалого
|
||||
процесу sync або scrub, не викликатимуть невідповідності парності або переривання
|
||||
операцій, оскільки SnapRAID бачить заморожений знімок на момент часу.
|
||||
Відновлення — Якщо файл оновлюється або видаляється з живої файлової системи,
|
||||
він залишається збереженим у знімку. Якщо збій диска станеться
|
||||
до запуску наступної синхронізації sync, SnapRAID використає дані, збережені
|
||||
в знімку, для реконструкції диска, що зазнав збою.
|
||||
|
||||
У разі збою диска під час активного процесу sync,
|
||||
SnapRAID також може автоматично читати як зі знімка попереднього
|
||||
обчислення парності, так і з поточного.
|
||||
Це максимізує ймовірність повного відновлення, надаючи
|
||||
доступ до точних блоків даних, необхідних для вирішення рівнянь парності,
|
||||
навіть якщо ці блоки були змінені або видалені між синхронізаціями.
|
||||
|
||||
Без знімків оновлений або видалений файл на справному диску
|
||||
призводить до відсутності блоків даних, які можуть знадобитися для
|
||||
відновлення інших дисків, що зазнали збою.
|
||||
|
||||
Знімки створюються лише для дисків із даними і лише в тому випадку, якщо базова
|
||||
файлова система підтримує цю функціональність. Диски парності завжди використовують
|
||||
живу файлову систему.
|
||||
|
||||
Наразі це підтримується на Btrfs, Bcachefs та ZFS в Linux
|
||||
і на NTFS у Windows.
|
||||
|
||||
Ви можете комбінувати диски з даними з різними файловими системами. Тільки ті з них,
|
||||
які підтримують знімки, використовуватимуть їх, тоді як інші диски продовжуватимуть
|
||||
працювати безпосередньо з живою файловою системою.
|
||||
|
||||
Створення та видалення знімків вимагають прав адміністратора.
|
||||
Переконайтеся, що SnapRAID запущено з необхідними привілеями (наприклад, sudo),
|
||||
коли знімки увімкнено.
|
||||
|
||||
Поведінка команд із знімками
|
||||
Команди `sync` та `scrub` працюють виключно зі знімками,
|
||||
щоб гарантувати, що всі операції з даними виконуються на узгодженому,
|
||||
замороженому стані. Використовуючи ці знімки, SnapRAID запобігає невідповідності
|
||||
парності, яка в іншому випадку була б викликана одночасними змінами файлів у живій файловій системі.
|
||||
Під час `sync` команда використовує новий знімок, створений на початку
|
||||
процесу, для фіксації поточного стану для обчислення парності.
|
||||
Навпаки, команда `scrub` використовує останній знімок, створений під час
|
||||
найостаннішої синхронізації, щоб підтримувати надійну точку відліку,
|
||||
яка відповідає існуючій парності.
|
||||
|
||||
Для команд `check` та `fix` використання останнього знімка
|
||||
залежить від того, чи націлені конкретні диски за допомогою опції
|
||||
-d, --filter-disk.
|
||||
|
||||
Диск, явно вибраний за допомогою -d («ціль» операції),
|
||||
завжди використовує живу файлову систему. Для `fix` це дозволяє відновити
|
||||
дані на активну заміну диска. Для `check` це дозволяє симулювати
|
||||
операцію `fix` за тих самих умов.
|
||||
|
||||
Доступ до всіх інших дисків із даними («довідкових» дисків) здійснюватиметься через
|
||||
їхні знімки. Це гарантує, що навіть якщо ви змінюєте файли
|
||||
на своїх справних дисках під час відновлення, SnapRAID
|
||||
має стабільну, замороженну точку відліку для вирішення рівнянь парності.
|
||||
|
||||
Якщо опція -d не надана, SnapRAID припускає, що операція застосовується
|
||||
до всього масиву; у цьому випадку `check` та `fix` використовуватимуть виключно
|
||||
живі файлові системи.
|
||||
|
||||
Усі інші команди працюють виключно з живою файловою системою.
|
||||
|
||||
Життєвий цикл знімків (Snapshots Lifecycle)
|
||||
SnapRAID керує двома конкретними знімками, `stable` та `pending`,
|
||||
всередині прихованого каталогу в корінному каталозі кожного підтому даних.
|
||||
У Btrfs, Bcachefs та NTFS використовується каталог `.snapraid/`,
|
||||
у ZFS — стандартний `.zfs/snapshot/`.
|
||||
|
||||
Знімок `stable` представляє стан останньої успішно
|
||||
завершеної синхронізації `sync`, що містить точні дані, використані для
|
||||
обчислення поточної парності. Він служить основним джерелом даних
|
||||
для команд `scrub`, `check` та `fix`.
|
||||
|
||||
Знімок `pending` — це тимчасовий образ, що створюється на початку
|
||||
`sync` для забезпечення замороженого стану для обчислення парності.
|
||||
Після успішного завершення операції попередній знімок `stable`
|
||||
видаляється, а знімок `pending` підвищується в статусі, щоб
|
||||
зайняти його місце в якості нового стабільного орієнтира.
|
||||
|
||||
Якщо процес `sync` переривається, знімок `pending` зберігається.
|
||||
Наступні команди `scrub`, `check` та `fix` використовуватимуть цей
|
||||
очікуваний знімок, оскільки він відповідає стану файлової системи, записаному в
|
||||
файлі .content, навіть якщо парність синхронізована лише частково.
|
||||
|
||||
У разі переривання `sync` команди `check` та `fix`
|
||||
також читають дані зі знімка `stable` для вилучення блоків даних
|
||||
із файлів, які були оновлені або видалені під час синхронізації.
|
||||
Це можливо тому, що файл .content зберігає метадані для
|
||||
усіх змінених або видалених файлів протягом усього процесу sync.
|
||||
Ця історична інформація очищається лише після успішного завершення sync
|
||||
і збереження фінальної версії файлу .content.
|
||||
|
||||
Якщо `sync` перезапускається після переривання, існуючий
|
||||
очікуваний (pending) знімок видаляється, і створюється новий для
|
||||
фіксації поточного стану живої файлової системи.
|
||||
|
||||
Шаблон (Pattern)
|
||||
Шаблони забезпечують гнучкий спосіб фільтрації файлів для включення або
|
||||
виключення. Використовуючи символи підстановки (globbing), ви можете визначити правила, які
|
||||
|
|
@ -1581,7 +1730,7 @@ Name{number}
|
|||
Класи символів із використанням квадратних дужок `[]` відповідають одному символу з
|
||||
визначеного набору або діапазону. Як і інші односимвольні шаблони, вони
|
||||
не відповідають роздільникам каталогів. Класи підтримують діапазони та заперечення за допомогою
|
||||
знаку оклику.
|
||||
знака оклику.
|
||||
|
||||
Фундаментальна відмінність, яку слід пам'ятати, полягає в тому, що `*`, `?` та класи символів
|
||||
усі дотримуються меж каталогів і відповідають лише в межах одного компонента
|
||||
|
|
@ -1592,19 +1741,19 @@ Name{number}
|
|||
|
||||
=FILE
|
||||
Вибирає будь-який файл з ім'ям FILE.
|
||||
Цей шаблон застосовується тільки до файлів, а не до директорій.
|
||||
Цей шаблон застосовується тільки до файлів, а не до каталогів.
|
||||
|
||||
=DIR/
|
||||
Вибирає будь-яку директорію з ім'ям DIR і все, що знаходиться всередині.
|
||||
Цей шаблон застосовується тільки до директорій, а не до файлів.
|
||||
Вибирає будь-який каталог з ім'ям DIR і все, що знаходиться всередині.
|
||||
Цей шаблон застосовується тільки до каталогів, а не до файлів.
|
||||
|
||||
=/PATH/FILE
|
||||
Вибирає точно вказаний шлях до файлу. Цей шаблон застосовується
|
||||
тільки до файлів, а не до директорій.
|
||||
тільки до файлів, а не до каталогів.
|
||||
|
||||
=/PATH/DIR/
|
||||
Вибирає точно вказаний шлях до директорії і все, що знаходиться
|
||||
всередині. Цей шаблон застосовується тільки до директорій, а не до файлів.
|
||||
Вибирає точно вказаний шлях до каталогу і все, що знаходиться
|
||||
всередині. Цей шаблон застосовується тільки до каталогів, а не до файлів.
|
||||
|
||||
Коли ви вказуєте абсолютний шлях, що починається
|
||||
з /, він застосовується до кореневого каталогу
|
||||
|
|
@ -1621,7 +1770,7 @@ Name{number}
|
|||
|
||||
Якщо ім'я файлу містить символи `*`, `?`, `[`,
|
||||
або `]`, ви повинні екранувати їх, щоб уникнути
|
||||
їх інтерпретації як символу глоббінгу.
|
||||
їх інтерпретації як символу глобінгу.
|
||||
В Unix символом екранування є `\`; у Windows — `^`.
|
||||
Коли шаблон знаходиться в командному рядку,
|
||||
ви повинні подвоїти символ екранування, щоб
|
||||
|
|
@ -1674,10 +1823,10 @@ Name{number}
|
|||
|
||||
:# Перевіряє лише файли .mp3.
|
||||
:# В Unix використовуйте лапки, щоб уникнути
|
||||
:# розширення глоббінгу оболонкою.
|
||||
:# розширення глобінгу оболонкою.
|
||||
:snapraid -f "*.mp3" check
|
||||
|
||||
В Unix, при використанні символів глоббінгу в
|
||||
В Unix, при використанні символів глобінгу в
|
||||
командному рядку, ви повинні взяти їх у лапки,
|
||||
щоб запобігти їх розширенню оболонкою.
|
||||
|
||||
|
|
@ -1732,9 +1881,10 @@ Name{number}
|
|||
усіма контрольними сумами для перевірки їх
|
||||
цілісності.
|
||||
|
||||
Цей файл зчитується та записується командами
|
||||
`sync` та `scrub` та зчитується командами `fix`,
|
||||
`check` та `status`.
|
||||
Файл вмісту зчитується та записується командами `sync`, `scrub`,
|
||||
`touch` та `rehash`. Він зчитується командами `status`, `diff`,
|
||||
`check`, `fix`, `list`, `dup`, `locate` та `pool`, і повністю
|
||||
ігнорується командами `smart`, `probe`, `up`, `down` та `devices`.
|
||||
|
||||
Парність (Parity)
|
||||
SnapRAID зберігає інформацію парності вашого
|
||||
|
|
@ -1769,8 +1919,19 @@ Name{number}
|
|||
консолі у файл, отриманий файл завжди
|
||||
буде у форматі UTF-8.
|
||||
|
||||
Код завершення (Exit Code)
|
||||
SnapRAID завершує роботу з такими кодами помилок:
|
||||
|
||||
0 - Все в порядку.
|
||||
1 - Команда виявила помилки.
|
||||
2 - Команда `diff` визначила, що все в порядку, але потрібен `sync`.
|
||||
|
||||
Переклад (Translation)
|
||||
Цей документ є автоматичним перекладом англійського посібника.
|
||||
Зверніться до англійського посібника для отримання офіційної версії.
|
||||
|
||||
Авторське право (Copyright)
|
||||
Цей файл захищений авторським правом (C) 2025 Andrea Mazzoleni
|
||||
Цей файл захищений авторським правом (C) 2026 Andrea Mazzoleni
|
||||
|
||||
Див. також (See Also)
|
||||
snapraid_log(1), snapraidd(1)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
=================================================
|
||||
|
||||
|
||||
1 Короткий опис
|
||||
===============
|
||||
1 Короткий опис (SYNOPSIS)
|
||||
==========================
|
||||
|
||||
snapraid [-c, --conf CONFIG]
|
||||
[-f, --filter PATTERN] [-d, --filter-disk NAME]
|
||||
|
|
@ -28,15 +28,15 @@ snapraid [-c, --conf CONFIG]
|
|||
snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
|
||||
2 Опис
|
||||
======
|
||||
2 Опис (DESCRIPTION)
|
||||
====================
|
||||
|
||||
SnapRAID — це програма резервного копіювання, розроблена для
|
||||
дискових масивів, яка зберігає інформацію парності для
|
||||
відновлення даних у випадку відмови до шести дисків.
|
||||
|
||||
В першу чергу призначена для домашніх медіацентрів з великими
|
||||
файлами, що рідко змінюються, SnapRAID пропонує кілька функцій:
|
||||
Насамперед призначений для домашніх медіацентрів з великими
|
||||
файлами, які рідко змінюються, SnapRAID пропонує кілька функцій:
|
||||
|
||||
* Ви можете використовувати диски, вже заповнені файлами, без
|
||||
необхідності їх переформатування, отримуючи доступ до них
|
||||
|
|
@ -62,26 +62,32 @@ SnapRAID:
|
|||
https://www.snapraid.it/
|
||||
|
||||
|
||||
3 Обмеження
|
||||
===========
|
||||
3 Обмеження (LIMITATIONS)
|
||||
=========================
|
||||
|
||||
SnapRAID є гібридом між RAID та програмою резервного копіювання,
|
||||
прагнучи поєднати найкращі переваги обох. Однак, він має деякі
|
||||
обмеження, які слід врахувати перед його використанням.
|
||||
SnapRAID є гібридом між RAID і програмою резервного копіювання, що має на меті поєднати
|
||||
найкращі переваги обох рішень. Однак у нього є деякі обмеження, які вам слід
|
||||
врахувати перед використанням.
|
||||
|
||||
Основне обмеження полягає в тому, що якщо диск виходить з ладу,
|
||||
а ви нещодавно не виконували синхронізацію, ви можете не
|
||||
змогти повністю відновити дані.
|
||||
Конкретніше, ви можете втратити можливість відновлення даних
|
||||
обсягом до розміру змінених або видалених файлів з моменту
|
||||
останньої операції синхронізації.
|
||||
Це відбувається, навіть якщо змінені або видалені файли не
|
||||
знаходяться на диску, що вийшов з ладу. Ось чому SnapRAID
|
||||
краще підходить для даних, які рідко змінюються.
|
||||
Головне обмеження полягає в тому, що у разі збою диска ви можете відновити дані лише до
|
||||
стану останньої операції синхронізації (`sync`). Будь-які дані, додані або змінені
|
||||
з моменту останньої синхронізації, які розташовані на пошкодженому диску, будуть втрачені.
|
||||
|
||||
З іншого боку, щойно додані файли не перешкоджають відновленню
|
||||
вже існуючих файлів. Ви втратите лише нещодавно додані файли,
|
||||
якщо вони знаходяться на диску, що вийшов з ладу.
|
||||
Відповідно, SnapRAID насамперед підходить для даних, які рідко змінюються.
|
||||
|
||||
Для даних, які вже існували на момент останньої синхронізації, надійність відновлення залежить
|
||||
від того, чи використовується опція знімка (`snapshot`):
|
||||
|
||||
* За наявності підтримки знімків (доступно на Btrfs, ZFS, Bcachefs та NTFS),
|
||||
SnapRAID може автоматично підтримувати заморожену копію ваших дисків із даними.
|
||||
Це гарантує, що навіть якщо ви зміните або видалите файли у вашій живій файловій системі
|
||||
під час або після синхронізації, процес відновлення залишиться узгодженим і надійним.
|
||||
|
||||
* Без підтримки знімків видалення або зміна файлів після `sync`
|
||||
може запобігти повному відновленню інших дисків, що зазнали збою. Це відбувається
|
||||
тому, що парність більше не відповідає зміненим файлам, навіть якщо
|
||||
ці файли знаходяться не на пошкодженому диску. З іншого боку, щойно додані
|
||||
файли не перешкоджають відновленню вже існуючих файлів.
|
||||
|
||||
Інші обмеження SnapRAID:
|
||||
|
||||
|
|
@ -98,12 +104,12 @@ SnapRAID є гібридом між RAID та програмою резервн
|
|||
можете відновити дані навіть після повної відмови
|
||||
всього дискового масиву.
|
||||
* Зберігаються лише імена файлів, часові мітки, символічні
|
||||
та жорсткі посилання. Права доступу, власність та
|
||||
та жорсткі посилання. Права доступу, власники та
|
||||
розширені атрибути не зберігаються.
|
||||
|
||||
|
||||
4 Початок роботи
|
||||
================
|
||||
4 Початок роботи (GETTING STARTED)
|
||||
==================================
|
||||
|
||||
Щоб використовувати SnapRAID, спершу потрібно вибрати один диск
|
||||
у вашому дисковому масиві, щоб присвятити його інформації
|
||||
|
|
@ -240,7 +246,7 @@ SnapRAID є гібридом між RAID та програмою резервн
|
|||
|
||||
Примітка: Функція об'єднання, описана нижче, була замінена
|
||||
інструментом mergerfs, який тепер є рекомендованою опцією для
|
||||
користувачів Linux у спільноті SnapRAID. Mergefs забезпечує
|
||||
користувачів Linux у спільноті SnapRAID. Mergerfs забезпечує
|
||||
більш гнучкий та ефективний спосіб об'єднання кількох дисків
|
||||
в єдину уніфіковану точку монтування, дозволяючи безперешкодний
|
||||
доступ до файлів у вашому масиві без використання символічних
|
||||
|
|
@ -446,18 +452,18 @@ SnapRAID функціонує більше як програма резервн
|
|||
Якщо все відновлено, ця команда виконується миттєво.
|
||||
|
||||
|
||||
5 Команди
|
||||
=========
|
||||
5 Команди (COMMANDS)
|
||||
====================
|
||||
|
||||
SnapRAID надає кілька простих команд, які дозволяють:
|
||||
|
||||
* Вивести статус масиву -> `status`
|
||||
* Керувати дисками -> `smart`, `probe`, `up`, `down`
|
||||
* Створити резервну копію/знімок -> `sync`
|
||||
* Створити точку резервного копіювання/відновлення -> `sync`
|
||||
* Періодично перевіряти дані -> `scrub`
|
||||
* Відновити останню резервну копію/знімок -> `fix`.
|
||||
* Відновити останню точку резервного копіювання/відновлення -> `fix`.
|
||||
|
||||
Команди повинні бути написані малими літерами.
|
||||
Команди обов'язково повинні бути написані малими літерами.
|
||||
|
||||
5.1 status
|
||||
----------
|
||||
|
|
@ -487,7 +493,7 @@ SnapRAID надає кілька простих команд, які дозво
|
|||
Виводить звіт SMART усіх дисків у системі.
|
||||
|
||||
Включає оцінку ймовірності відмови протягом наступного року,
|
||||
дозволяючи вам планувати планову заміну дисків, які
|
||||
дозволяючи вам планувати своєчасну заміну дисків, які
|
||||
виявляють підозрілі атрибути.
|
||||
|
||||
Ця оцінка ймовірності отримана шляхом кореляції атрибутів
|
||||
|
|
@ -497,7 +503,7 @@ SMART дисків з даними Backblaze, доступними за адре
|
|||
|
||||
Якщо SMART повідомляє, що диск виходить з ладу, для цього
|
||||
диска виводиться `FAIL` або `PREFAIL`, і SnapRAID повертає
|
||||
помилку. У цьому випадку настійно рекомендується негайна
|
||||
помилку. У цьому випадку наполегливо рекомендується негайна
|
||||
заміна диска.
|
||||
|
||||
Інші можливі рядки стану:
|
||||
|
|
@ -587,13 +593,13 @@ SMART дисків з даними Backblaze, доступними за адре
|
|||
на тому ж диску. Вони ідентифікуються за тим же
|
||||
іменем, розміром, часовою міткою та inode, але іншим
|
||||
каталогом.
|
||||
copied - файли, скопійовані на той самий або інший диск, де
|
||||
copied (скопійовані) - Файли, скопійовані на той самий або інший диск, де
|
||||
оригінальний файл все ще існує.
|
||||
Вони ідентифікуються за однаковою назвою, розміром та міткою
|
||||
часу.
|
||||
Якщо мітка часу з точністю до часток секунди дорівнює нулю, для
|
||||
ідентифікації має збігатися повний шлях, а не лише назва.
|
||||
relocated - файли, переміщені на той самий або інший диск, де
|
||||
relocated (перерозміщені) - Файли, переміщені на той самий або інший диск, де
|
||||
оригінал зник.
|
||||
Вони ідентифікуються за однаковою назвою, розміром та міткою
|
||||
часу.
|
||||
|
|
@ -601,7 +607,7 @@ SMART дисків з даними Backblaze, доступними за адре
|
|||
ідентифікації має збігатися повний шлях.
|
||||
На відміну від файлів 'moved' на тому ж диску, переміщені файли
|
||||
мають інший inode.
|
||||
restored - файли з іншим inode, але зі збігом каталогу, назви,
|
||||
restored (відновлені) - Файли з іншим inode, але зі збігом каталогу, назви,
|
||||
розміру та мітки часу.
|
||||
Зазвичай це файли, відновлені після видалення.
|
||||
|
||||
|
|
@ -692,15 +698,14 @@ full - Скрабувати все.
|
|||
5.9 fix
|
||||
-------
|
||||
|
||||
Виправляє всі файли та дані парності.
|
||||
Відновлює всі файли та дані парності.
|
||||
|
||||
Усі файли та дані парності порівнюються зі станом знімка,
|
||||
збереженим під час останньої `sync`.
|
||||
Якщо знайдено різницю, вона повертається до збереженого знімка.
|
||||
Усі файли та дані парності порівнюються зі станом, збереженим під час
|
||||
останньої синхронізації `sync`. Якщо виявлено відмінність, стан повертається до збереженого.
|
||||
|
||||
УВАГА! Команда `fix` не розрізняє помилки та навмисні
|
||||
модифікації. Вона безумовно повертає стан файлу до останньої
|
||||
`sync`.
|
||||
УВАГА!
|
||||
Команда `fix` не робить різниці між помилками та навмисними змінами.
|
||||
Вона безумовно повертає стан файлів до моменту останньої синхронізації `sync`.
|
||||
|
||||
Якщо не вказано жодної іншої опції, обробляється весь масив.
|
||||
Використовуйте опції фільтра, щоб вибрати підмножину файлів
|
||||
|
|
@ -737,7 +742,7 @@ SnapRAID перейменовує всі файли, які не можуть б
|
|||
Працює як `fix`, але лише імітує відновлення, і жодні зміни
|
||||
не записуються в масив.
|
||||
|
||||
Ця команда в першу чергу призначена для ручної перевірки,
|
||||
Ця команда насамперед призначена для ручної перевірки,
|
||||
наприклад, після процесу відновлення або в інших особливих
|
||||
умовах. Для періодичних та запланованих перевірок використовуйте
|
||||
`scrub`.
|
||||
|
|
@ -757,7 +762,7 @@ SnapRAID перейменовує всі файли, які не можуть б
|
|||
останньої `sync`.
|
||||
|
||||
З -v або --verbose також показується час з точністю до
|
||||
долі секунди.
|
||||
часток секунди.
|
||||
|
||||
Нічого не змінюється.
|
||||
|
||||
|
|
@ -810,17 +815,17 @@ SnapRAID перейменовує всі файли, які не можуть б
|
|||
5.15 touch
|
||||
----------
|
||||
|
||||
Встановлює довільну часову мітку з точністю до долі секунди
|
||||
Встановлює довільну часову мітку з точністю до часток секунди
|
||||
для всіх файлів, у яких вона встановлена на нуль.
|
||||
|
||||
Це покращує здатність SnapRAID розпізнавати переміщені та
|
||||
скопійовані файли, оскільки робить часову мітку майже
|
||||
унікальною, зменшуючи можливі дублікати.
|
||||
|
||||
Зокрема, якщо часова мітка з точністю до долі секунди не
|
||||
Зокрема, якщо часова мітка з точністю до часток секунди не
|
||||
дорівнює нулю, переміщений або скопійований файл ідентифікується
|
||||
як такий, якщо він збігається з іменем, розміром та часовою
|
||||
міткою. Якщо часова мітка з точністю до долі секунди дорівнює
|
||||
міткою. Якщо часова мітка з точністю до часток секунди дорівнює
|
||||
нулю, він вважається копією, лише якщо повний шлях, розмір та
|
||||
часова мітка збігаються.
|
||||
|
||||
|
|
@ -865,8 +870,8 @@ SnapRAID перейменовує всі файли, які не можуть б
|
|||
перерозподілу.
|
||||
|
||||
|
||||
6 Опції
|
||||
=======
|
||||
6 Опції (OPTIONS)
|
||||
=================
|
||||
|
||||
SnapRAID надає наступні опції:
|
||||
|
||||
|
|
@ -883,7 +888,7 @@ SnapRAID надає наступні опції:
|
|||
шаблону. Цю опцію можна використовувати кілька разів.
|
||||
Дивіться розділ PATTERN для отримання додаткової
|
||||
інформації про специфікації шаблонів.
|
||||
В Unix переконайтеся, що символи глоббінгу взяті
|
||||
В Unix переконайтеся, що символи глобінгу взяті
|
||||
в лапки, якщо вони використовуються.
|
||||
Цю опцію можна використовувати лише з `check` та `fix`.
|
||||
Її не можна використовувати з `sync` та `scrub`, оскільки
|
||||
|
|
@ -994,7 +999,7 @@ SnapRAID надає наступні опції:
|
|||
Ви можете вказати множник, такий як K, M або G (наприклад,
|
||||
--bw-limit 1G).
|
||||
|
||||
-t, --tail РОЗМІР
|
||||
-t, --tail SIZE
|
||||
Обмежує список файлів тими, що використовують не більше зазначеного
|
||||
розміру хвоста дисків парності.
|
||||
Можна використовувати множники, такі як K, M, G або T (наприклад, --tail 1G).
|
||||
|
|
@ -1107,12 +1112,12 @@ SnapRAID надає наступні опції:
|
|||
вмісту, для перевірки даних.
|
||||
Цю опцію можна використовувати лише з `sync`.
|
||||
УВАГА! Ця опція лише для експертів, і
|
||||
настійно не рекомендується її використовувати.
|
||||
наполегливо не рекомендується її використовувати.
|
||||
Ви НЕ маєте захисту даних під час операції `sync`.
|
||||
|
||||
-W, --force-realloc-tail РОЗМІР
|
||||
-W, --force-realloc-tail SIZE
|
||||
Працює як -R, --force-realloc, але обмежується вказаною кінцевою
|
||||
частиною (останні РОЗМІР байт) кожного файлу парності.
|
||||
частиною (останні SIZE-байт) кожного файлу парності.
|
||||
Примусово перерозподіляє (переміщує) будь-які фрагменти/блоки файлів,
|
||||
що наразі зберігаються в цій кінцевій секції, дозволяючи розмістити
|
||||
їх будь-де у файлі(ах) парності, де є вільне місце (включно з
|
||||
|
|
@ -1126,7 +1131,7 @@ SnapRAID надає наступні опції:
|
|||
Ви можете використовувати locate -t, --tail, щоб заздалегідь дізнатися
|
||||
про зачеплені файли.
|
||||
УВАГА!
|
||||
Цей параметр призначений лише для експертів, і його настійно
|
||||
Цей параметр призначений лише для експертів, і його наполегливо
|
||||
не рекомендується використовувати.
|
||||
Під час операції `sync` захист даних для зачеплених файлів ВІДСУТНІЙ.
|
||||
|
||||
|
|
@ -1204,8 +1209,8 @@ SnapRAID надає наступні опції:
|
|||
Виводить версію програми.
|
||||
|
||||
|
||||
7 Конфігурація
|
||||
==============
|
||||
7 Конфігурація (CONFIGURATION)
|
||||
==============================
|
||||
|
||||
SnapRAID вимагає конфігураційний файл, щоб знати, де
|
||||
розташований ваш дисковий масив і де зберігати інформацію
|
||||
|
|
@ -1272,8 +1277,8 @@ SnapRAID вимагає конфігураційний файл, щоб знат
|
|||
Визначає альтернативний файл та формат для зберігання
|
||||
потрійної парності.
|
||||
|
||||
Ця опція є альтернативою `3-parity`, в першу чергу
|
||||
призначена для ЦП низького класу, таких як ARM або
|
||||
Ця опція є альтернативою `3-parity`, насамперед
|
||||
призначена для малопотужних ЦП, таких як ARM або
|
||||
AMD Phenom, Athlon та Opteron, які не підтримують
|
||||
набір інструкцій SSSE3. У таких випадках вона
|
||||
забезпечує кращу продуктивність.
|
||||
|
|
@ -1342,14 +1347,40 @@ UUID дисків.
|
|||
Зверніть увагу, що на такі диски не впливають команди `up` та `down`,
|
||||
оскільки очікується, що вони завжди обертаються.
|
||||
|
||||
7.7 nohidden
|
||||
7.7 snapshot
|
||||
------------
|
||||
|
||||
Включає використання знімків файлової системи для команд `sync`, `scrub`,
|
||||
`check` та `fix`.
|
||||
|
||||
Якщо увімкнено, SnapRAID створює знімок ваших даних лише для читання на
|
||||
початку операції 'sync'. Це забезпечує узгоджений зріз ваших файлів на певний момент часу,
|
||||
запобігаючи помилкам, викликаним одночасним зміненням файлів.
|
||||
|
||||
Це значно покращує відновлення: якщо файл видаляється з живої файлової системи,
|
||||
він залишається збереженим у знімку. Це запобігає «порушенню» парності
|
||||
для цього блоку, гарантуючи, що ви все одно зможете успішно відновити дані,
|
||||
якщо інший диск зазнає збою.
|
||||
|
||||
Ця опція застосовується виключно до дисків із даними, відформатованих у файлових
|
||||
системах Btrfs, Bcachefs або ZFS у Linux та NTFS у Windows.
|
||||
Диски парності або диски з даними, що використовують інші файлові системи, завжди використовуватимуть
|
||||
живу версію файлової системи.
|
||||
|
||||
Створення та видалення знімків вимагають прав адміністратора.
|
||||
Переконайтеся, що SnapRAID запущено з необхідними привілеями (наприклад, sudo), коли
|
||||
увімкнено цю опцію.
|
||||
|
||||
Детальне пояснення життєвого циклу знімків див. у розділі SNAPSHOTS.
|
||||
|
||||
7.8 nohidden
|
||||
------------
|
||||
|
||||
Виключає всі приховані файли та каталоги.
|
||||
В Unix приховані файли — це ті, що починаються з `.`.
|
||||
У Windows це ті, що мають прихований атрибут.
|
||||
|
||||
7.8 exclude/include PATTERN
|
||||
7.9 exclude/include PATTERN
|
||||
---------------------------
|
||||
|
||||
Визначає шаблони файлів або каталогів для виключення
|
||||
|
|
@ -1368,8 +1399,8 @@ UUID дисків.
|
|||
|
||||
Цю опцію можна використовувати кілька разів.
|
||||
|
||||
7.9 blocksize SIZE_IN_KIBIBYTES
|
||||
-------------------------------
|
||||
7.10 blocksize SIZE_IN_KIBIBYTES
|
||||
--------------------------------
|
||||
|
||||
Визначає основний розмір блоку в кібібайтах для парності.
|
||||
Один кібібайт дорівнює 1024 байтам.
|
||||
|
|
@ -1377,7 +1408,7 @@ UUID дисків.
|
|||
Розмір блоку за замовчуванням становить 256, що має
|
||||
працювати для більшості випадків.
|
||||
|
||||
УВАГА! Ця опція лише для експертів, і настійно
|
||||
УВАГА! Ця опція лише для експертів, і наполегливо
|
||||
не рекомендується змінювати це значення. Щоб змінити
|
||||
це значення в майбутньому, вам потрібно буде
|
||||
перестворити всю парність!
|
||||
|
|
@ -1391,15 +1422,15 @@ UUID дисків.
|
|||
це може призвести до значного невикористаного місця
|
||||
парності. Коли ви повністю заповнюєте диск парності,
|
||||
вам не дозволяється додавати більше файлів на диски
|
||||
даних. Однак, витрачена парність не накопичується
|
||||
між дисками даних. Витрачене місце внаслідок великої
|
||||
даних. Однак, втрачена парність не накопичується
|
||||
між дисками даних. Марно втрачений простір внаслідок великої
|
||||
кількості файлів на диску даних обмежує лише кількість
|
||||
даних на цьому диску даних, а не на інших.
|
||||
|
||||
Як наближення, ви можете припустити, що половина
|
||||
розміру блоку витрачається для кожного файлу.
|
||||
розміру блоку втрачається марно для кожного файлу.
|
||||
Наприклад, зі 100 000 файлами та розміром блоку 256 КіБ
|
||||
ви витратите 12,8 ГБ парності, що може призвести до
|
||||
ви втратите 12,8 ГБ парності, що може призвести до
|
||||
того, що на диску даних буде на 12,8 ГБ менше місця.
|
||||
|
||||
Ви можете перевірити кількість витраченого місця на
|
||||
|
|
@ -1428,7 +1459,7 @@ Linux, полягає в тому, щоб відформатувати його
|
|||
приблизно 460 000 файлів на кожному диску даних
|
||||
без будь-якого витраченого місця.
|
||||
|
||||
7.10 hashsize SIZE_IN_BYTES
|
||||
7.11 hashsize SIZE_IN_BYTES
|
||||
---------------------------
|
||||
|
||||
Визначає розмір хешу в байтах для збережених блоків.
|
||||
|
|
@ -1436,18 +1467,18 @@ Linux, полягає в тому, щоб відформатувати його
|
|||
Розмір хешу за замовчуванням становить 16 байтів
|
||||
(128 біт), що має працювати для більшості випадків.
|
||||
|
||||
УВАГА! Ця опція лише для експертів, і настійно
|
||||
УВАГА! Ця опція лише для експертів, і наполегливо
|
||||
не рекомендується змінювати це значення. Щоб змінити
|
||||
це значення в майбутньому, вам потрібно буде
|
||||
перестворити всю парність!
|
||||
|
||||
Причина використовувати інший розмір хешу полягає
|
||||
в тому, якщо ваша система має обмежену пам'ять.
|
||||
Як правило, SnapRAID зазвичай вимагає 1 ГіБ ОЗП
|
||||
на кожні 16 ТБ даних у масиві.
|
||||
Інший розмір хешу варто використовувати, якщо ваша
|
||||
система має обмежену пам'ять.
|
||||
Зазвичай SnapRAID потребує 1 ГіБ ОЗП на кожні 16 ТБ
|
||||
даних у масиві.
|
||||
|
||||
Зокрема, для зберігання хешів даних SnapRAID
|
||||
вимагає приблизно $TS \times (1+HS) / BS$ байтів
|
||||
вимагає приблизно TS*(1+HS)/BS байтів
|
||||
ОЗП, де TS — загальний розмір вашого дискового масиву
|
||||
у байтах, BS — розмір блоку у байтах, а HS —
|
||||
розмір хешу у байтах.
|
||||
|
|
@ -1455,21 +1486,21 @@ Linux, полягає в тому, щоб відформатувати його
|
|||
Наприклад, з 8 дисками по 4 ТБ, розміром блоку 256 КіБ
|
||||
(1 КіБ = 1024 байта) та розміром хешу 16, ви отримуєте:
|
||||
|
||||
RAM = $(8 \times 4 \times 10^{12}) \times (1+16) / (256 \times 2^{10}) = 1.93$ ГіБ
|
||||
RAM = (8 * 4 * 10^12) * (1+16) / (256 * 2^10) = 1.93 ГіБ
|
||||
|
||||
Перехід до розміру хешу 8, ви отримуєте:
|
||||
|
||||
RAM = $(8 \times 4 \times 10^{12}) \times (1+8) / (256 \times 2^{10}) = 1.02$ ГіБ
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (256 * 2^10) = 1.02 ГіБ
|
||||
|
||||
Перехід до розміру блоку 512, ви отримуєте:
|
||||
|
||||
RAM = $(8 \times 4 \times 10^{12}) \times (1+16) / (512 \times 2^{10}) = 0.96$ ГіБ
|
||||
RAM = (8 * 4 * 10^12) * (1+16) / (512 * 2^10) = 0.96 ГіБ
|
||||
|
||||
Перехід до розміру хешу 8 та розміру блоку 512, ви отримуєте:
|
||||
|
||||
RAM = $(8 \times 4 \times 10^{12}) \times (1+8) / (512 \times 2^{10}) = 0.51$ ГіБ
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0.51 ГіБ
|
||||
|
||||
7.11 autosave SIZE_IN_GIGABYTES
|
||||
7.12 autosave SIZE_IN_GIGABYTES
|
||||
-------------------------------
|
||||
|
||||
Автоматично зберігає стан під час синхронізації або
|
||||
|
|
@ -1478,7 +1509,7 @@ RAM = $(8 \times 4 \times 10^{12}) \times (1+8) / (512 \times 2^{10}) = 0.51$ Г
|
|||
команд `sync` з нуля, якщо вони були перервані
|
||||
збоєм машини або будь-якою іншою подією.
|
||||
|
||||
7.12 temp_limit TEMPERATURE_CELSIUS
|
||||
7.13 temp_limit TEMPERATURE_CELSIUS
|
||||
-----------------------------------
|
||||
|
||||
Встановлює максимальну дозволену температуру диска
|
||||
|
|
@ -1509,19 +1540,19 @@ smartctl. Поточні температури дисків відобража
|
|||
виключно на фактично виміряних температурах
|
||||
дисків.
|
||||
|
||||
Для виконання цього аналізу SnapRAID потрібна
|
||||
довідкова інформація про температуру системи.
|
||||
Для виконання цього аналізу SnapRAID потрібне
|
||||
опорне значення температури системи.
|
||||
Спочатку він намагається зчитати її з доступних
|
||||
апаратних датчиків. Якщо до системного датчика
|
||||
неможливо отримати доступ, він використовує
|
||||
найнижчу температуру диска, виміряну на початку
|
||||
запуску, як резервну довідкову інформацію.
|
||||
запуску, як резервне опорне значення.
|
||||
|
||||
Зазвичай SnapRAID показує лише температуру
|
||||
найгарячішого диска. Щоб відобразити температуру
|
||||
всіх дисків, використовуйте опцію -A або --stats.
|
||||
|
||||
7.13 temp_sleep TIME_IN_MINUTES
|
||||
7.14 temp_sleep TIME_IN_MINUTES
|
||||
-------------------------------
|
||||
|
||||
Встановлює час очікування, у хвилинах, коли
|
||||
|
|
@ -1529,7 +1560,7 @@ smartctl. Поточні температури дисків відобража
|
|||
періоду диски залишаються зупиненими.
|
||||
За замовчуванням 5 хвилин.
|
||||
|
||||
7.14 pool DIR
|
||||
7.15 pool DIR
|
||||
-------------
|
||||
|
||||
Визначає каталог об'єднання, де створюється
|
||||
|
|
@ -1538,7 +1569,7 @@ smartctl. Поточні температури дисків відобража
|
|||
|
||||
Каталог повинен вже існувати.
|
||||
|
||||
7.15 share UNC_DIR
|
||||
7.16 share UNC_DIR
|
||||
------------------
|
||||
|
||||
Визначає шлях Windows UNC, необхідний для
|
||||
|
|
@ -1559,7 +1590,7 @@ smartctl. Поточні температури дисків відобража
|
|||
|
||||
Ця опція потрібна лише для Windows.
|
||||
|
||||
7.16 smartctl DISK/PARITY OPTIONS...
|
||||
7.17 smartctl DISK/PARITY OPTIONS...
|
||||
------------------------------------
|
||||
|
||||
Визначає користувацькі опції smartctl для
|
||||
|
|
@ -1581,6 +1612,9 @@ PARITY — це одне з імен парності: `parity`,
|
|||
ймовірно фіксований, і вам може не знадобитися
|
||||
використовувати `%s`.
|
||||
|
||||
Ви також можете вказати користувацький рядок параметрів інформації за допомогою
|
||||
тега `[info: ...]`, щоб замінити параметр за замовчуванням `-a`.
|
||||
|
||||
Зверніться до документації smartmontools
|
||||
для можливих опцій:
|
||||
|
||||
|
|
@ -1589,9 +1623,10 @@ PARITY — це одне з імен парності: `parity`,
|
|||
|
||||
Наприклад:
|
||||
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl parity -d sat %s
|
||||
|
||||
7.17 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
7.18 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
-------------------------------------------
|
||||
|
||||
Ігнорує вказаний атрибут SMART при обчисленні
|
||||
|
|
@ -1606,16 +1641,21 @@ PARITY — це одне з імен парності: `parity`,
|
|||
Спеціальне значення * можна використовувати
|
||||
для ігнорування атрибута на всіх дисках.
|
||||
|
||||
Наприклад, щоб ігнорувати атрибут `Current Pending Sector Count`
|
||||
на всіх дисках:
|
||||
Можна вказати кілька атрибутів, розділених пробілами.
|
||||
Кожен атрибут може бути вказаний як число від 1 до 255 або як регістронезалежне
|
||||
ім'я (наприклад, `Current_Pending_Sector`).
|
||||
|
||||
smartignore * 197
|
||||
Наприклад, щоб ігнорувати атрибути `Current Pending Sector Count` та
|
||||
`Reallocated Sectors Count` на всіх дисках за їхнім номером або ім'ям:
|
||||
|
||||
Щоб ігнорувати його лише на першому диску парності:
|
||||
smartignore * 197 5
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
smartignore parity 197
|
||||
Щоб ігнорувати їх лише на першому диску парності:
|
||||
|
||||
7.18 Приклади
|
||||
smartignore parity 197 5
|
||||
|
||||
7.19 Приклади
|
||||
-------------
|
||||
|
||||
Приклад типової конфігурації для Unix:
|
||||
|
|
@ -1628,7 +1668,7 @@ PARITY — це одне з імен парності: `parity`,
|
|||
data d3 /mnt/disk3/
|
||||
exclude /lost+found/
|
||||
exclude /tmp/
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/sg0
|
||||
smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1644,14 +1684,133 @@ PARITY — це одне з імен парності: `parity`,
|
|||
exclude Thumbs.db
|
||||
exclude \$RECYCLE.BIN
|
||||
exclude \System Volume Information
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
|
||||
8 Шаблон (PATTERN)
|
||||
==================
|
||||
8 Знімки (SNAPSHOTS)
|
||||
====================
|
||||
|
||||
Якщо в конфігурації увімкнено опцію знімків, SnapRAID використовує
|
||||
функціональність знімків файлової системи для забезпечення атомарності та
|
||||
узгодженості операцій.
|
||||
|
||||
Керування знімками відбувається повністю автоматично та прозоро.
|
||||
Ви можете продовжувати використовувати SnapRAID точно так само, як і раніше, отримуючи
|
||||
додатковий захист, що забезпечується знімками, які повністю обробляються у
|
||||
фоновому режимі.
|
||||
|
||||
Це дає дві основні переваги:
|
||||
|
||||
Узгодженість — Файли, змінені в живій файловій системі під час тривалого
|
||||
процесу sync або scrub, не викликатимуть невідповідності парності або переривання
|
||||
операцій, оскільки SnapRAID бачить заморожений знімок на момент часу.
|
||||
Відновлення — Якщо файл оновлюється або видаляється з живої файлової системи,
|
||||
він залишається збереженим у знімку. Якщо збій диска станеться
|
||||
до запуску наступної синхронізації sync, SnapRAID використає дані, збережені
|
||||
в знімку, для реконструкції диска, що зазнав збою.
|
||||
|
||||
У разі збою диска під час активного процесу sync,
|
||||
SnapRAID також може автоматично читати як зі знімка попереднього
|
||||
обчислення парності, так і з поточного.
|
||||
Це максимізує ймовірність повного відновлення, надаючи
|
||||
доступ до точних блоків даних, необхідних для вирішення рівнянь парності,
|
||||
навіть якщо ці блоки були змінені або видалені між синхронізаціями.
|
||||
|
||||
Без знімків оновлений або видалений файл на справному диску
|
||||
призводить до відсутності блоків даних, які можуть знадобитися для
|
||||
відновлення інших дисків, що зазнали збою.
|
||||
|
||||
Знімки створюються лише для дисків із даними і лише в тому випадку, якщо базова
|
||||
файлова система підтримує цю функціональність. Диски парності завжди використовують
|
||||
живу файлову систему.
|
||||
|
||||
Наразі це підтримується на Btrfs, Bcachefs та ZFS в Linux
|
||||
і на NTFS у Windows.
|
||||
|
||||
Ви можете комбінувати диски з даними з різними файловими системами. Тільки ті з них,
|
||||
які підтримують знімки, використовуватимуть їх, тоді як інші диски продовжуватимуть
|
||||
працювати безпосередньо з живою файловою системою.
|
||||
|
||||
Створення та видалення знімків вимагають прав адміністратора.
|
||||
Переконайтеся, що SnapRAID запущено з необхідними привілеями (наприклад, sudo),
|
||||
коли знімки увімкнено.
|
||||
|
||||
8.1 Поведінка команд із знімками
|
||||
--------------------------------
|
||||
|
||||
Команди `sync` та `scrub` працюють виключно зі знімками,
|
||||
щоб гарантувати, що всі операції з даними виконуються на узгодженому,
|
||||
замороженому стані. Використовуючи ці знімки, SnapRAID запобігає невідповідності
|
||||
парності, яка в іншому випадку була б викликана одночасними змінами файлів у живій файловій системі.
|
||||
Під час `sync` команда використовує новий знімок, створений на початку
|
||||
процесу, для фіксації поточного стану для обчислення парності.
|
||||
Навпаки, команда `scrub` використовує останній знімок, створений під час
|
||||
найостаннішої синхронізації, щоб підтримувати надійну точку відліку,
|
||||
яка відповідає існуючій парності.
|
||||
|
||||
Для команд `check` та `fix` використання останнього знімка
|
||||
залежить від того, чи націлені конкретні диски за допомогою опції
|
||||
-d, --filter-disk.
|
||||
|
||||
Диск, явно вибраний за допомогою -d («ціль» операції),
|
||||
завжди використовує живу файлову систему. Для `fix` це дозволяє відновити
|
||||
дані на активну заміну диска. Для `check` це дозволяє симулювати
|
||||
операцію `fix` за тих самих умов.
|
||||
|
||||
Доступ до всіх інших дисків із даними («довідкових» дисків) здійснюватиметься через
|
||||
їхні знімки. Це гарантує, що навіть якщо ви змінюєте файли
|
||||
на своїх справних дисках під час відновлення, SnapRAID
|
||||
має стабільну, замороженну точку відліку для вирішення рівнянь парності.
|
||||
|
||||
Якщо опція -d не надана, SnapRAID припускає, що операція застосовується
|
||||
до всього масиву; у цьому випадку `check` та `fix` використовуватимуть виключно
|
||||
живі файлові системи.
|
||||
|
||||
Усі інші команди працюють виключно з живою файловою системою.
|
||||
|
||||
|
||||
9 Життєвий цикл знімків (SNAPSHOTS LIFECYCLE)
|
||||
=============================================
|
||||
|
||||
SnapRAID керує двома конкретними знімками, `stable` та `pending`,
|
||||
всередині прихованого каталогу в корінному каталозі кожного підтому даних.
|
||||
У Btrfs, Bcachefs та NTFS використовується каталог `.snapraid/`,
|
||||
у ZFS — стандартний `.zfs/snapshot/`.
|
||||
|
||||
Знімок `stable` представляє стан останньої успішно
|
||||
завершеної синхронізації `sync`, що містить точні дані, використані для
|
||||
обчислення поточної парності. Він служить основним джерелом даних
|
||||
для команд `scrub`, `check` та `fix`.
|
||||
|
||||
Знімок `pending` — це тимчасовий образ, що створюється на початку
|
||||
`sync` для забезпечення замороженого стану для обчислення парності.
|
||||
Після успішного завершення операції попередній знімок `stable`
|
||||
видаляється, а знімок `pending` підвищується в статусі, щоб
|
||||
зайняти його місце в якості нового стабільного орієнтира.
|
||||
|
||||
Якщо процес `sync` переривається, знімок `pending` зберігається.
|
||||
Наступні команди `scrub`, `check` та `fix` використовуватимуть цей
|
||||
очікуваний знімок, оскільки він відповідає стану файлової системи, записаному в
|
||||
файлі .content, навіть якщо парність синхронізована лише частково.
|
||||
|
||||
У разі переривання `sync` команди `check` та `fix`
|
||||
також читають дані зі знімка `stable` для вилучення блоків даних
|
||||
із файлів, які були оновлені або видалені під час синхронізації.
|
||||
Це можливо тому, що файл .content зберігає метадані для
|
||||
усіх змінених або видалених файлів протягом усього процесу sync.
|
||||
Ця історична інформація очищається лише після успішного завершення sync
|
||||
і збереження фінальної версії файлу .content.
|
||||
|
||||
Якщо `sync` перезапускається після переривання, існуючий
|
||||
очікуваний (pending) знімок видаляється, і створюється новий для
|
||||
фіксації поточного стану живої файлової системи.
|
||||
|
||||
|
||||
10 Шаблон (PATTERN)
|
||||
===================
|
||||
|
||||
Шаблони забезпечують гнучкий спосіб фільтрації файлів для включення або
|
||||
виключення. Використовуючи символи підстановки (globbing), ви можете визначити правила, які
|
||||
|
|
@ -1684,7 +1843,7 @@ PARITY — це одне з імен парності: `parity`,
|
|||
Класи символів із використанням квадратних дужок `[]` відповідають одному символу з
|
||||
визначеного набору або діапазону. Як і інші односимвольні шаблони, вони
|
||||
не відповідають роздільникам каталогів. Класи підтримують діапазони та заперечення за допомогою
|
||||
знаку оклику.
|
||||
знака оклику.
|
||||
|
||||
Фундаментальна відмінність, яку слід пам'ятати, полягає в тому, що `*`, `?` та класи символів
|
||||
усі дотримуються меж каталогів і відповідають лише в межах одного компонента
|
||||
|
|
@ -1695,19 +1854,19 @@ PARITY — це одне з імен парності: `parity`,
|
|||
|
||||
FILE
|
||||
Вибирає будь-який файл з ім'ям FILE.
|
||||
Цей шаблон застосовується тільки до файлів, а не до директорій.
|
||||
Цей шаблон застосовується тільки до файлів, а не до каталогів.
|
||||
|
||||
DIR/
|
||||
Вибирає будь-яку директорію з ім'ям DIR і все, що знаходиться всередині.
|
||||
Цей шаблон застосовується тільки до директорій, а не до файлів.
|
||||
Вибирає будь-який каталог з ім'ям DIR і все, що знаходиться всередині.
|
||||
Цей шаблон застосовується тільки до каталогів, а не до файлів.
|
||||
|
||||
/PATH/FILE
|
||||
Вибирає точно вказаний шлях до файлу. Цей шаблон застосовується
|
||||
тільки до файлів, а не до директорій.
|
||||
тільки до файлів, а не до каталогів.
|
||||
|
||||
/PATH/DIR/
|
||||
Вибирає точно вказаний шлях до директорії і все, що знаходиться
|
||||
всередині. Цей шаблон застосовується тільки до директорій, а не до файлів.
|
||||
Вибирає точно вказаний шлях до каталогу і все, що знаходиться
|
||||
всередині. Цей шаблон застосовується тільки до каталогів, а не до файлів.
|
||||
|
||||
Коли ви вказуєте абсолютний шлях, що починається
|
||||
з /, він застосовується до кореневого каталогу
|
||||
|
|
@ -1724,7 +1883,7 @@ PARITY — це одне з імен парності: `parity`,
|
|||
|
||||
Якщо ім'я файлу містить символи `*`, `?`, `[`,
|
||||
або `]`, ви повинні екранувати їх, щоб уникнути
|
||||
їх інтерпретації як символу глоббінгу.
|
||||
їх інтерпретації як символу глобінгу.
|
||||
В Unix символом екранування є `\`; у Windows — `^`.
|
||||
Коли шаблон знаходиться в командному рядку,
|
||||
ви повинні подвоїти символ екранування, щоб
|
||||
|
|
@ -1777,16 +1936,16 @@ PARITY — це одне з імен парності: `parity`,
|
|||
|
||||
# Перевіряє лише файли .mp3.
|
||||
# В Unix використовуйте лапки, щоб уникнути
|
||||
# розширення глоббінгу оболонкою.
|
||||
# розширення глобінгу оболонкою.
|
||||
snapraid -f "*.mp3" check
|
||||
|
||||
В Unix, при використанні символів глоббінгу в
|
||||
В Unix, при використанні символів глобінгу в
|
||||
командному рядку, ви повинні взяти їх у лапки,
|
||||
щоб запобігти їх розширенню оболонкою.
|
||||
|
||||
|
||||
9 Ігнорування файлів (IGNORE FILE)
|
||||
==================================
|
||||
11 Ігнорування файлів (IGNORE FILE)
|
||||
===================================
|
||||
|
||||
На додаток до глобальних правил у файлі конфігурації, ви можете розміщувати
|
||||
файли `.snapraidignore` в будь-якому каталозі всередині масиву для визначення
|
||||
|
|
@ -1830,7 +1989,7 @@ PARITY — це одне з імен парності: `parity`,
|
|||
*.tmp
|
||||
|
||||
|
||||
10 Вміст (CONTENT)
|
||||
12 Вміст (CONTENT)
|
||||
==================
|
||||
|
||||
SnapRAID зберігає список та контрольні суми
|
||||
|
|
@ -1841,12 +2000,13 @@ SnapRAID зберігає список та контрольні суми
|
|||
усіма контрольними сумами для перевірки їх
|
||||
цілісності.
|
||||
|
||||
Цей файл зчитується та записується командами
|
||||
`sync` та `scrub` та зчитується командами `fix`,
|
||||
`check` та `status`.
|
||||
Файл вмісту зчитується та записується командами `sync`, `scrub`,
|
||||
`touch` та `rehash`. Він зчитується командами `status`, `diff`,
|
||||
`check`, `fix`, `list`, `dup`, `locate` та `pool`, і повністю
|
||||
ігнорується командами `smart`, `probe`, `up`, `down` та `devices`.
|
||||
|
||||
|
||||
11 Парність (PARITY)
|
||||
13 Парність (PARITY)
|
||||
====================
|
||||
|
||||
SnapRAID зберігає інформацію парності вашого
|
||||
|
|
@ -1861,7 +2021,7 @@ SnapRAID зберігає інформацію парності вашого
|
|||
`scrub` та `check`.
|
||||
|
||||
|
||||
12 Кодування (ENCODING)
|
||||
14 Кодування (ENCODING)
|
||||
=======================
|
||||
|
||||
SnapRAID в Unix ігнорує будь-яке кодування.
|
||||
|
|
@ -1885,13 +2045,30 @@ TrueType, такий як `Lucida Console`, як
|
|||
буде у форматі UTF-8.
|
||||
|
||||
|
||||
13 Авторське право (COPYRIGHT)
|
||||
15 Код завершення (EXIT CODE)
|
||||
=============================
|
||||
|
||||
SnapRAID завершує роботу з такими кодами помилок:
|
||||
|
||||
0 - Все в порядку.
|
||||
1 - Команда виявила помилки.
|
||||
2 - Команда `diff` визначила, що все в порядку, але потрібен `sync`.
|
||||
|
||||
|
||||
16 Переклад (TRANSLATION)
|
||||
=========================
|
||||
|
||||
Цей документ є автоматичним перекладом англійського посібника.
|
||||
Зверніться до англійського посібника для отримання офіційної версії.
|
||||
|
||||
|
||||
17 Авторське право (COPYRIGHT)
|
||||
==============================
|
||||
|
||||
Цей файл захищений авторським правом (C) 2025 Andrea Mazzoleni
|
||||
Цей файл захищений авторським правом (C) 2026 Andrea Mazzoleni
|
||||
|
||||
|
||||
14 Див. також (SEE ALSO)
|
||||
18 Див. також (SEE ALSO)
|
||||
========================
|
||||
|
||||
snapraid_log(1), snapraidd(1)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
.TH "磁盘阵列的 SnapRAID 备份" 1
|
||||
.SH NAME
|
||||
snapraid \- 磁盘阵列的 SnapRAID 备份
|
||||
.SH SYNOPSIS
|
||||
.SH 概要 (SYNOPSIS)
|
||||
snapraid [\-c, \-\-conf CONFIG]
|
||||
.PD 0
|
||||
.PP
|
||||
|
|
@ -77,7 +77,7 @@ snapraid [\-c, \-\-conf CONFIG]
|
|||
snapraid [\-V, \-\-version] [\-H, \-\-help] [\-C, \-\-gen\-conf CONTENT]
|
||||
.PD 0
|
||||
.PD
|
||||
.SH DESCRIPTION
|
||||
.SH 描述 (DESCRIPTION)
|
||||
SnapRAID 是一款专为磁盘阵列设计的备份程序,它存储奇偶校验信息,
|
||||
以在最多六个磁盘发生故障时进行数据恢复。
|
||||
.PP
|
||||
|
|
@ -109,19 +109,31 @@ https://www.snapraid.it/
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH LIMITATIONS
|
||||
SnapRAID 是 RAID 和备份程序之间的混合体,旨在结合两者的优点。
|
||||
然而,在使用它之前,您应该考虑一些限制。
|
||||
.SH 限制 (LIMITATIONS)
|
||||
SnapRAID 是 RAID 和备份程序之间的混合体,旨在结合两者的最佳优势。
|
||||
但是,在使用它之前,您应该考虑它的一些限制。
|
||||
.PP
|
||||
主要的限制是,如果一个磁盘发生故障而您最近没有进行同步(sync),
|
||||
您可能无法完全恢复。
|
||||
更具体地说,您可能无法恢复自上次同步操作以来已更改或已删除文件的
|
||||
大小所对应的部分。
|
||||
即使更改或删除的文件不在发生故障的磁盘上,也会发生这种情况。
|
||||
这就是为什么 SnapRAID 更适用于很少更改的数据。
|
||||
主要的限制是,如果磁盘发生故障,您只能将数据恢复到上一次 \`sync\`(同步)操作的状态。
|
||||
自上次同步以来添加的任何数据或进行的任何修改(如果位于发生故障的磁盘上)都将丢失。
|
||||
.PP
|
||||
另一方面,新添加的文件不会阻止对已有文件的恢复。
|
||||
您只会丢失位于发生故障磁盘上的最近添加的文件。
|
||||
因此,SnapRAID 主要适用于很少更改的数据。
|
||||
.PP
|
||||
对于上次同步时已经存在的数据,恢复的可靠性取决于是否使用了 \`snapshot\`(快照)选项:
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
具有快照支持(在 Btrfs、ZFS、Bcachefs 和 NTFS 上可用),
|
||||
SnapRAID 可以自动维护数据磁盘的冻结引用。
|
||||
这确保了即使您在同步期间或之后在活动文件系统上修改或删除文件,
|
||||
恢复过程仍保持一致且可靠。
|
||||
.PD
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
在没有快照支持的情况下,在 \`sync\` 之后删除或更改文件
|
||||
可能会阻止其他损坏磁盘的完全恢复。发生这种情况
|
||||
是因为校验数据不再与修改后的文件匹配,即使
|
||||
这些文件不在损坏的磁盘上。另一方面,新添加的文件
|
||||
不会阻止已存在文件的恢复。
|
||||
.PD
|
||||
.PP
|
||||
SnapRAID 的其他限制包括:
|
||||
.PD 0
|
||||
|
|
@ -141,7 +153,7 @@ SnapRAID 只能从有限数量的磁盘故障中恢复数据。
|
|||
仅保存文件名、时间戳、符号链接和硬链接。
|
||||
不保存权限、所有权和扩展属性。
|
||||
.PD
|
||||
.SH GETTING STARTED
|
||||
.SH 入门 (GETTING STARTED)
|
||||
要使用 SnapRAID,您需要首先选择磁盘阵列中的一个磁盘专用于
|
||||
\`parity\`(奇偶校验)信息。使用一个奇偶校验磁盘,
|
||||
您将能够从单磁盘故障中恢复,类似于 RAID5。
|
||||
|
|
@ -275,7 +287,7 @@ snapraid sync
|
|||
当此命令完成时,您的数据是**安全的**。
|
||||
.PP
|
||||
现在您可以开始随意使用您的阵列,并定期运行 \`sync\` 命令更新奇偶校验信息。
|
||||
.SS Scrubbing
|
||||
.SS 数据擦洗 (Scrubbing)
|
||||
要定期检查数据和奇偶校验的错误,您可以运行 \`scrub\` 命令。
|
||||
.PP
|
||||
.RS 4
|
||||
|
|
@ -327,10 +339,10 @@ snapraid \-p bad scrub
|
|||
.PP
|
||||
在未同步的阵列上运行 \`scrub\` 可能会报告由已删除或已修改文件引起的错误。
|
||||
这些错误会在 \`scrub\` 输出中报告,但相关块不会被标记为坏块。
|
||||
.SS Pooling
|
||||
.SS 合并池 (Pooling)
|
||||
注意:下面描述的 pooling 功能已被 mergerfs 工具取代,
|
||||
mergerfs 现在是 SnapRAID 社区推荐的 Linux 用户选项。
|
||||
Mergefs 提供了一种更灵活、更高效的方式,将多个驱动器汇集到一个
|
||||
Mergerfs 提供了一种更灵活、更高效的方式,将多个驱动器汇集到一个
|
||||
统一的挂载点中,允许跨阵列无缝访问文件,而无需依赖符号链接。
|
||||
它与 SnapRAID 很好地集成以提供奇偶校验保护,常用于
|
||||
OpenMediaVault (OMV) 或自定义 NAS 配置等设置中。
|
||||
|
|
@ -469,7 +481,7 @@ fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Undeleting
|
||||
.SS 取消删除 (Undeleting)
|
||||
SnapRAID 的功能更像一个备份程序而不是 RAID 系统,
|
||||
它可以使用 \-f, \-\-filter 选项来恢复或取消删除文件到其以前的状态:
|
||||
.PP
|
||||
|
|
@ -503,7 +515,7 @@ snapraid fix \-m
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SS Recovering
|
||||
.SS 数据恢复 (Recovering)
|
||||
最糟糕的情况发生了,您丢失了一个或多个磁盘!
|
||||
.PP
|
||||
**不要惊慌!** 您将能够恢复它们!
|
||||
|
|
@ -596,26 +608,26 @@ snapraid sync
|
|||
.RE
|
||||
.PP
|
||||
如果所有内容都已恢复,此命令是即时的。
|
||||
.SH COMMANDS
|
||||
SnapRAID 提供了一些简单的命令,允许您:
|
||||
.SH 命令 (COMMANDS)
|
||||
SnapRAID 提供了几个简单的命令,允许您:
|
||||
.PD 0
|
||||
.IP \(bu
|
||||
打印阵列的状态 \-> \`status\`
|
||||
.IP \(bu
|
||||
控制磁盘 \-> \`smart\`、\`probe\`、\`up\`、\`down\`
|
||||
.IP \(bu
|
||||
进行备份/快照 \-> \`sync\`
|
||||
创建备份/恢复点 \-> \`sync\`
|
||||
.IP \(bu
|
||||
定期检查数据 \-> \`scrub\`
|
||||
.IP \(bu
|
||||
恢复上次备份/快照 \-> \`fix\`。
|
||||
恢复上一个备份/恢复点 \-> \`fix\`。
|
||||
.PD
|
||||
.PP
|
||||
命令必须用小写字母书写。
|
||||
命令必须用小写字母编写。
|
||||
.SS status
|
||||
打印磁盘阵列状态的摘要。
|
||||
.PP
|
||||
它包括有关奇偶校验碎片、块未经检查有多久,以及在 scrubbing
|
||||
它包括有关奇偶校验碎片、块未经检查有多久,以及在数据擦洗 (scrubbing)
|
||||
期间遇到的所有记录的静默错误的信息。
|
||||
.PP
|
||||
所提供的信息指的是您上次运行 \`sync\` 的时间。
|
||||
|
|
@ -809,14 +821,14 @@ full \- Scrub 所有内容。
|
|||
\`parity\` 文件**不会**被修改。
|
||||
阵列中的文件**不会**被修改。
|
||||
.SS fix
|
||||
修复所有文件和奇偶校验数据。
|
||||
修复所有文件和校验数据。
|
||||
.PP
|
||||
所有文件和奇偶校验数据都与上次 \`sync\` 中保存的快照
|
||||
状态进行比较。
|
||||
如果发现差异,则将其恢复到存储的快照。
|
||||
将所有文件和校验数据与上一次 \`sync\` 中保存的状态进行比较。
|
||||
如果发现差异,则将其恢复到存储的状态。
|
||||
.PP
|
||||
**警告!** \`fix\` 命令不区分错误和
|
||||
故意修改。它**无条件地**将文件状态恢复到上次 \`sync\`。
|
||||
警告!
|
||||
\`fix\` 命令不区分错误和故意修改。
|
||||
它会无条件地将文件状态恢复到上一次 \`sync\` 的状态。
|
||||
.PP
|
||||
如果未指定其他选项,则处理整个阵列。
|
||||
使用过滤选项选择要操作的文件或磁盘的子集。
|
||||
|
|
@ -932,7 +944,7 @@ SnapRAID 会重命名所有无法修复的文件,并添加
|
|||
.PP
|
||||
如果您想重新分配这些文件,可以使用 \-W, \-\-force\-realloc\-tail 选项。
|
||||
请注意,在重新分配过程中,此类文件将不受校验保护。
|
||||
.SH OPTIONS
|
||||
.SH 选项 (OPTIONS)
|
||||
SnapRAID 提供以下选项:
|
||||
.TP
|
||||
.B \-c, \-\-conf CONFIG
|
||||
|
|
@ -1031,7 +1043,7 @@ DAYS 是块被 scrub 的最小天数;默认值为 10。
|
|||
每秒的字节数。您可以指定乘数,例如 K、M 或 G
|
||||
(例如,\-\-bw\-limit 1G)。
|
||||
.TP
|
||||
.B \-t, \-\-tail 大小
|
||||
.B \-t, \-\-tail SIZE
|
||||
将文件列表限制为那些使用校验盘指定尾部大小以内的文件。
|
||||
您可以使用乘数,如 K、M、G 或 T(例如 \-\-tail 1G)。
|
||||
此选项仅在与 \`locate\` 命令配合使用时有效。
|
||||
|
|
@ -1114,9 +1126,9 @@ DAYS 是块被 scrub 的最小天数;默认值为 10。
|
|||
**警告!** 此选项仅供专家使用,强烈建议不要使用它。
|
||||
在 \`sync\` 操作期间,您**没有**数据保护。
|
||||
.TP
|
||||
.B \-W, \-\-force\-realloc\-tail 大小
|
||||
.B \-W, \-\-force\-realloc\-tail SIZE
|
||||
工作方式类似于 \-R, \-\-force\-realloc,但仅限于每个校验文件的
|
||||
指定尾部部分(最后“大小”字节)。
|
||||
指定尾部部分(最后 SIZE 字节)。
|
||||
它会强制重新分配(移动)当前存储在该尾部部分的任何文件分片/块,
|
||||
允许它们被放置在校验文件中任何有可用空间的地方(包括现有的
|
||||
空隙)。
|
||||
|
|
@ -1187,7 +1199,7 @@ HHMMSS。在 Windows 批处理文件中,您必须双写 \`%\` 字符,
|
|||
.TP
|
||||
.B \-V, \-\-version
|
||||
打印程序版本。
|
||||
.SH CONFIGURATION
|
||||
.SH 配置 (CONFIGURATION)
|
||||
SnapRAID 需要一个配置文件来了解您的磁盘阵列
|
||||
位于何处以及在哪里存储奇偶校验信息。
|
||||
.PP
|
||||
|
|
@ -1282,6 +1294,24 @@ DIR 是磁盘在文件系统中的挂载点。
|
|||
.PP
|
||||
请注意,此类磁盘不受 \`up\` 和 \`down\` 命令的影响,因为它们被预期始终处于
|
||||
旋转状态。
|
||||
.SS snapshot
|
||||
为 \`sync\`、\`scrub\`、\`check\` 和 \`fix\` 命令启用文件系统快照的使用。
|
||||
.PP
|
||||
启用后,SnapRAID 会在“sync”开始时创建数据的只读快照。
|
||||
这确保了文件在特定时间点的一致视图,从而防止由并发文件修改引起的错误。
|
||||
.PP
|
||||
这显著提高了恢复能力:如果从实时文件系统中删除了一个文件,
|
||||
它仍会保留在快照中。这可以防止该数据块的校验数据变得“损坏”,
|
||||
从而确保在另一个磁盘发生故障时您仍能成功恢复数据。
|
||||
.PP
|
||||
此选项仅适用于在 Linux 中格式化为 Btrfs、Bcachefs 或 ZFS 文件系统,
|
||||
以及在 Windows 中格式化为 NTFS 的数据磁盘。
|
||||
校验磁盘或使用其他文件系统的数据磁盘将始终使用文件系统的活动版本。
|
||||
.PP
|
||||
快照的创建和删除需要管理权限。
|
||||
启用此选项时,请确保以必要的权限(例如 sudo)运行 SnapRAID。
|
||||
.PP
|
||||
有关快照生命周期的详细说明,请参阅 SNAPSHOTS(快照)部分。
|
||||
.SS nohidden
|
||||
排除所有隐藏文件和目录。
|
||||
在 Unix 中,隐藏文件是以 \`.\` 开头的文件。
|
||||
|
|
@ -1355,36 +1385,36 @@ mkfs.ext4 \-m 0 \-T largefile4 DEVICE
|
|||
根据经验,SnapRAID 通常每 16 TB 的阵列数据需要 1 GiB 的 RAM。
|
||||
.PP
|
||||
具体来说,为了存储数据的散列,SnapRAID 大约需要
|
||||
$TS*(1+HS)/BS$ 字节的 RAM,
|
||||
其中 $TS$ 是您的磁盘阵列的总大小(以字节为单位),$BS$ 是块大小(以字节为单位),
|
||||
$HS$ 是散列大小(以字节为单位)。
|
||||
TS*(1+HS)/BS 字节的 RAM,
|
||||
其中 TS 是您的磁盘阵列的总大小(以字节为单位),BS 是块大小(以字节为单位),
|
||||
HS 是散列大小(以字节为单位)。
|
||||
.PP
|
||||
例如,对于 8 个 4 TB 磁盘,块大小为 256 KiB
|
||||
(1 KiB = 1024 字节),散列大小为 16,您将获得:
|
||||
.PP
|
||||
RAM = $(8 * 4 * 10^{12}) * (1+16) / (256 * 2^{10}) = 1.93$ GiB
|
||||
RAM = (8 * 4 * 10^12) * (1+16) / (256 * 2^10) = 1.93 GiB
|
||||
.PD 0
|
||||
.PD
|
||||
.PP
|
||||
切换到散列大小为 8,您将获得:
|
||||
.PP
|
||||
RAM = $(8 * 4 * 10^{12}) * (1+8) / (256 * 2^{10}) = 1.02$ GiB
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (256 * 2^10) = 1.02 GiB
|
||||
.PD 0
|
||||
.PD
|
||||
.PP
|
||||
切换到块大小为 512,您将获得:
|
||||
.PP
|
||||
RAM = $(8 * 4 * 10^{12}) * (1+16) / (512 * 2^{10}) = 0.96$ GiB
|
||||
RAM = (8 * 4 * 10^12) * (1+16) / (512 * 2^10) = 0.96 GiB
|
||||
.PD 0
|
||||
.PD
|
||||
.PP
|
||||
切换到散列大小为 8 和块大小为 512,您将获得:
|
||||
.PP
|
||||
RAM = $(8 * 4 * 10^{12}) * (1+8) / (512 * 2^{10}) = 0.51$ GiB
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0.51 GiB
|
||||
.PD 0
|
||||
.PD
|
||||
.SS autosave SIZE_IN_GIGABYTES
|
||||
在同步或 scrub 之后,处理指定数量的 GB 后,自动保存状态。
|
||||
在同步或 scrub 期间,每处理指定数量的 GB 后就自动保存状态。
|
||||
此选项有助于避免在机器崩溃或任何其他事件中断时,
|
||||
从头开始重新启动长时间的 \`sync\` 命令。
|
||||
.SS temp_limit TEMPERATURE_CELSIUS
|
||||
|
|
@ -1405,10 +1435,10 @@ SnapRAID 运行时会显示当前磁盘温度。
|
|||
此估计温度仅供参考,对 SnapRAID 的行为没有影响。
|
||||
程序的动作仅基于实际测量的磁盘温度。
|
||||
.PP
|
||||
要执行此分析,SnapRAID 需要一个系统温度的参考。
|
||||
要执行此分析,SnapRAID 需要一个系统温度的参考基准值。
|
||||
它首先尝试从可用的硬件传感器读取。
|
||||
如果无法访问系统传感器,它会使用运行时测量的最低磁盘温度
|
||||
作为备用参考。
|
||||
作为备用基准值。
|
||||
.PP
|
||||
通常,SnapRAID 只显示最热磁盘的温度。
|
||||
要显示所有磁盘的温度,请使用 \-A 或 \-\-stats 选项。
|
||||
|
|
@ -1446,6 +1476,8 @@ PARITY 是奇偶校验名称之一:\`parity\`、\`2\-parity\`、\`3\-parity\`
|
|||
对于 RAID 控制器,设备可能是固定的,
|
||||
您可能不需要使用 \`%s\`。
|
||||
.PP
|
||||
您还可以使用 \`[info: ...]\` 标记指定自定义信息选项字符串,以替换默认的 \`\-a\` 选项。
|
||||
.PP
|
||||
请参阅 smartmontools 文档以了解可能的选项:
|
||||
.PP
|
||||
.RS 4
|
||||
|
|
@ -1461,6 +1493,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices
|
|||
例如:
|
||||
.PP
|
||||
.RS 4
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl parity \-d sat %s
|
||||
.PD 0
|
||||
.PD
|
||||
|
|
@ -1474,18 +1510,27 @@ PARITY 是奇偶校验名称之一:\`parity\`、\`2\-parity\`、\`3\-parity\`
|
|||
\`4\-parity\`、\`5\-parity\`、\`6\-parity\` 或 \`z\-parity\`。
|
||||
特殊值 * 可用于在所有磁盘上忽略该属性。
|
||||
.PP
|
||||
例如,要在所有磁盘上忽略 \`Current Pending Sector Count\` 属性:
|
||||
可以指定多个属性,用空格分隔。
|
||||
每个属性可以指定为 1 到 255 之间的数字,或者不区分大小写的名称
|
||||
(例如 \`Current_Pending_Sector\`)。
|
||||
.PP
|
||||
例如,要在所有磁盘上通过编号或名称忽略 \`Current Pending Sector Count\` 和
|
||||
\`Reallocated Sectors Count\` 属性:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore * 197
|
||||
smartignore * 197 5
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.PP
|
||||
要仅在第一个奇偶校验磁盘上忽略它:
|
||||
要仅在第一个奇偶校验磁盘上忽略它们:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore parity 197
|
||||
smartignore parity 197 5
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
|
|
@ -1525,7 +1570,7 @@ exclude /tmp/
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1581,7 +1626,7 @@ exclude \\System Volume Information
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1597,7 +1642,104 @@ smartctl 2\-parity \-d areca,2/1 /dev/arcmsr0
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH PATTERN
|
||||
.SH 快照 (SNAPSHOTS)
|
||||
如果配置中启用了快照选项,SnapRAID 将
|
||||
利用文件系统快照功能来确保原子操作和一致操作。
|
||||
.PP
|
||||
快照的管理是完全自动且透明的。
|
||||
您可以完全像以前一样继续使用 SnapRAID,而快照提供的
|
||||
额外保护完全在后台处理。
|
||||
.PP
|
||||
这提供了两个主要好处:
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I 一致性
|
||||
在运行时间较长的 sync 或 scrub 期间在活动文件系统上修改的文件
|
||||
不会导致校验不匹配或操作中止,因为 SnapRAID 看到的是一个冻结的时间点镜像。
|
||||
.HP 4
|
||||
.I 恢复
|
||||
如果从实时文件系统中更新或删除了一个文件,
|
||||
它仍会保留在快照中。如果下次 sync 运行之前发生磁盘故障,
|
||||
SnapRAID 会使用快照中保留的数据来重建发生故障的磁盘。
|
||||
.PD
|
||||
.PP
|
||||
.RS 4
|
||||
.PD 0
|
||||
在活动同步过程中发生磁盘故障的情况下,
|
||||
SnapRAID 还能自动从上一次校验计算的快照和当前的快照中读取数据。
|
||||
这通过提供解校验方程所需的精确数据块访问,
|
||||
最大程度地提高了完全恢复的概率,即使这些数据块在同步之间被修改或删除。
|
||||
.PD
|
||||
.PP
|
||||
.PD 0
|
||||
如果没有快照,健康磁盘上更新或删除的文件会导致缺少数据块,
|
||||
而这些数据块可能是修复其他损坏磁盘所必需的。
|
||||
.PD
|
||||
.RE
|
||||
.RE
|
||||
.PP
|
||||
快照仅为数据磁盘创建,并且仅在底层文件系统支持此功能时创建。
|
||||
校验磁盘始终使用实时文件系统。
|
||||
.PP
|
||||
目前,Linux 上的 Btrfs、Bcachefs 和 ZFS 以及 Windows 上的 NTFS 支持此功能。
|
||||
.PP
|
||||
您可以混合使用具有不同文件系统的数据磁盘。只有那些
|
||||
支持快照的磁盘才会利用它们,而其他磁盘将继续直接在实时文件系统上运行。
|
||||
.PP
|
||||
快照的创建和删除需要管理权限。
|
||||
启用快照时,请确保以必要的权限(例如 sudo)运行 SnapRAID。
|
||||
.SS 快照的命令行为
|
||||
\`sync\` 和 \`scrub\` 命令都完全在快照上运行,
|
||||
以确保所有数据操作都是针对一致的、冻结的状态进行的。通过利用这些快照,
|
||||
SnapRAID 阻止了本由实时文件系统上的并发文件修改所触发的校验不匹配。
|
||||
在 \`sync\` 期间,该命令使用在过程开始时创建的新快照来捕获用于校验计算的当前状态。
|
||||
相比之下,\`scrub\` 命令利用上一个快照(即在最近一次同步期间创建的快照)
|
||||
来维持与现有校验匹配的可靠参考点。
|
||||
.PP
|
||||
对于 \`check\` 和 \`fix\` 命令,上一个快照的使用
|
||||
取决于是否使用 \-d, \-\-filter\-disk 选项指定了特定磁盘。
|
||||
.PP
|
||||
通过 \-d 明确选择的磁盘(操作的“目标”)始终使用实时文件系统。
|
||||
对于 \`fix\`,这允许将数据恢复到活动的替代磁盘。对于 \`check\`,
|
||||
它允许在相同条件下模拟 \`fix\` 操作。
|
||||
.PP
|
||||
所有其他数据磁盘(“参考”磁盘)都将通过其快照进行访问。
|
||||
这确保了即使您在恢复进行时修改健康磁盘上的文件,
|
||||
SnapRAID 也有一个稳定、冻结的参考来求解校验方程。
|
||||
.PP
|
||||
如果没有提供 \-d 选项,SnapRAID 会假设该操作适用于整个阵列,
|
||||
在这种情况下,\`check\` 和 \`fix\` 将排他性地使用实时文件系统。
|
||||
.PP
|
||||
所有其他命令完全在实时文件系统上运行。
|
||||
.SH 快照生命周期 (SNAPSHOTS LIFECYCLE)
|
||||
SnapRAID 在每个数据子卷根目录下的隐藏目录中管理两个特定的快照:
|
||||
\`stable\`(稳定)和 \`pending\`(待定)。
|
||||
在 Btrfs、Bcachefs 和 NTFS 中使用 \`.snapraid/\` 目录,
|
||||
在 ZFS 中使用标准的 \`.zfs/snapshot/\`。
|
||||
.PP
|
||||
\`stable\` 快照代表上一次成功完成的 \`sync\` 的状态,
|
||||
包含用于计算当前校验的准确数据。它作为 \`scrub\`、\`check\`
|
||||
和 \`fix\` 命令的主要数据源。
|
||||
.PP
|
||||
\`pending\` 快照是在 \`sync\` 开始时创建的临时镜像,
|
||||
用于为校验计算提供冻结状态。在操作成功完成后,
|
||||
以前的 \`stable\` 快照将被删除,并且 \`pending\` 快照将被提升
|
||||
以接替其作为新的稳定参考。
|
||||
.PP
|
||||
如果 \`sync\` 中断,\`pending\` 快照将被保留。
|
||||
随后的 \`scrub\`、\`check\` 和 \`fix\` 命令将使用此待定快照,
|
||||
因为它与 .content 文件中记录的文件系统状态相匹配,即使校验仅部分同步。
|
||||
.PP
|
||||
在 \`sync\` 中断的情况下,\`check\` 和 \`fix\` 命令
|
||||
还会从 \`stable\` 快照中读取数据,以检索在同步期间更新或删除的文件的
|
||||
数据块。这是可能的,因为 .content 文件在整个同步过程中保留了
|
||||
所有修改或删除的文件的元数据。此历史信息仅在同步
|
||||
成功完成并保存 .content 文件的最终版本后才会清除。
|
||||
.PP
|
||||
如果 \`sync\` 在中断后重新启动,现有的 pending 快照将被删除,
|
||||
并创建一个新快照以捕获实时文件系统的当前状态。
|
||||
.SH 模式 (PATTERN)
|
||||
模式提供了一种灵活的方法来过滤要包含或排除的文件。通过使用通配符(globbing),
|
||||
您可以定义匹配特定文件名或整个目录结构的规则,而无需手动列出每个路径。
|
||||
.PP
|
||||
|
|
@ -1765,7 +1907,7 @@ snapraid \-f \[dq]*.mp3\[dq] check
|
|||
.PP
|
||||
在 Unix 中,在命令行上使用 globbing 字符时,必须
|
||||
引用它们以防止 shell 扩展它们。
|
||||
.SH IGNORE FILE
|
||||
.SH 忽略文件 (IGNORE FILE)
|
||||
除了配置文件中的全局规则外,您还可以在阵列内的任何目录中放置
|
||||
\`.snapraidignore\` 文件,以定义分散的排除规则。
|
||||
.PP
|
||||
|
|
@ -1821,15 +1963,17 @@ build/
|
|||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.SH CONTENT
|
||||
.SH 内容 (CONTENT)
|
||||
SnapRAID 将文件列表和校验和存储在 content 文件中。
|
||||
.PP
|
||||
它是一个二进制文件,列出了磁盘阵列中存在的所有文件,
|
||||
以及用于验证其完整性的所有校验和。
|
||||
.PP
|
||||
此文件由 \`sync\` 和 \`scrub\` 命令读取和写入,并由
|
||||
\`fix\`、\`check\` 和 \`status\` 命令读取。
|
||||
.SH PARITY
|
||||
content 文件由 \`sync\`、\`scrub\`、\`touch\` 和 \`rehash\` 命令读取和写入。
|
||||
它由 \`status\`、\`diff\`、\`check\`、\`fix\`、\`list\`、\`dup\`、\`locate\` 和
|
||||
\`pool\` 命令读取,并被 \`smart\`、\`probe\`、\`up\`、\`down\` 和 \`devices\`
|
||||
命令完全忽略。
|
||||
.SH 奇偶校验 (PARITY)
|
||||
SnapRAID 将阵列的奇偶校验信息存储在 parity 文件中。
|
||||
.PP
|
||||
这些是二进制文件,包含 \`content\` 文件中定义的所有
|
||||
|
|
@ -1837,7 +1981,7 @@ SnapRAID 将阵列的奇偶校验信息存储在 parity 文件中。
|
|||
.PP
|
||||
这些文件由 \`sync\` 和 \`fix\` 命令读取和写入,
|
||||
并且仅由 \`scrub\` 和 \`check\` 命令读取。
|
||||
.SH ENCODING
|
||||
.SH 编码 (ENCODING)
|
||||
SnapRAID 在 Unix 中忽略任何编码。它读取并存储
|
||||
文件系统使用的相同编码的文件名。
|
||||
.PP
|
||||
|
|
@ -1849,7 +1993,25 @@ SnapRAID 在 Unix 中忽略任何编码。它读取并存储
|
|||
作为控制台字体。这仅影响打印的文件名;如果
|
||||
您将控制台输出重定向到文件,则生成的文件始终
|
||||
采用 UTF\-8 格式。
|
||||
.SH COPYRIGHT
|
||||
此文件版权所有 (C) 2025 Andrea Mazzoleni
|
||||
.SH SEE ALSO
|
||||
snapraid_log(1), snapraidd(1)
|
||||
.SH 退出码 (EXIT CODE)
|
||||
SnapRAID 终止并返回以下错误代码:
|
||||
.RS 0
|
||||
.PD 0
|
||||
.HP 4
|
||||
.I 0
|
||||
一切正常。
|
||||
.HP 4
|
||||
.I 1
|
||||
命令遇到一些错误。
|
||||
.HP 4
|
||||
.I 2
|
||||
\`diff\` 命令发现一切正常,但需要进行 \`sync\`。
|
||||
.PD
|
||||
.RE
|
||||
.SH 翻译 (TRANSLATION)
|
||||
本文档是英文手册的自动翻译。
|
||||
请参阅英文手册以获取权威版本。
|
||||
.SH 版权 (COPYRIGHT)
|
||||
此文件版权所有 (C) 2026 Andrea Mazzoleni
|
||||
.SH 参见 (SEE ALSO)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
Name{number}
|
||||
snapraid - 磁盘阵列的 SnapRAID 备份
|
||||
|
||||
Synopsis
|
||||
概要 (Synopsis)
|
||||
:snapraid [-c, --conf CONFIG]
|
||||
: [-f, --filter PATTERN] [-d, --filter-disk NAME]
|
||||
: [-m, --filter-missing] [-e, --filter-error]
|
||||
|
|
@ -23,7 +23,7 @@ Synopsis
|
|||
|
||||
:snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
Description
|
||||
描述 (Description)
|
||||
SnapRAID 是一款专为磁盘阵列设计的备份程序,它存储奇偶校验信息,
|
||||
以在最多六个磁盘发生故障时进行数据恢复。
|
||||
|
||||
|
|
@ -43,19 +43,27 @@ Description
|
|||
|
||||
:https://www.snapraid.it/
|
||||
|
||||
Limitations
|
||||
SnapRAID 是 RAID 和备份程序之间的混合体,旨在结合两者的优点。
|
||||
然而,在使用它之前,您应该考虑一些限制。
|
||||
限制 (Limitations)
|
||||
SnapRAID 是 RAID 和备份程序之间的混合体,旨在结合两者的最佳优势。
|
||||
但是,在使用它之前,您应该考虑它的一些限制。
|
||||
|
||||
主要的限制是,如果一个磁盘发生故障而您最近没有进行同步(sync),
|
||||
您可能无法完全恢复。
|
||||
更具体地说,您可能无法恢复自上次同步操作以来已更改或已删除文件的
|
||||
大小所对应的部分。
|
||||
即使更改或删除的文件不在发生故障的磁盘上,也会发生这种情况。
|
||||
这就是为什么 SnapRAID 更适用于很少更改的数据。
|
||||
主要的限制是,如果磁盘发生故障,您只能将数据恢复到上一次 `sync`(同步)操作的状态。
|
||||
自上次同步以来添加的任何数据或进行的任何修改(如果位于发生故障的磁盘上)都将丢失。
|
||||
|
||||
另一方面,新添加的文件不会阻止对已有文件的恢复。
|
||||
您只会丢失位于发生故障磁盘上的最近添加的文件。
|
||||
因此,SnapRAID 主要适用于很少更改的数据。
|
||||
|
||||
对于上次同步时已经存在的数据,恢复的可靠性取决于是否使用了 `snapshot`(快照)选项:
|
||||
|
||||
* 具有快照支持(在 Btrfs、ZFS、Bcachefs 和 NTFS 上可用),
|
||||
SnapRAID 可以自动维护数据磁盘的冻结引用。
|
||||
这确保了即使您在同步期间或之后在活动文件系统上修改或删除文件,
|
||||
恢复过程仍保持一致且可靠。
|
||||
|
||||
* 在没有快照支持的情况下,在 `sync` 之后删除或更改文件
|
||||
可能会阻止其他损坏磁盘的完全恢复。发生这种情况
|
||||
是因为校验数据不再与修改后的文件匹配,即使
|
||||
这些文件不在损坏的磁盘上。另一方面,新添加的文件
|
||||
不会阻止已存在文件的恢复。
|
||||
|
||||
SnapRAID 的其他限制包括:
|
||||
|
||||
|
|
@ -70,7 +78,7 @@ Limitations
|
|||
* 仅保存文件名、时间戳、符号链接和硬链接。
|
||||
不保存权限、所有权和扩展属性。
|
||||
|
||||
Getting Started
|
||||
入门 (Getting Started)
|
||||
要使用 SnapRAID,您需要首先选择磁盘阵列中的一个磁盘专用于
|
||||
`parity`(奇偶校验)信息。使用一个奇偶校验磁盘,
|
||||
您将能够从单磁盘故障中恢复,类似于 RAID5。
|
||||
|
|
@ -140,7 +148,7 @@ Getting Started
|
|||
|
||||
现在您可以开始随意使用您的阵列,并定期运行 `sync` 命令更新奇偶校验信息。
|
||||
|
||||
Scrubbing
|
||||
数据擦洗 (Scrubbing)
|
||||
要定期检查数据和奇偶校验的错误,您可以运行 `scrub` 命令。
|
||||
|
||||
:snapraid scrub
|
||||
|
|
@ -173,10 +181,10 @@ Getting Started
|
|||
在未同步的阵列上运行 `scrub` 可能会报告由已删除或已修改文件引起的错误。
|
||||
这些错误会在 `scrub` 输出中报告,但相关块不会被标记为坏块。
|
||||
|
||||
Pooling
|
||||
合并池 (Pooling)
|
||||
注意:下面描述的 pooling 功能已被 mergerfs 工具取代,
|
||||
mergerfs 现在是 SnapRAID 社区推荐的 Linux 用户选项。
|
||||
Mergefs 提供了一种更灵活、更高效的方式,将多个驱动器汇集到一个
|
||||
Mergerfs 提供了一种更灵活、更高效的方式,将多个驱动器汇集到一个
|
||||
统一的挂载点中,允许跨阵列无缝访问文件,而无需依赖符号链接。
|
||||
它与 SnapRAID 很好地集成以提供奇偶校验保护,常用于
|
||||
OpenMediaVault (OMV) 或自定义 NAS 配置等设置中。
|
||||
|
|
@ -239,7 +247,7 @@ Getting Started
|
|||
|
||||
:fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
||||
|
||||
Undeleting
|
||||
取消删除 (Undeleting)
|
||||
SnapRAID 的功能更像一个备份程序而不是 RAID 系统,
|
||||
它可以使用 -f, --filter 选项来恢复或取消删除文件到其以前的状态:
|
||||
|
||||
|
|
@ -258,7 +266,7 @@ Getting Started
|
|||
|
||||
:snapraid fix -m
|
||||
|
||||
Recovering
|
||||
数据恢复 (Recovering)
|
||||
最糟糕的情况发生了,您丢失了一个或多个磁盘!
|
||||
|
||||
**不要惊慌!** 您将能够恢复它们!
|
||||
|
|
@ -336,21 +344,21 @@ Getting Started
|
|||
|
||||
如果所有内容都已恢复,此命令是即时的。
|
||||
|
||||
Commands
|
||||
SnapRAID 提供了一些简单的命令,允许您:
|
||||
命令 (Commands)
|
||||
SnapRAID 提供了几个简单的命令,允许您:
|
||||
|
||||
* 打印阵列的状态 -> `status`
|
||||
* 控制磁盘 -> `smart`、`probe`、`up`、`down`
|
||||
* 进行备份/快照 -> `sync`
|
||||
* 创建备份/恢复点 -> `sync`
|
||||
* 定期检查数据 -> `scrub`
|
||||
* 恢复上次备份/快照 -> `fix`。
|
||||
* 恢复上一个备份/恢复点 -> `fix`。
|
||||
|
||||
命令必须用小写字母书写。
|
||||
命令必须用小写字母编写。
|
||||
|
||||
status
|
||||
打印磁盘阵列状态的摘要。
|
||||
|
||||
它包括有关奇偶校验碎片、块未经检查有多久,以及在 scrubbing
|
||||
它包括有关奇偶校验碎片、块未经检查有多久,以及在数据擦洗 (scrubbing)
|
||||
期间遇到的所有记录的静默错误的信息。
|
||||
|
||||
所提供的信息指的是您上次运行 `sync` 的时间。
|
||||
|
|
@ -518,14 +526,14 @@ Commands
|
|||
阵列中的文件**不会**被修改。
|
||||
|
||||
fix
|
||||
修复所有文件和奇偶校验数据。
|
||||
修复所有文件和校验数据。
|
||||
|
||||
所有文件和奇偶校验数据都与上次 `sync` 中保存的快照
|
||||
状态进行比较。
|
||||
如果发现差异,则将其恢复到存储的快照。
|
||||
将所有文件和校验数据与上一次 `sync` 中保存的状态进行比较。
|
||||
如果发现差异,则将其恢复到存储的状态。
|
||||
|
||||
**警告!** `fix` 命令不区分错误和
|
||||
故意修改。它**无条件地**将文件状态恢复到上次 `sync`。
|
||||
警告!
|
||||
`fix` 命令不区分错误和故意修改。
|
||||
它会无条件地将文件状态恢复到上一次 `sync` 的状态。
|
||||
|
||||
如果未指定其他选项,则处理整个阵列。
|
||||
使用过滤选项选择要操作的文件或磁盘的子集。
|
||||
|
|
@ -650,7 +658,7 @@ Commands
|
|||
如果您想重新分配这些文件,可以使用 -W, --force-realloc-tail 选项。
|
||||
请注意,在重新分配过程中,此类文件将不受校验保护。
|
||||
|
||||
Options
|
||||
选项 (Options)
|
||||
SnapRAID 提供以下选项:
|
||||
|
||||
-c, --conf CONFIG
|
||||
|
|
@ -749,7 +757,7 @@ Options
|
|||
每秒的字节数。您可以指定乘数,例如 K、M 或 G
|
||||
(例如,--bw-limit 1G)。
|
||||
|
||||
-t, --tail 大小
|
||||
-t, --tail SIZE
|
||||
将文件列表限制为那些使用校验盘指定尾部大小以内的文件。
|
||||
您可以使用乘数,如 K、M、G 或 T(例如 --tail 1G)。
|
||||
此选项仅在与 `locate` 命令配合使用时有效。
|
||||
|
|
@ -832,9 +840,9 @@ Options
|
|||
**警告!** 此选项仅供专家使用,强烈建议不要使用它。
|
||||
在 `sync` 操作期间,您**没有**数据保护。
|
||||
|
||||
-W, --force-realloc-tail 大小
|
||||
-W, --force-realloc-tail SIZE
|
||||
工作方式类似于 -R, --force-realloc,但仅限于每个校验文件的
|
||||
指定尾部部分(最后“大小”字节)。
|
||||
指定尾部部分(最后 SIZE 字节)。
|
||||
它会强制重新分配(移动)当前存储在该尾部部分的任何文件分片/块,
|
||||
允许它们被放置在校验文件中任何有可用空间的地方(包括现有的
|
||||
空隙)。
|
||||
|
|
@ -906,7 +914,7 @@ Options
|
|||
-V, --version
|
||||
打印程序版本。
|
||||
|
||||
Configuration
|
||||
配置 (Configuration)
|
||||
SnapRAID 需要一个配置文件来了解您的磁盘阵列
|
||||
位于何处以及在哪里存储奇偶校验信息。
|
||||
|
||||
|
|
@ -1002,6 +1010,25 @@ Configuration
|
|||
请注意,此类磁盘不受 `up` 和 `down` 命令的影响,因为它们被预期始终处于
|
||||
旋转状态。
|
||||
|
||||
snapshot
|
||||
为 `sync`、`scrub`、`check` 和 `fix` 命令启用文件系统快照的使用。
|
||||
|
||||
启用后,SnapRAID 会在“sync”开始时创建数据的只读快照。
|
||||
这确保了文件在特定时间点的一致视图,从而防止由并发文件修改引起的错误。
|
||||
|
||||
这显著提高了恢复能力:如果从实时文件系统中删除了一个文件,
|
||||
它仍会保留在快照中。这可以防止该数据块的校验数据变得“损坏”,
|
||||
从而确保在另一个磁盘发生故障时您仍能成功恢复数据。
|
||||
|
||||
此选项仅适用于在 Linux 中格式化为 Btrfs、Bcachefs 或 ZFS 文件系统,
|
||||
以及在 Windows 中格式化为 NTFS 的数据磁盘。
|
||||
校验磁盘或使用其他文件系统的数据磁盘将始终使用文件系统的活动版本。
|
||||
|
||||
快照的创建和删除需要管理权限。
|
||||
启用此选项时,请确保以必要的权限(例如 sudo)运行 SnapRAID。
|
||||
|
||||
有关快照生命周期的详细说明,请参阅 SNAPSHOTS(快照)部分。
|
||||
|
||||
nohidden
|
||||
排除所有隐藏文件和目录。
|
||||
在 Unix 中,隐藏文件是以 `.` 开头的文件。
|
||||
|
|
@ -1074,29 +1101,29 @@ Configuration
|
|||
根据经验,SnapRAID 通常每 16 TB 的阵列数据需要 1 GiB 的 RAM。
|
||||
|
||||
具体来说,为了存储数据的散列,SnapRAID 大约需要
|
||||
$TS*(1+HS)/BS$ 字节的 RAM,
|
||||
其中 $TS$ 是您的磁盘阵列的总大小(以字节为单位),$BS$ 是块大小(以字节为单位),
|
||||
$HS$ 是散列大小(以字节为单位)。
|
||||
TS*(1+HS)/BS 字节的 RAM,
|
||||
其中 TS 是您的磁盘阵列的总大小(以字节为单位),BS 是块大小(以字节为单位),
|
||||
HS 是散列大小(以字节为单位)。
|
||||
|
||||
例如,对于 8 个 4 TB 磁盘,块大小为 256 KiB
|
||||
(1 KiB = 1024 字节),散列大小为 16,您将获得:
|
||||
|
||||
:RAM = $(8 * 4 * 10^{12}) * (1+16) / (256 * 2^{10}) = 1.93$ GiB
|
||||
:RAM = (8 * 4 * 10^12) * (1+16) / (256 * 2^10) = 1.93 GiB
|
||||
|
||||
切换到散列大小为 8,您将获得:
|
||||
|
||||
:RAM = $(8 * 4 * 10^{12}) * (1+8) / (256 * 2^{10}) = 1.02$ GiB
|
||||
:RAM = (8 * 4 * 10^12) * (1+8) / (256 * 2^10) = 1.02 GiB
|
||||
|
||||
切换到块大小为 512,您将获得:
|
||||
|
||||
:RAM = $(8 * 4 * 10^{12}) * (1+16) / (512 * 2^{10}) = 0.96$ GiB
|
||||
:RAM = (8 * 4 * 10^12) * (1+16) / (512 * 2^10) = 0.96 GiB
|
||||
|
||||
切换到散列大小为 8 和块大小为 512,您将获得:
|
||||
|
||||
:RAM = $(8 * 4 * 10^{12}) * (1+8) / (512 * 2^{10}) = 0.51$ GiB
|
||||
:RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0.51 GiB
|
||||
|
||||
autosave SIZE_IN_GIGABYTES
|
||||
在同步或 scrub 之后,处理指定数量的 GB 后,自动保存状态。
|
||||
在同步或 scrub 期间,每处理指定数量的 GB 后就自动保存状态。
|
||||
此选项有助于避免在机器崩溃或任何其他事件中断时,
|
||||
从头开始重新启动长时间的 `sync` 命令。
|
||||
|
||||
|
|
@ -1118,10 +1145,10 @@ Configuration
|
|||
此估计温度仅供参考,对 SnapRAID 的行为没有影响。
|
||||
程序的动作仅基于实际测量的磁盘温度。
|
||||
|
||||
要执行此分析,SnapRAID 需要一个系统温度的参考。
|
||||
要执行此分析,SnapRAID 需要一个系统温度的参考基准值。
|
||||
它首先尝试从可用的硬件传感器读取。
|
||||
如果无法访问系统传感器,它会使用运行时测量的最低磁盘温度
|
||||
作为备用参考。
|
||||
作为备用基准值。
|
||||
|
||||
通常,SnapRAID 只显示最热磁盘的温度。
|
||||
要显示所有磁盘的温度,请使用 -A 或 --stats 选项。
|
||||
|
|
@ -1163,6 +1190,8 @@ Configuration
|
|||
对于 RAID 控制器,设备可能是固定的,
|
||||
您可能不需要使用 `%s`。
|
||||
|
||||
您还可以使用 `[info: ...]` 标记指定自定义信息选项字符串,以替换默认的 `-a` 选项。
|
||||
|
||||
请参阅 smartmontools 文档以了解可能的选项:
|
||||
|
||||
:https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
|
|
@ -1170,6 +1199,7 @@ Configuration
|
|||
|
||||
例如:
|
||||
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl parity -d sat %s
|
||||
|
||||
smartignore DISK/PARITY ATTR [ATTR...]
|
||||
|
|
@ -1181,13 +1211,19 @@ Configuration
|
|||
`4-parity`、`5-parity`、`6-parity` 或 `z-parity`。
|
||||
特殊值 * 可用于在所有磁盘上忽略该属性。
|
||||
|
||||
例如,要在所有磁盘上忽略 `Current Pending Sector Count` 属性:
|
||||
可以指定多个属性,用空格分隔。
|
||||
每个属性可以指定为 1 到 255 之间的数字,或者不区分大小写的名称
|
||||
(例如 `Current_Pending_Sector`)。
|
||||
|
||||
:smartignore * 197
|
||||
例如,要在所有磁盘上通过编号或名称忽略 `Current Pending Sector Count` 和
|
||||
`Reallocated Sectors Count` 属性:
|
||||
|
||||
要仅在第一个奇偶校验磁盘上忽略它:
|
||||
:smartignore * 197 5
|
||||
:smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
:smartignore parity 197
|
||||
要仅在第一个奇偶校验磁盘上忽略它们:
|
||||
|
||||
:smartignore parity 197 5
|
||||
|
||||
Examples
|
||||
Unix 的典型配置示例如下:
|
||||
|
|
@ -1200,7 +1236,7 @@ Configuration
|
|||
:data d3 /mnt/disk3/
|
||||
:exclude /lost+found/
|
||||
:exclude /tmp/
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/sg0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1216,12 +1252,99 @@ Configuration
|
|||
:exclude Thumbs.db
|
||||
:exclude \$RECYCLE.BIN
|
||||
:exclude \System Volume Information
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
Pattern
|
||||
快照 (Snapshots)
|
||||
如果配置中启用了快照选项,SnapRAID 将
|
||||
利用文件系统快照功能来确保原子操作和一致操作。
|
||||
|
||||
快照的管理是完全自动且透明的。
|
||||
您可以完全像以前一样继续使用 SnapRAID,而快照提供的
|
||||
额外保护完全在后台处理。
|
||||
|
||||
这提供了两个主要好处:
|
||||
|
||||
一致性 - 在运行时间较长的 sync 或 scrub 期间在活动文件系统上修改的文件
|
||||
不会导致校验不匹配或操作中止,因为 SnapRAID 看到的是一个冻结的时间点镜像。
|
||||
恢复 - 如果从实时文件系统中更新或删除了一个文件,
|
||||
它仍会保留在快照中。如果下次 sync 运行之前发生磁盘故障,
|
||||
SnapRAID 会使用快照中保留的数据来重建发生故障的磁盘。
|
||||
|
||||
在活动同步过程中发生磁盘故障的情况下,
|
||||
SnapRAID 还能自动从上一次校验计算的快照和当前的快照中读取数据。
|
||||
这通过提供解校验方程所需的精确数据块访问,
|
||||
最大程度地提高了完全恢复的概率,即使这些数据块在同步之间被修改或删除。
|
||||
|
||||
如果没有快照,健康磁盘上更新或删除的文件会导致缺少数据块,
|
||||
而这些数据块可能是修复其他损坏磁盘所必需的。
|
||||
|
||||
快照仅为数据磁盘创建,并且仅在底层文件系统支持此功能时创建。
|
||||
校验磁盘始终使用实时文件系统。
|
||||
|
||||
目前,Linux 上的 Btrfs、Bcachefs 和 ZFS 以及 Windows 上的 NTFS 支持此功能。
|
||||
|
||||
您可以混合使用具有不同文件系统的数据磁盘。只有那些
|
||||
支持快照的磁盘才会利用它们,而其他磁盘将继续直接在实时文件系统上运行。
|
||||
|
||||
快照的创建和删除需要管理权限。
|
||||
启用快照时,请确保以必要的权限(例如 sudo)运行 SnapRAID。
|
||||
|
||||
快照的命令行为
|
||||
`sync` 和 `scrub` 命令都完全在快照上运行,
|
||||
以确保所有数据操作都是针对一致的、冻结的状态进行的。通过利用这些快照,
|
||||
SnapRAID 阻止了本由实时文件系统上的并发文件修改所触发的校验不匹配。
|
||||
在 `sync` 期间,该命令使用在过程开始时创建的新快照来捕获用于校验计算的当前状态。
|
||||
相比之下,`scrub` 命令利用上一个快照(即在最近一次同步期间创建的快照)
|
||||
来维持与现有校验匹配的可靠参考点。
|
||||
|
||||
对于 `check` 和 `fix` 命令,上一个快照的使用
|
||||
取决于是否使用 -d, --filter-disk 选项指定了特定磁盘。
|
||||
|
||||
通过 -d 明确选择的磁盘(操作的“目标”)始终使用实时文件系统。
|
||||
对于 `fix`,这允许将数据恢复到活动的替代磁盘。对于 `check`,
|
||||
它允许在相同条件下模拟 `fix` 操作。
|
||||
|
||||
所有其他数据磁盘(“参考”磁盘)都将通过其快照进行访问。
|
||||
这确保了即使您在恢复进行时修改健康磁盘上的文件,
|
||||
SnapRAID 也有一个稳定、冻结的参考来求解校验方程。
|
||||
|
||||
如果没有提供 -d 选项,SnapRAID 会假设该操作适用于整个阵列,
|
||||
在这种情况下,`check` 和 `fix` 将排他性地使用实时文件系统。
|
||||
|
||||
所有其他命令完全在实时文件系统上运行。
|
||||
|
||||
快照生命周期 (Snapshots Lifecycle)
|
||||
SnapRAID 在每个数据子卷根目录下的隐藏目录中管理两个特定的快照:
|
||||
`stable`(稳定)和 `pending`(待定)。
|
||||
在 Btrfs、Bcachefs 和 NTFS 中使用 `.snapraid/` 目录,
|
||||
在 ZFS 中使用标准的 `.zfs/snapshot/`。
|
||||
|
||||
`stable` 快照代表上一次成功完成的 `sync` 的状态,
|
||||
包含用于计算当前校验的准确数据。它作为 `scrub`、`check`
|
||||
和 `fix` 命令的主要数据源。
|
||||
|
||||
`pending` 快照是在 `sync` 开始时创建的临时镜像,
|
||||
用于为校验计算提供冻结状态。在操作成功完成后,
|
||||
以前的 `stable` 快照将被删除,并且 `pending` 快照将被提升
|
||||
以接替其作为新的稳定参考。
|
||||
|
||||
如果 `sync` 中断,`pending` 快照将被保留。
|
||||
随后的 `scrub`、`check` 和 `fix` 命令将使用此待定快照,
|
||||
因为它与 .content 文件中记录的文件系统状态相匹配,即使校验仅部分同步。
|
||||
|
||||
在 `sync` 中断的情况下,`check` 和 `fix` 命令
|
||||
还会从 `stable` 快照中读取数据,以检索在同步期间更新或删除的文件的
|
||||
数据块。这是可能的,因为 .content 文件在整个同步过程中保留了
|
||||
所有修改或删除的文件的元数据。此历史信息仅在同步
|
||||
成功完成并保存 .content 文件的最终版本后才会清除。
|
||||
|
||||
如果 `sync` 在中断后重新启动,现有的 pending 快照将被删除,
|
||||
并创建一个新快照以捕获实时文件系统的当前状态。
|
||||
|
||||
模式 (Pattern)
|
||||
模式提供了一种灵活的方法来过滤要包含或排除的文件。通过使用通配符(globbing),
|
||||
您可以定义匹配特定文件名或整个目录结构的规则,而无需手动列出每个路径。
|
||||
|
||||
|
|
@ -1323,7 +1446,7 @@ Pattern
|
|||
在 Unix 中,在命令行上使用 globbing 字符时,必须
|
||||
引用它们以防止 shell 扩展它们。
|
||||
|
||||
Ignore File
|
||||
忽略文件 (Ignore File)
|
||||
除了配置文件中的全局规则外,您还可以在阵列内的任何目录中放置
|
||||
`.snapraidignore` 文件,以定义分散的排除规则。
|
||||
|
||||
|
|
@ -1361,16 +1484,18 @@ Ignore File
|
|||
:# 排除 projects/ 或其子文件夹中任何 .tmp 文件
|
||||
:*.tmp
|
||||
|
||||
Content
|
||||
内容 (Content)
|
||||
SnapRAID 将文件列表和校验和存储在 content 文件中。
|
||||
|
||||
它是一个二进制文件,列出了磁盘阵列中存在的所有文件,
|
||||
以及用于验证其完整性的所有校验和。
|
||||
|
||||
此文件由 `sync` 和 `scrub` 命令读取和写入,并由
|
||||
`fix`、`check` 和 `status` 命令读取。
|
||||
content 文件由 `sync`、`scrub`、`touch` 和 `rehash` 命令读取和写入。
|
||||
它由 `status`、`diff`、`check`、`fix`、`list`、`dup`、`locate` 和
|
||||
`pool` 命令读取,并被 `smart`、`probe`、`up`、`down` 和 `devices`
|
||||
命令完全忽略。
|
||||
|
||||
Parity
|
||||
奇偶校验 (Parity)
|
||||
SnapRAID 将阵列的奇偶校验信息存储在 parity 文件中。
|
||||
|
||||
这些是二进制文件,包含 `content` 文件中定义的所有
|
||||
|
|
@ -1379,7 +1504,7 @@ Parity
|
|||
这些文件由 `sync` 和 `fix` 命令读取和写入,
|
||||
并且仅由 `scrub` 和 `check` 命令读取。
|
||||
|
||||
Encoding
|
||||
编码 (Encoding)
|
||||
SnapRAID 在 Unix 中忽略任何编码。它读取并存储
|
||||
文件系统使用的相同编码的文件名。
|
||||
|
||||
|
|
@ -1392,8 +1517,19 @@ Encoding
|
|||
您将控制台输出重定向到文件,则生成的文件始终
|
||||
采用 UTF-8 格式。
|
||||
|
||||
Copyright
|
||||
此文件版权所有 (C) 2025 Andrea Mazzoleni
|
||||
退出码 (Exit Code)
|
||||
SnapRAID 终止并返回以下错误代码:
|
||||
|
||||
See Also
|
||||
snapraid_log(1), snapraidd(1)
|
||||
0 - 一切正常。
|
||||
1 - 命令遇到一些错误。
|
||||
2 - `diff` 命令发现一切正常,但需要进行 `sync`。
|
||||
|
||||
翻译 (Translation)
|
||||
本文档是英文手册的自动翻译。
|
||||
请参阅英文手册以获取权威版本。
|
||||
|
||||
版权 (Copyright)
|
||||
此文件版权所有 (C) 2026 Andrea Mazzoleni
|
||||
|
||||
参见 (See Also)
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
=================
|
||||
|
||||
|
||||
1 SYNOPSIS
|
||||
==========
|
||||
1 概要 (SYNOPSIS)
|
||||
===============
|
||||
|
||||
snapraid [-c, --conf CONFIG]
|
||||
[-f, --filter PATTERN] [-d, --filter-disk NAME]
|
||||
|
|
@ -28,8 +28,8 @@ snapraid [-c, --conf CONFIG]
|
|||
snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
|
||||
|
||||
|
||||
2 DESCRIPTION
|
||||
=============
|
||||
2 描述 (DESCRIPTION)
|
||||
==================
|
||||
|
||||
SnapRAID 是一款专为磁盘阵列设计的备份程序,它存储奇偶校验信息,
|
||||
以在最多六个磁盘发生故障时进行数据恢复。
|
||||
|
|
@ -51,21 +51,29 @@ SnapRAID 主要面向拥有大型、不常更改文件的家庭媒体中心,
|
|||
https://www.snapraid.it/
|
||||
|
||||
|
||||
3 LIMITATIONS
|
||||
=============
|
||||
3 限制 (LIMITATIONS)
|
||||
==================
|
||||
|
||||
SnapRAID 是 RAID 和备份程序之间的混合体,旨在结合两者的优点。
|
||||
然而,在使用它之前,您应该考虑一些限制。
|
||||
SnapRAID 是 RAID 和备份程序之间的混合体,旨在结合两者的最佳优势。
|
||||
但是,在使用它之前,您应该考虑它的一些限制。
|
||||
|
||||
主要的限制是,如果一个磁盘发生故障而您最近没有进行同步(sync),
|
||||
您可能无法完全恢复。
|
||||
更具体地说,您可能无法恢复自上次同步操作以来已更改或已删除文件的
|
||||
大小所对应的部分。
|
||||
即使更改或删除的文件不在发生故障的磁盘上,也会发生这种情况。
|
||||
这就是为什么 SnapRAID 更适用于很少更改的数据。
|
||||
主要的限制是,如果磁盘发生故障,您只能将数据恢复到上一次 `sync`(同步)操作的状态。
|
||||
自上次同步以来添加的任何数据或进行的任何修改(如果位于发生故障的磁盘上)都将丢失。
|
||||
|
||||
另一方面,新添加的文件不会阻止对已有文件的恢复。
|
||||
您只会丢失位于发生故障磁盘上的最近添加的文件。
|
||||
因此,SnapRAID 主要适用于很少更改的数据。
|
||||
|
||||
对于上次同步时已经存在的数据,恢复的可靠性取决于是否使用了 `snapshot`(快照)选项:
|
||||
|
||||
* 具有快照支持(在 Btrfs、ZFS、Bcachefs 和 NTFS 上可用),
|
||||
SnapRAID 可以自动维护数据磁盘的冻结引用。
|
||||
这确保了即使您在同步期间或之后在活动文件系统上修改或删除文件,
|
||||
恢复过程仍保持一致且可靠。
|
||||
|
||||
* 在没有快照支持的情况下,在 `sync` 之后删除或更改文件
|
||||
可能会阻止其他损坏磁盘的完全恢复。发生这种情况
|
||||
是因为校验数据不再与修改后的文件匹配,即使
|
||||
这些文件不在损坏的磁盘上。另一方面,新添加的文件
|
||||
不会阻止已存在文件的恢复。
|
||||
|
||||
SnapRAID 的其他限制包括:
|
||||
|
||||
|
|
@ -81,8 +89,8 @@ SnapRAID 的其他限制包括:
|
|||
不保存权限、所有权和扩展属性。
|
||||
|
||||
|
||||
4 GETTING STARTED
|
||||
=================
|
||||
4 入门 (GETTING STARTED)
|
||||
======================
|
||||
|
||||
要使用 SnapRAID,您需要首先选择磁盘阵列中的一个磁盘专用于
|
||||
`parity`(奇偶校验)信息。使用一个奇偶校验磁盘,
|
||||
|
|
@ -153,8 +161,8 @@ SnapRAID 的其他限制包括:
|
|||
|
||||
现在您可以开始随意使用您的阵列,并定期运行 `sync` 命令更新奇偶校验信息。
|
||||
|
||||
4.1 Scrubbing
|
||||
-------------
|
||||
4.1 数据擦洗 (Scrubbing)
|
||||
--------------------
|
||||
|
||||
要定期检查数据和奇偶校验的错误,您可以运行 `scrub` 命令。
|
||||
|
||||
|
|
@ -188,12 +196,12 @@ SnapRAID 的其他限制包括:
|
|||
在未同步的阵列上运行 `scrub` 可能会报告由已删除或已修改文件引起的错误。
|
||||
这些错误会在 `scrub` 输出中报告,但相关块不会被标记为坏块。
|
||||
|
||||
4.2 Pooling
|
||||
-----------
|
||||
4.2 合并池 (Pooling)
|
||||
-----------------
|
||||
|
||||
注意:下面描述的 pooling 功能已被 mergerfs 工具取代,
|
||||
mergerfs 现在是 SnapRAID 社区推荐的 Linux 用户选项。
|
||||
Mergefs 提供了一种更灵活、更高效的方式,将多个驱动器汇集到一个
|
||||
Mergerfs 提供了一种更灵活、更高效的方式,将多个驱动器汇集到一个
|
||||
统一的挂载点中,允许跨阵列无缝访问文件,而无需依赖符号链接。
|
||||
它与 SnapRAID 很好地集成以提供奇偶校验保护,常用于
|
||||
OpenMediaVault (OMV) 或自定义 NAS 配置等设置中。
|
||||
|
|
@ -256,8 +264,8 @@ OpenMediaVault (OMV) 或自定义 NAS 配置等设置中。
|
|||
|
||||
fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
|
||||
|
||||
4.3 Undeleting
|
||||
--------------
|
||||
4.3 取消删除 (Undeleting)
|
||||
---------------------
|
||||
|
||||
SnapRAID 的功能更像一个备份程序而不是 RAID 系统,
|
||||
它可以使用 -f, --filter 选项来恢复或取消删除文件到其以前的状态:
|
||||
|
|
@ -277,8 +285,8 @@ SnapRAID 的功能更像一个备份程序而不是 RAID 系统,
|
|||
|
||||
snapraid fix -m
|
||||
|
||||
4.4 Recovering
|
||||
--------------
|
||||
4.4 数据恢复 (Recovering)
|
||||
---------------------
|
||||
|
||||
最糟糕的情况发生了,您丢失了一个或多个磁盘!
|
||||
|
||||
|
|
@ -358,25 +366,25 @@ SnapRAID 的功能更像一个备份程序而不是 RAID 系统,
|
|||
如果所有内容都已恢复,此命令是即时的。
|
||||
|
||||
|
||||
5 COMMANDS
|
||||
==========
|
||||
5 命令 (COMMANDS)
|
||||
===============
|
||||
|
||||
SnapRAID 提供了一些简单的命令,允许您:
|
||||
SnapRAID 提供了几个简单的命令,允许您:
|
||||
|
||||
* 打印阵列的状态 -> `status`
|
||||
* 控制磁盘 -> `smart`、`probe`、`up`、`down`
|
||||
* 进行备份/快照 -> `sync`
|
||||
* 创建备份/恢复点 -> `sync`
|
||||
* 定期检查数据 -> `scrub`
|
||||
* 恢复上次备份/快照 -> `fix`。
|
||||
* 恢复上一个备份/恢复点 -> `fix`。
|
||||
|
||||
命令必须用小写字母书写。
|
||||
命令必须用小写字母编写。
|
||||
|
||||
5.1 status
|
||||
----------
|
||||
|
||||
打印磁盘阵列状态的摘要。
|
||||
|
||||
它包括有关奇偶校验碎片、块未经检查有多久,以及在 scrubbing
|
||||
它包括有关奇偶校验碎片、块未经检查有多久,以及在数据擦洗 (scrubbing)
|
||||
期间遇到的所有记录的静默错误的信息。
|
||||
|
||||
所提供的信息指的是您上次运行 `sync` 的时间。
|
||||
|
|
@ -560,14 +568,14 @@ full - Scrub 所有内容。
|
|||
5.9 fix
|
||||
-------
|
||||
|
||||
修复所有文件和奇偶校验数据。
|
||||
修复所有文件和校验数据。
|
||||
|
||||
所有文件和奇偶校验数据都与上次 `sync` 中保存的快照
|
||||
状态进行比较。
|
||||
如果发现差异,则将其恢复到存储的快照。
|
||||
将所有文件和校验数据与上一次 `sync` 中保存的状态进行比较。
|
||||
如果发现差异,则将其恢复到存储的状态。
|
||||
|
||||
**警告!** `fix` 命令不区分错误和
|
||||
故意修改。它**无条件地**将文件状态恢复到上次 `sync`。
|
||||
警告!
|
||||
`fix` 命令不区分错误和故意修改。
|
||||
它会无条件地将文件状态恢复到上一次 `sync` 的状态。
|
||||
|
||||
如果未指定其他选项,则处理整个阵列。
|
||||
使用过滤选项选择要操作的文件或磁盘的子集。
|
||||
|
|
@ -709,8 +717,8 @@ SnapRAID 会重命名所有无法修复的文件,并添加
|
|||
请注意,在重新分配过程中,此类文件将不受校验保护。
|
||||
|
||||
|
||||
6 OPTIONS
|
||||
=========
|
||||
6 选项 (OPTIONS)
|
||||
==============
|
||||
|
||||
SnapRAID 提供以下选项:
|
||||
|
||||
|
|
@ -810,7 +818,7 @@ SnapRAID 提供以下选项:
|
|||
每秒的字节数。您可以指定乘数,例如 K、M 或 G
|
||||
(例如,--bw-limit 1G)。
|
||||
|
||||
-t, --tail 大小
|
||||
-t, --tail SIZE
|
||||
将文件列表限制为那些使用校验盘指定尾部大小以内的文件。
|
||||
您可以使用乘数,如 K、M、G 或 T(例如 --tail 1G)。
|
||||
此选项仅在与 `locate` 命令配合使用时有效。
|
||||
|
|
@ -893,9 +901,9 @@ SnapRAID 提供以下选项:
|
|||
**警告!** 此选项仅供专家使用,强烈建议不要使用它。
|
||||
在 `sync` 操作期间,您**没有**数据保护。
|
||||
|
||||
-W, --force-realloc-tail 大小
|
||||
-W, --force-realloc-tail SIZE
|
||||
工作方式类似于 -R, --force-realloc,但仅限于每个校验文件的
|
||||
指定尾部部分(最后“大小”字节)。
|
||||
指定尾部部分(最后 SIZE 字节)。
|
||||
它会强制重新分配(移动)当前存储在该尾部部分的任何文件分片/块,
|
||||
允许它们被放置在校验文件中任何有可用空间的地方(包括现有的
|
||||
空隙)。
|
||||
|
|
@ -968,8 +976,8 @@ SnapRAID 提供以下选项:
|
|||
打印程序版本。
|
||||
|
||||
|
||||
7 CONFIGURATION
|
||||
===============
|
||||
7 配置 (CONFIGURATION)
|
||||
====================
|
||||
|
||||
SnapRAID 需要一个配置文件来了解您的磁盘阵列
|
||||
位于何处以及在哪里存储奇偶校验信息。
|
||||
|
|
@ -1078,14 +1086,35 @@ DIR 是磁盘在文件系统中的挂载点。
|
|||
请注意,此类磁盘不受 `up` 和 `down` 命令的影响,因为它们被预期始终处于
|
||||
旋转状态。
|
||||
|
||||
7.7 nohidden
|
||||
7.7 snapshot
|
||||
------------
|
||||
|
||||
为 `sync`、`scrub`、`check` 和 `fix` 命令启用文件系统快照的使用。
|
||||
|
||||
启用后,SnapRAID 会在“sync”开始时创建数据的只读快照。
|
||||
这确保了文件在特定时间点的一致视图,从而防止由并发文件修改引起的错误。
|
||||
|
||||
这显著提高了恢复能力:如果从实时文件系统中删除了一个文件,
|
||||
它仍会保留在快照中。这可以防止该数据块的校验数据变得“损坏”,
|
||||
从而确保在另一个磁盘发生故障时您仍能成功恢复数据。
|
||||
|
||||
此选项仅适用于在 Linux 中格式化为 Btrfs、Bcachefs 或 ZFS 文件系统,
|
||||
以及在 Windows 中格式化为 NTFS 的数据磁盘。
|
||||
校验磁盘或使用其他文件系统的数据磁盘将始终使用文件系统的活动版本。
|
||||
|
||||
快照的创建和删除需要管理权限。
|
||||
启用此选项时,请确保以必要的权限(例如 sudo)运行 SnapRAID。
|
||||
|
||||
有关快照生命周期的详细说明,请参阅 SNAPSHOTS(快照)部分。
|
||||
|
||||
7.8 nohidden
|
||||
------------
|
||||
|
||||
排除所有隐藏文件和目录。
|
||||
在 Unix 中,隐藏文件是以 `.` 开头的文件。
|
||||
在 Windows 中,它们是具有隐藏属性的文件。
|
||||
|
||||
7.8 exclude/include PATTERN
|
||||
7.9 exclude/include PATTERN
|
||||
---------------------------
|
||||
|
||||
定义要从同步过程中排除或包含的文件或目录模式。
|
||||
|
|
@ -1100,8 +1129,8 @@ DIR 是磁盘在文件系统中的挂载点。
|
|||
|
||||
此选项可以多次使用。
|
||||
|
||||
7.9 blocksize SIZE_IN_KIBIBYTES
|
||||
-------------------------------
|
||||
7.10 blocksize SIZE_IN_KIBIBYTES
|
||||
--------------------------------
|
||||
|
||||
定义奇偶校验的基本块大小(以 KiB 为单位)。
|
||||
一 KiB 是 1024 字节。
|
||||
|
|
@ -1144,7 +1173,7 @@ DIR 是磁盘在文件系统中的挂载点。
|
|||
这会导致大约 1.5% 的额外空间,对于 4 TB 磁盘约为 60 GB,
|
||||
这允许每个数据磁盘上大约 460,000 个文件而不会浪费任何空间。
|
||||
|
||||
7.10 hashsize SIZE_IN_BYTES
|
||||
7.11 hashsize SIZE_IN_BYTES
|
||||
---------------------------
|
||||
|
||||
定义保存块的散列大小(以字节为单位)。
|
||||
|
|
@ -1158,35 +1187,35 @@ DIR 是磁盘在文件系统中的挂载点。
|
|||
根据经验,SnapRAID 通常每 16 TB 的阵列数据需要 1 GiB 的 RAM。
|
||||
|
||||
具体来说,为了存储数据的散列,SnapRAID 大约需要
|
||||
$TS*(1+HS)/BS$ 字节的 RAM,
|
||||
其中 $TS$ 是您的磁盘阵列的总大小(以字节为单位),$BS$ 是块大小(以字节为单位),
|
||||
$HS$ 是散列大小(以字节为单位)。
|
||||
TS*(1+HS)/BS 字节的 RAM,
|
||||
其中 TS 是您的磁盘阵列的总大小(以字节为单位),BS 是块大小(以字节为单位),
|
||||
HS 是散列大小(以字节为单位)。
|
||||
|
||||
例如,对于 8 个 4 TB 磁盘,块大小为 256 KiB
|
||||
(1 KiB = 1024 字节),散列大小为 16,您将获得:
|
||||
|
||||
RAM = $(8 * 4 * 10^{12}) * (1+16) / (256 * 2^{10}) = 1.93$ GiB
|
||||
RAM = (8 * 4 * 10^12) * (1+16) / (256 * 2^10) = 1.93 GiB
|
||||
|
||||
切换到散列大小为 8,您将获得:
|
||||
|
||||
RAM = $(8 * 4 * 10^{12}) * (1+8) / (256 * 2^{10}) = 1.02$ GiB
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (256 * 2^10) = 1.02 GiB
|
||||
|
||||
切换到块大小为 512,您将获得:
|
||||
|
||||
RAM = $(8 * 4 * 10^{12}) * (1+16) / (512 * 2^{10}) = 0.96$ GiB
|
||||
RAM = (8 * 4 * 10^12) * (1+16) / (512 * 2^10) = 0.96 GiB
|
||||
|
||||
切换到散列大小为 8 和块大小为 512,您将获得:
|
||||
|
||||
RAM = $(8 * 4 * 10^{12}) * (1+8) / (512 * 2^{10}) = 0.51$ GiB
|
||||
RAM = (8 * 4 * 10^12) * (1+8) / (512 * 2^10) = 0.51 GiB
|
||||
|
||||
7.11 autosave SIZE_IN_GIGABYTES
|
||||
7.12 autosave SIZE_IN_GIGABYTES
|
||||
-------------------------------
|
||||
|
||||
在同步或 scrub 之后,处理指定数量的 GB 后,自动保存状态。
|
||||
在同步或 scrub 期间,每处理指定数量的 GB 后就自动保存状态。
|
||||
此选项有助于避免在机器崩溃或任何其他事件中断时,
|
||||
从头开始重新启动长时间的 `sync` 命令。
|
||||
|
||||
7.12 temp_limit TEMPERATURE_CELSIUS
|
||||
7.13 temp_limit TEMPERATURE_CELSIUS
|
||||
-----------------------------------
|
||||
|
||||
设置允许的最高磁盘温度(摄氏度)。指定后,
|
||||
|
|
@ -1206,21 +1235,21 @@ SnapRAID 运行时会显示当前磁盘温度。
|
|||
此估计温度仅供参考,对 SnapRAID 的行为没有影响。
|
||||
程序的动作仅基于实际测量的磁盘温度。
|
||||
|
||||
要执行此分析,SnapRAID 需要一个系统温度的参考。
|
||||
要执行此分析,SnapRAID 需要一个系统温度的参考基准值。
|
||||
它首先尝试从可用的硬件传感器读取。
|
||||
如果无法访问系统传感器,它会使用运行时测量的最低磁盘温度
|
||||
作为备用参考。
|
||||
作为备用基准值。
|
||||
|
||||
通常,SnapRAID 只显示最热磁盘的温度。
|
||||
要显示所有磁盘的温度,请使用 -A 或 --stats 选项。
|
||||
|
||||
7.13 temp_sleep TIME_IN_MINUTES
|
||||
7.14 temp_sleep TIME_IN_MINUTES
|
||||
-------------------------------
|
||||
|
||||
设置达到温度限制时的待机时间(以分钟为单位)。
|
||||
在此期间,磁盘保持停转状态。默认值为 5 分钟。
|
||||
|
||||
7.14 pool DIR
|
||||
7.15 pool DIR
|
||||
-------------
|
||||
|
||||
定义 `pooling` 目录,其中使用 `pool` 命令创建磁盘
|
||||
|
|
@ -1228,7 +1257,7 @@ SnapRAID 运行时会显示当前磁盘温度。
|
|||
|
||||
目录必须已经存在。
|
||||
|
||||
7.15 share UNC_DIR
|
||||
7.16 share UNC_DIR
|
||||
------------------
|
||||
|
||||
定义远程访问磁盘所需的 Windows UNC 路径。
|
||||
|
|
@ -1243,7 +1272,7 @@ SnapRAID 运行时会显示当前磁盘温度。
|
|||
|
||||
此选项仅在 Windows 中需要。
|
||||
|
||||
7.16 smartctl DISK/PARITY OPTIONS...
|
||||
7.17 smartctl DISK/PARITY OPTIONS...
|
||||
------------------------------------
|
||||
|
||||
定义自定义 smartctl 选项以获取每个磁盘的 SMART 属性。
|
||||
|
|
@ -1259,6 +1288,8 @@ PARITY 是奇偶校验名称之一:`parity`、`2-parity`、`3-parity`、
|
|||
对于 RAID 控制器,设备可能是固定的,
|
||||
您可能不需要使用 `%s`。
|
||||
|
||||
您还可以使用 `[info: ...]` 标记指定自定义信息选项字符串,以替换默认的 `-a` 选项。
|
||||
|
||||
请参阅 smartmontools 文档以了解可能的选项:
|
||||
|
||||
https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
|
|
@ -1266,9 +1297,10 @@ PARITY 是奇偶校验名称之一:`parity`、`2-parity`、`3-parity`、
|
|||
|
||||
例如:
|
||||
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl parity -d sat %s
|
||||
|
||||
7.17 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
7.18 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
-------------------------------------------
|
||||
|
||||
在计算磁盘故障概率时忽略指定的 SMART 属性。
|
||||
|
|
@ -1279,15 +1311,21 @@ PARITY 是奇偶校验名称之一:`parity`、`2-parity`、`3-parity`、
|
|||
`4-parity`、`5-parity`、`6-parity` 或 `z-parity`。
|
||||
特殊值 * 可用于在所有磁盘上忽略该属性。
|
||||
|
||||
例如,要在所有磁盘上忽略 `Current Pending Sector Count` 属性:
|
||||
可以指定多个属性,用空格分隔。
|
||||
每个属性可以指定为 1 到 255 之间的数字,或者不区分大小写的名称
|
||||
(例如 `Current_Pending_Sector`)。
|
||||
|
||||
smartignore * 197
|
||||
例如,要在所有磁盘上通过编号或名称忽略 `Current Pending Sector Count` 和
|
||||
`Reallocated Sectors Count` 属性:
|
||||
|
||||
要仅在第一个奇偶校验磁盘上忽略它:
|
||||
smartignore * 197 5
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
smartignore parity 197
|
||||
要仅在第一个奇偶校验磁盘上忽略它们:
|
||||
|
||||
7.18 Examples
|
||||
smartignore parity 197 5
|
||||
|
||||
7.19 Examples
|
||||
-------------
|
||||
|
||||
Unix 的典型配置示例如下:
|
||||
|
|
@ -1300,7 +1338,7 @@ Unix 的典型配置示例如下:
|
|||
data d3 /mnt/disk3/
|
||||
exclude /lost+found/
|
||||
exclude /tmp/
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/sg0
|
||||
smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1316,14 +1354,109 @@ Windows 的典型配置示例如下:
|
|||
exclude Thumbs.db
|
||||
exclude \$RECYCLE.BIN
|
||||
exclude \System Volume Information
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
||||
|
||||
8 PATTERN
|
||||
=========
|
||||
8 快照 (SNAPSHOTS)
|
||||
================
|
||||
|
||||
如果配置中启用了快照选项,SnapRAID 将
|
||||
利用文件系统快照功能来确保原子操作和一致操作。
|
||||
|
||||
快照的管理是完全自动且透明的。
|
||||
您可以完全像以前一样继续使用 SnapRAID,而快照提供的
|
||||
额外保护完全在后台处理。
|
||||
|
||||
这提供了两个主要好处:
|
||||
|
||||
一致性 - 在运行时间较长的 sync 或 scrub 期间在活动文件系统上修改的文件
|
||||
不会导致校验不匹配或操作中止,因为 SnapRAID 看到的是一个冻结的时间点镜像。
|
||||
恢复 - 如果从实时文件系统中更新或删除了一个文件,
|
||||
它仍会保留在快照中。如果下次 sync 运行之前发生磁盘故障,
|
||||
SnapRAID 会使用快照中保留的数据来重建发生故障的磁盘。
|
||||
|
||||
在活动同步过程中发生磁盘故障的情况下,
|
||||
SnapRAID 还能自动从上一次校验计算的快照和当前的快照中读取数据。
|
||||
这通过提供解校验方程所需的精确数据块访问,
|
||||
最大程度地提高了完全恢复的概率,即使这些数据块在同步之间被修改或删除。
|
||||
|
||||
如果没有快照,健康磁盘上更新或删除的文件会导致缺少数据块,
|
||||
而这些数据块可能是修复其他损坏磁盘所必需的。
|
||||
|
||||
快照仅为数据磁盘创建,并且仅在底层文件系统支持此功能时创建。
|
||||
校验磁盘始终使用实时文件系统。
|
||||
|
||||
目前,Linux 上的 Btrfs、Bcachefs 和 ZFS 以及 Windows 上的 NTFS 支持此功能。
|
||||
|
||||
您可以混合使用具有不同文件系统的数据磁盘。只有那些
|
||||
支持快照的磁盘才会利用它们,而其他磁盘将继续直接在实时文件系统上运行。
|
||||
|
||||
快照的创建和删除需要管理权限。
|
||||
启用快照时,请确保以必要的权限(例如 sudo)运行 SnapRAID。
|
||||
|
||||
8.1 快照的命令行为
|
||||
-----------
|
||||
|
||||
`sync` 和 `scrub` 命令都完全在快照上运行,
|
||||
以确保所有数据操作都是针对一致的、冻结的状态进行的。通过利用这些快照,
|
||||
SnapRAID 阻止了本由实时文件系统上的并发文件修改所触发的校验不匹配。
|
||||
在 `sync` 期间,该命令使用在过程开始时创建的新快照来捕获用于校验计算的当前状态。
|
||||
相比之下,`scrub` 命令利用上一个快照(即在最近一次同步期间创建的快照)
|
||||
来维持与现有校验匹配的可靠参考点。
|
||||
|
||||
对于 `check` 和 `fix` 命令,上一个快照的使用
|
||||
取决于是否使用 -d, --filter-disk 选项指定了特定磁盘。
|
||||
|
||||
通过 -d 明确选择的磁盘(操作的“目标”)始终使用实时文件系统。
|
||||
对于 `fix`,这允许将数据恢复到活动的替代磁盘。对于 `check`,
|
||||
它允许在相同条件下模拟 `fix` 操作。
|
||||
|
||||
所有其他数据磁盘(“参考”磁盘)都将通过其快照进行访问。
|
||||
这确保了即使您在恢复进行时修改健康磁盘上的文件,
|
||||
SnapRAID 也有一个稳定、冻结的参考来求解校验方程。
|
||||
|
||||
如果没有提供 -d 选项,SnapRAID 会假设该操作适用于整个阵列,
|
||||
在这种情况下,`check` 和 `fix` 将排他性地使用实时文件系统。
|
||||
|
||||
所有其他命令完全在实时文件系统上运行。
|
||||
|
||||
|
||||
9 快照生命周期 (SNAPSHOTS LIFECYCLE)
|
||||
==============================
|
||||
|
||||
SnapRAID 在每个数据子卷根目录下的隐藏目录中管理两个特定的快照:
|
||||
`stable`(稳定)和 `pending`(待定)。
|
||||
在 Btrfs、Bcachefs 和 NTFS 中使用 `.snapraid/` 目录,
|
||||
在 ZFS 中使用标准的 `.zfs/snapshot/`。
|
||||
|
||||
`stable` 快照代表上一次成功完成的 `sync` 的状态,
|
||||
包含用于计算当前校验的准确数据。它作为 `scrub`、`check`
|
||||
和 `fix` 命令的主要数据源。
|
||||
|
||||
`pending` 快照是在 `sync` 开始时创建的临时镜像,
|
||||
用于为校验计算提供冻结状态。在操作成功完成后,
|
||||
以前的 `stable` 快照将被删除,并且 `pending` 快照将被提升
|
||||
以接替其作为新的稳定参考。
|
||||
|
||||
如果 `sync` 中断,`pending` 快照将被保留。
|
||||
随后的 `scrub`、`check` 和 `fix` 命令将使用此待定快照,
|
||||
因为它与 .content 文件中记录的文件系统状态相匹配,即使校验仅部分同步。
|
||||
|
||||
在 `sync` 中断的情况下,`check` 和 `fix` 命令
|
||||
还会从 `stable` 快照中读取数据,以检索在同步期间更新或删除的文件的
|
||||
数据块。这是可能的,因为 .content 文件在整个同步过程中保留了
|
||||
所有修改或删除的文件的元数据。此历史信息仅在同步
|
||||
成功完成并保存 .content 文件的最终版本后才会清除。
|
||||
|
||||
如果 `sync` 在中断后重新启动,现有的 pending 快照将被删除,
|
||||
并创建一个新快照以捕获实时文件系统的当前状态。
|
||||
|
||||
|
||||
10 模式 (PATTERN)
|
||||
===============
|
||||
|
||||
模式提供了一种灵活的方法来过滤要包含或排除的文件。通过使用通配符(globbing),
|
||||
您可以定义匹配特定文件名或整个目录结构的规则,而无需手动列出每个路径。
|
||||
|
|
@ -1427,8 +1560,8 @@ globbing 字符。在 Unix 中,转义字符是 `\`;在 Windows 中,它是
|
|||
引用它们以防止 shell 扩展它们。
|
||||
|
||||
|
||||
9 IGNORE FILE
|
||||
=============
|
||||
11 忽略文件 (IGNORE FILE)
|
||||
=====================
|
||||
|
||||
除了配置文件中的全局规则外,您还可以在阵列内的任何目录中放置
|
||||
`.snapraidignore` 文件,以定义分散的排除规则。
|
||||
|
|
@ -1468,20 +1601,22 @@ globbing 字符。在 Unix 中,转义字符是 `\`;在 Windows 中,它是
|
|||
*.tmp
|
||||
|
||||
|
||||
10 CONTENT
|
||||
==========
|
||||
12 内容 (CONTENT)
|
||||
===============
|
||||
|
||||
SnapRAID 将文件列表和校验和存储在 content 文件中。
|
||||
|
||||
它是一个二进制文件,列出了磁盘阵列中存在的所有文件,
|
||||
以及用于验证其完整性的所有校验和。
|
||||
|
||||
此文件由 `sync` 和 `scrub` 命令读取和写入,并由
|
||||
`fix`、`check` 和 `status` 命令读取。
|
||||
content 文件由 `sync`、`scrub`、`touch` 和 `rehash` 命令读取和写入。
|
||||
它由 `status`、`diff`、`check`、`fix`、`list`、`dup`、`locate` 和
|
||||
`pool` 命令读取,并被 `smart`、`probe`、`up`、`down` 和 `devices`
|
||||
命令完全忽略。
|
||||
|
||||
|
||||
11 PARITY
|
||||
=========
|
||||
13 奇偶校验 (PARITY)
|
||||
================
|
||||
|
||||
SnapRAID 将阵列的奇偶校验信息存储在 parity 文件中。
|
||||
|
||||
|
|
@ -1492,8 +1627,8 @@ SnapRAID 将阵列的奇偶校验信息存储在 parity 文件中。
|
|||
并且仅由 `scrub` 和 `check` 命令读取。
|
||||
|
||||
|
||||
12 ENCODING
|
||||
===========
|
||||
14 编码 (ENCODING)
|
||||
================
|
||||
|
||||
SnapRAID 在 Unix 中忽略任何编码。它读取并存储
|
||||
文件系统使用的相同编码的文件名。
|
||||
|
|
@ -1508,13 +1643,30 @@ SnapRAID 在 Unix 中忽略任何编码。它读取并存储
|
|||
采用 UTF-8 格式。
|
||||
|
||||
|
||||
13 COPYRIGHT
|
||||
============
|
||||
15 退出码 (EXIT CODE)
|
||||
==================
|
||||
|
||||
此文件版权所有 (C) 2025 Andrea Mazzoleni
|
||||
SnapRAID 终止并返回以下错误代码:
|
||||
|
||||
0 - 一切正常。
|
||||
1 - 命令遇到一些错误。
|
||||
2 - `diff` 命令发现一切正常,但需要进行 `sync`。
|
||||
|
||||
|
||||
14 SEE ALSO
|
||||
===========
|
||||
16 翻译 (TRANSLATION)
|
||||
===================
|
||||
|
||||
snapraid_log(1), snapraidd(1)
|
||||
本文档是英文手册的自动翻译。
|
||||
请参阅英文手册以获取权威版本。
|
||||
|
||||
|
||||
17 版权 (COPYRIGHT)
|
||||
=================
|
||||
|
||||
此文件版权所有 (C) 2026 Andrea Mazzoleni
|
||||
|
||||
|
||||
18 参见 (SEE ALSO)
|
||||
================
|
||||
|
||||
snapraid_log(1), snapraidd(1), rsync(1)
|
||||
|
|
|
|||
|
|
@ -125,6 +125,7 @@ consider before using it.
|
|||
The main limitation is that if a disk fails, you can only recover data up to
|
||||
the state of the last \`sync\` operation. Any data added or modifications made
|
||||
since the last sync that are located on the failed disk will be lost.
|
||||
.PP
|
||||
Consequently, SnapRAID is primarily suited for data that rarely changes.
|
||||
.PP
|
||||
For data that already existed at the last sync, recovery reliability depends
|
||||
|
|
@ -371,7 +372,7 @@ output, but the related blocks are not marked as bad.
|
|||
.SS Pooling
|
||||
Note: The pooling feature described below has been superseded by the
|
||||
mergerfs tool, which is now the recommended option for Linux users in
|
||||
the SnapRAID community. Mergefs provides a more flexible and efficient
|
||||
the SnapRAID community. Mergerfs provides a more flexible and efficient
|
||||
way to pool multiple drives into a single unified mount point,
|
||||
allowing seamless access to files across your array without relying
|
||||
on symbolic links. It integrates well with SnapRAID for parity
|
||||
|
|
@ -1642,6 +1643,9 @@ In the specified OPTIONS, the \`%s\` string is replaced by the
|
|||
device name. For RAID controllers, the device is
|
||||
likely fixed, and you may not need to use \`%s\`.
|
||||
.PP
|
||||
You can also specify a custom info options string using the
|
||||
\`[info: ...]\` tag to override the default \`\-a\` option.
|
||||
.PP
|
||||
Refer to the smartmontools documentation for possible options:
|
||||
.PP
|
||||
.RS 4
|
||||
|
|
@ -1657,6 +1661,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices
|
|||
For example:
|
||||
.PP
|
||||
.RS 4
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl parity \-d sat %s
|
||||
.PD 0
|
||||
.PD
|
||||
|
|
@ -1671,19 +1679,28 @@ PARITY is one of the parity names: \`parity\`, \`2\-parity\`, \`3\-parity\`,
|
|||
\`4\-parity\`, \`5\-parity\`, \`6\-parity\`, or \`z\-parity\`.
|
||||
The special value * can be used to ignore the attribute on all disks.
|
||||
.PP
|
||||
For example, to ignore the \`Current Pending Sector Count\` attribute on
|
||||
all disks:
|
||||
Multiple attributes can be specified separated by spaces.
|
||||
Each attribute can be specified as a number from 1 to 255, or as a
|
||||
case\-insensitive name (e.g. \`Current_Pending_Sector\`).
|
||||
.PP
|
||||
For example, to ignore the \`Current Pending Sector Count\` and
|
||||
\`Reallocated Sectors Count\` attributes on all disks by their number
|
||||
or name:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore * 197
|
||||
smartignore * 197 5
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
.PP
|
||||
To ignore it only on the first parity disk:
|
||||
To ignore them only on the first parity disk:
|
||||
.PP
|
||||
.RS 4
|
||||
smartignore parity 197
|
||||
smartignore parity 197 5
|
||||
.PD 0
|
||||
.PD
|
||||
.RE
|
||||
|
|
@ -1723,7 +1740,7 @@ exclude /tmp/
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -1779,7 +1796,7 @@ exclude \\System Volume Information
|
|||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
smartctl d1 \-d sat %s
|
||||
smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s
|
||||
.PD 0
|
||||
.PP
|
||||
.PD
|
||||
|
|
@ -2165,8 +2182,10 @@ SnapRAID stores the list and checksums of your files in the content file.
|
|||
It is a binary file that lists all the files present in your disk array,
|
||||
along with all the checksums to verify their integrity.
|
||||
.PP
|
||||
This file is read and written by the \`sync\` and \`scrub\` commands and
|
||||
read by the \`fix\`, \`check\`, and \`status\` commands.
|
||||
The content file is read and written by the \`sync\`, \`scrub\`, \`touch\`, and
|
||||
\`rehash\` commands. It is read by the \`status\`, \`diff\`, \`check\`, \`fix\`,
|
||||
\`list\`, \`dup\`, \`locate\`, and \`pool\` commands, and it is completely
|
||||
ignored by the \`smart\`, \`probe\`, \`up\`, \`down\`, and \`devices\` commands.
|
||||
.SH PARITY
|
||||
SnapRAID stores the parity information of your array in the parity
|
||||
files.
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ Limitations
|
|||
The main limitation is that if a disk fails, you can only recover data up to
|
||||
the state of the last `sync` operation. Any data added or modifications made
|
||||
since the last sync that are located on the failed disk will be lost.
|
||||
|
||||
Consequently, SnapRAID is primarily suited for data that rarely changes.
|
||||
|
||||
For data that already existed at the last sync, recovery reliability depends
|
||||
|
|
@ -213,7 +214,7 @@ Getting Started
|
|||
Pooling
|
||||
Note: The pooling feature described below has been superseded by the
|
||||
mergerfs tool, which is now the recommended option for Linux users in
|
||||
the SnapRAID community. Mergefs provides a more flexible and efficient
|
||||
the SnapRAID community. Mergerfs provides a more flexible and efficient
|
||||
way to pool multiple drives into a single unified mount point,
|
||||
allowing seamless access to files across your array without relying
|
||||
on symbolic links. It integrates well with SnapRAID for parity
|
||||
|
|
@ -1356,6 +1357,9 @@ Configuration
|
|||
device name. For RAID controllers, the device is
|
||||
likely fixed, and you may not need to use `%s`.
|
||||
|
||||
You can also specify a custom info options string using the
|
||||
`[info: ...]` tag to override the default `-a` option.
|
||||
|
||||
Refer to the smartmontools documentation for possible options:
|
||||
|
||||
:https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
|
|
@ -1363,6 +1367,7 @@ Configuration
|
|||
|
||||
For example:
|
||||
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl parity -d sat %s
|
||||
|
||||
smartignore DISK/PARITY ATTR [ATTR...]
|
||||
|
|
@ -1375,14 +1380,20 @@ Configuration
|
|||
`4-parity`, `5-parity`, `6-parity`, or `z-parity`.
|
||||
The special value * can be used to ignore the attribute on all disks.
|
||||
|
||||
For example, to ignore the `Current Pending Sector Count` attribute on
|
||||
all disks:
|
||||
Multiple attributes can be specified separated by spaces.
|
||||
Each attribute can be specified as a number from 1 to 255, or as a
|
||||
case-insensitive name (e.g. `Current_Pending_Sector`).
|
||||
|
||||
:smartignore * 197
|
||||
For example, to ignore the `Current Pending Sector Count` and
|
||||
`Reallocated Sectors Count` attributes on all disks by their number
|
||||
or name:
|
||||
|
||||
To ignore it only on the first parity disk:
|
||||
:smartignore * 197 5
|
||||
:smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
:smartignore parity 197
|
||||
To ignore them only on the first parity disk:
|
||||
|
||||
:smartignore parity 197 5
|
||||
|
||||
Examples
|
||||
An example of a typical configuration for Unix is:
|
||||
|
|
@ -1395,7 +1406,7 @@ Configuration
|
|||
:data d3 /mnt/disk3/
|
||||
:exclude /lost+found/
|
||||
:exclude /tmp/
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/sg0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1411,7 +1422,7 @@ Configuration
|
|||
:exclude Thumbs.db
|
||||
:exclude \$RECYCLE.BIN
|
||||
:exclude \System Volume Information
|
||||
:smartctl d1 -d sat %s
|
||||
:smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
:smartctl d2 -d usbjmicron %s
|
||||
:smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
:smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
|
@ -1692,8 +1703,10 @@ Content
|
|||
It is a binary file that lists all the files present in your disk array,
|
||||
along with all the checksums to verify their integrity.
|
||||
|
||||
This file is read and written by the `sync` and `scrub` commands and
|
||||
read by the `fix`, `check`, and `status` commands.
|
||||
The content file is read and written by the `sync`, `scrub`, `touch`, and
|
||||
`rehash` commands. It is read by the `status`, `diff`, `check`, `fix`,
|
||||
`list`, `dup`, `locate`, and `pool` commands, and it is completely
|
||||
ignored by the `smart`, `probe`, `up`, `down`, and `devices` commands.
|
||||
|
||||
Parity
|
||||
SnapRAID stores the parity information of your array in the parity
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ consider before using it.
|
|||
The main limitation is that if a disk fails, you can only recover data up to
|
||||
the state of the last `sync` operation. Any data added or modifications made
|
||||
since the last sync that are located on the failed disk will be lost.
|
||||
|
||||
Consequently, SnapRAID is primarily suited for data that rarely changes.
|
||||
|
||||
For data that already existed at the last sync, recovery reliability depends
|
||||
|
|
@ -230,7 +231,7 @@ output, but the related blocks are not marked as bad.
|
|||
|
||||
Note: The pooling feature described below has been superseded by the
|
||||
mergerfs tool, which is now the recommended option for Linux users in
|
||||
the SnapRAID community. Mergefs provides a more flexible and efficient
|
||||
the SnapRAID community. Mergerfs provides a more flexible and efficient
|
||||
way to pool multiple drives into a single unified mount point,
|
||||
allowing seamless access to files across your array without relying
|
||||
on symbolic links. It integrates well with SnapRAID for parity
|
||||
|
|
@ -1454,6 +1455,9 @@ In the specified OPTIONS, the `%s` string is replaced by the
|
|||
device name. For RAID controllers, the device is
|
||||
likely fixed, and you may not need to use `%s`.
|
||||
|
||||
You can also specify a custom info options string using the
|
||||
`[info: ...]` tag to override the default `-a` option.
|
||||
|
||||
Refer to the smartmontools documentation for possible options:
|
||||
|
||||
https://www.smartmontools.org/wiki/Supported_RAID-Controllers
|
||||
|
|
@ -1461,6 +1465,7 @@ Refer to the smartmontools documentation for possible options:
|
|||
|
||||
For example:
|
||||
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl parity -d sat %s
|
||||
|
||||
7.18 smartignore DISK/PARITY ATTR [ATTR...]
|
||||
|
|
@ -1475,14 +1480,20 @@ PARITY is one of the parity names: `parity`, `2-parity`, `3-parity`,
|
|||
`4-parity`, `5-parity`, `6-parity`, or `z-parity`.
|
||||
The special value * can be used to ignore the attribute on all disks.
|
||||
|
||||
For example, to ignore the `Current Pending Sector Count` attribute on
|
||||
all disks:
|
||||
Multiple attributes can be specified separated by spaces.
|
||||
Each attribute can be specified as a number from 1 to 255, or as a
|
||||
case-insensitive name (e.g. `Current_Pending_Sector`).
|
||||
|
||||
smartignore * 197
|
||||
For example, to ignore the `Current Pending Sector Count` and
|
||||
`Reallocated Sectors Count` attributes on all disks by their number
|
||||
or name:
|
||||
|
||||
To ignore it only on the first parity disk:
|
||||
smartignore * 197 5
|
||||
smartignore * Current_Pending_Sector Reallocated_Sector_Ct
|
||||
|
||||
smartignore parity 197
|
||||
To ignore them only on the first parity disk:
|
||||
|
||||
smartignore parity 197 5
|
||||
|
||||
7.19 Examples
|
||||
-------------
|
||||
|
|
@ -1497,7 +1508,7 @@ An example of a typical configuration for Unix is:
|
|||
data d3 /mnt/disk3/
|
||||
exclude /lost+found/
|
||||
exclude /tmp/
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/sg0
|
||||
smartctl 2-parity -d areca,2/1 /dev/sg0
|
||||
|
|
@ -1513,7 +1524,7 @@ An example of a typical configuration for Windows is:
|
|||
exclude Thumbs.db
|
||||
exclude \$RECYCLE.BIN
|
||||
exclude \System Volume Information
|
||||
smartctl d1 -d sat %s
|
||||
smartctl d1 [info: -H -i -c -A] -d sat %s
|
||||
smartctl d2 -d usbjmicron %s
|
||||
smartctl parity -d areca,1/1 /dev/arcmsr0
|
||||
smartctl 2-parity -d areca,2/1 /dev/arcmsr0
|
||||
|
|
@ -1811,8 +1822,10 @@ SnapRAID stores the list and checksums of your files in the content file.
|
|||
It is a binary file that lists all the files present in your disk array,
|
||||
along with all the checksums to verify their integrity.
|
||||
|
||||
This file is read and written by the `sync` and `scrub` commands and
|
||||
read by the `fix`, `check`, and `status` commands.
|
||||
The content file is read and written by the `sync`, `scrub`, `touch`, and
|
||||
`rehash` commands. It is read by the `status`, `diff`, `check`, `fix`,
|
||||
`list`, `dup`, `locate`, and `pool` commands, and it is completely
|
||||
ignored by the `smart`, `probe`, `up`, `down`, and `devices` commands.
|
||||
|
||||
|
||||
13 PARITY
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
uncrustify -c uncrustify.cfg --replace --no-backup cmdline/*.c cmdline/*.h
|
||||
uncrustify -c linux.cfg --replace --no-backup raid/*.c raid/*.h raid/test/*.c raid/test/*.h
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,5 +1,5 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2011 Andrea Mazzoleni
|
||||
// Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
#ifndef __PORTABLE_MINGW_H
|
||||
#define __PORTABLE_MINGW_H
|
||||
|
|
@ -8,9 +8,83 @@
|
|||
|
||||
#include <wchar.h>
|
||||
|
||||
#define SYSLOG "EventLog"
|
||||
|
||||
#define OS_LVL_CRITICAL 1
|
||||
#define OS_LVL_ERROR 2
|
||||
#define OS_LVL_WARNING 3
|
||||
#define OS_LVL_INFO 4
|
||||
#define OS_LVL_DEBUG 5
|
||||
|
||||
/* map Windows name to POSIX name */
|
||||
#define strncasecmp _strnicmp
|
||||
|
||||
/****************************************************************************/
|
||||
/* conversion */
|
||||
|
||||
/**
|
||||
* Size in chars of conversion buffers for u8to16() and u16to8().
|
||||
*/
|
||||
#define CONV_MAX PATH_MAX
|
||||
|
||||
/**
|
||||
* Convert a path to the Windows format.
|
||||
*
|
||||
* If only_is_required is 1, the extended-length format is used only if required.
|
||||
*
|
||||
* The exact operation done is:
|
||||
* - If it's a '\\?\' or '\\.\' path, convert any '/' to '\'.
|
||||
* - If it's a disk designator path, like 'D:\' or 'D:/', it prepends '\\?\' to the path and convert any '/' to '\'.
|
||||
* - If it's a UNC path, like ''\\server'', it prepends '\\?\UNC\' to the path and convert any '/' to '\'.
|
||||
* - Otherwise, only the UTF conversion is done. In this case Windows imposes a limit of 260 chars, and automatically convert any '/' to '\'.
|
||||
*
|
||||
* For more details see:
|
||||
* Naming Files, Paths, and Namespaces
|
||||
* http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx#maxpath
|
||||
*/
|
||||
wchar_t* convert_arg(wchar_t* conv_buf, const char* src, int only_if_required);
|
||||
|
||||
#define convert(buf, a) convert_arg(buf, a, 0)
|
||||
#define convert_if_required(buf, a) convert_arg(buf, a, 1)
|
||||
|
||||
/**
|
||||
* Convert a generic string from UTF16 to UTF8.
|
||||
* \param conv_buf Destination UTF-8 buffer of size CONV_MAX.
|
||||
* \param src Source UTF-16 null-terminated string.
|
||||
* \return The converted string. It never fails.
|
||||
*/
|
||||
char* u16tou8(char* conv_buf, const wchar_t* src);
|
||||
|
||||
/**
|
||||
* Convert a generic string from UTF8 to UTF16.
|
||||
* \param conv_buf Destination UTF-16 buffer of size CONV_MAX.
|
||||
* \param src Source UTF-8 null-terminated string.
|
||||
* \return The converted string. It never fails.
|
||||
*/
|
||||
wchar_t* u8tou16(wchar_t* conv_buf, const char* src);
|
||||
|
||||
/**
|
||||
* Convert a generic string from UTF16 to UTF8.
|
||||
* \param conv_buf Destination UTF-8 buffer.
|
||||
* \param number_of_char Size of the destination buffer in bytes.
|
||||
* \param src Source UTF-16 string.
|
||||
* \param number_of_wchar Number of wide characters to convert.
|
||||
* \param result_length_without_terminator Optional pointer to receive the converted length.
|
||||
* \return The converted string, or 0 on failure.
|
||||
*/
|
||||
char* u16tou8_mayfail(char* conv_buf, size_t number_of_char, const wchar_t* src, size_t number_of_wchar, size_t* result_length_without_terminator);
|
||||
|
||||
/**
|
||||
* Convert a generic string from UTF8 to UTF16.
|
||||
* \param conv_buf Destination UTF-16 buffer.
|
||||
* \param conv_size Size of the destination buffer in wchar_t elements.
|
||||
* \param src Source UTF-8 string.
|
||||
* \param number_of_char Number of bytes to convert (or -1 for null-terminated string).
|
||||
* \param result_length_without_terminator Optional pointer to receive the converted length.
|
||||
* \return The converted string, or 0 on failure.
|
||||
*/
|
||||
wchar_t* u8tou16_mayfail(wchar_t* conv_buf, size_t number_of_wchar, const char* src, size_t number_of_char, size_t* result_length_without_terminator);
|
||||
|
||||
/****************************************************************************/
|
||||
/* file */
|
||||
|
||||
|
|
@ -23,6 +97,8 @@
|
|||
/* Remap functions and types */
|
||||
#undef fopen
|
||||
#define fopen windows_fopen
|
||||
#define FOPEN_TEXT "t"
|
||||
#define FOPEN_BINARY "b"
|
||||
#undef open
|
||||
#define open windows_open
|
||||
#define open_noatime windows_open
|
||||
|
|
@ -71,6 +147,7 @@
|
|||
#undef utimensat
|
||||
#define utimensat windows_utimensat
|
||||
#define O_NOFOLLOW 0
|
||||
#define O_CLOEXEC 0
|
||||
#define dirent_hidden windows_dirent_hidden
|
||||
#define HAVE_STRUCT_DIRENT_D_STAT 1
|
||||
#undef HAVE_STRUCT_DIRENT_D_INO
|
||||
|
|
@ -110,6 +187,12 @@
|
|||
#define HAVE_DIRECT_IO 1
|
||||
#define O_DIRECT 0x10000000
|
||||
#define O_DSYNC 0x20000000
|
||||
#undef gmtime_r
|
||||
#define gmtime_r windows_gmtime_r
|
||||
#undef localtime_r
|
||||
#define localtime_r windows_localtime_r
|
||||
#undef realpath
|
||||
#define realpath windows_realpath
|
||||
|
||||
/**
|
||||
* If nanoseconds are not supported, we report the special STAT_NSEC_INVALID value,
|
||||
|
|
@ -120,6 +203,39 @@
|
|||
/* We have nano second support */
|
||||
#define STAT_NSEC(st) ((int)(st)->st_mtimensec)
|
||||
|
||||
static inline int WEXITSTATUS(DWORD status)
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
static inline int WTERMSIG(DWORD status)
|
||||
{
|
||||
/* identify most common crash reasons */
|
||||
switch (status) {
|
||||
case 0x40000015 : return SIGABRT; /* STATUS_FATAL_APP_EXIT */
|
||||
case 0xC0000005 : return SIGSEGV; /* STATUS_ACCESS_VIOLATION */
|
||||
case 0xC0000006 : return SIGSEGV; /* STATUS_IN_PAGE_ERROR */
|
||||
case 0xC000001D : return SIGILL; /* STATUS_ILLEGAL_INSTRUCTION */
|
||||
case 0xC00000FD : return SIGSEGV; /* STATUS_STACK_OVERFLOW */
|
||||
case 0xC0000090 : return SIGFPE; /* STATUS_FLOAT_INVALID_OPERATION */
|
||||
case 0xC0000094 : return SIGFPE; /* STATUS_INTEGER_DIVIDE_BY_ZERO */
|
||||
case 0xC000013A : return SIGINT; /* STATUS_CONTROL_C_EXIT */
|
||||
case 0xC0000409 : return SIGSEGV; /* STATUS_STACK_BUFFER_OVERRUN */
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int WIFEXITED(DWORD status)
|
||||
{
|
||||
return status < 0xC0000000 && WTERMSIG(status) == 0;
|
||||
}
|
||||
|
||||
static inline int WIFSIGNALED(DWORD status)
|
||||
{
|
||||
return WTERMSIG(status) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic stat information.
|
||||
*/
|
||||
|
|
@ -144,7 +260,7 @@ int windows_fstat(int fd, struct windows_stat* st);
|
|||
/**
|
||||
* Like the C lstat(), but with some limitations.
|
||||
*
|
||||
* The st_ino field may be 0 if it's not possible to read it in a fast way.
|
||||
* The st_ino field may be INODE_INVALID if it's not possible to read it in a fast way.
|
||||
* Specifically this always happens.
|
||||
*
|
||||
* In case of hardlinks, the size and the attributes of the file can
|
||||
|
|
@ -319,7 +435,7 @@ const char* windows_stat_desc(struct stat* st);
|
|||
unsigned windows_sleep(unsigned seconds);
|
||||
|
||||
/**
|
||||
* List usleep().
|
||||
* Like usleep().
|
||||
*/
|
||||
void windows_usleep(uint64_t useconds);
|
||||
|
||||
|
|
@ -376,10 +492,25 @@ ssize_t windows_pread(int f, void* buffer, size_t size, off_t offset);
|
|||
ssize_t windows_pwrite(int f, const void* buffer, size_t size, off_t offset);
|
||||
|
||||
/**
|
||||
* List direct_size().
|
||||
* Like direct_size().
|
||||
*/
|
||||
size_t windows_direct_size(void);
|
||||
|
||||
/**
|
||||
* Like gmtime_r().
|
||||
*/
|
||||
struct tm* windows_gmtime_r(const time_t* timer, struct tm* result);
|
||||
|
||||
/**
|
||||
* Like localtime_r().
|
||||
*/
|
||||
struct tm* windows_localtime_r(const time_t* timer, struct tm* result);
|
||||
|
||||
/**
|
||||
* Like realpath().
|
||||
*/
|
||||
char* windows_realpath(const char* path, char* resolved_path);
|
||||
|
||||
/**
|
||||
* Like GetFileAttributes()
|
||||
*/
|
||||
|
|
@ -390,23 +521,51 @@ int windows_get_file_attributes(const char* file);
|
|||
*/
|
||||
int windows_set_file_attributes(const char* file, int attributes);
|
||||
|
||||
/**
|
||||
* Convert Windows error to errno.
|
||||
*/
|
||||
void windows_errno(DWORD error);
|
||||
|
||||
/**
|
||||
* Return the executable directory.
|
||||
*
|
||||
* Ends with \
|
||||
*/
|
||||
const wchar_t* windows_exedir(void);
|
||||
|
||||
/**
|
||||
* Return if we are in the Wine environment.
|
||||
*/
|
||||
int windows_is_wine(void);
|
||||
|
||||
/****************************************************************************/
|
||||
/* thread */
|
||||
|
||||
#define HAVE_THREAD 1
|
||||
typedef void* windows_thread_t;
|
||||
typedef CRITICAL_SECTION windows_mutex_t;
|
||||
typedef struct {
|
||||
SRWLOCK srw;
|
||||
BOOL exclusive;
|
||||
} windows_rwlock_t;
|
||||
typedef CONDITION_VARIABLE windows_cond_t;
|
||||
typedef void* windows_key_t;
|
||||
/* remap to pthread */
|
||||
#define pid_t intptr_t
|
||||
#define thread_id_t windows_thread_t
|
||||
#define thread_mutex_t windows_mutex_t
|
||||
#define thread_cond_t windows_cond_t
|
||||
#define thread_rwlock_t windows_rwlock_t
|
||||
#define thread_key_t windows_key_t
|
||||
#define pthread_mutex_init windows_mutex_init
|
||||
#define pthread_mutex_destroy windows_mutex_destroy
|
||||
#define pthread_mutex_lock windows_mutex_lock
|
||||
#define pthread_mutex_unlock windows_mutex_unlock
|
||||
#define pthread_rwlock_init windows_rwlock_init
|
||||
#define pthread_rwlock_destroy windows_rwlock_destroy
|
||||
#define pthread_rwlock_rdlock windows_rwlock_rdlock
|
||||
#define pthread_rwlock_wrlock windows_rwlock_wrlock
|
||||
#define pthread_rwlock_unlock windows_rwlock_unlock
|
||||
#define pthread_cond_init windows_cond_init
|
||||
#define pthread_cond_destroy windows_cond_destroy
|
||||
#define pthread_cond_signal windows_cond_signal
|
||||
|
|
@ -426,6 +585,11 @@ int windows_mutex_init(windows_mutex_t* mutex, void* attr);
|
|||
int windows_mutex_destroy(windows_mutex_t* mutex);
|
||||
int windows_mutex_lock(windows_mutex_t* mutex);
|
||||
int windows_mutex_unlock(windows_mutex_t* mutex);
|
||||
int windows_rwlock_init(windows_rwlock_t* mutex, void* attr);
|
||||
int windows_rwlock_destroy(windows_rwlock_t* mutex);
|
||||
int windows_rwlock_rdlock(windows_rwlock_t* mutex);
|
||||
int windows_rwlock_wrlock(windows_rwlock_t* mutex);
|
||||
int windows_rwlock_unlock(windows_rwlock_t* mutex);
|
||||
int windows_cond_init(windows_cond_t* cond, void* attr);
|
||||
int windows_cond_destroy(windows_cond_t* cond);
|
||||
int windows_cond_signal(windows_cond_t* cond);
|
||||
|
|
@ -444,6 +608,23 @@ int windows_key_delete(windows_key_t key);
|
|||
void* windows_getspecific(windows_key_t key);
|
||||
int windows_setspecific(windows_key_t key, void* value);
|
||||
|
||||
/****************************************************************************/
|
||||
/* service */
|
||||
|
||||
#if !HAVE_GETOPT_LONG
|
||||
#error HAVE_GETOPT_LONG is required in Windows for the service options
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Log into Eventlog
|
||||
*/
|
||||
void windows_eventlog(int level, const char* msg);
|
||||
|
||||
/**
|
||||
* Signal that the service is starting and it needs more time.
|
||||
*/
|
||||
void windows_starting(void);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
345
os/os.h
Normal file
345
os/os.h
Normal file
|
|
@ -0,0 +1,345 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
#ifndef __OS_H
|
||||
#define __OS_H
|
||||
|
||||
/****************************************************************************/
|
||||
/* syslog */
|
||||
|
||||
/**
|
||||
* Log an informational syslog message.
|
||||
* The message should start with a lowercase letter and must not terminate with \n.
|
||||
* \param level One of OS_LVL_*.
|
||||
* \param format Printf-like format string.
|
||||
*/
|
||||
void os_syslog(int level, const char* format, ...) __attribute__((format(attribute_printf, 2, 3)));
|
||||
|
||||
/****************************************************************************/
|
||||
/* signal */
|
||||
|
||||
/**
|
||||
* Enable or disable signal handling.
|
||||
* \param enable 1 to enable signals, 0 to disable.
|
||||
*/
|
||||
void os_signal_set(int enable);
|
||||
|
||||
/**
|
||||
* Initialize signal handling.
|
||||
* \param handler_term Signal handler callback for termination signals (SIGTERM, SIGINT).
|
||||
* \param handler_hup Signal handler callback for hangup signal (SIGHUP).
|
||||
*/
|
||||
void os_signal_init(void (*handler_term)(int sig), void (*handler_hup)(int sig));
|
||||
|
||||
/**
|
||||
* Restore signal handlers after fork in child process.
|
||||
* This resets signals to default handling.
|
||||
*/
|
||||
void os_signal_restore_after_fork(void);
|
||||
|
||||
/**
|
||||
* Get string representation of signal number.
|
||||
* \param sig Signal number.
|
||||
* \return Signal name string.
|
||||
*/
|
||||
const char* os_signal_name(int sig);
|
||||
|
||||
/**
|
||||
* Global variable to identify if Ctrl+C is pressed.
|
||||
* \return 1 if Ctrl+C was pressed/interrupted, 0 otherwise.
|
||||
*/
|
||||
int os_signal_interrupt(void);
|
||||
|
||||
/****************************************************************************/
|
||||
/* exec */
|
||||
|
||||
/**
|
||||
* Opaque handle tracking a process execution stream and its process ID.
|
||||
*
|
||||
* This structure encapsulates a standard buffered I/O stream tied to the
|
||||
* redirected standard output of a child process spawned via os_popen().
|
||||
*/
|
||||
#ifdef __MINGW32__
|
||||
#define OS_FILE FILE
|
||||
#else
|
||||
typedef struct OS_FILE {
|
||||
FILE* fp; /**< Standard I/O buffered stream wrapper. */
|
||||
pid_t pid; /**< Process ID of the child process. */
|
||||
} OS_FILE;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Spawns a child process and opens a buffered stream to read its stdout.
|
||||
*
|
||||
* This function acts as a safer alternative to standard popen(), accepting an
|
||||
* explicit argument vector rather than evaluating a shell command string.
|
||||
*
|
||||
* The child process is completely isolated in its own process group (via setpgid)
|
||||
* with its stdin and stderr redirected to /dev/null. The underlying pipe is
|
||||
* created with O_CLOEXEC set to prevent leakage across concurrent forks.
|
||||
*
|
||||
* The caller is expected to call os_privileges_acquire() before this operation if permission is needed.
|
||||
*
|
||||
* \param argv A NULL-terminated array of strings representing the argument vector.
|
||||
* argv[0] must contain the absolute path to the verified executable.
|
||||
* \return A pointer to an initialized OS_FILE structure on success, or NULL on failure.
|
||||
*/
|
||||
OS_FILE* os_popen(const char** argv);
|
||||
|
||||
/**
|
||||
* Reads a line from an OS execution stream.
|
||||
*
|
||||
* Reads characters from the specified stream into the buffer string until
|
||||
* (size - 1) characters are read, a newline character is read and transferred,
|
||||
* or an end-of-file (EOF) condition is encountered. A terminating null
|
||||
* character is appended.
|
||||
*
|
||||
* \param s Pointer to an array of chars where the string read is stored.
|
||||
* \param size Maximum number of characters to be read (including the null character).
|
||||
* \param stream Pointer to the OS_FILE tracking context.
|
||||
* \return On success, returns the buffer pointer s. If EOF is reached or a read
|
||||
* error occurs before any characters are read, returns NULL.
|
||||
*/
|
||||
char* os_fgets(char* s, int size, OS_FILE* stream);
|
||||
|
||||
/**
|
||||
* Closes an execution stream and reaps the associated child process.
|
||||
*
|
||||
* Closes the underlying buffered standard I/O stream, releases the allocated
|
||||
* tracking context container, and blocks until the associated child process
|
||||
* terminates to prevent the creation of zombie processes.
|
||||
*
|
||||
* \param stream Pointer to the active OS_FILE context to close and free.
|
||||
* \return The termination status of the child process on success, or -1 on failure.
|
||||
*/
|
||||
int os_pclose(OS_FILE* stream);
|
||||
|
||||
/**
|
||||
* Spawn a new process with the specified argument vector, optionally capturing stdout and/or stderr.
|
||||
* The caller is expected to call os_privileges_acquire() before this operation if permission is needed.
|
||||
* \param argv Array of command line arguments.
|
||||
* \param stdout_read_fd Pointer to store file descriptor for stdout, or NULL to redirect to /dev/null.
|
||||
* \param stderr_read_fd Pointer to store file descriptor for stderr, or NULL to redirect to /dev/null.
|
||||
* \param run_as_user User to run script as (NULL for current user).
|
||||
* \return Process ID of spawned process, or -1 on failure.
|
||||
*/
|
||||
pid_t os_spawn(char** argv, int* stdout_read_fd, int* stderr_read_fd, const char* run_as_user);
|
||||
|
||||
/**
|
||||
* Wait for the child process to terminate.
|
||||
* \param pid Process ID of the child process.
|
||||
* \param status Pointer to store the exit status.
|
||||
* \return Child PID on success, -1 on failure.
|
||||
*/
|
||||
pid_t os_wait(pid_t pid, int* status);
|
||||
|
||||
/**
|
||||
* Terminate gracefully a process. Intended for daemon/service processes controlling child processes.
|
||||
* The caller must subsequently call os_wait() to reap process resources and close handles.
|
||||
* \param pid Process ID of the process to terminate.
|
||||
* \return 0 on success, -1 on failure.
|
||||
*/
|
||||
int os_term(pid_t pid);
|
||||
|
||||
/**
|
||||
* Forcibly terminate a process.
|
||||
* The caller must subsequently call os_wait() to reap process resources and close handles.
|
||||
* \param pid Process ID of the process to kill.
|
||||
* \return 0 on success, -1 on failure.
|
||||
*/
|
||||
int os_kill(pid_t pid);
|
||||
|
||||
/**
|
||||
* Fork and execute a verified executable, discarding all I/O.
|
||||
*
|
||||
* Spawns @argv[0] in a new process with stdin, stdout and stderr all
|
||||
* redirected to /dev/null. Use this for fire-and-forget tasks where the
|
||||
* child's output is not needed.
|
||||
*
|
||||
* The child is placed in its own process group (setpgid) to isolate it
|
||||
* from signals sent to the daemon's process group.
|
||||
*
|
||||
* The caller is expected to call os_privileges_acquire() before this operation if permission is needed.
|
||||
*
|
||||
* \param argv NULL-terminated argument vector. argv[0] must be the absolute path
|
||||
* to the executable.
|
||||
* \return The child exit status on success, or -1 on failure.
|
||||
*/
|
||||
int os_spawn_and_wait(const char** argv);
|
||||
|
||||
/**
|
||||
* Execute a system command with optional user context and input.
|
||||
* The caller is expected to call os_privileges_acquire() before this operation if permission is needed.
|
||||
* \param command Command to execute.
|
||||
* \param run_as_user User to run command as (NULL for current user).
|
||||
* \param stdin_text Text to provide as stdin (NULL for no input).
|
||||
* \return Exit status of command.
|
||||
*/
|
||||
int os_command(const char* command, const char* run_as_user, const char* stdin_text);
|
||||
|
||||
/**
|
||||
* Execute a script file with specified user context.
|
||||
* The caller is expected to call os_privileges_acquire() before this operation if permission is needed.
|
||||
* \param argv Array of command line arguments.
|
||||
* \param envp Environment variables (NULL-terminated list of strings).
|
||||
* \param run_as_user User to run script as (NULL for current user).
|
||||
* \return Exit status of script.
|
||||
*/
|
||||
int os_script(char** argv, char** envp, const char* run_as_user);
|
||||
|
||||
/**
|
||||
* Validates a string for exec.
|
||||
* \param str The input string to validate.
|
||||
* \return -1 if dangerous characters are detected, 0 otherwise.
|
||||
*/
|
||||
int os_validate_exec_input(const char* str);
|
||||
|
||||
/****************************************************************************/
|
||||
/* fs */
|
||||
|
||||
/**
|
||||
* Invalid inode number.
|
||||
*
|
||||
* Value 0 is used to represent an invalid or unavailable inode number.
|
||||
* While 0 is not strictly guaranteed to be invalid by standards, in practice
|
||||
* it is never used for valid files. And even if a file happens to have inode 0,
|
||||
* the program will simply process that specific file without using its inode.
|
||||
*/
|
||||
#define INODE_INVALID 0
|
||||
|
||||
/**
|
||||
* Physical offset not yet read.
|
||||
*/
|
||||
#define FILEPHY_UNREAD_OFFSET 0
|
||||
|
||||
/**
|
||||
* Special value returned when the file-system doesn't report any offset for unknown reason.
|
||||
*/
|
||||
#define FILEPHY_UNREPORTED_OFFSET 1
|
||||
|
||||
/**
|
||||
* Special value returned when the file doesn't have a real offset.
|
||||
* For example, because it's stored in the NTFS MFT.
|
||||
*/
|
||||
#define FILEPHY_WITHOUT_OFFSET 2
|
||||
|
||||
/**
|
||||
* Value indicating real offsets. All offsets greater or equal at this one are real.
|
||||
*/
|
||||
#define FILEPHY_REAL_OFFSET 3
|
||||
|
||||
/**
|
||||
* Get the physical address of the specified file.
|
||||
* This is expected to be just a hint and not necessarily correct or unique.
|
||||
* \param path The path of the file.
|
||||
* \param size The size of the file.
|
||||
* \param physical Pointer to store the physical offset.
|
||||
* \return 0 on success, -1 on failure.
|
||||
*/
|
||||
int filephy(const char* path, uint64_t size, uint64_t* physical);
|
||||
|
||||
/****************************************************************************/
|
||||
/* privileges */
|
||||
|
||||
/**
|
||||
* Bracketed Privileges System:
|
||||
* These functions allow the daemon to run with dropped effective privileges
|
||||
* by default (euid/egid set to an unprivileged user like "nobody"), while
|
||||
* temporarily escalating to root privileges for specific operations that require
|
||||
* administrative permissions (e.g., config changes, executing SnapRAID commands,
|
||||
* managing log files).
|
||||
*/
|
||||
|
||||
/**
|
||||
* Temporarily acquire root privileges.
|
||||
* Restores the effective user and group ID of the calling thread to root (0).
|
||||
*/
|
||||
void os_privileges_acquire(void);
|
||||
|
||||
/**
|
||||
* Release root privileges.
|
||||
* Reverts the effective user and group ID of the calling thread to the unprivileged credentials.
|
||||
*/
|
||||
void os_privileges_release(void);
|
||||
|
||||
/**
|
||||
* Drop effective privileges permanently to an unprivileged user (e.g., "nobody").
|
||||
* Called after startup/initialization is complete to transition the daemon into
|
||||
* the Bracketed Privileges execution mode.
|
||||
*/
|
||||
void os_privileges_drop(void);
|
||||
|
||||
/****************************************************************************/
|
||||
/* os */
|
||||
|
||||
#define OS_INIT_OPT_AVOID_SLEEP 1 /**< Prevent the system to go to sleep */
|
||||
#define OS_INIT_OPT_WINFIND 2 /**< Use the legacy Windows FindFirstFile interface instead of the new stream interface */
|
||||
|
||||
/**
|
||||
* Initializes the system.
|
||||
* \param opt System initialization options.
|
||||
*/
|
||||
void os_init(unsigned opt);
|
||||
|
||||
/**
|
||||
* Deinitializes the system.
|
||||
*/
|
||||
void os_done(void);
|
||||
|
||||
/**
|
||||
* Get the os_tick counter value.
|
||||
*
|
||||
* Note that the frequency is unspecified, because the time measure
|
||||
* is meant to be used to compare the ratio between usage times.
|
||||
* \return Monotonic clock tick value.
|
||||
*/
|
||||
uint64_t os_tick(void);
|
||||
|
||||
/**
|
||||
* Get the os_tick counter value in millisecond.
|
||||
* \return Monotonic clock value in milliseconds.
|
||||
*/
|
||||
uint64_t os_tick_ms(void);
|
||||
|
||||
/**
|
||||
* Get the os_tick counter value in seconds.
|
||||
* \return Monotonic clock value in seconds.
|
||||
*/
|
||||
uint64_t os_tick_sec(void);
|
||||
|
||||
/**
|
||||
* Abort the process with a stacktrace.
|
||||
*/
|
||||
void os_abort(void) __noreturn;
|
||||
|
||||
/**
|
||||
* Exit the process with failure.
|
||||
*/
|
||||
void os_exit(void) __noreturn;
|
||||
|
||||
/**
|
||||
* Shutdown the system.
|
||||
* \return 0 on success, -1 on failure.
|
||||
*/
|
||||
int os_shutdown(void);
|
||||
|
||||
/**
|
||||
* Clear the screen.
|
||||
*/
|
||||
void os_clear(void);
|
||||
|
||||
/**
|
||||
* Fill memory with pseudo-random values
|
||||
* \param ptr Pointer to the memory buffer.
|
||||
* \param size Size of the memory buffer.
|
||||
* \return 0 on success, -1 on failure.
|
||||
*/
|
||||
int os_randomize(void* ptr, size_t size);
|
||||
|
||||
/**
|
||||
* Get the optimal CPU for the speed test
|
||||
* \return Optimal CPU index.
|
||||
*/
|
||||
int os_get_optimal_cpu(void);
|
||||
|
||||
#endif
|
||||
315
os/portable.h
Normal file
315
os/portable.h
Normal file
|
|
@ -0,0 +1,315 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (C) 2026 Andrea Mazzoleni
|
||||
|
||||
#ifndef __PORTABLE_H
|
||||
#define __PORTABLE_H
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include "config.h" /* Use " to include first in the same directory of this file */
|
||||
#endif
|
||||
|
||||
/***************************************************************************/
|
||||
/* Config */
|
||||
|
||||
#ifdef __MINGW32__
|
||||
/**
|
||||
* Enable the GNU printf functions instead of using the MSVCRT ones.
|
||||
*
|
||||
* Note that this is the default if _POSIX is also defined.
|
||||
* To disable it you have to set it to 0.
|
||||
*/
|
||||
#define __USE_MINGW_ANSI_STDIO 1
|
||||
|
||||
/**
|
||||
* Define the MSVCRT version targeting Windows 7.
|
||||
*/
|
||||
#define __MSVCRT_VERSION__ 0x0601
|
||||
|
||||
/**
|
||||
* Include Windows 7 headers.
|
||||
*
|
||||
* Like for InitializeCriticalSection().
|
||||
*/
|
||||
#define _WIN32_WINNT 0x601
|
||||
|
||||
/**
|
||||
* Enable the rand_s() function.
|
||||
*/
|
||||
#define _CRT_RAND_S
|
||||
|
||||
/**
|
||||
* Undef as it clashes with windows.h declarations
|
||||
*/
|
||||
#undef DATADIR
|
||||
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Specify the format attribute for printf.
|
||||
*/
|
||||
#ifdef __MINGW32__
|
||||
#if defined(__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO == 1
|
||||
#define attribute_printf gnu_printf /* GNU format */
|
||||
#define printf(...) __mingw_printf(__VA_ARGS__) /* to support %z in printf */
|
||||
#else
|
||||
#define attribute_printf ms_printf /* MSVCRT format */
|
||||
#endif
|
||||
#else
|
||||
#define attribute_printf printf /* GNU format is the default one */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Compiler extension
|
||||
*/
|
||||
#ifndef __always_inline
|
||||
#define __always_inline inline __attribute__((always_inline))
|
||||
#endif
|
||||
|
||||
#ifndef __noreturn
|
||||
#define __noreturn __attribute__((noreturn))
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Architecture for inline assembly.
|
||||
*/
|
||||
#if HAVE_ASSEMBLY
|
||||
#if defined(__i386__)
|
||||
#define CONFIG_X86 1
|
||||
#define CONFIG_X86_32 1
|
||||
#endif
|
||||
|
||||
#if defined(__x86_64__)
|
||||
#define CONFIG_X86 1
|
||||
#define CONFIG_X86_64 1
|
||||
#endif
|
||||
|
||||
#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32)
|
||||
#define CONFIG_ARM_CRC 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Includes some platform specific headers.
|
||||
*/
|
||||
#if HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_MOUNT_H
|
||||
#include <sys/mount.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_VFS_H
|
||||
#include <sys/vfs.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_STATFS_H
|
||||
#include <sys/statfs.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_FILE_H
|
||||
#include <sys/file.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_SYSCTL_H
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_IOCTL_H
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_LINUX_FS_H
|
||||
#include <linux/fs.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_LINUX_BTRFS_H
|
||||
#include <linux/btrfs.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_LINUX_FIEMAP_H
|
||||
#include <linux/fiemap.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_BLKID_BLKID_H
|
||||
#include <blkid/blkid.h>
|
||||
#if HAVE_BLKID_DEVNO_TO_DEVNAME && HAVE_BLKID_GET_TAG_VALUE
|
||||
#define HAVE_BLKID 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Includes some standard headers.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h> /* On many systems (e.g., Darwin), `stdio.h' is a prerequisite. */
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <fcntl.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <limits.h>
|
||||
|
||||
#if HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_INTTYPES_H
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#else
|
||||
#if HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#else
|
||||
#include <time.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAVE_MACH_MACH_TIME_H
|
||||
#include <mach/mach_time.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_DIRENT_H
|
||||
#include <dirent.h>
|
||||
#define NAMLEN(dirent) strlen((dirent)->d_name)
|
||||
#else
|
||||
#define dirent direct
|
||||
#define NAMLEN(dirent) (dirent)->d_namlen
|
||||
#if HAVE_SYS_NDIR_H
|
||||
#include <sys/ndir.h>
|
||||
#endif
|
||||
#if HAVE_SYS_DIR_H
|
||||
#include <sys/dir.h>
|
||||
#endif
|
||||
#if HAVE_NDIR_H
|
||||
#include <ndir.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_MKDEV
|
||||
#include <sys/mkdev.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_SYSMACROS_H
|
||||
#include <sys/sysmacros.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_PRCTL_H
|
||||
#include <sys/prctl.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_MATH_H
|
||||
#include <math.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_EXECINFO_H
|
||||
#include <execinfo.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRINGS
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYSLOG_H
|
||||
#include <syslog.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_GRP_H
|
||||
#include <grp.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_PWD_H
|
||||
#include <pwd.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_SYSINFO_H
|
||||
#include <sys/sysinfo.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_UTSNAME_H
|
||||
#include <sys/utsname.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_ZLIB
|
||||
#include <zlib.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_ZSTD
|
||||
#include <zstd.h>
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include <DiskArbitration/DiskArbitration.h>
|
||||
#include <mach-o/dyld.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_IO_H
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_GETOPT_LONG
|
||||
#define SWITCH_GETOPT_LONG(a, b) a
|
||||
#else
|
||||
#define SWITCH_GETOPT_LONG(a, b) b
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Enables lock file support.
|
||||
*/
|
||||
#if (HAVE_FLOCK && HAVE_FTRUNCATE) || defined(_WIN32)
|
||||
#define HAVE_LOCKFILE 1
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LINUX_CLOSE_RANGE_H
|
||||
#include <linux/close_range.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Flags for open()
|
||||
*/
|
||||
#ifndef O_PATH
|
||||
#ifdef O_SEARCH
|
||||
#define O_PATH O_SEARCH /* macOS */
|
||||
#else
|
||||
#define O_PATH O_RDONLY /* POSIX */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Includes specific support for Windows or Linux.
|
||||
*/
|
||||
#ifdef __MINGW32__
|
||||
#include "mingw.h"
|
||||
#else
|
||||
#include "unix.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue