Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Btrfs: support default subvolid!=0 #334

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Core/Main.vala
Original file line number Diff line number Diff line change
Expand Up @@ -3760,15 +3760,15 @@ public class Main : GLib.Object{
return false;
}
else{
Device.mount(dev_unlocked.uuid, mnt_btrfs, "", true);
Device.mount(dev_unlocked.uuid, mnt_btrfs, "subvolid=0", true);
}
}
else{
return false;
}
}
else{
Device.mount(dev.uuid, mnt_btrfs, "", true);
Device.mount(dev.uuid, mnt_btrfs, "subvolid=0", true);
}
}

Expand Down
6 changes: 5 additions & 1 deletion src/Core/SnapshotRepo.vala
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,11 @@ public class SnapshotRepo : GLib.Object{
}

// mount
bool ok = Device.mount(dev.uuid, path_to_mount, ""); // TODO: check if already mounted
var mount_options = "";
if (btrfs_mode){
mount_options = "subvolid=0";
}
bool ok = Device.mount(dev.uuid, path_to_mount, mount_options); // TODO: check if already mounted

if (ok){
return path_to_mount;
Expand Down
2 changes: 1 addition & 1 deletion src/Utility/Device.vala
Original file line number Diff line number Diff line change
Expand Up @@ -1627,13 +1627,13 @@ public class Device : GLib.Object{
unmount(mount_point);

// mount the device -------------------

if (mount_options.length > 0){
cmd = "mount -o %s \"%s\" \"%s\"".printf(mount_options, device, mount_point);
}
else{
cmd = "mount \"%s\" \"%s\"".printf(device, mount_point);
}
log_debug("mount command: %s".printf(cmd));

ret_val = exec_sync(cmd, out std_out, out std_err);

Expand Down