November 8, 20232 yr 3 hours ago, Normand_Nadon said: But in reality, this is all smoke and mirrors created by the sorcery of symlinks and in fact it is structured as such behind the scene It is not symlinks, its lower level than that more like mount points. Its a fundamental property of BTRFS filesystems. If it helps to think of it that way then sure, I am not entirely sure what the lower levels of BTRFS look like. The important point is that no matter how they are structured subvolumes can only be snapshotted separately.
January 18, 20242 yr So I have a question... I backup my ESXi to my unraid server using ghettovcb. I have modified it so it always writes to the same directory, so my strategy is always remove the backup and then backup again. Will that "deletion" negate the benefit of snapshots? it's a single gigantic file in most cases and the method I use doesn't support overwriting the old backup, so it's always a completely new file in the same folder (despite the files being mostly identical, actually completely identical when I backup a stopped VM). Right now I tried it, and it I get 2x the file usage so I guess that's just how it is
January 18, 20242 yr I guess I could backup to a temporary location without snapshots or anything, then use something like virtsync to sync only changed blocks to the "old file", then my incremental backups would work with minimal space usage
January 26, 20242 yr I am having issues and broke my setup. I had flaws in it and using duplicacy to back up as it was creating excessive amount of storage. My 300 gig backups turned into 2TB because it was archiving everything due to the prefix changing file structure. Each backup had a YYYYMMDD style tag behind it. So now I am trying to only maintain 1 backup with the plugin and have everything backed up with duplicacy once a day that maintains version and revision control. So not instead of having 7 days of backups I changed it to 1. That isn't working through, it creates a snapshot but then keeps telling me that it exists already, how can I have a static names backup file such as just appdata that is deleted and then created for the new one each time?
January 26, 20242 yr 2 hours ago, ZerkerEOD said: I am having issues and broke my setup. I had flaws in it and using duplicacy to back up as it was creating excessive amount of storage. My 300 gig backups turned into 2TB because it was archiving everything due to the prefix changing file structure. Each backup had a YYYYMMDD style tag behind it. So now I am trying to only maintain 1 backup with the plugin and have everything backed up with duplicacy once a day that maintains version and revision control. So not instead of having 7 days of backups I changed it to 1. That isn't working through, it creates a snapshot but then keeps telling me that it exists already, how can I have a static names backup file such as just appdata that is deleted and then created for the new one each time? Are you backing up your snapshots as well as you filesystem? You should probably just exclude your snapshots from your backup.
January 26, 20242 yr 1 minute ago, primeval_god said: Are you backing up your snapshots as well as you filesystem? You should probably just exclude your snapshots from your backup. An I missing an option, the exclude that I see is only for the GUI. I don't see anything that excludes the backups from the snapshot.
January 27, 20242 yr 19 hours ago, ZerkerEOD said: An I missing an option, the exclude that I see is only for the GUI. I don't see anything that excludes the backups from the snapshot. Are you using BTRFS? If so just make the directory you store your backups in into a sub volume (rename the folder they are currently in, create a sub volume with the name of the original directory, then move them into the subviolume). Btrfs snapshots are not recursive, so when snapshotting the top level the sub volume containing the backups will be excluded.
April 8, 20242 yr Just wondering, is there any way to see what command is issued by the plugin to create the snapshots? I have a script that needs to create some manually, and I'd like it to be coherent and identical to what it does in the plugin.
April 8, 20242 yr Author 11 minutes ago, fr500 said: Just wondering, is there any way to see what command is issued by the plugin to create the snapshots? I have a script that needs to create some manually, and I'd like it to be coherent and identical to what it does in the plugin. Here is command and example php btrfs subvolume snapshot '.$readonly.' '.escapeshellarg($subvol).' '.escapeshellarg($snapshoty). subvol is path to snap. snapshoty is the name of the snapshot. readonly is -r if you want the snapshot to be readonly. case 'create_snapshot': $snapshot = urldecode(($_POST['snapshot'])); $subvol = urldecode(($_POST['subvol'])); $readonly = urldecode(($_POST['readonly'])); if ($readonly == "true") $readonly = "-r" ; else $readonly="" ; $DateTimeF = findText("{", "}", $snapshot) ; if ($DateTimeF == "YMD") $DateTime = "YmdHis" ; else $DateTime = $DateTimeF ; $ymd = date($DateTime, time()); $snapshoty = str_replace("{".$DateTimeF."}", $ymd, $snapshot); # check_to_dir($snapshoty) ; $slashpos = substr(strrchr($snapshot,'/'), 1); $directory = substr($snapshot, 0, - strlen($slashpos)); if (!is_dir($directory) && $snapshot != $subvol) mkdir($directory, 0777, true) ; $result = NULL ; exec('btrfs subvolume snapshot '.$readonly.' '.escapeshellarg($subvol).' '.escapeshellarg($snapshoty)." 2>&1", $result, $error) ; snap_manager_log('btrfs snapshot create '.$snapshot.' '.$error.' '.$result[0]) ; if ($error=="1") $error_rtn = false ; else $error_rtn=true ; echo json_encode(array("success"=>$error_rtn, "error"=>$result)); break; Auto script. https://github.com/SimonFair/Snapshots/blob/b4ff445c44f3618a74d2737873c3efadfda43a38/source/include/snapping.php#L228
April 17, 20242 yr I want to implement Snapshots on my cache but this is my first time learning about Snapshots and how COW works so I want to make sure I am understanding the process correctly. I start with a single disk cache that is /mnt/cache-single that contains the shares Downloads, appdata and system. I run the four commands in the instructions for a share, eg Downloads mv /mnt/cache-single/Downloads /mnt/cache-single/some-temp btrfs sub create /mnt/cache-single/Downloads cp -aT --reflink=always /mnt/cache-single/some-temp /mnt/cache-single/Downloads rm -r /mnt/cache/some-temp This will convert that share to a subvolume. Since this is a file system level of change, do I need to go in and update Docker mappings and the Share Settings (Primary storage, move settings, SMB settings etc) as if a new Share had been created in UNRAID? Or do I now have two Shares of the same name and I need to configure the new one and remove the old one? I then repeat this for each Share and I will have 4 Subvolumes on this one pool. I can then enable Snapshots of a Subvolume and either store it within the Subvolume (preferred?) or to a different Subvolume as long as it is on the same pool. ie I cannot make a snap to /mnt/cache-single/some-snaps as 'some-snaps' is not a Subvolume and I cannot send to /mnt/cache-double/... as 'cache-double' is a different pool. At this point I will be able to restore from a snapshot manually if my Scrub notices a file is broken or I accidentally delete something I did not want to.
April 18, 20242 yr 14 hours ago, AngryPig said: This will convert that share to a subvolume. Since this is a file system level of change, do I need to go in and update Docker mappings and the Share Settings (Primary storage, move settings, SMB settings etc) as if a new Share had been created in UNRAID? Or do I now have two Shares of the same name and I need to configure the new one and remove the old one? You will want to stop any Docker containers that have a mapping to or within the share you are operating on while you make changes, aside from that though you dont need to make any changes since you are creating the subvolume with the original path. Likewise you shouldnt need to make any changes to share settings since so far as unRAID is concerned the new subvolume (which has the same path as the original user share) is the existing user share. 15 hours ago, AngryPig said: I can then enable Snapshots of a Subvolume and either store it within the Subvolume (preferred?) or to a different Subvolume as long as it is on the same pool. ie I cannot make a snap to /mnt/cache-single/some-snaps as 'some-snaps' is not a Subvolume Where you store snapshots doesnt really matter, they can be anywhere within the same pool (they dont have to be within a subvolume). Snapshots themselves are just subvolumes anyway. 15 hours ago, AngryPig said: I cannot send to /mnt/cache-double/... as 'cache-double' is a different pool. This is not entirely true but it requires some explanation. When you snapshot a subvolume the snapshot must be made somewhere on the same filesystem (pool) as it is a CoW copy of the subvolume (and a new subvolume itself). You can however send subvolumes from one BTRFS filesystem to another using btrfs send and receive (which are available in this plugin). Doing this copies the subvolume to the other filesystem and thus it is no longer CoW copy but a full copy taking up space on the other filesystem. Once a subvolume is sent to the other filesystem there is a way to send subsequent snapshots of that subvolume between the two filesystems in a way that maintains the CoW relationship between the subvolume and its snapshots.
April 18, 20242 yr 5 hours ago, primeval_god said: You will want to stop any Docker containers that have a mapping to or within the share you are operating on while you make changes, aside from that though you dont need to make any changes since you are creating the subvolume with the original path. Likewise you shouldnt need to make any changes to share settings since so far as unRAID is concerned the new subvolume (which has the same path as the original user share) is the existing user share. Glad to see I understood that part! 5 hours ago, primeval_god said: Where you store snapshots doesnt really matter, they can be anywhere within the same pool (they dont have to be within a subvolume). Snapshots themselves are just subvolumes anyway. That's good to know. Are they required to be in a Subvolume for Send to work or because they are Subvolumes themselves they will automatically work with Send? 5 hours ago, primeval_god said: This is not entirely true but it requires some explanation. When you snapshot a subvolume the snapshot must be made somewhere on the same filesystem (pool) as it is a CoW copy of the subvolume (and a new subvolume itself). You can however send subvolumes from one BTRFS filesystem to another using btrfs send and receive (which are available in this plugin). Doing this copies the subvolume to the other filesystem and thus it is no longer CoW copy but a full copy taking up space on the other filesystem. Once a subvolume is sent to the other filesystem there is a way to send subsequent snapshots of that subvolume between the two filesystems in a way that maintains the CoW relationship between the subvolume and its snapshots. Thank you for clarifying this. Does the other file system have to BTRFS to be able to Send to it? ie I would not be able to send to my array as it is XFS? Does this plugin allow for me to Snap on a daily basis and Send on a weekly basis? So if I was Sending off-site it would not use my bandwidth as much? Or is it simply that since it maintains the BTRFS CoW, it would not be that much bandwidth after the initial send?
April 19, 20242 yr 17 hours ago, AngryPig said: That's good to know. Are they required to be in a Subvolume for Send to work or because they are Subvolumes themselves they will automatically work with Send? Yes send and receive work on subvolumes only (snapshots are just a type of subvolume). 17 hours ago, AngryPig said: Thank you for clarifying this. Does the other file system have to BTRFS to be able to Send to it? ie I would not be able to send to my array as it is XFS? Yes the other filesystem has to be BTRFS for send and receive to work, the send subvolume becomes a subvolume on the receiving filesystem. 17 hours ago, AngryPig said: Does this plugin allow for me to Snap on a daily basis and Send on a weekly basis? I am not entirely sure about the capabilities of this plugin with regards to scheduling. 17 hours ago, AngryPig said: So if I was Sending off-site it would not use my bandwidth as much? Or is it simply that since it maintains the BTRFS CoW, it would not be that much bandwidth after the initial send? BTRFS send and receive does a sort of differential send when subvolume/snapshot is based on subvolume/snapshot that is present in both filesystems (assuming you use the option to specify the parent). This reduces the amount of data sent for subsequent snapshots of the same subvolume. I am not sure if this plugin actually makes that option available though as I do my snapshot sending via the command line.
December 14, 20241 yr On 2/5/2022 at 9:56 AM, SimonF said: FYI on Disk 2 you have used DMY. YMD is converted to YmdHis but you need to use these time formats for anything other than YMD. format character Description Example returned values Day --- --- d Day of the month, 2 digits with leading zeros 01 to 31 D A textual representation of a day, three letters Mon through Sun j Day of the month without leading zeros 1 to 31 l (lowercase 'L') A full textual representation of the day of the week Sunday through Saturday N ISO 8601 numeric representation of the day of the week 1 (for Monday) through 7 (for Sunday) S English ordinal suffix for the day of the month, 2 characters st, nd, rd or th. Works well with j w Numeric representation of the day of the week 0 (for Sunday) through 6 (for Saturday) z The day of the year (starting from 0) 0 through 365 Week --- --- W ISO 8601 week number of year, weeks starting on Monday Example: 42 (the 42nd week in the year) Month --- --- F A full textual representation of a month, such as January or March January through December m Numeric representation of a month, with leading zeros 01 through 12 M A short textual representation of a month, three letters Jan through Dec n Numeric representation of a month, without leading zeros 1 through 12 t Number of days in the given month 28 through 31 Year --- --- L Whether it's a leap year 1 if it is a leap year, 0 otherwise. o ISO 8601 week-numbering year. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. Examples: 1999 or 2003 Y A full numeric representation of a year, 4 digits Examples: 1999 or 2003 y A two digit representation of a year Examples: 99 or 03 Time --- --- a Lowercase Ante meridiem and Post meridiem am or pm A Uppercase Ante meridiem and Post meridiem AM or PM B Swatch Internet time 000 through 999 g 12-hour format of an hour without leading zeros 1 through 12 G 24-hour format of an hour without leading zeros 0 through 23 h 12-hour format of an hour with leading zeros 01 through 12 H 24-hour format of an hour with leading zeros 00 through 23 i Minutes with leading zeros 00 to 59 s Seconds with leading zeros 00 through 59 u Microseconds. Note that date() will always generate 000000 since it takes an int parameter, whereas DateTime::format() does support microseconds if DateTime was created with microseconds. Example: 654321 v Milliseconds. Same note applies as for u. Example: 654 Timezone --- --- e Timezone identifier Examples: UTC, GMT, Atlantic/Azores I (capital i) Whether or not the date is in daylight saving time 1 if Daylight Saving Time, 0 otherwise. O Difference to Greenwich time (GMT) without colon between hours and minutes Example: +0200 P Difference to Greenwich time (GMT) with colon between hours and minutes Example: +02:00 p The same as P, but returns Z instead of +00:00 Example: +02:00 T Timezone abbreviation, if known; otherwise the GMT offset. Examples: EST, MDT, +05 Z Timezone offset in seconds. The offset for timezones west of UTC is always negative, and for those east of UTC is always positive. -43200 through 50400 Full Date/Time --- --- c ISO 8601 date 2004-02-12T15:19:21+00:00 r » RFC 2822 formatted date Example: Thu, 21 Dec 2000 16:01:07 +0200 U Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) See also time() Thanks for this. It would be most helpful to have this info built in to the system help. And really any other amount of help information for that matter. This plugin is severely lacking in that area.
January 3, 20251 yr I suppose since Current Version2023.07.16 no updates and no plan to improve? For example system folder has a lot of snapshots and no options to collapse them, just huge list.
January 3, 20251 yr Author 55 minutes ago, d3m3zs said: I suppose since Current Version2023.07.16 no updates and no plan to improve? For example system folder has a lot of snapshots and no options to collapse them, just huge list. They are mainly dockers images. Which can hide with, there are options to exclude
January 3, 20251 yr 5 hours ago, SimonF said: They are mainly dockers images. Which can hide with, there are options to exclude Oh thank you, weird, but didn`t notice. And one more question - what is maybe best way to store snapshots - each inside particular subvolume or maybe create one "snapshots" subvolume for all disk and store them there? I mean example: 1. /mnt/cache/.snapshots/docker_{Y-M-D_H:i:s} 2. /mnt/cache/docker/.snapshots/docker_{Y-M-D_H:i:s} Edited January 3, 20251 yr by d3m3zs
January 3, 20251 yr Also setup job and got snapshots: btrfs snapshot send -p / /mnt/cache/.snapshots/docker_2025-Jan-Sat_00:30:10 To /mnt/disk4/btrfs_snapshots/ Error ERROR: empty stream is not considered valid Would be great to have any explanation, don`t understand what is wrong with settings. Have no idea what is "empty stream" Run one more time and got snapshots: btrfs snapshot send -p /mnt/cache/.snapshots/docker_2025-Jan-Sat_00:30:10 /mnt/cache/.snapshots/docker_2025-Jan-Sat_00:31:57 To /mnt/disk4/btrfs_snapshots/ Error ERROR: snapshot: cannot find parent subvolume d09791c2-0608-f342-b4ae-e3d736714ad6 At snapshot docker_2025-Jan-Sat_00:31:57 But if I press "Send" - snapshot will be sent to disk4. Also doesn`t clear why on disk4 received snapshots don`t separated from subvolume Snapshots - 2023.07.16 Unraid - 7.0.0-rc.2 Edited January 3, 20251 yr by d3m3zs
January 4, 20251 yr 14 hours ago, d3m3zs said: Also setup job and got snapshots: btrfs snapshot send -p / /mnt/cache/.snapshots/docker_2025-Jan-Sat_00:30:10 To /mn This one appears to have an extra / 14 hours ago, d3m3zs said: snapshots: btrfs snapshot send -p /mnt/cache/.snapshots/docker_2025-Jan-Sat_00:30:10 /mnt/cache/.snapshots/docker_2025-Jan-Sat_00:31:57 To /mnt/disk4/btrfs_snapshots/ Error ERROR: snapshot: cannot find parent subvolume d09791c2-0608-f342-b4ae-e3d736714ad6 At snapshot docker_2025-Jan-Sat_00:31:57 This one should mean that the parent (source) does not exist on the destination, so it cannot do an incremental send I see that you have some with @ and others without @, suggest starting over and use the same for all.
January 4, 20251 yr 8 hours ago, JorgeB said: This one appears to have an extra / But this one comes from plugin, not my fault. 8 hours ago, JorgeB said: This one should mean that the parent (source) does not exist on the destination, so it cannot do an incremental send Thank you, so plugin is totally not ready and has no simple validation and even human-readable log. Now I understand why BTRFS so unpopular - because even Lime Technology, Inc. is not interested in simple UI for maintaining BTRFS file system. 8 hours ago, JorgeB said: I see that you have some with @ and others without @, suggest starting over and use the same for all. I added "@" for snapshot just to better distinguish on destination after sending. Trying to figure out what is the best flow for snapshots, really don`t see many information, only one positive thing from plugin - is visibility of available snapshots, but even here some mess.
January 4, 20251 yr 34 minutes ago, d3m3zs said: Now I understand why BTRFS so unpopular - because even Lime Technology, Inc. is not interested in simple UI for maintaining BTRFS file system. This is an unfair characterization. unRAID does offer a UI for scrub and balancing, which are the primary btrfs maintaince operations. Snapshots are simply not yet a feature that unraid supports, for any filesystem. At last check this plugin is also the primary method of supporting snapshots for ZFS on unraid as well.
January 4, 20251 yr Author 53 minutes ago, d3m3zs said: But this one comes from plugin, not my fault. Thank you, so plugin is totally not ready and has no simple validation and even human-readable log. Now I understand why BTRFS so unpopular - because even Lime Technology, Inc. is not interested in simple UI for maintaining BTRFS file system. I added "@" for snapshot just to better distinguish on destination after sending. Trying to figure out what is the best flow for snapshots, really don`t see many information, only one positive thing from plugin - is visibility of available snapshots, but even here some mess. The plugin was to provide some simple interface, commands exist for you to build your own scripts. Code based is in github for you to fork if you want and PRs are welcome. ZFS master supports zfs snapshots if required.
January 5, 20251 yr 2 hours ago, SimonF said: The plugin was to provide some simple interface, commands exist for you to build your own scripts. Code based is in github for you to fork if you want and PRs are welcome. ZFS master supports zfs snapshots if required. Thank you, already setup btrbk tool with few scripts, 2 configs and automatically copy btrbk itself from boot drive to /usr/local/bin. Plugin is good only for visualization, unfortunately (I don`t want to offend anyone) plugin looks like limited and unfinished: no manual, no error explanation, no validation for user mistake, very primitive and illogical user experience. From my experience it the most outdated and messy plugin from all list of installed plugins. 3 hours ago, primeval_god said: This is an unfair characterization. unRAID does offer a UI for scrub and balancing, which are the primary btrfs maintaince operations. Yes, but for example unraid still has no monitoring for BTRFS errors, found workaround: And after all these nuances instead of improving current functionality Lime Technology, Inc. decided to add ZFS improvemnts, it reminds me Xiaomi smarthones when they release new model each week and forget about support old one.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.