Add bcachefs creation (!123)
Set the minimum file system size to 16 MiB as creating a bcachefs that size succeeds: $ truncate -s $((16*1024*1024)) /tmp/disk.img $ bcachefs format /tmp/disk.img ... initializing new filesystem going read-write initializing freespace $ echo $? 0 Where as creating a smaller file system fails for most sizes below that: $ rm /tmp/disk.img $ truncate -s $((15*1024*1024)) /tmp/disk.img $ bcachefs format /tmp/disk.img ... mounting version 1.6: btree_subvolume_children initializing new filesystem going read-write bch2_trans_mark_dev_sb(): error ENOSPC_disk_reservation bch2_fs_initialize(): error marking superblocks ENOSPC_disk_reservation bch2_fs_initialize(): error ENOSPC_disk_reservation bch2_fs_start(): error starting filesystem ENOSPC_disk_reservation error opening /tmp/disk.img: ENOSPC_disk_reservation $ echo $? 1 Closes !123 - Add support for bcachefs, single device file systems only
This commit is contained in:
parent
c9b991cc95
commit
ae5a6aeea8
1
README
1
README
|
@ -265,6 +265,7 @@ devices and partitions. When available, it uses each file system's
|
|||
specific commands. The following optional file system specific packages
|
||||
provide this support:
|
||||
|
||||
bcachefs-tools
|
||||
btrfs-progs / btrfs-tools
|
||||
e2fsprogs
|
||||
exfatprogs
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
data rescue from lost partitions.
|
||||
</p>
|
||||
<p>
|
||||
GParted works with many file systems including: btrfs, exfat, ext2,
|
||||
ext3, ext4, fat16, fat32, hfs, hfs+, linux-swap, lvm2 pv, minix,
|
||||
nilfs2, ntfs, reiserfs, reiser4, udf, ufs, and xfs.
|
||||
GParted works with many file systems including: bcachefs, btrfs,
|
||||
exfat, ext2, ext3, ext4, fat16, fat32, hfs, hfs+, linux-swap,
|
||||
lvm2 pv, minix, nilfs2, ntfs, reiserfs, reiser4, udf, ufs, and xfs.
|
||||
</p>
|
||||
</description>
|
||||
<launchable type="desktop-id">gparted.desktop</launchable>
|
||||
|
|
|
@ -53,6 +53,7 @@ noinst_HEADERS = \
|
|||
TreeView_Detail.h \
|
||||
Utils.h \
|
||||
Win_GParted.h \
|
||||
bcachefs.h \
|
||||
btrfs.h \
|
||||
exfat.h \
|
||||
ext2.h \
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
/* Copyright (C) 2024 Mike Fleetwood
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef GPARTED_BCACHEFS_H
|
||||
#define GPARTED_BCACHEFS_H
|
||||
|
||||
|
||||
#include "FileSystem.h"
|
||||
#include "OperationDetail.h"
|
||||
#include "Partition.h"
|
||||
|
||||
|
||||
namespace GParted
|
||||
{
|
||||
|
||||
|
||||
class bcachefs : public FileSystem
|
||||
{
|
||||
public:
|
||||
FS get_filesystem_support();
|
||||
bool create(const Partition& new_partition, OperationDetail& operationdetail);
|
||||
};
|
||||
|
||||
|
||||
} //GParted
|
||||
|
||||
#endif /* GPARTED_BCACHEFS_H */
|
|
@ -48,6 +48,7 @@ src/SWRaid_Info.cc
|
|||
src/TreeView_Detail.cc
|
||||
src/Utils.cc
|
||||
src/Win_GParted.cc
|
||||
src/bcachefs.cc
|
||||
src/btrfs.cc
|
||||
src/exfat.cc
|
||||
src/ext2.cc
|
||||
|
|
|
@ -63,6 +63,7 @@ gpartedbin_SOURCES = \
|
|||
TreeView_Detail.cc \
|
||||
Utils.cc \
|
||||
Win_GParted.cc \
|
||||
bcachefs.cc \
|
||||
btrfs.cc \
|
||||
exfat.cc \
|
||||
ext2.cc \
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "SupportedFileSystems.h"
|
||||
#include "FileSystem.h"
|
||||
#include "Utils.h"
|
||||
#include "bcachefs.h"
|
||||
#include "btrfs.h"
|
||||
#include "exfat.h"
|
||||
#include "ext2.h"
|
||||
|
@ -59,6 +60,7 @@ SupportedFileSystems::SupportedFileSystems()
|
|||
// supported_filesystem() -> false
|
||||
m_fs_objects[FS_UNKNOWN] = nullptr;
|
||||
m_fs_objects[FS_OTHER] = nullptr;
|
||||
m_fs_objects[FS_BCACHEFS] = new bcachefs();
|
||||
m_fs_objects[FS_BTRFS] = new btrfs();
|
||||
m_fs_objects[FS_EXFAT] = new exfat();
|
||||
m_fs_objects[FS_EXT2] = new ext2(FS_EXT2);
|
||||
|
|
|
@ -260,6 +260,7 @@ int Utils::get_filesystem_label_maxlength(FSType fstype)
|
|||
// afterwards, need a maximum length defining.
|
||||
switch (fstype)
|
||||
{
|
||||
case FS_BCACHEFS: return 32;
|
||||
case FS_BTRFS: return 255;
|
||||
case FS_EXFAT: return 11;
|
||||
case FS_EXT2: return 16;
|
||||
|
@ -408,6 +409,7 @@ const Glib::ustring Utils::get_filesystem_kernel_name( FSType fstype )
|
|||
{
|
||||
switch ( fstype )
|
||||
{
|
||||
case FS_BCACHEFS : return "bcachefs";
|
||||
case FS_BTRFS : return "btrfs";
|
||||
case FS_EXFAT : return "exfat";
|
||||
case FS_EXT2 : return "ext2";
|
||||
|
@ -435,6 +437,7 @@ const Glib::ustring Utils::get_filesystem_software(FSType fstype)
|
|||
{
|
||||
switch (fstype)
|
||||
{
|
||||
case FS_BCACHEFS: return "bcachefs-tools";
|
||||
case FS_BTRFS: return "btrfs-progs / btrfs-tools";
|
||||
case FS_EXFAT: return "exfatprogs";
|
||||
case FS_EXT2: return "e2fsprogs";
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
/* Copyright (C) 2024 Mike Fleetwood
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "bcachefs.h"
|
||||
#include "FileSystem.h"
|
||||
#include "OperationDetail.h"
|
||||
#include "Partition.h"
|
||||
#include "Utils.h"
|
||||
|
||||
# include <glibmm/miscutils.h>
|
||||
# include <glibmm/shell.h>
|
||||
|
||||
|
||||
namespace GParted
|
||||
{
|
||||
|
||||
|
||||
FS bcachefs::get_filesystem_support()
|
||||
{
|
||||
FS fs(FS_BCACHEFS);
|
||||
|
||||
fs.busy = FS::GPARTED;
|
||||
fs.move = FS::GPARTED;
|
||||
fs.copy = FS::GPARTED;
|
||||
fs.online_read = FS::GPARTED;
|
||||
|
||||
if (! Glib::find_program_in_path("bcachefs").empty())
|
||||
{
|
||||
fs.create = FS::EXTERNAL;
|
||||
fs.create_with_label = FS::EXTERNAL;
|
||||
}
|
||||
|
||||
fs_limits.min_size = 16 * MEBIBYTE;
|
||||
|
||||
return fs;
|
||||
}
|
||||
|
||||
|
||||
bool bcachefs::create(const Partition& new_partition, OperationDetail& operationdetail)
|
||||
{
|
||||
return ! execute_command("bcachefs format -L " + Glib::shell_quote(new_partition.get_filesystem_label()) +
|
||||
" " + Glib::shell_quote(new_partition.get_path()),
|
||||
operationdetail, EXEC_CHECK_STATUS);
|
||||
}
|
||||
|
||||
|
||||
} //GParted
|
|
@ -50,6 +50,7 @@ gparted_core_OBJECTS = \
|
|||
$(top_builddir)/src/SupportedFileSystems.$(OBJEXT) \
|
||||
$(top_builddir)/src/SWRaid_Info.$(OBJEXT) \
|
||||
$(top_builddir)/src/Utils.$(OBJEXT) \
|
||||
$(top_builddir)/src/bcachefs.$(OBJEXT) \
|
||||
$(top_builddir)/src/btrfs.$(OBJEXT) \
|
||||
$(top_builddir)/src/exfat.$(OBJEXT) \
|
||||
$(top_builddir)/src/ext2.$(OBJEXT) \
|
||||
|
|
Loading…
Reference in New Issue