1
0
mirror of https://gitlab.gnome.org/GNOME/gparted synced 2024-07-02 15:58:47 +00:00

Add bcachefs checking (!123)

[Only the options being used by GParted are quoted here from the help
output.  More options are available.]
    $ bcachefs fsck --help
    bcachefs fsck - filesystem check and repair
    Usage: bcachefs fsck [OPTION]... <device>

    Options:
      -y               Assume "yes" to all questions
      -f               Force checking even if filesystem is marked clean
      -v               Be verbose

Closes !123 - Add support for bcachefs, single device file systems only
This commit is contained in:
Mike Fleetwood 2024-04-06 20:42:00 +01:00
parent 31df2f2b75
commit 3b5da02943
2 changed files with 9 additions and 0 deletions

View File

@ -37,6 +37,7 @@ public:
void read_label(Partition& partition);
void read_uuid(Partition& partition);
bool resize(const Partition& partition_new, OperationDetail& operationdetail, bool fill_partition);
bool check_repair(const Partition& partition, OperationDetail& operationdetail);
};

View File

@ -50,6 +50,7 @@ FS bcachefs::get_filesystem_support()
if (Utils::kernel_version_at_least(3, 6, 0))
fs.online_grow = FS::EXTERNAL;
#endif
fs.check = FS::EXTERNAL;
}
fs_limits.min_size = 32 * MEBIBYTE;
@ -143,4 +144,11 @@ bool bcachefs::resize(const Partition& partition_new, OperationDetail& operation
}
bool bcachefs::check_repair(const Partition& partition, OperationDetail& operationdetail)
{
return ! execute_command("bcachefs fsck -f -y -v " + Glib::shell_quote(partition.get_path()),
operationdetail, EXEC_CHECK_STATUS);
}
} //GParted