From 83f89f4f0e29ce40c6ea8d5c33a0d98ad3d2bab0 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 19 Sep 2011 20:45:35 +0200 Subject: [PATCH] Some minor changes. --- HISTORY | 2 ++ TODO | 4 +++- mingw.c | 7 ++++++- snapraid.1 | 21 +++++++++++++++------ snapraid.conf.example | 5 +++-- snapraid.conf.example.windows | 5 +++-- snapraid.d | 15 +++++++++------ snapraid.txt | 15 +++++++++------ state.c | 6 +++--- 9 files changed, 53 insertions(+), 27 deletions(-) diff --git a/HISTORY b/HISTORY index aa007574..996edfa9 100644 --- a/HISTORY +++ b/HISTORY @@ -8,6 +8,8 @@ SnapRAID HISTORY sync. Note that the sync will terminate with an error. * If the content file is placed in a data disk, it's automatically excluded from the sync process. +* Increased by one the minimum number of content files. Before it was only + a suggestion, but now it's a requirement in case you put them in data disks. 1.6 2011/9 - THIS UPDATE IS HIGHLY RECOMMENDED! =============================================== diff --git a/TODO b/TODO index 31aa6655..de55a9ec 100644 --- a/TODO +++ b/TODO @@ -5,8 +5,10 @@ This is the list of TODO items for SnapRAID. - v1.7 +* Use st_dev to effectively check if data/parity disks are different and +content files are in different disks. + * Put the content files in the data disks in the default configuration file. -But this requires to have at leas N+1 or them. * Remove the dependency of the 'disk' order specification in the conf file. The used order can be defined by SnapRAID and saved in the content file to avoid diff --git a/mingw.c b/mingw.c index b02fde74..3a28fdc5 100644 --- a/mingw.c +++ b/mingw.c @@ -87,7 +87,12 @@ static void windows_info2stat(const BY_HANDLE_FILE_INFORMATION* info, struct win /* hidden files should be backuped like any other */ if ((info->dwFileAttributes & FILE_ATTRIBUTE_DEVICE) != 0) { st->st_mode = S_IFBLK; - } else if ((info->dwFileAttributes & (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_TEMPORARY | FILE_ATTRIBUTE_OFFLINE | FILE_ATTRIBUTE_REPARSE_POINT)) != 0) { + } else if ((info->dwFileAttributes & ( + FILE_ATTRIBUTE_SYSTEM /* System files */ + | FILE_ATTRIBUTE_TEMPORARY /* Files going to be deleted on close */ + | FILE_ATTRIBUTE_OFFLINE + | FILE_ATTRIBUTE_REPARSE_POINT /* Symbolic links */ + )) != 0) { st->st_mode = S_IFCHR; } else if ((info->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) { st->st_mode = S_IFDIR; diff --git a/snapraid.1 b/snapraid.1 index 4197cfab..94b6859d 100644 --- a/snapraid.1 +++ b/snapraid.1 @@ -121,9 +121,12 @@ files. You should not store other data in them, with the only possible exception of the \(a"content\(a" files. .PP The list of files is stored in the \(a"content\(a" files, usually -stored in the parity disks or in other locations. -These files contain the details of you backup with all the +stored in the data, parity or boot disks. +These files contain the details of your backup with all the checksums to verify its integrity. +The \(a"content\(a" file is stored in multiple copies, each one in a +different disks, to ensure that in even in case of a multiple disk +failure at least one copy is available. .PP For example, suppose that you are interested only at one parity level of protection, and that your disks are present in: @@ -159,6 +162,10 @@ content /mnt/diskpar/content .PD 0 .PP .PD +content /var/snapraid/content +.PD 0 +.PP +.PD disk d1 /mnt/disk1/ .PD 0 .PP @@ -185,6 +192,10 @@ content E:\(rspar\(rscontent .PD 0 .PP .PD +content C:\(rssnapraid\(rscontent +.PD 0 +.PP +.PD disk d1 F:\(rsarray\(rs .PD 0 .PP @@ -399,10 +410,8 @@ from the \(a"sync\(a" process. This option is mandatory and it can be used more time to save more copies of the same files. .PP -You have to store at least one copy for each parity disk used. -It\(cqs suggested to use one more to ensure to always have -one copy in case of multiple disks damage, to be able to -check the data integrity of the remaining. +You have to store at least one copy for each parity disk used +plus one. Using some more don\(cqt hurt. .SS disk NAME DIR Defines the name and the mount point of the disks of the array. NAME is used to identify the disk, and it must be unique. diff --git a/snapraid.conf.example b/snapraid.conf.example index 83056a55..c4702996 100644 --- a/snapraid.conf.example +++ b/snapraid.conf.example @@ -13,8 +13,9 @@ parity /mnt/diskpar/parity # Defines the file to use as content list # You can use multiple specification to store more copies of the file -# It's suggested to have at least N+1 copies of the file, where N is the number of parity files. -# It can be in the disks used for data or parity storage +# You must have least one copy for each parity file plus one. Some more don't hurt +# They can be in the disks used for data, parity or boot, +# but each file must be in a different disk # Format: "content FILE_PATH" content /mnt/diskpar/content #content /mnt/diskqar/content diff --git a/snapraid.conf.example.windows b/snapraid.conf.example.windows index 8385f477..96c8797b 100644 --- a/snapraid.conf.example.windows +++ b/snapraid.conf.example.windows @@ -13,8 +13,9 @@ parity E:\par\parity # Defines the file to use as content list # You can use multiple specification to store more copies of the file -# It's suggested to have at least N+1 copies of the file, where N is the number of parity files. -# It can be in the disks used for data or parity storage +# You must have least one copy for each parity file plus one. Some more don't hurt +# They can be in the disks used for data, parity or boot, +# but each file must be in a different disk # Format: "content FILE_PATH" content E:\par\content #content F:\qar\content diff --git a/snapraid.d b/snapraid.d index f175a3dc..c22dec5f 100644 --- a/snapraid.d +++ b/snapraid.d @@ -87,9 +87,12 @@ Getting Started possible exception of the "content" files. The list of files is stored in the "content" files, usually - stored in the parity disks or in other locations. - These files contain the details of you backup with all the + stored in the data, parity or boot disks. + These files contain the details of your backup with all the checksums to verify its integrity. + The "content" file is stored in multiple copies, each one in a + different disks, to ensure that in even in case of a multiple disk + failure at least one copy is available. For example, suppose that you are interested only at one parity level of protection, and that your disks are present in: @@ -104,6 +107,7 @@ Getting Started :parity /mnt/diskpar/parity :content /mnt/diskpar/content + :content /var/snapraid/content :disk d1 /mnt/disk1/ :disk d2 /mnt/disk2/ :disk d3 /mnt/disk3/ @@ -113,6 +117,7 @@ Getting Started :parity E:\par\parity :content E:\par\content + :content C:\snapraid\content :disk d1 F:\array\ :disk d2 G:\array\ :disk d3 H:\array\ @@ -302,10 +307,8 @@ Configuration This option is mandatory and it can be used more time to save more copies of the same files. - You have to store at least one copy for each parity disk used. - It's suggested to use one more to ensure to always have - one copy in case of multiple disks damage, to be able to - check the data integrity of the remaining. + You have to store at least one copy for each parity disk used + plus one. Using some more don't hurt. disk NAME DIR Defines the name and the mount point of the disks of the array. diff --git a/snapraid.txt b/snapraid.txt index dce44b71..ebd1f8fc 100644 --- a/snapraid.txt +++ b/snapraid.txt @@ -100,9 +100,12 @@ files. You should not store other data in them, with the only possible exception of the "content" files. The list of files is stored in the "content" files, usually -stored in the parity disks or in other locations. -These files contain the details of you backup with all the +stored in the data, parity or boot disks. +These files contain the details of your backup with all the checksums to verify its integrity. +The "content" file is stored in multiple copies, each one in a +different disks, to ensure that in even in case of a multiple disk +failure at least one copy is available. For example, suppose that you are interested only at one parity level of protection, and that your disks are present in: @@ -117,6 +120,7 @@ the following options: parity /mnt/diskpar/parity content /mnt/diskpar/content + content /var/snapraid/content disk d1 /mnt/disk1/ disk d2 /mnt/disk2/ disk d3 /mnt/disk3/ @@ -126,6 +130,7 @@ instead of slashes: parity E:\par\parity content E:\par\content + content C:\snapraid\content disk d1 F:\array\ disk d2 G:\array\ disk d3 H:\array\ @@ -338,10 +343,8 @@ from the "sync" process. This option is mandatory and it can be used more time to save more copies of the same files. -You have to store at least one copy for each parity disk used. -It's suggested to use one more to ensure to always have -one copy in case of multiple disks damage, to be able to -check the data integrity of the remaining. +You have to store at least one copy for each parity disk used +plus one. Using some more don't hurt. 7.4 disk NAME DIR ----------------- diff --git a/state.c b/state.c index ce3f27d3..2cba0d18 100644 --- a/state.c +++ b/state.c @@ -261,12 +261,12 @@ void state_config(struct snapraid_state* state, const char* path, int verbose, i exit(EXIT_FAILURE); } if (state->qarity[0] != 0) { - content_required = 2; + content_required = 3; } else { - content_required = 1; + content_required = 2; } if (content_count < content_required) { - fprintf(stderr, "You must have one 'content' file for each parity disk.\n"); + fprintf(stderr, "You must have at least %d 'content' files. One for each parity disk plus one.\n", content_required); exit(EXIT_FAILURE); }