public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup 1/1] ext4 filesystems no longer reserve blocks when created as a datastore
@ 2022-05-27 10:57 Daniel Tschlatscher
  2022-05-27 10:57 ` [pbs-devel] [PATCH proxmox-backup 1/1] fix #4077: Estimated Full metric on ext4 file systems Daniel Tschlatscher
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Tschlatscher @ 2022-05-27 10:57 UTC (permalink / raw)
  To: pbs-devel

Ext4 Filesystems reserve about 5% of all available blocks for usage by
the root user. While this can be helpful for root partitions and mount
points, it is significantly less so for datastores. Therefore, ext4
filesystems are created with no reserved blocks, increasing the
available storage for unpriviliged backup users.
Some more rationale can be found in #4077:
https://bugzilla.proxmox.com/show_bug.cgi?id=4077

Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
---
 src/tools/disks/mod.rs | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/tools/disks/mod.rs b/src/tools/disks/mod.rs
index 568dccbf..9a19f0c1 100644
--- a/src/tools/disks/mod.rs
+++ b/src/tools/disks/mod.rs
@@ -979,10 +979,14 @@ pub fn create_file_system(disk: &Disk, fs_type: FileSystemType) -> Result<(), Er
         None => bail!("disk {:?} has no node in /dev", disk.syspath()),
     };
 
-    let fs_type = fs_type.to_string();
-
     let mut command = std::process::Command::new("mkfs");
-    command.args(&["-t", &fs_type]);
+
+    command.args(&["-t", &fs_type.to_string()]);
+
+    if matches!(fs_type, FileSystemType::Ext4) {
+        command.args(&["-m", "0"]);
+    }
+
     command.arg(disk_path);
 
     proxmox_sys::command::run_command(command, None)?;
-- 
2.30.2





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-27 11:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-27 10:57 [pbs-devel] [PATCH proxmox-backup 1/1] ext4 filesystems no longer reserve blocks when created as a datastore Daniel Tschlatscher
2022-05-27 10:57 ` [pbs-devel] [PATCH proxmox-backup 1/1] fix #4077: Estimated Full metric on ext4 file systems Daniel Tschlatscher
2022-05-27 11:40   ` Daniel Tschlatscher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal