Skip to content

Commit 372448e

Browse files
committed
Fix support for target that is mounted as a subvolume by ignoring extra mount options
1 parent 52421d0 commit 372448e

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

changelog.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.10.0 (07 October, 2023)
2+
* Fix warning generated during normal operation
3+
* Fix support for target that is mounted as a subvolume by ignoring extra mount options
4+
15
# 0.9 (17 March, 2017)
26
* Added `/sbin/btrfs` to the list of checked binary locations (used on Gentoo)
37

just-backup-btrfs

+19-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ use
88
/**
99
* @package Just backup btrfs
1010
* @author Nazar Mokrynskyi <[email protected]>
11-
* @copyright Copyright (c) 2014-2017, Nazar Mokrynskyi
11+
* @copyright Copyright (c) 2014-2023, Nazar Mokrynskyi
1212
* @license http://opensource.org/licenses/MIT
13-
* @version 0.9
13+
* @version 0.10.0
1414
*/
1515
class Just_backup_btrfs {
1616
/**
@@ -217,6 +217,23 @@ class Just_backup_btrfs {
217217
}
218218
list($partition, $mount_point, $mount_options) = $mount_point_options;
219219

220+
/**
221+
* Remove subvolume options, we'll be mounting root instead
222+
*/
223+
$mount_options = implode(
224+
",",
225+
array_filter(explode(",", $mount_options), function ($option) {
226+
if (strpos($option, "subvolid=") === 0) {
227+
return false;
228+
}
229+
if (strpos($option, "subvol=") === 0) {
230+
return false;
231+
}
232+
233+
return true;
234+
})
235+
);
236+
220237
/**
221238
* Set fixed destination as path inside subvolume, just remove mount point from the whole destination path
222239
*/

0 commit comments

Comments
 (0)